]> Pileus Git - ~andy/gtk/blob - gtk-config.in
Unset CATOBJEXT so that the macros and Makefiles correctly handle
[~andy/gtk] / gtk-config.in
1 #!/bin/sh
2
3 glib_libs="@glib_libs@"
4 glib_cflags="@glib_cflags@"
5
6 prefix=@prefix@
7 exec_prefix=@exec_prefix@
8 exec_prefix_set=no
9
10 usage="\
11 Usage: gtk-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
12
13 if test $# -eq 0; then
14       echo "${usage}" 1>&2
15       exit 1
16 fi
17
18 while test $# -gt 0; do
19   case "$1" in
20   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
21   *) optarg= ;;
22   esac
23
24   case $1 in
25     --prefix=*)
26       prefix=$optarg
27       if test $exec_prefix_set = no ; then
28         exec_prefix=$optarg
29       fi
30       ;;
31     --prefix)
32       echo $prefix
33       ;;
34     --exec-prefix=*)
35       exec_prefix=$optarg
36       exec_prefix_set=yes
37       ;;
38     --exec-prefix)
39       echo $exec_prefix
40       ;;
41     --version)
42       echo @GTK_VERSION@
43       ;;
44     --cflags)
45       if test @includedir@ != /usr/include ; then
46         includes=-I@includedir@
47         for i in $glib_cflags ; do
48           if test $i = -I@includedir@ ; then
49             includes=""
50           fi
51         done
52       fi
53       echo $includes @x_cflags@ $glib_cflags
54       ;;
55     --libs)
56       my_glib_libs=
57       libdirs=-L@libdir@
58       for i in $glib_libs ; do
59         if test $i != -L@libdir@ ; then
60           if test -z "$my_glib_libs" ; then
61             my_glib_libs="$i"
62           else
63             my_glib_libs="$my_glib_libs $i"
64           fi
65         fi
66       done
67       echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ -lm
68       ;;
69     *)
70       echo "${usage}" 1>&2
71       exit 1
72       ;;
73   esac
74   shift
75 done
76