1 | #! /bin/sh |
---|
2 | |
---|
3 | prefix=@prefix@ |
---|
4 | exec_prefix=@exec_prefix@ |
---|
5 | includedir=@includedir@ |
---|
6 | |
---|
7 | usage() |
---|
8 | { |
---|
9 | cat <<EOF |
---|
10 | Usage: libglade-config [OPTION] [LIBRARIES] |
---|
11 | |
---|
12 | Known values for OPTION are: |
---|
13 | |
---|
14 | --prefix=DIR change libglade prefix [default $prefix] |
---|
15 | --libs print library linking information |
---|
16 | --cflags print pre-processor and compiler flags |
---|
17 | --check just check for library. |
---|
18 | --help display this help and exit |
---|
19 | --version output version information |
---|
20 | |
---|
21 | Possible widget libraries: |
---|
22 | gtk (included by default) |
---|
23 | gnome |
---|
24 | bonobo |
---|
25 | gnomedb |
---|
26 | EOF |
---|
27 | |
---|
28 | exit $1 |
---|
29 | } |
---|
30 | |
---|
31 | if test $# -eq 0; then |
---|
32 | usage 1 |
---|
33 | fi |
---|
34 | |
---|
35 | cflags=false |
---|
36 | libs=false |
---|
37 | |
---|
38 | lib_gtk=yes |
---|
39 | lib_gnome=no |
---|
40 | lib_bonobo=no |
---|
41 | lib_gnomedb=no |
---|
42 | |
---|
43 | while test $# -gt 0; do |
---|
44 | case "$1" in |
---|
45 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
---|
46 | *) optarg= ;; |
---|
47 | esac |
---|
48 | |
---|
49 | case "$1" in |
---|
50 | --prefix=*) |
---|
51 | prefix=$optarg |
---|
52 | ;; |
---|
53 | |
---|
54 | --prefix) |
---|
55 | echo $prefix |
---|
56 | ;; |
---|
57 | |
---|
58 | --version) |
---|
59 | echo @PACKAGE@ @VERSION@ |
---|
60 | exit 0 |
---|
61 | ;; |
---|
62 | |
---|
63 | --help) |
---|
64 | usage 0 |
---|
65 | ;; |
---|
66 | |
---|
67 | --cflags) |
---|
68 | echo_cflags=yes |
---|
69 | ;; |
---|
70 | |
---|
71 | --libs) |
---|
72 | echo_libs=yes |
---|
73 | ;; |
---|
74 | |
---|
75 | --check) |
---|
76 | ;; |
---|
77 | |
---|
78 | gtk) |
---|
79 | lib_gtk=yes |
---|
80 | ;; |
---|
81 | gnome) |
---|
82 | lib_gnome=yes |
---|
83 | ;; |
---|
84 | bonobo) |
---|
85 | lib_gnome=yes # bonobo implies gnome |
---|
86 | lib_bonobo=yes |
---|
87 | ;; |
---|
88 | gnomedb) # gnomedb implies gnome |
---|
89 | lib_gnome=yes |
---|
90 | lib_gnomedb=yes |
---|
91 | ;; |
---|
92 | |
---|
93 | *) |
---|
94 | usage 1 1>&2 |
---|
95 | exit 1 |
---|
96 | ;; |
---|
97 | esac |
---|
98 | shift |
---|
99 | done |
---|
100 | |
---|
101 | # This is uncommented when we have no GNOME support ... |
---|
102 | @GNOME_SUPPORT_FALSE@if test "$lib_gnome" = "yes"; then |
---|
103 | @GNOME_SUPPORT_FALSE@ echo "*** GNOME support was not compiled into libglade" 1>&2 |
---|
104 | @GNOME_SUPPORT_FALSE@ exit 1 |
---|
105 | @GNOME_SUPPORT_FALSE@fi |
---|
106 | |
---|
107 | # This is uncommented when we have no BONOBO support ... |
---|
108 | @BONOBO_SUPPORT_FALSE@if test "$lib_bonobo" = "yes"; then |
---|
109 | @BONOBO_SUPPORT_FALSE@ echo "*** Bonobo support was not compiled into libglade" 1>&2 |
---|
110 | @BONOBO_SUPPORT_FALSE@ exit 1 |
---|
111 | @BONOBO_SUPPORT_FALSE@fi |
---|
112 | |
---|
113 | # This is uncommented when we have no GNOME-DB support ... |
---|
114 | @GNOMEDB_SUPPORT_FALSE@if test "$lib_gnomedb" = "yes"; then |
---|
115 | @GNOMEDB_SUPPORT_FALSE@ echo "*** GNOME-DB support was not compiled into libglade" 1>&2 |
---|
116 | @GNOMEDB_SUPPORT_FALSE@ exit 1 |
---|
117 | @GNOMEDB_SUPPORT_FALSE@fi |
---|
118 | |
---|
119 | if test "$echo_cflags" = "yes"; then |
---|
120 | cflags="@XML_CFLAGS@ -I@includedir@/libglade-1.0" |
---|
121 | if test "$lib_bonobo" = "yes"; then |
---|
122 | cflags="$cflags @BONOBO_CFLAGS@" |
---|
123 | elif test "$lib_gnomedb" = "yes"; then |
---|
124 | cflags="$cflags @GNOMEDB_CFLAGS@" |
---|
125 | elif test "$lib_gnome" = "yes"; then |
---|
126 | cflags="$cflags @GNOME_INCLUDEDIR@" |
---|
127 | else |
---|
128 | cflags="$cflags @GTK_CFLAGS@" |
---|
129 | fi |
---|
130 | echo $cflags |
---|
131 | fi |
---|
132 | |
---|
133 | if test "$echo_libs" = "yes"; then |
---|
134 | libs="" |
---|
135 | libsa="" |
---|
136 | if test "$lib_gtk" = "yes"; then |
---|
137 | libs="-lglade" |
---|
138 | libsa="@GTK_LIBS@" |
---|
139 | fi |
---|
140 | if test "$lib_gnome" = "yes"; then |
---|
141 | libs="-lglade-gnome $libs" |
---|
142 | libsa="@GNOME_LIBDIR@ @GNOMEUI_LIBS@" |
---|
143 | fi |
---|
144 | if test "$lib_bonobo" = "yes"; then |
---|
145 | libs="-lglade-bonobo $libs" |
---|
146 | libsa="@GNOME_LIBDIR@ @BONOBO_LIBS@" |
---|
147 | fi |
---|
148 | if test "$lib_gnomedb" = "yes"; then |
---|
149 | libs="-lglade-gnomedb $libs" |
---|
150 | libsa="@GNOME_LIBDIR@ @GNOMEDB_LIBS@" |
---|
151 | fi |
---|
152 | echo -L@libdir@ $libs @XML_LIBS@ $libsa |
---|
153 | fi |
---|
154 | |
---|
155 | exit 0 |
---|