Include Boost CFLAGS for metaproxy-config
[metaproxy-moved-to-github.git] / metaproxy-config.in
1 #!/bin/sh
2 prefix=@prefix@
3 echo_cflags=no
4 echo_libs=no
5 echo_help=no
6 echo_tabs=no
7 echo_source=yes
8 echo_lalibs=no
9 src_root=@abs_top_srcdir@
10 build_root=@abs_top_builddir@
11
12 libs="@YAZPPLIB@ @LIBS@"
13 lalibs="@YAZPPLALIB@ @LIBS@"
14 VERSION=@VERSION@
15
16 usage()
17 {
18         cat <<EOF
19 Usage: metaproxy-config [OPTIONS] [LIBRARIES]
20 Options:
21         [--prefix[=DIR]]
22         [--version]
23         [--libs]
24         [--lalibs]
25         [--cflags]
26 EOF
27         exit $1
28 }
29
30 if test $# -eq 0; then
31         echo_help=yes
32 fi
33
34 while test $# -gt 0; do
35   case "$1" in
36   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
37   *) optarg= ;;
38   esac
39
40   case $1 in
41     --prefix=*)
42       prefix=$optarg
43       ;;
44     --prefix)
45       echo $prefix
46       exit 0
47       ;;
48     --version)
49       echo $VERSION
50       exit 0
51       ;;
52     --cflags)
53       echo_cflags=yes
54       ;;
55     --libs)
56       echo_libs=yes
57       ;;
58     --tabs)
59       echo_tabs=yes
60       ;;
61     --lalibs)
62       echo_lalibs=yes
63       ;;
64     -*)
65       echo_help=yes
66       ;;
67   esac
68   shift
69 done
70
71 INC="@YAZPPINC@ @BOOST_CPPFLAGS@"
72
73 if test "$echo_source" = "yes"; then
74     LIB="-L${build_root}/src/.libs -lmetaproxy $libs"
75     LALIB="${build_root}/src/libmetaproxy.la $lalibs"
76     INC="-I${src_root}/include $INC"
77 else
78     LIB="-lmetaproxy $libs"
79     if test "$prefix" != "/usr"; then
80         LIB="-L${prefix}/lib $LIB"
81     fi
82     LALIB=$LIB
83     if test "$prefix" != "/usr"; then
84         INC="-I${prefix}/include $INC"
85     fi
86 fi
87
88 if test "$echo_help" = "yes"; then
89         usage 1 1>&2
90 fi
91 if test "$echo_cflags" = "yes"; then
92     echo $INC
93 fi
94 if test "$echo_libs" = "yes"; then
95     echo $LIB
96 fi
97 if test "$echo_lalibs" = "yes"; then
98     echo $LALIB
99 fi