Update to libtool-1.2b, change library versioning scheme to drop
[platform/upstream/glib.git] / glib-config.in
1 #!/bin/sh
2
3 prefix=@prefix@
4 exec_prefix=@exec_prefix@
5 exec_prefix_set=no
6
7 usage()
8 {
9         cat <<EOF
10 Usage: glib-config [OPTIONS] [LIBRARIES]
11 Options:
12         [--prefix[=DIR]]
13         [--exec-prefix[=DIR]]
14         [--version]
15         [--libs]
16         [--cflags]
17 Libraries:
18         glib
19         gmodule
20 EOF
21         exit $1
22 }
23
24 if test $# -eq 0; then
25         usage 1 1>&2
26 fi
27
28 lib_glib=yes
29
30 while test $# -gt 0; do
31   case "$1" in
32   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
33   *) optarg= ;;
34   esac
35
36   case $1 in
37     --prefix=*)
38       prefix=$optarg
39       if test $exec_prefix_set = no ; then
40         exec_prefix=$optarg
41       fi
42       ;;
43     --prefix)
44       echo_prefix=yes
45       ;;
46     --exec-prefix=*)
47       exec_prefix=$optarg
48       exec_prefix_set=yes
49       ;;
50     --exec-prefix)
51       echo_exec_prefix=yes
52       ;;
53     --version)
54       echo @GLIB_VERSION@
55       exit 0
56       ;;
57     --cflags)
58       if test "@includedir@" != /usr/include ; then
59         includes="-I@includedir@"
60       fi
61       echo_cflags=yes
62       ;;
63     --libs)
64       echo_libs=yes
65       ;;
66     glib)
67       lib_glib=yes
68       ;;
69     gmodule)
70       lib_gmodule=yes
71       ;;
72     *)
73       usage 1 1>&2
74       ;;
75   esac
76   shift
77 done
78
79 if test "$echo_prefix" = "yes"; then
80         echo $prefix
81 fi
82 if test "$echo_exec_prefix" = "yes"; then
83         echo $exec_prefix
84 fi
85 if test "$echo_cflags" = "yes"; then
86         echo -I@libdir@/glib/include $includes
87 fi
88 if test "$echo_libs" = "yes"; then
89         libs=""
90         if test "$lib_glib" = "yes"; then
91                 libs="$libs -lglib"
92         fi
93         if test "$lib_gmodule" = "yes"; then
94                 libs="@G_MODULE_LDFLAGS@ -lgmodule $libs @G_MODULE_LIBS@"
95         fi
96         echo "-L@libdir@ $libs"
97 fi