Moved header files to include/yaz++. Switched to libtool and automake.
[yazpp-moved-to-github.git] / yaz++-config.in
1 #!/bin/sh
2 # $Id: yaz++-config.in,v 1.1 2000-10-11 11:58:16 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     --source)
61       yaz_echo_source=yes
62       ;;
63     --lalibs)
64       yaz_echo_lalibs=yes
65       ;;
66     -*)
67       yaz_echo_help=yes
68       ;;
69   esac
70   shift
71 done
72
73 if test "$yaz_echo_source" = "yes"; then
74     YAZPPLIB="-L${yazpp_src_root}/src/.libs -lyaz++ $yazlibs"
75     YAZPPLALIB="${yazpp_src_root}/src/libyaz++.la $yazlibs"
76     YAZPPINC="@YAZINC@ -I${yazpp_src_root}/include"
77 else
78
79     if test "$yazppprefix" = "/usr"; then
80         YAZPPLIB="-lyaz++ $yazlibs"
81     else
82         YAZPPLIB="-L${yazppprefix}/lib -lyaz++ $yazlibs"
83     fi
84     YAZPPLALIB=$YAZPPLIB
85     if test "$yazppprefix" = "/usr"; then
86         YAZPPINC=
87     else
88         YAZPPINC="@YAZINC@ -I${yazppprefix}/include"
89     fi
90 fi
91
92 if test "$yaz_echo_help" = "yes"; then
93         usage 1 1>&2
94 fi
95 if test "$yaz_echo_cflags" = "yes"; then
96         echo $YAZPPINC
97 fi
98 if test "$yaz_echo_libs" = "yes"; then
99         echo $YAZPPLIB
100 fi
101 if test "$yaz_echo_lalibs" = "yes"; then
102         echo $YAZPPLALIB
103 fi