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