From b10ec8cc7b6b9d181cccacee6b4c1c4c5bdbd510 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 22 Aug 2016 22:54:07 +0200 Subject: CMake: Handle endian.h locations on other platforms Gbp-Dch: ignore --- CMake/config.h.in | 6 ++++++ CMake/endian.h.in | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 CMake/endian.h.in (limited to 'CMake') diff --git a/CMake/config.h.in b/CMake/config.h.in index e929646fa..f32f15b8a 100644 --- a/CMake/config.h.in +++ b/CMake/config.h.in @@ -25,6 +25,12 @@ /* Define if we have sys/mount.h */ #cmakedefine HAVE_MOUNT_H +/* Define if we have sys/endian.h */ +#cmakedefine HAVE_SYS_ENDIAN_H + +/* Define if we have machine/endian.h */ +#cmakedefine HAVE_MACHINE_ENDIAN_H + /* Define if we have enabled pthread support */ #cmakedefine HAVE_PTHREAD diff --git a/CMake/endian.h.in b/CMake/endian.h.in new file mode 100644 index 000000000..1d9198c24 --- /dev/null +++ b/CMake/endian.h.in @@ -0,0 +1,9 @@ +#include + +#ifdef HAVE_MACHINE_ENDIAN_H +#include +#endif +#ifdef HAVE_SYS_ENDIAN_H +#include +#include +#endif -- cgit v1.2.3 From c799c3efe43d7fde53ea4a3c5f976375607a2805 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 14:13:24 +0200 Subject: CMake: Add FindLZ4 and FindLZMA This makes things work with /usr/local on FreeBSD. Gbp-Dch: ignore --- CMake/FindLZ4.cmake | 25 +++++++++++++++++++++++++ CMake/FindLZMA.cmake | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 CMake/FindLZ4.cmake create mode 100644 CMake/FindLZMA.cmake (limited to 'CMake') diff --git a/CMake/FindLZ4.cmake b/CMake/FindLZ4.cmake new file mode 100644 index 000000000..597f520a8 --- /dev/null +++ b/CMake/FindLZ4.cmake @@ -0,0 +1,25 @@ +# - Try to find LZ4 +# Once done, this will define +# +# LZ4_FOUND - system has LZ4 +# LZ4_INCLUDE_DIRS - the LZ4 include directories +# LZ4_LIBRARIES - the LZ4 library +find_package(PkgConfig) + +pkg_check_modules(LZ4_PKGCONF liblz4) + +find_path(LZ4_INCLUDE_DIRS + NAMES lz4frame.h + PATHS ${LZ4_PKGCONF_INCLUDE_DIRS} +) + + +find_library(LZ4_LIBRARIES + NAMES lz4 + PATHS ${LZ4_PKGCONF_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LZ4 DEFAULT_MSG LZ4_INCLUDE_DIRS LZ4_LIBRARIES) + +mark_as_advanced(LZ4_INCLUDE_DIRS LZ4_LIBRARIES) diff --git a/CMake/FindLZMA.cmake b/CMake/FindLZMA.cmake new file mode 100644 index 000000000..6abc4fa77 --- /dev/null +++ b/CMake/FindLZMA.cmake @@ -0,0 +1,25 @@ +# - Try to find LZMA +# Once done, this will define +# +# LZMA_FOUND - system has LZMA +# LZMA_INCLUDE_DIRS - the LZMA include directories +# LZMA_LIBRARIES - the LZMA library +find_package(PkgConfig) + +pkg_check_modules(LZMA_PKGCONF liblzma) + +find_path(LZMA_INCLUDE_DIRS + NAMES lzma.h + PATHS ${LZMA_PKGCONF_INCLUDE_DIRS} +) + + +find_library(LZMA_LIBRARIES + NAMES lzma + PATHS ${LZMA_PKGCONF_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LZMA DEFAULT_MSG LZMA_INCLUDE_DIRS LZMA_LIBRARIES) + +mark_as_advanced(LZMA_INCLUDE_DIRS LZMA_LIBRARIES) -- cgit v1.2.3 From 24ad9b325f2d277864e3a75931137b93dd75cd03 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 12:48:25 +0200 Subject: CMake: Handle Berkeley DB on FreeBSD The BSD systems still ship their own db.h with a historical BSD implementation, which is preferred by CMake, as it searches its default path first. We thus have to disable the DEFAULT_PATH for the search, unfortunately. We also need to pass the correct include directory to the target. Furthermore, on FreeBSD the library is called db-, so let's add db-5 to the list of allowed names. Gbp-Dch: ignore --- CMake/FindBerkeleyDB.cmake | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'CMake') diff --git a/CMake/FindBerkeleyDB.cmake b/CMake/FindBerkeleyDB.cmake index 44cfd3ddb..34bc3b0d1 100644 --- a/CMake/FindBerkeleyDB.cmake +++ b/CMake/FindBerkeleyDB.cmake @@ -33,14 +33,25 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# We need NO_DEFAULT_PATH here, otherwise CMake helpfully picks up the wrong +# db.h on BSD systems instead of the Berkeley DB one. find_path(BERKELEY_DB_INCLUDE_DIRS db.h - /usr/include/db5 + ${CMAKE_INSTALL_FULL_INCLUDEDIR}/db5 /usr/local/include/db5 - /usr/include/db4 + /usr/include/db5 + + ${CMAKE_INSTALL_FULL_INCLUDEDIR}/db4 /usr/local/include/db4 + /usr/include/db4 + + ${CMAKE_INSTALL_FULL_INCLUDEDIR} + /usr/local/include + /usr/include + + NO_DEFAULT_PATH ) -find_library(BERKELEY_DB_LIBRARIES NAMES db ) +find_library(BERKELEY_DB_LIBRARIES NAMES db db-5) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Berkeley "Could not find Berkeley DB >= 4.1" BERKELEY_DB_INCLUDE_DIRS BERKELEY_DB_LIBRARIES) -- cgit v1.2.3 From 8757a0fdeee00ea6a7cc717188a0e129ad8a553c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 19:41:58 +0200 Subject: Make directory paths configurable This allows other vendors to use different paths, or to build your own APT in /opt for testing. Note that this uses + 1 in some places, as the paths we receive are absolute, but we need to strip of the initial /. --- CMake/config.h.in | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'CMake') diff --git a/CMake/config.h.in b/CMake/config.h.in index f32f15b8a..c23254929 100644 --- a/CMake/config.h.in +++ b/CMake/config.h.in @@ -55,6 +55,15 @@ /* The mail address to reach upstream */ #define PACKAGE_MAIL "${PACKAGE_MAIL}" +/* Various directories */ +#cmakedefine CMAKE_INSTALL_FULL_BINDIR "${CMAKE_INSTALL_FULL_BINDIR}" +#cmakedefine STATE_DIR "${STATE_DIR}" +#cmakedefine CACHE_DIR "${CACHE_DIR}" +#cmakedefine LOG_DIR "${LOG_DIR}" +#cmakedefine CONF_DIR "${CONF_DIR}" +#cmakedefine LIBEXEC_DIR "${LIBEXEC_DIR}" +#cmakedefine BIN_DIR "${BIN_DIR}" + #define APT_8_CLEANER_HEADERS #define APT_9_CLEANER_HEADERS #define APT_10_CLEANER_HEADERS -- cgit v1.2.3 From 6f1f3c9afdb6ade6a7be110b90c8fc9e603254cf Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 25 Aug 2016 16:25:00 +0200 Subject: Make root group configurable via ROOT_GROUP This is needed on BSD where root's default group is wheel, not root. --- CMake/config.h.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMake') diff --git a/CMake/config.h.in b/CMake/config.h.in index c23254929..6f39e2f58 100644 --- a/CMake/config.h.in +++ b/CMake/config.h.in @@ -64,6 +64,9 @@ #cmakedefine LIBEXEC_DIR "${LIBEXEC_DIR}" #cmakedefine BIN_DIR "${BIN_DIR}" +/* Group of the root user */ +#cmakedefine ROOT_GROUP "${ROOT_GROUP}" + #define APT_8_CLEANER_HEADERS #define APT_9_CLEANER_HEADERS #define APT_10_CLEANER_HEADERS -- cgit v1.2.3 From 01d207a5076b6fc37a064645b13f2c6550f58b94 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 26 Aug 2016 17:55:28 +0200 Subject: CMake: Add missing iconv dependency FreeBSD has two iconv systems: It ships an iconv.h itself, and symbols for that in the libc. But there's also the port of GNU libiconv, which unfortunately for us, Doxygen depends on. This changes things to prefer a separate libiconv library over the system one; that is, the port on FreeBSD. Gbp-Dch: ignore --- CMake/FindIconv.cmake | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 CMake/FindIconv.cmake (limited to 'CMake') diff --git a/CMake/FindIconv.cmake b/CMake/FindIconv.cmake new file mode 100644 index 000000000..67046d95d --- /dev/null +++ b/CMake/FindIconv.cmake @@ -0,0 +1,20 @@ +find_path(ICONV_INCLUDE_DIR NAMES iconv.h) + +find_library(ICONV_LIBRARY NAMES iconv) +if (ICONV_LIBRARY) + set(ICONV_SYMBOL_FOUND "${ICONV_LIBRARY}") +else() + check_function_exists(iconv_open ICONV_SYMBOL_FOUND) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Iconv DEFAULT_MESSAGE ICONV_INCLUDE_DIR ICONV_SYMBOL_FOUND) + +if(ICONV_LIBRARY) + set(ICONV_LIBRARIES "${ICONV_LIBRARY}") +else() + set(ICONV_LIBRARIES) +endif() +set(ICONV_INCLUDE_DIRS "${ICONV_INCLUDE_DIR}") + +mark_as_advanced(ICONV_LIBRARY ICONV_INCLUDE_DIR) -- cgit v1.2.3