From 8bd8250336694b0a68546fa01417ef40748c84a4 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 30 Apr 2020 04:19:45 +0200 Subject: configure: Make sure libusbmuxd is correctly found for AC_TRY_COMPILE checks when installed in non-standard prefix --- configure.ac | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7041667..3d2b255 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,12 @@ case ${host_os} in esac AM_CONDITIONAL(WIN32, test x$win32 = xtrue) +AC_SUBST(libusbmuxd_CFLAGS) +AC_SUBST(libusbmuxd_LIBS) + +CACHED_CFLAGS="$CFLAGS" +CFLAGS+=" $libusbmuxd_CFLAGS" + AC_CHECK_MEMBER(usbmuxd_device_info_t.conn_type,, AC_MSG_ERROR([libusbmuxd (usbmuxd.h) is not up-to-date; missing conn_type member in usbmuxd_device_info_t. Please update libusbmuxd to build $PACKAGE_NAME]), [#include ]) AC_TRY_COMPILE([ #include @@ -94,6 +100,8 @@ AC_TRY_COMPILE([ enum usbmux_lookup_options opts = DEVICE_LOOKUP_USBMUX | DEVICE_LOOKUP_NETWORK | DEVICE_LOOKUP_PREFER_NETWORK; ],, AC_MSG_ERROR([[libusbmuxd (usbmuxd.h) is not up-to-date; missing enum usbmux_lookup_options with DEVICE_LOOKUP_USBMUX, DEVICE_LOOKUP_NETWORK, and DEVICE_LOOKUP_PREFER_NETWORK - Please update libusbmuxd to build $PACKAGE_NAME]])) +CFLAGS="$CACHED_CFLAGS" + AC_CHECK_MEMBER(struct dirent.d_type, AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, [define if struct dirent has member d_type]),, [#include ]) # Cython Python Bindings @@ -182,7 +190,7 @@ else building_debug_code=yes fi -AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fsigned-char -fvisibility=hidden") +AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fsigned-char -fvisibility=hidden -fsanitize=address") AC_SUBST(GLOBAL_CFLAGS) case "$GLOBAL_CFLAGS" in -- cgit v1.1-32-gdbae