]> Pileus Git - ~andy/gtk/blob - gtk-config.in
README.win32 Add HAVE_WINTAB. Undefine it if bulding without the Wintab
[~andy/gtk] / gtk-config.in
1 #!/bin/sh
2
3 glib_libs="@glib_libs@"
4 glib_cflags="@glib_cflags@"
5 glib_thread_libs="@glib_thread_libs@"
6 glib_thread_cflags="@glib_thread_cflags@"
7
8 prefix=@prefix@
9 exec_prefix=@exec_prefix@
10 exec_prefix_set=no
11
12 usage()
13 {
14         cat <<EOF
15 Usage: gtk-config [OPTIONS] [LIBRARIES]
16 Options:
17         [--prefix[=DIR]]
18         [--exec-prefix[=DIR]]
19         [--version]
20         [--libs]
21         [--cflags]
22 Libraries:
23         gtk
24         gthread
25 EOF
26         exit $1
27 }
28
29 if test $# -eq 0; then
30         usage 1 1>&2
31 fi
32
33 lib_gtk=yes
34
35 while test $# -gt 0; do
36   case "$1" in
37   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
38   *) optarg= ;;
39   esac
40
41   case $1 in
42     --prefix=*)
43       prefix=$optarg
44       if test $exec_prefix_set = no ; then
45         exec_prefix=$optarg
46       fi
47       ;;
48     --prefix)
49       echo_prefix=yes
50       ;;
51     --exec-prefix=*)
52       exec_prefix=$optarg
53       exec_prefix_set=yes
54       ;;
55     --exec-prefix)
56       echo_exec_prefix=yes
57       ;;
58     --version)
59       echo @GTK_VERSION@
60       ;;
61     --cflags)
62       echo_cflags=yes
63       ;;
64     --libs)
65       echo_libs=yes
66       ;;
67     gtk)
68       lib_gtk=yes
69       ;;
70     gthread)
71       lib_gthread=yes
72       ;;
73     *)
74       usage 1 1>&2
75       ;;
76   esac
77   shift
78 done
79
80 if test "$echo_prefix" = "yes"; then
81         echo $prefix
82 fi
83
84 if test "$echo_exec_prefix" = "yes"; then
85         echo $exec_prefix
86 fi
87
88 if test "$lib_gthread" = "yes"; then
89       glib_cflags="$glib_thread_cflags"
90       glib_libs="$glib_thread_libs"
91 fi
92
93 if test "$echo_cflags" = "yes"; then
94       if test @includedir@ != /usr/include ; then
95         includes=-I@includedir@
96         for i in $glib_cflags ; do
97           if test $i = -I@includedir@ ; then
98             includes=""
99           fi
100         done
101       fi
102       echo -I@libdir@/gtk+/include $includes @x_cflags@ $glib_cflags
103 fi
104
105 if test "$echo_libs" = "yes"; then
106       my_glib_libs=
107       libdirs=-L@libdir@
108       for i in $glib_libs ; do
109         if test $i != -L@libdir@ ; then
110           if test -z "$my_glib_libs" ; then
111             my_glib_libs="$i"
112           else
113             my_glib_libs="$my_glib_libs $i"
114           fi
115         fi
116       done
117
118       echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ @MATH_LIB@
119 fi      
120