Omit YLOG_LOG msg
[yazpp-moved-to-github.git] / yazpp-config.in
1 #!/bin/sh
2 # $Id: yazpp-config.in,v 1.2 2006-12-12 14:39:02 marc 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 if test "$yaz_echo_source" = "yes"; then
75     YAZPPLIB="-L${yazpp_build_root}/src/.libs -lyazpp"
76     YAZPPLIB="$YAZPPLIB -L${yazpp_build_root}/zoom/.libs -lzoompp"
77     YAZPPLIB="$YAZPPLIB $yazlibs"
78     YAZPPLALIB="${yazpp_build_root}/src/libyazpp.la $yazlalibs"
79     YAZPPINC="@YAZINC@ -I${yazpp_src_root}/include"
80 else
81
82     if test "$yazppprefix" = "/usr"; then
83         YAZPPLIB="${libs_short} $yazlibs"
84     else
85         YAZPPLIB="-L${yazppprefix}/lib ${libs_short} $yazlibs"
86     fi
87     YAZPPLALIB=$YAZPPLIB
88     if test "$yazppprefix" = "/usr"; then
89         YAZPPINC="@YAZINC@"
90     else
91         YAZPPINC="@YAZINC@ -I${yazppprefix}/include"
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