X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=configure.ac;h=eab19ccef22e6ebbe447a692e6ca9203f0d86357;hp=1c5c06b997b63d4f53dfc870ea7a64155fb1d72e;hb=3f7c21d3bf85a142671d97bd4183bc3fe9b61e9e;hpb=8d133ab04af9cc1fe4d2463fb2a0139644ecd6e2 diff --git a/configure.ac b/configure.ac index 1c5c06b..eab19cc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1995-2007 dnl See the file LICENSE for details. -dnl $Id: configure.ac,v 1.64 2007-02-25 14:46:50 adam Exp $ +dnl $Id: configure.ac,v 1.65 2007-02-25 21:04:04 adam Exp $ AC_PREREQ(2.59) AC_INIT([yaz],[2.1.51],[yaz-help@indexdata.dk]) AC_CONFIG_SRCDIR(configure.ac) @@ -339,6 +339,20 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then ACX_PTHREAD([ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" AC_DEFINE(YAZ_POSIX_THREADS) + dnl unfortunately empty thread lib spec is problematic because + dnl 'yaz-config --cflags' is not always passed to linker in + dnl applications using YAZ (such as Zebra). + if test "x$PTHREAD_LIBS" = "x"; then + OLIBS=$LIBS + for lib in -lpthread -lpthreads -lc_r; do + LIBS="$lib $OLIBS" + AC_TRY_LINK([ #include ], + [ pthread_t id; pthread_join(id, 0); ], + [ PTHREAD_LIBS=$lib; break ] + ) + done + LIBS=$OLIBS + fi LIBS="$PTHREAD_LIBS $LIBS" YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS $PTHREAD_CFLAGS -DYAZ_POSIX_THREADS=1" ])