Move config.xml, yaz-proxy.sh to etc
[yazpp-moved-to-github.git] / yaz++-config.in
1 #!/bin/sh
2 # $Id: yaz++-config.in,v 1.4 2002-11-14 14:41:07 adam Exp $
3 yazppprefix=@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 yazpp_src_root=@YAZPP_SRC_ROOT@
11 yazpp_build_root=@YAZPP_BUILD_ROOT@
12
13 yazlibs="@YAZLIB@ @LIBS@"
14 yazlalibs="@YAZLALIB@ @LIBS@"
15 YAZPPVERSION=@VERSION@
16
17 usage()
18 {
19         cat <<EOF
20 Usage: yaz++-config [OPTIONS] [LIBRARIES]
21 Options:
22         [--prefix[=DIR]]
23         [--version]
24         [--libs]
25         [--lalibs]
26         [--cflags]
27 EOF
28         exit $1
29 }
30
31 #if test $# -eq 0; then
32 #       yaz_echo_help=yes
33 #fi
34
35 while test $# -gt 0; do
36   case "$1" in
37   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
38   *) optarg= ;;
39   esac
40
41   case $1 in
42     --prefix=*)
43       yazppprefix=$optarg
44       ;;
45     --prefix)
46       echo $yazppprefix
47       exit 0
48       ;;
49     --version)
50       echo $YAZPPVERSION
51       exit 0
52       ;;
53     --cflags)
54       yaz_echo_cflags=yes
55       ;;
56     --libs)
57       yaz_echo_libs=yes
58       ;;
59     --tabs)
60       yaz_echo_tabs=yes
61       ;;
62     --lalibs)
63       yaz_echo_lalibs=yes
64       ;;
65     -*)
66       yaz_echo_help=yes
67       ;;
68   esac
69   shift
70 done
71
72 if test "$yaz_echo_source" = "yes"; then
73     YAZPPLIB="-L${yazpp_build_root}/lib/.libs -lyaz++ $yazlibs"
74     YAZPPLALIB="${yazpp_build_root}/lib/libyaz++.la $yazlalibs"
75     YAZPPINC="@YAZINC@ -I${yazpp_src_root}/include"
76 else
77
78     if test "$yazppprefix" = "/usr"; then
79         YAZPPLIB="-lyaz++ $yazlibs"
80     else
81         YAZPPLIB="-L${yazppprefix}/lib -lyaz++ $yazlibs"
82     fi
83     YAZPPLALIB=$YAZPPLIB
84     if test "$yazppprefix" = "/usr"; then
85         YAZPPINC=
86     else
87         YAZPPINC="@YAZINC@ -I${yazppprefix}/include"
88     fi
89 fi
90
91 if test "$yaz_echo_help" = "yes"; then
92         usage 1 1>&2
93 fi
94 if test "$yaz_echo_cflags" = "yes"; then
95         echo $YAZPPINC
96 fi
97 if test "$yaz_echo_libs" = "yes"; then
98         echo $YAZPPLIB
99 fi
100 if test "$yaz_echo_lalibs" = "yes"; then
101         echo $YAZPPLALIB
102 fi