Line 0
Link Here
|
|
|
1 |
--- aclocal.m4.orig 2008-04-08 01:32:46.000000000 +0900 |
2 |
+++ aclocal.m4 2008-04-13 02:57:08.000000000 +0900 |
3 |
@@ -1057,3 +860,395 @@ |
4 |
AC_SUBST([am__untar]) |
5 |
]) # _AM_PROG_TAR |
6 |
|
7 |
+# Configure paths for GTK+ |
8 |
+# Owen Taylor 1997-2001 |
9 |
+ |
10 |
+dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
11 |
+dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, |
12 |
+dnl pass to pkg-config |
13 |
+dnl |
14 |
+AC_DEFUN([AM_PATH_GTK_2_0], |
15 |
+[dnl |
16 |
+dnl Get the cflags and libraries from pkg-config |
17 |
+dnl |
18 |
+AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], |
19 |
+ , enable_gtktest=yes) |
20 |
+ |
21 |
+ pkg_config_args=gtk+-2.0 |
22 |
+ for module in . $4 |
23 |
+ do |
24 |
+ case "$module" in |
25 |
+ gthread) |
26 |
+ pkg_config_args="$pkg_config_args gthread-2.0" |
27 |
+ ;; |
28 |
+ esac |
29 |
+ done |
30 |
+ |
31 |
+ no_gtk="" |
32 |
+ |
33 |
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
34 |
+ |
35 |
+ if test x$PKG_CONFIG != xno ; then |
36 |
+ if pkg-config --atleast-pkgconfig-version 0.7 ; then |
37 |
+ : |
38 |
+ else |
39 |
+ echo "*** pkg-config too old; version 0.7 or better required." |
40 |
+ no_gtk=yes |
41 |
+ PKG_CONFIG=no |
42 |
+ fi |
43 |
+ else |
44 |
+ no_gtk=yes |
45 |
+ fi |
46 |
+ |
47 |
+ min_gtk_version=ifelse([$1], ,2.0.0,$1) |
48 |
+ AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) |
49 |
+ |
50 |
+ if test x$PKG_CONFIG != xno ; then |
51 |
+ ## don't try to run the test against uninstalled libtool libs |
52 |
+ if $PKG_CONFIG --uninstalled $pkg_config_args; then |
53 |
+ echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" |
54 |
+ enable_gtktest=no |
55 |
+ fi |
56 |
+ |
57 |
+ if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then |
58 |
+ : |
59 |
+ else |
60 |
+ no_gtk=yes |
61 |
+ fi |
62 |
+ fi |
63 |
+ |
64 |
+ if test x"$no_gtk" = x ; then |
65 |
+ GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` |
66 |
+ GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` |
67 |
+ gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
68 |
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
69 |
+ gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
70 |
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
71 |
+ gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ |
72 |
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
73 |
+ if test "x$enable_gtktest" = "xyes" ; then |
74 |
+ ac_save_CFLAGS="$CFLAGS" |
75 |
+ ac_save_LIBS="$LIBS" |
76 |
+ CFLAGS="$CFLAGS $GTK_CFLAGS" |
77 |
+ LIBS="$GTK_LIBS $LIBS" |
78 |
+dnl |
79 |
+dnl Now check if the installed GTK+ is sufficiently new. (Also sanity |
80 |
+dnl checks the results of pkg-config to some extent) |
81 |
+dnl |
82 |
+ rm -f conf.gtktest |
83 |
+ AC_TRY_RUN([ |
84 |
+#include <gtk/gtk.h> |
85 |
+#include <stdio.h> |
86 |
+#include <stdlib.h> |
87 |
+ |
88 |
+int |
89 |
+main () |
90 |
+{ |
91 |
+ int major, minor, micro; |
92 |
+ char *tmp_version; |
93 |
+ |
94 |
+ system ("touch conf.gtktest"); |
95 |
+ |
96 |
+ /* HP/UX 9 (%@#!) writes to sscanf strings */ |
97 |
+ tmp_version = g_strdup("$min_gtk_version"); |
98 |
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
99 |
+ printf("%s, bad version string\n", "$min_gtk_version"); |
100 |
+ exit(1); |
101 |
+ } |
102 |
+ |
103 |
+ if ((gtk_major_version != $gtk_config_major_version) || |
104 |
+ (gtk_minor_version != $gtk_config_minor_version) || |
105 |
+ (gtk_micro_version != $gtk_config_micro_version)) |
106 |
+ { |
107 |
+ printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", |
108 |
+ $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, |
109 |
+ gtk_major_version, gtk_minor_version, gtk_micro_version); |
110 |
+ printf ("*** was found! If pkg-config was correct, then it is best\n"); |
111 |
+ printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); |
112 |
+ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
113 |
+ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
114 |
+ printf("*** required on your system.\n"); |
115 |
+ printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); |
116 |
+ printf("*** to point to the correct configuration files\n"); |
117 |
+ } |
118 |
+ else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
119 |
+ (gtk_minor_version != GTK_MINOR_VERSION) || |
120 |
+ (gtk_micro_version != GTK_MICRO_VERSION)) |
121 |
+ { |
122 |
+ printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
123 |
+ GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
124 |
+ printf("*** library (version %d.%d.%d)\n", |
125 |
+ gtk_major_version, gtk_minor_version, gtk_micro_version); |
126 |
+ } |
127 |
+ else |
128 |
+ { |
129 |
+ if ((gtk_major_version > major) || |
130 |
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) || |
131 |
+ ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) |
132 |
+ { |
133 |
+ return 0; |
134 |
+ } |
135 |
+ else |
136 |
+ { |
137 |
+ printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", |
138 |
+ gtk_major_version, gtk_minor_version, gtk_micro_version); |
139 |
+ printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", |
140 |
+ major, minor, micro); |
141 |
+ printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); |
142 |
+ printf("***\n"); |
143 |
+ printf("*** If you have already installed a sufficiently new version, this error\n"); |
144 |
+ printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); |
145 |
+ printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
146 |
+ printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); |
147 |
+ printf("*** correct copy of pkg-config. (In this case, you will have to\n"); |
148 |
+ printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
149 |
+ printf("*** so that the correct libraries are found at run-time))\n"); |
150 |
+ } |
151 |
+ } |
152 |
+ return 1; |
153 |
+} |
154 |
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
155 |
+ CFLAGS="$ac_save_CFLAGS" |
156 |
+ LIBS="$ac_save_LIBS" |
157 |
+ fi |
158 |
+ fi |
159 |
+ if test "x$no_gtk" = x ; then |
160 |
+ AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) |
161 |
+ ifelse([$2], , :, [$2]) |
162 |
+ else |
163 |
+ AC_MSG_RESULT(no) |
164 |
+ if test "$PKG_CONFIG" = "no" ; then |
165 |
+ echo "*** A new enough version of pkg-config was not found." |
166 |
+ echo "*** See http://pkgconfig.sourceforge.net" |
167 |
+ else |
168 |
+ if test -f conf.gtktest ; then |
169 |
+ : |
170 |
+ else |
171 |
+ echo "*** Could not run GTK+ test program, checking why..." |
172 |
+ ac_save_CFLAGS="$CFLAGS" |
173 |
+ ac_save_LIBS="$LIBS" |
174 |
+ CFLAGS="$CFLAGS $GTK_CFLAGS" |
175 |
+ LIBS="$LIBS $GTK_LIBS" |
176 |
+ AC_TRY_LINK([ |
177 |
+#include <gtk/gtk.h> |
178 |
+#include <stdio.h> |
179 |
+], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], |
180 |
+ [ echo "*** The test program compiled, but did not run. This usually means" |
181 |
+ echo "*** that the run-time linker is not finding GTK+ or finding the wrong" |
182 |
+ echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" |
183 |
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
184 |
+ echo "*** to the installed location Also, make sure you have run ldconfig if that" |
185 |
+ echo "*** is required on your system" |
186 |
+ echo "***" |
187 |
+ echo "*** If you have an old version installed, it is best to remove it, although" |
188 |
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], |
189 |
+ [ echo "*** The test program failed to compile or link. See the file config.log for the" |
190 |
+ echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) |
191 |
+ CFLAGS="$ac_save_CFLAGS" |
192 |
+ LIBS="$ac_save_LIBS" |
193 |
+ fi |
194 |
+ fi |
195 |
+ GTK_CFLAGS="" |
196 |
+ GTK_LIBS="" |
197 |
+ ifelse([$3], , :, [$3]) |
198 |
+ fi |
199 |
+ AC_SUBST(GTK_CFLAGS) |
200 |
+ AC_SUBST(GTK_LIBS) |
201 |
+ rm -f conf.gtktest |
202 |
+]) |
203 |
+ |
204 |
+# Configure paths for GTK+ |
205 |
+# Owen Taylor 97-11-3 |
206 |
+ |
207 |
+dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
208 |
+dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS |
209 |
+dnl |
210 |
+AC_DEFUN(AM_PATH_GTK, |
211 |
+[dnl |
212 |
+dnl Get the cflags and libraries from the gtk-config script |
213 |
+dnl |
214 |
+AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], |
215 |
+ gtk_config_prefix="$withval", gtk_config_prefix="") |
216 |
+AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], |
217 |
+ gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") |
218 |
+AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
219 |
+ , enable_gtktest=yes) |
220 |
+ |
221 |
+ for module in . $4 |
222 |
+ do |
223 |
+ case "$module" in |
224 |
+ gthread) |
225 |
+ gtk_config_args="$gtk_config_args gthread" |
226 |
+ ;; |
227 |
+ esac |
228 |
+ done |
229 |
+ |
230 |
+ if test x$gtk_config_exec_prefix != x ; then |
231 |
+ gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" |
232 |
+ if test x${GTK_CONFIG+set} != xset ; then |
233 |
+ GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config |
234 |
+ fi |
235 |
+ fi |
236 |
+ if test x$gtk_config_prefix != x ; then |
237 |
+ gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" |
238 |
+ if test x${GTK_CONFIG+set} != xset ; then |
239 |
+ GTK_CONFIG=$gtk_config_prefix/bin/gtk-config |
240 |
+ fi |
241 |
+ fi |
242 |
+ |
243 |
+ AC_PATH_PROG(GTK_CONFIG, gtk-config, no) |
244 |
+ min_gtk_version=ifelse([$1], ,0.99.7,$1) |
245 |
+ AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
246 |
+ no_gtk="" |
247 |
+ if test "$GTK_CONFIG" = "no" ; then |
248 |
+ no_gtk=yes |
249 |
+ else |
250 |
+ GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` |
251 |
+ GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` |
252 |
+ gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ |
253 |
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
254 |
+ gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ |
255 |
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
256 |
+ gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ |
257 |
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
258 |
+ if test "x$enable_gtktest" = "xyes" ; then |
259 |
+ ac_save_CFLAGS="$CFLAGS" |
260 |
+ ac_save_LIBS="$LIBS" |
261 |
+ CFLAGS="$CFLAGS $GTK_CFLAGS" |
262 |
+ LIBS="$GTK_LIBS $LIBS" |
263 |
+dnl |
264 |
+dnl Now check if the installed GTK is sufficiently new. (Also sanity |
265 |
+dnl checks the results of gtk-config to some extent |
266 |
+dnl |
267 |
+ rm -f conf.gtktest |
268 |
+ AC_TRY_RUN([ |
269 |
+#include <gtk/gtk.h> |
270 |
+#include <stdio.h> |
271 |
+#include <stdlib.h> |
272 |
+ |
273 |
+int |
274 |
+main () |
275 |
+{ |
276 |
+ int major, minor, micro; |
277 |
+ char *tmp_version; |
278 |
+ |
279 |
+ system ("touch conf.gtktest"); |
280 |
+ |
281 |
+ /* HP/UX 9 (%@#!) writes to sscanf strings */ |
282 |
+ tmp_version = g_strdup("$min_gtk_version"); |
283 |
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
284 |
+ printf("%s, bad version string\n", "$min_gtk_version"); |
285 |
+ exit(1); |
286 |
+ } |
287 |
+ |
288 |
+ if ((gtk_major_version != $gtk_config_major_version) || |
289 |
+ (gtk_minor_version != $gtk_config_minor_version) || |
290 |
+ (gtk_micro_version != $gtk_config_micro_version)) |
291 |
+ { |
292 |
+ printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", |
293 |
+ $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, |
294 |
+ gtk_major_version, gtk_minor_version, gtk_micro_version); |
295 |
+ printf ("*** was found! If gtk-config was correct, then it is best\n"); |
296 |
+ printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); |
297 |
+ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
298 |
+ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
299 |
+ printf("*** required on your system.\n"); |
300 |
+ printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); |
301 |
+ printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); |
302 |
+ printf("*** before re-running configure\n"); |
303 |
+ } |
304 |
+#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) |
305 |
+ else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
306 |
+ (gtk_minor_version != GTK_MINOR_VERSION) || |
307 |
+ (gtk_micro_version != GTK_MICRO_VERSION)) |
308 |
+ { |
309 |
+ printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
310 |
+ GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
311 |
+ printf("*** library (version %d.%d.%d)\n", |
312 |
+ gtk_major_version, gtk_minor_version, gtk_micro_version); |
313 |
+ } |
314 |
+#endif /* defined (GTK_MAJOR_VERSION) ... */ |
315 |
+ else |
316 |
+ { |
317 |
+ if ((gtk_major_version > major) || |
318 |
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) || |
319 |
+ ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) |
320 |
+ { |
321 |
+ return 0; |
322 |
+ } |
323 |
+ else |
324 |
+ { |
325 |
+ printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", |
326 |
+ gtk_major_version, gtk_minor_version, gtk_micro_version); |
327 |
+ printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", |
328 |
+ major, minor, micro); |
329 |
+ printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); |
330 |
+ printf("***\n"); |
331 |
+ printf("*** If you have already installed a sufficiently new version, this error\n"); |
332 |
+ printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); |
333 |
+ printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
334 |
+ printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); |
335 |
+ printf("*** correct copy of gtk-config. (In this case, you will have to\n"); |
336 |
+ printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
337 |
+ printf("*** so that the correct libraries are found at run-time))\n"); |
338 |
+ } |
339 |
+ } |
340 |
+ return 1; |
341 |
+} |
342 |
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
343 |
+ CFLAGS="$ac_save_CFLAGS" |
344 |
+ LIBS="$ac_save_LIBS" |
345 |
+ fi |
346 |
+ fi |
347 |
+ if test "x$no_gtk" = x ; then |
348 |
+ AC_MSG_RESULT(yes) |
349 |
+ ifelse([$2], , :, [$2]) |
350 |
+ else |
351 |
+ AC_MSG_RESULT(no) |
352 |
+ if test "$GTK_CONFIG" = "no" ; then |
353 |
+ echo "*** The gtk-config script installed by GTK could not be found" |
354 |
+ echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" |
355 |
+ echo "*** your path, or set the GTK_CONFIG environment variable to the" |
356 |
+ echo "*** full path to gtk-config." |
357 |
+ else |
358 |
+ if test -f conf.gtktest ; then |
359 |
+ : |
360 |
+ else |
361 |
+ echo "*** Could not run GTK test program, checking why..." |
362 |
+ CFLAGS="$CFLAGS $GTK_CFLAGS" |
363 |
+ LIBS="$LIBS $GTK_LIBS" |
364 |
+ AC_TRY_LINK([ |
365 |
+#include <gtk/gtk.h> |
366 |
+#include <stdio.h> |
367 |
+], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], |
368 |
+ [ echo "*** The test program compiled, but did not run. This usually means" |
369 |
+ echo "*** that the run-time linker is not finding GTK or finding the wrong" |
370 |
+ echo "*** version of GTK. If it is not finding GTK, you'll need to set your" |
371 |
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
372 |
+ echo "*** to the installed location Also, make sure you have run ldconfig if that" |
373 |
+ echo "*** is required on your system" |
374 |
+ echo "***" |
375 |
+ echo "*** If you have an old version installed, it is best to remove it, although" |
376 |
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
377 |
+ echo "***" |
378 |
+ echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" |
379 |
+ echo "*** came with the system with the command" |
380 |
+ echo "***" |
381 |
+ echo "*** rpm --erase --nodeps gtk gtk-devel" ], |
382 |
+ [ echo "*** The test program failed to compile or link. See the file config.log for the" |
383 |
+ echo "*** exact error that occured. This usually means GTK was incorrectly installed" |
384 |
+ echo "*** or that you have moved GTK since it was installed. In the latter case, you" |
385 |
+ echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) |
386 |
+ CFLAGS="$ac_save_CFLAGS" |
387 |
+ LIBS="$ac_save_LIBS" |
388 |
+ fi |
389 |
+ fi |
390 |
+ GTK_CFLAGS="" |
391 |
+ GTK_LIBS="" |
392 |
+ ifelse([$3], , :, [$3]) |
393 |
+ fi |
394 |
+ AC_SUBST(GTK_CFLAGS) |
395 |
+ AC_SUBST(GTK_LIBS) |
396 |
+ rm -f conf.gtktest |
397 |
+]) |
398 |
+ |