- dnl GLIBC uses threads to emulate posix timers when kernel support
- dnl is not available (like Linux < 2.6 or when used with kFreeBSD)
- dnl Now the pthread lib is linked automatically in the normal case,
- dnl but when linking statically, it needs to be explicitly specified.
- AC_EGREP_CPP([Thread],
- [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
- && !defined __UCLIBC__
- Thread emulation available
- #endif
-#endif
- ],
- [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])
+ m4_ifdef([gl_][THREADLIB],
+ [dnl GLIBC uses threads to emulate posix timers when kernel support
+ dnl is not available (like Linux < 2.6 or when used with kFreeBSD)
+ dnl Now the pthread lib is linked automatically in the normal case,
+ dnl but when linking statically, it needs to be explicitly specified.
+ AC_EGREP_CPP([Thread],
+ [#include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
+ && !(__UCLIBC__ && __HAS_NO_THREADS__)
+ Thread emulation available
+ #endif
+ #endif
+ ],
+ [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])])