Version 3.0.49. Update news.
[yaz-moved-to-github.git] / yaz-config.in
index d14e507..57886b6 100644 (file)
@@ -1,5 +1,7 @@
 #!/bin/sh
-# $Id: yaz-config.in,v 1.27 2007-04-13 10:24:32 adam Exp $
+# This file is part of the YAZ toolkit.
+# Copyright (C) 1995-2008 Index Data
+
 yazprefix=@prefix@
 yaz_echo_cflags=no
 yaz_echo_libs=no
@@ -9,9 +11,14 @@ yaz_echo_lalibs=no
 yaz_echo_comp=no
 yaz_src_root=@YAZ_SRC_ROOT@
 yaz_build_root=@YAZ_BUILD_ROOT@
-
-yazextralibs="@LIBS@"
+PTHREAD_LIBS="@PTHREAD_LIBS@"
+PTHREAD_CFLAGS="@PTHREAD_CFLAGS@"
+ICU_LIBS="@ICU_LIBS@"
+ICU_CPPFLAGS="@ICU_CPPFLAGS@"
+SSL_LIBS="@SSL_LIBS@"
+LIBS="@LIBS@"
 YAZVERSION=@VERSION@
+VERSION_SHA1=@VERSION_SHA1@
 
 usage()
 {
@@ -24,8 +31,9 @@ Options:
        [--lalibs]
        [--cflags]
        [--comp]
+        [-V]
 Libraries:
-       threads
+       threads icu server
 EOF
        exit $1
 }
@@ -44,6 +52,10 @@ while test $# -gt 0; do
            echo $yazprefix
            exit 0
            ;;
+        -V)
+           echo "$YAZVERSION $VERSION_SHA1"
+           exit 0
+            ;;
        --version)
            echo $YAZVERSION
            exit 0
@@ -63,8 +75,17 @@ while test $# -gt 0; do
        threads)
            lib_thread=yes
            ;;
-       malloc)
-           lib_malloc=yes
+       icu)
+           if test "$ICU_CPPFLAGS"; then
+               lib_icu=yes
+           fi
+           ;;
+       server)
+           lib_thread=yes
+           lib_server=yes
+           ;;
+       static)
+           lib_static=yes
            ;;
        -*)
            yaz_echo_help=yes
@@ -74,30 +95,69 @@ while test $# -gt 0; do
 done
 
 lyaz="-lyaz"
+if test "$lib_server" = "yes"; then
+    lyaz="-lyaz_server $lyaz"
+fi
+
+if test "$lib_icu" = "yes"; then
+    lyaz="-lyaz_icu $lyaz"
+fi
 
 YAZINC="@YAZ_CONFIG_CFLAGS@"
 
 if test "$yaz_echo_source" = "yes"; then
     YAZBIN=${yaz_build_root}/bin
-    YAZLIB="-L${yaz_build_root}/src/.libs $lyaz $yazextralibs"
-    YAZLALIB="${yaz_build_root}/src/libyaz.la $yazextralibs"
+
+    if test "$lib_static" = "yes"; then
+        YAZLIB="${yaz_build_root}/src/.libs/libyaz.a"
+        if test "$lib_server" = "yes"; then
+           YAZLIB="${yaz_build_root}/src/.libs/libyaz_server.a $YAZLIB"
+        fi
+        if test "$lib_icu" = "yes"; then
+           YAZLIB="${yaz_build_root}/src/.libs/libyaz_icu.a $YAZLIB"
+        fi
+    else
+        YAZLIB="-L${yaz_build_root}/src/.libs $lyaz"
+    fi
+    YAZLIB="$YAZLIB ${SSL_LIBS} $LIBS"
+
+    YAZLALIB="${yaz_build_root}/src/libyaz.la"
+    if test "$lib_server" = "yes"; then
+       YAZLALIB="${yaz_build_root}/src/libyaz_server.la $YAZLALIB"
+    fi
+    if test "$lib_icu" = "yes"; then
+       YAZLALIB="${yaz_build_root}/src/libyaz_icu.la $YAZLALIB"
+    fi
+    YAZLALIB="$YAZLALIB $LIBS"
+
     YAZINC="-I${yaz_src_root}/include $YAZINC"
     YAZCOMP=${yaz_src_root}/util/yaz-asncomp
 else
     YAZBIN=${yazprefix}/bin
     YAZCOMP=${yazprefix}/bin/yaz-asncomp
 
-    if test "$yazprefix" = "/usr"; then
-       YAZLIB="$lyaz $yazextralibs"
-    else
-       YAZLIB="-L$yazprefix/lib $lyaz $yazextralibs"
+    if test "$yazprefix" != "/usr"; then
+       YAZLIB="-L$yazprefix/lib"
     fi
+    YAZLIB="$YAZLIB $lyaz ${SSL_LIBS} $LIBS"
     YAZLALIB=$YAZLIB
     if test "$yazprefix" != "/usr"; then
        YAZINC="-I$yazprefix/include $YAZINC"
     fi
 fi
 
+if test "$lib_thread" = "yes"; then
+    YAZINC="$PTHREAD_CFLAGS $YAZINC"
+    YAZLIB="$YAZLIB $PTHREAD_LIBS"
+    YAZLALIB="$YAZLALIB $PTHREAD_LIBS"
+fi
+
+if test "$lib_icu" = "yes"; then
+    YAZINC="$YAZINC $ICU_CPPFLAGS"
+    YAZLIB="$YAZLIB $ICU_LIBS"
+    YAZLALIB="$YAZLALIB $ICU_LIBS"
+fi
+
 if test "$yaz_echo_help" = "yes"; then
     usage 1 1>&2
 fi