For win, generate yazpp3.dll instead of yazpp2.dll.
[yazpp-moved-to-github.git] / yazpp-config.in
1 #!/bin/sh
2 # $Id: yazpp-config.in,v 1.3 2007-04-13 10:26:57 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="-lyazpp -lzoompp"
73
74 YAZPPINC="@YAZINC@"
75
76 if test "$yaz_echo_source" = "yes"; then
77     YAZPPLIB="-L${yazpp_build_root}/src/.libs -lyazpp"
78     YAZPPLIB="$YAZPPLIB -L${yazpp_build_root}/zoom/.libs -lzoompp"
79     YAZPPLIB="$YAZPPLIB $yazlibs"
80     YAZPPLALIB="${yazpp_build_root}/src/libyazpp.la $yazlalibs"
81     YAZPPINC="-I${yazpp_src_root}/include $YAZPPINC"
82 else
83
84     if test "$yazppprefix" = "/usr"; then
85         YAZPPLIB="${libs_short} $yazlibs"
86     else
87         YAZPPLIB="-L${yazppprefix}/lib ${libs_short} $yazlibs"
88     fi
89     YAZPPLALIB=$YAZPPLIB
90     if test "$yazppprefix" != "/usr"; then
91         YAZPPINC="-I${yazppprefix}/include $YAZPPINC"
92     fi
93 fi
94
95 if test "$yaz_echo_help" = "yes"; then
96         usage 1 1>&2
97 fi
98 if test "$yaz_echo_cflags" = "yes"; then
99         echo $YAZPPINC
100 fi
101 if test "$yaz_echo_libs" = "yes"; then
102         echo $YAZPPLIB
103 fi
104 if test "$yaz_echo_lalibs" = "yes"; then
105         echo $YAZPPLALIB
106 fi