Directive s=pw sets structure to phrase if term includes blank(s).
[yaz-moved-to-github.git] / yaz-config.in
index b047e6d..99e2ed2 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: yaz-config.in,v 1.2 2000-10-11 10:40:56 adam Exp $
+# $Id: yaz-config.in,v 1.6 2001-03-20 15:58:24 adam Exp $
 yazprefix=@prefix@
 yaz_echo_cflags=no
 yaz_echo_libs=no
@@ -8,8 +8,9 @@ yaz_echo_tabs=no
 yaz_echo_source=yes
 yaz_echo_lalibs=no
 yaz_src_root=@YAZ_SRC_ROOT@
+yaz_build_root=@YAZ_BUILD_ROOT@
 
-yazlibs="@LIBS@"
+yazextralibs="@LIBS@"
 YAZVERSION=@VERSION@
 
 usage()
@@ -23,6 +24,8 @@ Options:
        [--lalibs]
        [--cflags]
        [--tabs]
+Libraries:
+       threads
 EOF
        exit $1
 }
@@ -58,12 +61,12 @@ while test $# -gt 0; do
     --tabs)
       yaz_echo_tabs=yes
       ;;
-    --source)
-      yaz_echo_source=yes
-      ;;
     --lalibs)
       yaz_echo_lalibs=yes
       ;;
+    threads)
+      lib_thread=yes
+      ;;
     -*)
       yaz_echo_help=yes
       ;;
@@ -71,20 +74,30 @@ while test $# -gt 0; do
   shift
 done
 
+if test "$lib_thread" = "yes"; then
+    yazextralibs="@LIBTHREAD@ $yazextralibs"
+    lyaz="-lyazthread -lyaz"
+else
+    lyaz="-lyaz"
+fi 
 if test "$yaz_echo_source" = "yes"; then
     YAZTAB=${yaz_src_root}/tab
-    YAZBIN=${yaz_src_root}/bin
-    YAZLIB="-L${yaz_src_root}/lib/.libs -lyaz $yazlibs"
-    YAZLALIB="${yaz_src_root}/lib/libyaz.la $yazlibs"
+    YAZBIN=${yaz_build_root}/bin
+    YAZLIB="-L${yaz_build_root}/lib/.libs $lyaz $yazextralibs"
+    if test "$lib_thread" = "yes"; then
+        YAZLALIB="${yaz_build_root}/lib/libyazthread.la ${yaz_build_root}/lib/libyaz.la $yazextralibs"
+    else
+        YAZLALIB="${yaz_build_root}/lib/libyaz.la $yazextralibs"
+    fi
     YAZINC="-I${yaz_src_root}/include"
 else
     YAZTAB=$yazprefix/share/yaz/tab
     YAZBIN=$yazprefix/bin
 
     if test "$yazprefix" = "/usr"; then
-       YAZLIB="-lyaz $yazlibs"
+       YAZLIB="$lyaz $yazextralibs"
     else
-       YAZLIB="-L$yazprefix/lib -lyaz $yazlibs"
+       YAZLIB="-L$yazprefix/lib $lyaz $yazextralibs"
     fi
     YAZLALIB=$YAZLIB
     if test "$yazprefix" = "/usr"; then
@@ -94,6 +107,10 @@ else
     fi
 fi
 
+if test "$lib_thread" = "yes"; then
+    YAZINC="$YAZINC -D_REENTRANT"
+fi
+
 if test "$yaz_echo_help" = "yes"; then
        usage 1 1>&2
 fi