Using SSLeay_add_all_algorithms instead of OpenSSL_add_all_algorithms.
[yaz-moved-to-github.git] / yaz-config.in
1 #!/bin/sh
2 # $Id: yaz-config.in,v 1.4 2000-11-23 10:58:32 adam Exp $
3 yazprefix=@prefix@
4 yaz_echo_cflags=no
5 yaz_echo_libs=no
6 yaz_echo_help=no
7 yaz_echo_tabs=no
8 yaz_echo_source=yes
9 yaz_echo_lalibs=no
10 yaz_src_root=@YAZ_SRC_ROOT@
11
12 yazextralibs="@LIBS@"
13 YAZVERSION=@VERSION@
14
15 usage()
16 {
17         cat <<EOF
18 Usage: yaz-config [OPTIONS] [LIBRARIES]
19 Options:
20         [--prefix[=DIR]]
21         [--version]
22         [--libs]
23         [--lalibs]
24         [--cflags]
25         [--tabs]
26 Libraries:
27         threads
28 EOF
29         exit $1
30 }
31
32 #if test $# -eq 0; then
33 #       yaz_echo_help=yes
34 #fi
35
36 while test $# -gt 0; do
37   case "$1" in
38   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
39   *) optarg= ;;
40   esac
41
42   case $1 in
43     --prefix=*)
44       yazprefix=$optarg
45       ;;
46     --prefix)
47       echo $yazprefix
48       exit 0
49       ;;
50     --version)
51       echo $YAZVERSION
52       exit 0
53       ;;
54     --cflags)
55       yaz_echo_cflags=yes
56       ;;
57     --libs)
58       yaz_echo_libs=yes
59       ;;
60     --tabs)
61       yaz_echo_tabs=yes
62       ;;
63     --lalibs)
64       yaz_echo_lalibs=yes
65       ;;
66     threads)
67       lib_thread=yes
68       ;;
69     -*)
70       yaz_echo_help=yes
71       ;;
72   esac
73   shift
74 done
75
76 if test "$lib_thread" = "yes"; then
77     yazextralibs="@LIBTHREAD@ $yazextralibs"
78     lyaz="-lyazthread -lyaz"
79 else
80     lyaz="-lyaz"
81 fi 
82 if test "$yaz_echo_source" = "yes"; then
83     YAZTAB=${yaz_src_root}/tab
84     YAZBIN=${yaz_src_root}/bin
85     YAZLIB="-L${yaz_src_root}/lib/.libs $lyaz $yazextralibs"
86     if test "$lib_thread" = "yes"; then
87         YAZLALIB="${yaz_src_root}/lib/libyazthread.la ${yaz_src_root}/lib/libyaz.la $yazextralibs"
88     else
89         YAZLALIB="${yaz_src_root}/lib/libyazthread.la $yazextralibs"
90     fi
91     YAZINC="-I${yaz_src_root}/include"
92 else
93     YAZTAB=$yazprefix/share/yaz/tab
94     YAZBIN=$yazprefix/bin
95
96     if test "$yazprefix" = "/usr"; then
97         YAZLIB="$lyaz $yazextralibs"
98     else
99         YAZLIB="-L$yazprefix/lib $lyaz $yazextralibs"
100     fi
101     YAZLALIB=$YAZLIB
102     if test "$yazprefix" = "/usr"; then
103         YAZINC=
104     else
105         YAZINC=-I$yazprefix/include
106     fi
107 fi
108
109 if test "$lib_thread" = "yes"; then
110     YAZINC="$YAZINC -D_REENTRANT"
111 fi
112
113 if test "$yaz_echo_help" = "yes"; then
114         usage 1 1>&2
115 fi
116 if test "$yaz_echo_cflags" = "yes"; then
117         echo $YAZINC
118 fi
119 if test "$yaz_echo_libs" = "yes"; then
120         echo $YAZLIB
121 fi
122 if test "$yaz_echo_tabs" = "yes"; then
123         echo $YAZTAB
124 fi
125 if test "$yaz_echo_lalibs" = "yes"; then
126         echo $YAZLALIB
127 fi