Separate libs. Update version
[yazpp-moved-to-github.git] / yaz++-config.in
1 #!/bin/sh
2 # $Id: yaz++-config.in,v 1.5 2004-02-11 10:01:54 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 libs_short="-lyazcpp -lzoomcpp"
73
74 if test "$yaz_echo_source" = "yes"; then
75     YAZPPLIB="-L${yazpp_build_root}/src/.libs ${libs_short} $yazlibs"
76     YAZPPLALIB="${yazpp_build_root}/src/libyazcpp.la $yazlalibs"
77     YAZPPINC="@YAZINC@ -I${yazpp_src_root}/include"
78 else
79
80     if test "$yazppprefix" = "/usr"; then
81         YAZPPLIB="${libs_short} $yazlibs"
82     else
83         YAZPPLIB="-L${yazppprefix}/lib ${libs_short} $yazlibs"
84     fi
85     YAZPPLALIB=$YAZPPLIB
86     if test "$yazppprefix" = "/usr"; then
87         YAZPPINC=
88     else
89         YAZPPINC="@YAZINC@ -I${yazppprefix}/include"
90     fi
91 fi
92
93 if test "$yaz_echo_help" = "yes"; then
94         usage 1 1>&2
95 fi
96 if test "$yaz_echo_cflags" = "yes"; then
97         echo $YAZPPINC
98 fi
99 if test "$yaz_echo_libs" = "yes"; then
100         echo $YAZPPLIB
101 fi
102 if test "$yaz_echo_lalibs" = "yes"; then
103         echo $YAZPPLALIB
104 fi