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