revert accidentally commited change
[platform/upstream/glib.git] / glib-config-2.0.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         gobject
21         gthread
22 EOF
23         exit $1
24 }
25
26 if test $# -eq 0; then
27         usage 1 1>&2
28 fi
29
30 lib_glib=yes
31
32 while test $# -gt 0; do
33   case "$1" in
34   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
35   *) optarg= ;;
36   esac
37
38   case $1 in
39     --prefix=*)
40       prefix=$optarg
41       if test $exec_prefix_set = no ; then
42         exec_prefix=$optarg
43       fi
44       ;;
45     --prefix)
46       echo_prefix=yes
47       ;;
48     --exec-prefix=*)
49       exec_prefix=$optarg
50       exec_prefix_set=yes
51       ;;
52     --exec-prefix)
53       echo_exec_prefix=yes
54       ;;
55     --version)
56       echo @GLIB_VERSION@
57       exit 0
58       ;;
59     --cflags)
60       includes="-I@includedir@/glib-2.0"
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     gobject)
73       lib_gobject=yes
74       ;;
75     gthread)
76       lib_gthread=yes
77       ;;
78     *)
79       usage 1 1>&2
80       ;;
81   esac
82   shift
83 done
84
85 if test "$echo_prefix" = "yes"; then
86         echo $prefix
87 fi
88 if test "$echo_exec_prefix" = "yes"; then
89         echo $exec_prefix
90 fi
91 if test "$echo_cflags" = "yes"; then
92         cflags=""
93         if test "$lib_gthread" = "yes"; then
94                 cflags="$cflags @G_THREAD_CFLAGS@"
95         fi
96         echo -I@libdir@/glib-2.0/include $includes $cflags
97 fi
98 if test "$echo_libs" = "yes"; then
99         libsp=""
100         libsa=""
101         if test "$lib_glib" = "yes"; then
102                 libsp="$libsp -lglib-1.3"
103         fi
104         if test "$lib_gobject" = "yes"; then
105                 libsp="-lgobject-1.3 $libsp"
106         fi
107         if test "$lib_gthread" = "yes"; then
108                 libsp="-lgthread-1.3 $libsp"
109                 libsa="$libsa @G_THREAD_LIBS@"
110         fi
111         if test "$lib_gmodule" = "yes"; then
112                 libsp="@G_MODULE_LDFLAGS@ -lgmodule-1.3 $libsp"
113                 libsa="$libsa @G_MODULE_LIBS@"
114         fi
115         echo -L@libdir@ $libsp $libsa
116 fi