Reformat comments for Doxygen
[yaz-moved-to-github.git] / yaz-config.in
1 #!/bin/sh
2 # $Id: yaz-config.in,v 1.23 2005-09-09 10:34:09 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 #if test $# -eq 0; then
34 #       yaz_echo_help=yes
35 #fi
36
37 while test $# -gt 0; do
38   case "$1" in
39   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
40   *) optarg= ;;
41   esac
42
43   case $1 in
44     --prefix=*)
45       yazprefix=$optarg
46       ;;
47     --prefix)
48       echo $yazprefix
49       exit 0
50       ;;
51     --version)
52       echo $YAZVERSION
53       exit 0
54       ;;
55     --cflags)
56       yaz_echo_cflags=yes
57       ;;
58     --libs)
59       yaz_echo_libs=yes
60       ;;
61     --lalibs)
62       yaz_echo_lalibs=yes
63       ;;
64     --comp)
65       yaz_echo_comp=yes
66       ;;
67     threads)
68       lib_thread=yes
69       ;;
70     malloc)
71       lib_malloc=yes
72       ;;
73     -*)
74       yaz_echo_help=yes
75       ;;
76   esac
77   shift
78 done
79
80 lyaz="-lyaz"
81
82 if test "$yaz_echo_source" = "yes"; then
83     YAZBIN=${yaz_build_root}/bin
84     YAZLIB="-L${yaz_build_root}/src/.libs $lyaz $yazextralibs"
85     YAZLALIB="${yaz_build_root}/src/libyaz.la $yazextralibs"
86     YAZINC="-I${yaz_src_root}/include"
87     YAZCOMP=${yaz_src_root}/util/yaz-asncomp
88 else
89     YAZBIN=${yazprefix}/bin
90     YAZCOMP=${yazprefix}/bin/yaz-asncomp
91
92     if test "$yazprefix" = "/usr"; then
93         YAZLIB="$lyaz $yazextralibs"
94     else
95         YAZLIB="-L$yazprefix/lib $lyaz $yazextralibs"
96     fi
97     YAZLALIB=$YAZLIB
98     if test "$yazprefix" = "/usr"; then
99         YAZINC=
100     else
101         YAZINC=-I$yazprefix/include
102     fi
103 fi
104
105 YAZINC="$YAZINC @YAZ_CONF_CFLAGS@"
106
107 if test "$lib_thread" = "yes"; then
108     YAZINC="$YAZINC @THREAD_CFLAGS@"
109 fi
110
111 if test "$yaz_echo_help" = "yes"; then
112         usage 1 1>&2
113 fi
114 if test "$yaz_echo_cflags" = "yes"; then
115         echo $YAZINC
116 fi
117 if test "$yaz_echo_libs" = "yes"; then
118         echo $YAZLIB
119 fi
120 if test "$yaz_echo_lalibs" = "yes"; then
121         echo $YAZLALIB
122 fi
123 if test "$yaz_echo_comp" = "yes"; then
124         echo $YAZCOMP
125 fi