aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-06-05 13:08:38 +0200
committerMartin Willi <martin@revosec.ch>2014-06-06 15:34:12 +0200
commitbd19e27ae3295f224bf568d0b7d625a5c6bae8b8 (patch)
treeabaa2e023ba408ae1565d816792388d3e520e170
parent9d228ddb04b7adc7c5904b98bc7857b12176904a (diff)
downloadstrongswan-bd19e27ae3295f224bf568d0b7d625a5c6bae8b8.tar.bz2
strongswan-bd19e27ae3295f224bf568d0b7d625a5c6bae8b8.tar.xz
windows: Do not check if having clock_gettime()
Windows does not have it, but libwinpthread has. If this library is available during build, it will be linked, which we prefer to avoid.
-rw-r--r--configure.ac17
1 files changed, 11 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 6ac371973..9359264de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -459,12 +459,6 @@ AC_SEARCH_LIBS(socket, socket, [SOCKLIB=$LIBS],
)
AC_SUBST(SOCKLIB)
-# FreeBSD has clock_gettime in libc, Linux needs librt
-LIBS=""
-AC_SEARCH_LIBS(clock_gettime, rt, [RTLIB=$LIBS])
-AC_CHECK_FUNCS(clock_gettime)
-AC_SUBST(RTLIB)
-
# Android has pthread_* functions in bionic (libc), others need libpthread
LIBS=""
AC_SEARCH_LIBS(pthread_create, pthread, [PTHREADLIB=$LIBS])
@@ -759,6 +753,17 @@ AC_COMPILE_IFELSE(
[
AC_MSG_RESULT([no])
openssl_lib=crypto
+
+ # check for clock_gettime() on non-Windows only. Otherwise this
+ # check might find clock_gettime() in libwinpthread, but we don't want
+ # to link against it.
+ saved_LIBS=$LIBS
+ # FreeBSD has clock_gettime in libc, Linux needs librt
+ LIBS=""
+ AC_SEARCH_LIBS(clock_gettime, rt, [RTLIB=$LIBS])
+ AC_CHECK_FUNCS(clock_gettime)
+ AC_SUBST(RTLIB)
+ LIBS=$saved_LIBS
]
)
AC_SUBST(OPENSSL_LIB, [-l$openssl_lib])