Initial revision
[ardour.git] / libs / cassowary / cassowary-config
1 #!/bin/sh
2 # Modified from gtk-config
3 # --09/07/99 gjb
4
5 # gotten from LDADD in c++/Makefile.am
6 cassowary_gtllibs=""
7 cassowary_libs="-L/usr/local/lib $cassowary_gtllibs"
8 cassowary_cflags="-I/usr/local/include "
9
10 prefix=/usr/local
11 exec_prefix=${prefix}
12 exec_prefix_set=no
13
14 usage()
15 {
16         cat <<EOF
17 Usage: cassowary-config [OPTIONS]
18 Options:
19         [--prefix[=DIR]]
20         [--exec-prefix[=DIR]]
21         [--version]
22         [--libs]
23         [--gtllibs]
24         [--cflags]
25 EOF
26         exit $1
27 }
28
29 if test $# -eq 0; then
30         usage 1 1>&2
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       prefix=$optarg
42       if test $exec_prefix_set = no ; then
43         exec_prefix=$optarg
44       fi
45       ;;
46     --prefix)
47       echo_prefix=yes
48       ;;
49     --exec-prefix=*)
50       exec_prefix=$optarg
51       exec_prefix_set=yes
52       ;;
53     --exec-prefix)
54       echo_exec_prefix=yes
55       ;;
56     --version)
57       echo 0.60
58       ;;
59     --cflags)
60       echo_cflags=yes
61       ;;
62     --libs)
63       echo_libs=yes
64       ;;
65     --gtllibs)
66       echo_gtllibs=yes
67       ;;
68     *)
69       usage 1 1>&2
70       ;;
71   esac
72   shift
73 done
74
75 if test "$echo_prefix" = "yes"; then
76         echo $prefix
77 fi
78
79 if test "$echo_exec_prefix" = "yes"; then
80         echo $exec_prefix
81 fi
82
83
84 if test "$echo_cflags" = "yes"; then
85       if test ${prefix}/include != /usr/include ; then
86         includes=-I${prefix}/include
87         for i in $cassowary_cflags ; do
88           if test $i = -I${prefix}/include ; then
89             includes=""
90           fi
91         done
92       fi
93       echo $includes $cassowary_cflags
94 fi
95
96 if test "$echo_libs" = "yes"; then
97       echo -L${exec_prefix}/lib -lcassowary -lstdc++ $cassowary_libs
98 fi
99
100 if test "$echo_gtllibs" = "yes"; then
101       echo $cassowary_gtllibs
102 fi