summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-10-24 19:27:13 +0200
committerGravatar Nikias Bassen2016-10-24 19:27:13 +0200
commiteec2e855b4f192cb1808d1f02b6bc8935a979025 (patch)
treeb985a64c7f69a0973cb5760c4886debdc0a63cc7 /configure.ac
parent392135c7db4d9cb4a14ff5935d7c4c6e21363847 (diff)
downloadlibplist-eec2e855b4f192cb1808d1f02b6bc8935a979025.tar.gz
libplist-eec2e855b4f192cb1808d1f02b6bc8935a979025.tar.bz2
Add pthread detection to configure.ac to get cflags and libs right
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 10c7f9d..d100b81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,12 @@ case ${host_os} in
70esac 70esac
71AM_CONDITIONAL(WIN32, test x$win32 = xtrue) 71AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
72 72
73# if we are not on win32, check for pthread
74if test x"$win32" != x"true"; then
75 AX_PTHREAD([], [AC_MSG_ERROR([pthread is required to build libplist])])
76 AC_CHECK_LIB(pthread, [pthread_once], [], [AC_MSG_ERROR([pthread with pthread_once required to build libplist])])
77fi
78
73# Check if struct tm has a tm_gmtoff member 79# Check if struct tm has a tm_gmtoff member
74AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, 80AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
75 AC_TRY_COMPILE([ 81 AC_TRY_COMPILE([
@@ -130,7 +136,8 @@ fi
130AM_CONDITIONAL([HAVE_CYTHON],[test "x$CYTHON_SUB" = "xcython"]) 136AM_CONDITIONAL([HAVE_CYTHON],[test "x$CYTHON_SUB" = "xcython"])
131AC_SUBST([CYTHON_SUB]) 137AC_SUBST([CYTHON_SUB])
132 138
133AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden") 139AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -fvisibility=hidden $PTHREAD_CFLAGS")
140GLOBAL_LDFLAGS="$PTHREAD_LIBS"
134 141
135AC_ARG_ENABLE(debug, 142AC_ARG_ENABLE(debug,
136AS_HELP_STRING([--enable-debug], 143AS_HELP_STRING([--enable-debug],
@@ -148,6 +155,7 @@ if (test "x$debug" = "xyes"); then
148fi 155fi
149 156
150AC_SUBST(GLOBAL_CFLAGS) 157AC_SUBST(GLOBAL_CFLAGS)
158AC_SUBST(GLOBAL_LDFLAGS)
151 159
152case "$GLOBAL_CFLAGS" in 160case "$GLOBAL_CFLAGS" in
153 *-fvisibility=hidden*) 161 *-fvisibility=hidden*)