New function, that calls g_source_remove(). Check return value of
[glib.git] / glib-config-2.0.in
blob106c6eacb19b94e1f432132b2aac5b0c24a92140
1 #!/bin/sh
3 prefix=@prefix@
4 exec_prefix=@exec_prefix@
5 exec_prefix_set=no
7 usage()
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
26 if test $# -eq 0; then
27 usage 1 1>&2
30 lib_glib=yes
32 while test $# -gt 0; do
33 case "$1" in
34 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
35 *) optarg= ;;
36 esac
38 case $1 in
39 --prefix=*)
40 prefix=$optarg
41 if test $exec_prefix_set = no ; then
42 exec_prefix=$optarg
45 --prefix)
46 echo_prefix=yes
48 --exec-prefix=*)
49 exec_prefix=$optarg
50 exec_prefix_set=yes
52 --exec-prefix)
53 echo_exec_prefix=yes
55 --version)
56 echo @GLIB_VERSION@
57 exit 0
59 --cflags)
60 includes="-I@includedir@/glib-2.0"
61 echo_cflags=yes
63 --libs)
64 echo_libs=yes
66 glib)
67 lib_glib=yes
69 gmodule)
70 lib_gmodule=yes
72 gobject)
73 lib_gobject=yes
75 gthread)
76 lib_gthread=yes
79 usage 1 1>&2
81 esac
82 shift
83 done
85 if test "$echo_prefix" = "yes"; then
86 echo $prefix
88 if test "$echo_exec_prefix" = "yes"; then
89 echo $exec_prefix
91 if test "$echo_cflags" = "yes"; then
92 cflags=""
93 if test "$lib_gthread" = "yes"; then
94 cflags="$cflags @G_THREAD_CFLAGS@"
96 echo -I@libdir@/glib-2.0/include $includes $cflags
98 if test "$echo_libs" = "yes"; then
99 libsp=""
100 libsa=""
101 if test "$lib_glib" = "yes"; then
102 libsp="$libsp -lglib-1.3"
104 if test "$lib_gobject" = "yes"; then
105 libsp="-lgobject-1.3 $libsp"
107 if test "$lib_gthread" = "yes"; then
108 libsp="-lgthread-1.3 $libsp"
109 libsa="$libsa @G_THREAD_LIBS@"
111 if test "$lib_gmodule" = "yes"; then
112 libsp="@G_MODULE_LDFLAGS@ -lgmodule-1.3 $libsp"
113 libsa="$libsa @G_MODULE_LIBS@"
115 echo -L@libdir@ $libsp $libsa