Process all source with doyxgen
[idzebra-moved-to-github.git] / idzebra-config.in
1 #!/bin/sh
2 # $Id: idzebra-config.in,v 1.5 2005-05-03 12:31:28 adam Exp $
3 prefix=@prefix@
4 idzebra_echo_cflags=no
5 idzebra_echo_libs=no
6 idzebra_echo_help=no
7 idzebra_echo_tab=no
8 idzebra_echo_source=yes
9 idzebra_echo_lalibs=no
10 idzebra_src_root=@IDZEBRA_SRC_ROOT@
11 idzebra_build_root=@IDZEBRA_BUILD_ROOT@
12
13 extralibs="@YAZLIB@ @TCL_LIB@ @EXPAT_LIBS@ @XSLT_LIBS@ @LIBS@ "
14 extralalibs="@YAZLALIB@ @TCL_LIB@ @EXPAT_LIBS@ @XSLT_LIBS@ @LIBS@"
15 IDZEBRAVERSION=@VERSION@
16
17 usage()
18 {
19     cat <<EOF
20 Usage: idzebra-config [OPTIONS] [LIBRARIES]
21 Options:
22         [--prefix[=DIR]]
23         [--version]
24         [--libs]
25         [--lalibs]
26         [--cflags]
27         [--tab]
28 EOF
29     exit $1
30 }
31
32 if test $# -eq 0; then
33     idzebra_echo_help=yes
34 fi
35
36 modules=""
37 while test $# -gt 0; do
38     case "$1" in
39         -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
40         *) optarg= ;;
41     esac
42     
43     case $1 in
44         --prefix=*)
45             prefix=$optarg
46             ;;
47         --prefix)
48             echo $prefix
49             exit 0
50             ;;
51         --version)
52             echo $IDZEBRAVERSION
53             exit 0
54             ;;
55         --cflags)
56             idzebra_echo_cflags=yes
57             ;;
58         --libs)
59             idzebra_echo_libs=yes
60             ;;
61         --tab)
62             idzebra_echo_tab=yes
63             ;;
64         --lalibs)
65             idzebra_echo_lalibs=yes
66             ;;
67         -*)
68             idzebra_echo_help=yes
69             ;;
70         *)
71             modules="$modules $1"
72             ;;
73     esac
74     shift
75 done
76
77 IDZEBRALIB=""
78 IDZEBRALALIB=""
79 IDZEBRAINC="@YAZINC@"
80
81 if test -z "$modules"; then
82     modules="api rset recctrl dict isams isamc isamb data1 bfile dfa util"
83 fi
84
85 for m in $modules; do
86     d=$m
87     if test "$m" = "api"; then
88         d="index"
89     fi
90     if test "$idzebra_echo_source" = "yes"; then
91         IDZEBRALIB="$IDZEBRALIB -L${idzebra_build_root}/$d/.libs -lidzebra-$m"
92         IDZEBRALALIB="$IDZEBRALALIB ${idzebra_build_root}/$d/libidzebra-$m.la"
93     else
94         IDZEBRALIB="$IDZEBRALIB -lidzebra-$m"
95     fi
96 done
97
98 if test "$idzebra_echo_source" = "yes"; then
99     IDZEBRALIB="$IDZEBRALIB $extralibs"
100     IDZEBRALALIB="$IDZEBRALALIB $extralalibs"
101     IDZEBRAINC="$IDZEBRAINC -I${idzebra_src_root}/include"
102     IDZEBRATAB="${idzebra_src_root}/tab"
103 else
104     if test "$prefix" != "/usr"; then
105         IDZEBRALIB="-L${prefix}/lib $IDZEBRALIB"
106         IDZEBRAINC="$IDZEBRAINC -I${prefix}/include"
107     fi
108     IDZEBRALIB="$IDZEBRALIB $extralibs"
109     IDZEBRALALIB="$IDZEBRALIB"
110     IDZEBRATAB="@datadir@/idzebra/tab"
111 fi
112
113 if test "$idzebra_echo_help" = "yes"; then
114     usage 1 1>&2
115 fi
116 if test "$idzebra_echo_cflags" = "yes"; then
117     echo $IDZEBRAINC
118 fi
119 if test "$idzebra_echo_libs" = "yes"; then
120     echo $IDZEBRALIB
121 fi
122 if test "$idzebra_echo_lalibs" = "yes"; then
123     echo $IDZEBRALALIB
124 fi
125 if test "$idzebra_echo_tab" = "yes"; then
126     echo $IDZEBRATAB
127 fi