From b848efcd471e8a20f3720d6e1f690c15a369e7df Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 27 Dec 2016 16:00:14 +0100 Subject: Use ax_pthread.m4 and get rid of clang compiler warning about pthread --- configure.ac | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8ffb4cb..0a405e0 100644 --- a/configure.ac +++ b/configure.ac @@ -67,27 +67,27 @@ AC_FUNC_REALLOC AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) # Check for operating system -AC_MSG_CHECKING([whether to enable WIN32 build settings]) +AC_MSG_CHECKING([whether we need platform-specific build settings]) case ${host_os} in *mingw32*|*cygwin*) - win32=true AC_MSG_RESULT([yes]) - AC_CHECK_TOOL([WINDRES], [windres], AC_MSG_ERROR([windres not found])) - AC_SUBST(WINDRES) + win32=true ;; - *) - win32=false + darwin*) AC_MSG_RESULT([no]) ;; + *) + AC_MSG_RESULT([yes]) + AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build libusbmuxd])]) + AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [], [AC_MSG_ERROR([pthread is required to build libusbmuxd])]) + ;; esac AM_CONDITIONAL(WIN32, test x$win32 = xtrue) -if test "x$win32" != "xtrue"; then - AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [AC_SUBST(libpthread_LIBS,[-lpthread])], [AC_MSG_ERROR([libpthread is required to build libusbmuxd])]) -fi - -AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden") +AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden $PTHREAD_CFLAGS") +GLOBAL_LDFLAGS="$PTHREAD_LIBS" AC_SUBST(GLOBAL_CFLAGS) +AC_SUBST(GLOBAL_LDFLAGS) case "$GLOBAL_CFLAGS" in *-fvisibility=hidden*) -- cgit v1.1-32-gdbae