Mercurial > dwindows
comparison acinclude.m4 @ 3:67a643a734d9
Import
author | ktk@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 03 Jul 2001 07:50:39 +0000 |
parents | |
children | 83c17a84bc27 |
comparison
equal
deleted
inserted
replaced
2:36c5f0ce3fbe | 3:67a643a734d9 |
---|---|
1 dnl aclocal.m4 generated automatically by aclocal 1.4a | |
2 | |
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
4 dnl This file is free software; the Free Software Foundation | |
5 dnl gives unlimited permission to copy and/or distribute it, | |
6 dnl with or without modifications, as long as this notice is preserved. | |
7 | |
8 dnl This program is distributed in the hope that it will be useful, | |
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
11 dnl PARTICULAR PURPOSE. | |
12 | |
13 # Configure paths for GLIB | |
14 # Owen Taylor 97-11-3 | |
15 | |
16 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) | |
17 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or | |
18 dnl gthread is specified in MODULES, pass to glib-config | |
19 dnl | |
20 AC_DEFUN(AM_PATH_GLIB, | |
21 [dnl | |
22 dnl Get the cflags and libraries from the glib-config script | |
23 dnl | |
24 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], | |
25 glib_config_prefix="$withval", glib_config_prefix="") | |
26 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], | |
27 glib_config_exec_prefix="$withval", glib_config_exec_prefix="") | |
28 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], | |
29 , enable_glibtest=yes) | |
30 | |
31 if test x$glib_config_exec_prefix != x ; then | |
32 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" | |
33 if test x${GLIB_CONFIG+set} != xset ; then | |
34 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config | |
35 fi | |
36 fi | |
37 if test x$glib_config_prefix != x ; then | |
38 glib_config_args="$glib_config_args --prefix=$glib_config_prefix" | |
39 if test x${GLIB_CONFIG+set} != xset ; then | |
40 GLIB_CONFIG=$glib_config_prefix/bin/glib-config | |
41 fi | |
42 fi | |
43 | |
44 for module in . $4 | |
45 do | |
46 case "$module" in | |
47 gmodule) | |
48 glib_config_args="$glib_config_args gmodule" | |
49 ;; | |
50 gthread) | |
51 glib_config_args="$glib_config_args gthread" | |
52 ;; | |
53 esac | |
54 done | |
55 | |
56 AC_PATH_PROG(GLIB_CONFIG, glib-config, no) | |
57 min_glib_version=ifelse([$1], ,1.2.0,$1) | |
58 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) | |
59 no_glib="" | |
60 if test "$GLIB_CONFIG" = "no" ; then | |
61 no_glib=yes | |
62 else | |
63 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` | |
64 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` | |
65 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ | |
66 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
67 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ | |
68 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
69 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ | |
70 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
71 if test "x$enable_glibtest" = "xyes" ; then | |
72 ac_save_CFLAGS="$CFLAGS" | |
73 ac_save_LIBS="$LIBS" | |
74 CFLAGS="$CFLAGS $GLIB_CFLAGS" | |
75 LIBS="$GLIB_LIBS $LIBS" | |
76 dnl | |
77 dnl Now check if the installed GLIB is sufficiently new. (Also sanity | |
78 dnl checks the results of glib-config to some extent | |
79 dnl | |
80 rm -f conf.glibtest | |
81 AC_TRY_RUN([ | |
82 #include <glib.h> | |
83 #include <stdio.h> | |
84 #include <stdlib.h> | |
85 | |
86 int | |
87 main () | |
88 { | |
89 int major, minor, micro; | |
90 char *tmp_version; | |
91 | |
92 system ("touch conf.glibtest"); | |
93 | |
94 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
95 tmp_version = g_strdup("$min_glib_version"); | |
96 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
97 printf("%s, bad version string\n", "$min_glib_version"); | |
98 exit(1); | |
99 } | |
100 | |
101 if ((glib_major_version != $glib_config_major_version) || | |
102 (glib_minor_version != $glib_config_minor_version) || | |
103 (glib_micro_version != $glib_config_micro_version)) | |
104 { | |
105 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", | |
106 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, | |
107 glib_major_version, glib_minor_version, glib_micro_version); | |
108 printf ("*** was found! If glib-config was correct, then it is best\n"); | |
109 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); | |
110 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | |
111 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | |
112 printf("*** required on your system.\n"); | |
113 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); | |
114 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); | |
115 printf("*** before re-running configure\n"); | |
116 } | |
117 else if ((glib_major_version != GLIB_MAJOR_VERSION) || | |
118 (glib_minor_version != GLIB_MINOR_VERSION) || | |
119 (glib_micro_version != GLIB_MICRO_VERSION)) | |
120 { | |
121 printf("*** GLIB header files (version %d.%d.%d) do not match\n", | |
122 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); | |
123 printf("*** library (version %d.%d.%d)\n", | |
124 glib_major_version, glib_minor_version, glib_micro_version); | |
125 } | |
126 else | |
127 { | |
128 if ((glib_major_version > major) || | |
129 ((glib_major_version == major) && (glib_minor_version > minor)) || | |
130 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) | |
131 { | |
132 return 0; | |
133 } | |
134 else | |
135 { | |
136 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", | |
137 glib_major_version, glib_minor_version, glib_micro_version); | |
138 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", | |
139 major, minor, micro); | |
140 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); | |
141 printf("***\n"); | |
142 printf("*** If you have already installed a sufficiently new version, this error\n"); | |
143 printf("*** probably means that the wrong copy of the glib-config shell script is\n"); | |
144 printf("*** being found. The easiest way to fix this is to remove the old version\n"); | |
145 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); | |
146 printf("*** correct copy of glib-config. (In this case, you will have to\n"); | |
147 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | |
148 printf("*** so that the correct libraries are found at run-time))\n"); | |
149 } | |
150 } | |
151 return 1; | |
152 } | |
153 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
154 CFLAGS="$ac_save_CFLAGS" | |
155 LIBS="$ac_save_LIBS" | |
156 fi | |
157 fi | |
158 if test "x$no_glib" = x ; then | |
159 AC_MSG_RESULT(yes) | |
160 ifelse([$2], , :, [$2]) | |
161 else | |
162 AC_MSG_RESULT(no) | |
163 if test "$GLIB_CONFIG" = "no" ; then | |
164 echo "*** The glib-config script installed by GLIB could not be found" | |
165 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" | |
166 echo "*** your path, or set the GLIB_CONFIG environment variable to the" | |
167 echo "*** full path to glib-config." | |
168 else | |
169 if test -f conf.glibtest ; then | |
170 : | |
171 else | |
172 echo "*** Could not run GLIB test program, checking why..." | |
173 CFLAGS="$CFLAGS $GLIB_CFLAGS" | |
174 LIBS="$LIBS $GLIB_LIBS" | |
175 AC_TRY_LINK([ | |
176 #include <glib.h> | |
177 #include <stdio.h> | |
178 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], | |
179 [ echo "*** The test program compiled, but did not run. This usually means" | |
180 echo "*** that the run-time linker is not finding GLIB or finding the wrong" | |
181 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" | |
182 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
183 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
184 echo "*** is required on your system" | |
185 echo "***" | |
186 echo "*** If you have an old version installed, it is best to remove it, although" | |
187 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], | |
188 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
189 echo "*** exact error that occured. This usually means GLIB was incorrectly installed" | |
190 echo "*** or that you have moved GLIB since it was installed. In the latter case, you" | |
191 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) | |
192 CFLAGS="$ac_save_CFLAGS" | |
193 LIBS="$ac_save_LIBS" | |
194 fi | |
195 fi | |
196 GLIB_CFLAGS="" | |
197 GLIB_LIBS="" | |
198 ifelse([$3], , :, [$3]) | |
199 fi | |
200 AC_SUBST(GLIB_CFLAGS) | |
201 AC_SUBST(GLIB_LIBS) | |
202 rm -f conf.glibtest | |
203 ]) | |
204 | |
205 # Configure paths for GTK+ | |
206 # Owen Taylor 97-11-3 | |
207 | |
208 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) | |
209 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS | |
210 dnl | |
211 AC_DEFUN(AM_PATH_GTK, | |
212 [dnl | |
213 dnl Get the cflags and libraries from the gtk-config script | |
214 dnl | |
215 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], | |
216 gtk_config_prefix="$withval", gtk_config_prefix="") | |
217 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], | |
218 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") | |
219 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], | |
220 , enable_gtktest=yes) | |
221 | |
222 for module in . $4 | |
223 do | |
224 case "$module" in | |
225 gthread) | |
226 gtk_config_args="$gtk_config_args gthread" | |
227 ;; | |
228 esac | |
229 done | |
230 | |
231 if test x$gtk_config_exec_prefix != x ; then | |
232 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" | |
233 if test x${GTK_CONFIG+set} != xset ; then | |
234 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config | |
235 fi | |
236 fi | |
237 if test x$gtk_config_prefix != x ; then | |
238 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" | |
239 if test x${GTK_CONFIG+set} != xset ; then | |
240 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config | |
241 fi | |
242 fi | |
243 | |
244 AC_PATH_PROG(GTK_CONFIG, gtk-config, no) | |
245 min_gtk_version=ifelse([$1], ,1.2.0,$1) | |
246 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) | |
247 no_gtk="" | |
248 if test "$GTK_CONFIG" = "no" ; then | |
249 no_gtk=yes | |
250 else | |
251 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` | |
252 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` | |
253 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ | |
254 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
255 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ | |
256 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
257 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ | |
258 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
259 if test "x$enable_gtktest" = "xyes" ; then | |
260 ac_save_CFLAGS="$CFLAGS" | |
261 ac_save_LIBS="$LIBS" | |
262 CFLAGS="$CFLAGS $GTK_CFLAGS" | |
263 LIBS="$GTK_LIBS $LIBS" | |
264 dnl | |
265 dnl Now check if the installed GTK is sufficiently new. (Also sanity | |
266 dnl checks the results of gtk-config to some extent | |
267 dnl | |
268 rm -f conf.gtktest | |
269 AC_TRY_RUN([ | |
270 #include <gtk/gtk.h> | |
271 #include <stdio.h> | |
272 #include <stdlib.h> | |
273 | |
274 int | |
275 main () | |
276 { | |
277 int major, minor, micro; | |
278 char *tmp_version; | |
279 | |
280 system ("touch conf.gtktest"); | |
281 | |
282 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
283 tmp_version = g_strdup("$min_gtk_version"); | |
284 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
285 printf("%s, bad version string\n", "$min_gtk_version"); | |
286 exit(1); | |
287 } | |
288 | |
289 if ((gtk_major_version != $gtk_config_major_version) || | |
290 (gtk_minor_version != $gtk_config_minor_version) || | |
291 (gtk_micro_version != $gtk_config_micro_version)) | |
292 { | |
293 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", | |
294 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, | |
295 gtk_major_version, gtk_minor_version, gtk_micro_version); | |
296 printf ("*** was found! If gtk-config was correct, then it is best\n"); | |
297 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); | |
298 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); | |
299 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); | |
300 printf("*** required on your system.\n"); | |
301 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); | |
302 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); | |
303 printf("*** before re-running configure\n"); | |
304 } | |
305 #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) | |
306 else if ((gtk_major_version != GTK_MAJOR_VERSION) || | |
307 (gtk_minor_version != GTK_MINOR_VERSION) || | |
308 (gtk_micro_version != GTK_MICRO_VERSION)) | |
309 { | |
310 printf("*** GTK+ header files (version %d.%d.%d) do not match\n", | |
311 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); | |
312 printf("*** library (version %d.%d.%d)\n", | |
313 gtk_major_version, gtk_minor_version, gtk_micro_version); | |
314 } | |
315 #endif /* defined (GTK_MAJOR_VERSION) ... */ | |
316 else | |
317 { | |
318 if ((gtk_major_version > major) || | |
319 ((gtk_major_version == major) && (gtk_minor_version > minor)) || | |
320 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) | |
321 { | |
322 return 0; | |
323 } | |
324 else | |
325 { | |
326 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", | |
327 gtk_major_version, gtk_minor_version, gtk_micro_version); | |
328 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", | |
329 major, minor, micro); | |
330 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); | |
331 printf("***\n"); | |
332 printf("*** If you have already installed a sufficiently new version, this error\n"); | |
333 printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); | |
334 printf("*** being found. The easiest way to fix this is to remove the old version\n"); | |
335 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); | |
336 printf("*** correct copy of gtk-config. (In this case, you will have to\n"); | |
337 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); | |
338 printf("*** so that the correct libraries are found at run-time))\n"); | |
339 } | |
340 } | |
341 return 1; | |
342 } | |
343 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
344 CFLAGS="$ac_save_CFLAGS" | |
345 LIBS="$ac_save_LIBS" | |
346 fi | |
347 fi | |
348 if test "x$no_gtk" = x ; then | |
349 AC_MSG_RESULT(yes) | |
350 ifelse([$2], , :, [$2]) | |
351 else | |
352 AC_MSG_RESULT(no) | |
353 if test "$GTK_CONFIG" = "no" ; then | |
354 echo "*** The gtk-config script installed by GTK could not be found" | |
355 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" | |
356 echo "*** your path, or set the GTK_CONFIG environment variable to the" | |
357 echo "*** full path to gtk-config." | |
358 else | |
359 if test -f conf.gtktest ; then | |
360 : | |
361 else | |
362 echo "*** Could not run GTK test program, checking why..." | |
363 CFLAGS="$CFLAGS $GTK_CFLAGS" | |
364 LIBS="$LIBS $GTK_LIBS" | |
365 AC_TRY_LINK([ | |
366 #include <gtk/gtk.h> | |
367 #include <stdio.h> | |
368 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], | |
369 [ echo "*** The test program compiled, but did not run. This usually means" | |
370 echo "*** that the run-time linker is not finding GTK or finding the wrong" | |
371 echo "*** version of GTK. If it is not finding GTK, you'll need to set your" | |
372 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
373 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
374 echo "*** is required on your system" | |
375 echo "***" | |
376 echo "*** If you have an old version installed, it is best to remove it, although" | |
377 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], | |
378 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
379 echo "*** exact error that occured. This usually means GTK was incorrectly installed" | |
380 echo "*** or that you have moved GTK since it was installed. In the latter case, you" | |
381 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) | |
382 CFLAGS="$ac_save_CFLAGS" | |
383 LIBS="$ac_save_LIBS" | |
384 fi | |
385 fi | |
386 GTK_CFLAGS="" | |
387 GTK_LIBS="" | |
388 ifelse([$3], , :, [$3]) | |
389 fi | |
390 AC_SUBST(GTK_CFLAGS) | |
391 AC_SUBST(GTK_LIBS) | |
392 rm -f conf.gtktest | |
393 ]) | |
394 | |
395 # Configure paths for IMLIB | |
396 # David Walluck 99-9-18 | |
397 # Frank Belew 98-8-31 | |
398 # stolen from Manish Singh | |
399 # Shamelessly stolen from Owen Taylor | |
400 | |
401 dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
402 dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS | |
403 dnl | |
404 AC_DEFUN(AM_PATH_IMLIB, | |
405 [dnl | |
406 dnl Get the cflags and libraries from the imlib-config script | |
407 dnl | |
408 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)], | |
409 imlib_prefix="$withval", imlib_prefix="") | |
410 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)], | |
411 imlib_exec_prefix="$withval", imlib_exec_prefix="") | |
412 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program], | |
413 , enable_imlibtest=yes) | |
414 | |
415 if test x$imlib_exec_prefix != x ; then | |
416 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix" | |
417 if test x${IMLIB_CONFIG+set} != xset ; then | |
418 IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config | |
419 fi | |
420 fi | |
421 if test x$imlib_prefix != x ; then | |
422 imlib_args="$imlib_args --prefix=$imlib_prefix" | |
423 if test x${IMLIB_CONFIG+set} != xset ; then | |
424 IMLIB_CONFIG=$imlib_prefix/bin/imlib-config | |
425 fi | |
426 fi | |
427 | |
428 AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no) | |
429 min_imlib_version=ifelse([$1], ,1.9.4,$1) | |
430 AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version) | |
431 no_imlib="" | |
432 if test "$IMLIB_CONFIG" = "no" ; then | |
433 no_imlib=yes | |
434 else | |
435 IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags` | |
436 IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs` | |
437 | |
438 imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \ | |
439 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
440 imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \ | |
441 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
442 imlib_micro_version=`$IMLIB_CONFIG $imlib_args --version | \ | |
443 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
444 if test "x$enable_imlibtest" = "xyes" ; then | |
445 ac_save_CFLAGS="$CFLAGS" | |
446 ac_save_LIBS="$LIBS" | |
447 CFLAGS="$CFLAGS $IMLIB_CFLAGS" | |
448 LIBS="$LIBS $IMLIB_LIBS" | |
449 dnl | |
450 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity | |
451 dnl checks the results of imlib-config to some extent | |
452 dnl | |
453 rm -f conf.imlibtest | |
454 AC_TRY_RUN([ | |
455 #include <stdio.h> | |
456 #include <stdlib.h> | |
457 #include <Imlib.h> | |
458 | |
459 int main () | |
460 { | |
461 int major, minor, micro; | |
462 char *tmp_version; | |
463 | |
464 system ("touch conf.imlibtest"); | |
465 | |
466 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
467 tmp_version = g_strdup("$min_imlib_version"); | |
468 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
469 printf("%s, bad version string\n", "$min_imlib_version"); | |
470 exit(1); | |
471 } | |
472 | |
473 if (($imlib_major_version > major) || | |
474 (($imlib_major_version == major) && ($imlib_minor_version > minor)) || | |
475 (($imlib_major_version == major) && ($imlib_minor_version == minor) && | |
476 ($imlib_micro_version >= micro))) | |
477 { | |
478 return 0; | |
479 } | |
480 else | |
481 { | |
482 printf("\n*** 'imlib-config --version' returned %d.%d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version, $imlib_micro_version); | |
483 printf("*** of IMLIB required is %d.%d.%d. If imlib-config is correct, then it is\n", major, minor, micro); | |
484 printf("*** best to upgrade to the required version.\n"); | |
485 printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n"); | |
486 printf("*** to point to the correct copy of imlib-config, and remove the file\n"); | |
487 printf("*** config.cache before re-running configure\n"); | |
488 return 1; | |
489 } | |
490 } | |
491 | |
492 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
493 CFLAGS="$ac_save_CFLAGS" | |
494 LIBS="$ac_save_LIBS" | |
495 fi | |
496 fi | |
497 if test "x$no_imlib" = x ; then | |
498 AC_MSG_RESULT(yes) | |
499 ifelse([$2], , :, [$2]) | |
500 else | |
501 AC_MSG_RESULT(no) | |
502 if test "$IMLIB_CONFIG" = "no" ; then | |
503 echo "*** The imlib-config script installed by IMLIB could not be found" | |
504 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" | |
505 echo "*** your path, or set the IMLIB_CONFIG environment variable to the" | |
506 echo "*** full path to imlib-config." | |
507 else | |
508 if test -f conf.imlibtest ; then | |
509 : | |
510 else | |
511 echo "*** Could not run IMLIB test program, checking why..." | |
512 CFLAGS="$CFLAGS $IMLIB_CFLAGS" | |
513 LIBS="$LIBS $IMLIB_LIBS" | |
514 AC_TRY_LINK([ | |
515 #include <stdio.h> | |
516 #include <Imlib.h> | |
517 ], [ return 0; ], | |
518 [ echo "*** The test program compiled, but did not run. This usually means" | |
519 echo "*** that the run-time linker is not finding IMLIB or finding the wrong" | |
520 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" | |
521 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
522 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
523 echo "*** is required on your system" | |
524 echo "***" | |
525 echo "*** If you have an old version installed, it is best to remove it, although" | |
526 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
527 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
528 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" | |
529 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" | |
530 echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ]) | |
531 CFLAGS="$ac_save_CFLAGS" | |
532 LIBS="$ac_save_LIBS" | |
533 fi | |
534 fi | |
535 IMLIB_CFLAGS="" | |
536 IMLIB_LIBS="" | |
537 ifelse([$3], , :, [$3]) | |
538 fi | |
539 AC_SUBST(IMLIB_CFLAGS) | |
540 AC_SUBST(IMLIB_LIBS) | |
541 rm -f conf.imlibtest | |
542 ]) | |
543 | |
544 # Check for gdk-imlib | |
545 AC_DEFUN(AM_PATH_GDK_IMLIB, | |
546 [dnl | |
547 dnl Get the cflags and libraries from the imlib-config script | |
548 dnl | |
549 AC_ARG_WITH(imlib-prefix,[ --with-imlib-prefix=PFX Prefix where IMLIB is installed (optional)], | |
550 imlib_prefix="$withval", imlib_prefix="") | |
551 AC_ARG_WITH(imlib-exec-prefix,[ --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)], | |
552 imlib_exec_prefix="$withval", imlib_exec_prefix="") | |
553 AC_ARG_ENABLE(imlibtest, [ --disable-imlibtest Do not try to compile and run a test IMLIB program], | |
554 , enable_imlibtest=yes) | |
555 | |
556 if test x$imlib_exec_prefix != x ; then | |
557 imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix" | |
558 if test x${IMLIB_CONFIG+set} != xset ; then | |
559 IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config | |
560 fi | |
561 fi | |
562 if test x$imlib_prefix != x ; then | |
563 imlib_args="$imlib_args --prefix=$imlib_prefix" | |
564 if test x${IMLIB_CONFIG+set} != xset ; then | |
565 IMLIB_CONFIG=$imlib_prefix/bin/imlib-config | |
566 fi | |
567 fi | |
568 | |
569 AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no) | |
570 min_imlib_version=ifelse([$1], ,1.9.4,$1) | |
571 AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version) | |
572 no_imlib="" | |
573 if test "$IMLIB_CONFIG" = "no" ; then | |
574 no_imlib=yes | |
575 else | |
576 GDK_IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags-gdk` | |
577 GDK_IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs-gdk` | |
578 | |
579 imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \ | |
580 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
581 imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \ | |
582 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
583 imlib_micro_version=`$IMLIB_CONFIG $imlib_args --version | \ | |
584 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
585 if test "x$enable_imlibtest" = "xyes" ; then | |
586 ac_save_CFLAGS="$CFLAGS" | |
587 ac_save_LIBS="$LIBS" | |
588 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS" | |
589 LIBS="$LIBS $GDK_IMLIB_LIBS" | |
590 dnl | |
591 dnl Now check if the installed IMLIB is sufficiently new. (Also sanity | |
592 dnl checks the results of imlib-config to some extent | |
593 dnl | |
594 rm -f conf.imlibtest | |
595 AC_TRY_RUN([ | |
596 #include <stdio.h> | |
597 #include <stdlib.h> | |
598 #include <gdk_imlib.h> | |
599 | |
600 int main () | |
601 { | |
602 int major, minor, micro; | |
603 char *tmp_version; | |
604 | |
605 system ("touch conf.gdkimlibtest"); | |
606 | |
607 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
608 tmp_version = g_strdup("$min_imlib_version"); | |
609 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
610 printf("%s, bad version string\n", "$min_imlib_version"); | |
611 exit(1); | |
612 } | |
613 | |
614 if (($imlib_major_version > major) || | |
615 (($imlib_major_version == major) && ($imlib_minor_version > minor)) || | |
616 (($imlib_major_version == major) && ($imlib_minor_version == minor) && | |
617 ($imlib_micro_version >= micro))) | |
618 { | |
619 return 0; | |
620 } | |
621 else | |
622 { | |
623 printf("\n*** 'imlib-config --version' returned %d.%d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version, $imlib_micro_version); | |
624 printf("*** of IMLIB required is %d.%d.%d. If imlib-config is correct, then it is\n", major, minor, micro); | |
625 printf("*** best to upgrade to the required version.\n"); | |
626 printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n"); | |
627 printf("*** to point to the correct copy of imlib-config, and remove the file\n"); | |
628 printf("*** config.cache before re-running configure\n"); | |
629 return 1; | |
630 } | |
631 } | |
632 | |
633 ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
634 CFLAGS="$ac_save_CFLAGS" | |
635 LIBS="$ac_save_LIBS" | |
636 fi | |
637 fi | |
638 if test "x$no_imlib" = x ; then | |
639 AC_MSG_RESULT(yes) | |
640 ifelse([$2], , :, [$2]) | |
641 else | |
642 AC_MSG_RESULT(no) | |
643 if test "$IMLIB_CONFIG" = "no" ; then | |
644 echo "*** The imlib-config script installed by IMLIB could not be found" | |
645 echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" | |
646 echo "*** your path, or set the IMLIB_CONFIG environment variable to the" | |
647 echo "*** full path to imlib-config." | |
648 else | |
649 if test -f conf.gdkimlibtest ; then | |
650 : | |
651 else | |
652 echo "*** Could not run IMLIB test program, checking why..." | |
653 CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS" | |
654 LIBS="$LIBS $GDK_IMLIB_LIBS" | |
655 AC_TRY_LINK([ | |
656 #include <stdio.h> | |
657 #include <gdk_imlib.h> | |
658 ], [ return 0; ], | |
659 [ echo "*** The test program compiled, but did not run. This usually means" | |
660 echo "*** that the run-time linker is not finding IMLIB or finding the wrong" | |
661 echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" | |
662 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
663 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
664 echo "*** is required on your system" | |
665 echo "***" | |
666 echo "*** If you have an old version installed, it is best to remove it, although" | |
667 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
668 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
669 echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" | |
670 echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" | |
671 echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ]) | |
672 CFLAGS="$ac_save_CFLAGS" | |
673 LIBS="$ac_save_LIBS" | |
674 fi | |
675 fi | |
676 GDK_IMLIB_CFLAGS="" | |
677 GDK_IMLIB_LIBS="" | |
678 ifelse([$3], , :, [$3]) | |
679 fi | |
680 AC_SUBST(GDK_IMLIB_CFLAGS) | |
681 AC_SUBST(GDK_IMLIB_LIBS) | |
682 rm -f conf.gdkimlibtest | |
683 ]) | |
684 | |
685 # Configure paths for ESD | |
686 # David Walluck 99-9-20 | |
687 # Manish Singh 98-9-30 | |
688 # stolen back from Frank Belew | |
689 # stolen from Manish Singh | |
690 # Shamelessly stolen from Owen Taylor | |
691 | |
692 dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
693 dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS | |
694 dnl | |
695 AC_DEFUN(AM_PATH_ESD, | |
696 [dnl | |
697 dnl Get the cflags and libraries from the esd-config script | |
698 dnl | |
699 AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], | |
700 esd_prefix="$withval", esd_prefix="") | |
701 AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], | |
702 esd_exec_prefix="$withval", esd_exec_prefix="") | |
703 AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], | |
704 , enable_esdtest=yes) | |
705 | |
706 if test x$esd_exec_prefix != x ; then | |
707 esd_args="$esd_args --exec-prefix=$esd_exec_prefix" | |
708 if test x${ESD_CONFIG+set} != xset ; then | |
709 ESD_CONFIG=$esd_exec_prefix/bin/esd-config | |
710 fi | |
711 fi | |
712 if test x$esd_prefix != x ; then | |
713 esd_args="$esd_args --prefix=$esd_prefix" | |
714 if test x${ESD_CONFIG+set} != xset ; then | |
715 ESD_CONFIG=$esd_prefix/bin/esd-config | |
716 fi | |
717 fi | |
718 | |
719 AC_PATH_PROG(ESD_CONFIG, esd-config, no) | |
720 min_esd_version=ifelse([$1], ,0.2.5,$1) | |
721 AC_MSG_CHECKING(for ESD - version >= $min_esd_version) | |
722 no_esd="" | |
723 if test "$ESD_CONFIG" = "no" ; then | |
724 no_esd=yes | |
725 else | |
726 ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` | |
727 ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` | |
728 | |
729 esd_major_version=`$ESD_CONFIG $esd_args --version | \ | |
730 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
731 esd_minor_version=`$ESD_CONFIG $esd_args --version | \ | |
732 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
733 esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ | |
734 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
735 if test "x$enable_esdtest" = "xyes" ; then | |
736 ac_save_CFLAGS="$CFLAGS" | |
737 ac_save_LIBS="$LIBS" | |
738 CFLAGS="$CFLAGS $ESD_CFLAGS" | |
739 LIBS="$LIBS $ESD_LIBS" | |
740 dnl | |
741 dnl Now check if the installed ESD is sufficiently new. (Also sanity | |
742 dnl checks the results of esd-config to some extent | |
743 dnl | |
744 rm -f conf.esdtest | |
745 AC_TRY_RUN([ | |
746 #include <stdio.h> | |
747 #include <stdlib.h> | |
748 #include <esd.h> | |
749 | |
750 int main () | |
751 { | |
752 int major, minor, micro; | |
753 char *tmp_version; | |
754 | |
755 system ("touch conf.esdtest"); | |
756 | |
757 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
758 tmp_version = g_strdup("$min_esd_version"); | |
759 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
760 printf("%s, bad version string\n", "$min_esd_version"); | |
761 exit(1); | |
762 } | |
763 | |
764 if (($esd_major_version > major) || | |
765 (($esd_major_version == major) && ($esd_minor_version > minor)) || | |
766 (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) | |
767 { | |
768 return 0; | |
769 } | |
770 else | |
771 { | |
772 printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); | |
773 printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); | |
774 printf("*** best to upgrade to the required version.\n"); | |
775 printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); | |
776 printf("*** to point to the correct copy of esd-config, and remove the file\n"); | |
777 printf("*** config.cache before re-running configure\n"); | |
778 return 1; | |
779 } | |
780 } | |
781 | |
782 ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
783 CFLAGS="$ac_save_CFLAGS" | |
784 LIBS="$ac_save_LIBS" | |
785 fi | |
786 fi | |
787 if test "x$no_esd" = x ; then | |
788 AC_MSG_RESULT(yes) | |
789 ifelse([$2], , :, [$2]) | |
790 else | |
791 AC_MSG_RESULT(no) | |
792 if test "$ESD_CONFIG" = "no" ; then | |
793 echo "*** The esd-config script installed by ESD could not be found" | |
794 echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" | |
795 echo "*** your path, or set the ESD_CONFIG environment variable to the" | |
796 echo "*** full path to esd-config." | |
797 else | |
798 if test -f conf.esdtest ; then | |
799 : | |
800 else | |
801 echo "*** Could not run ESD test program, checking why..." | |
802 CFLAGS="$CFLAGS $ESD_CFLAGS" | |
803 LIBS="$LIBS $ESD_LIBS" | |
804 AC_TRY_LINK([ | |
805 #include <stdio.h> | |
806 #include <esd.h> | |
807 ], [ return 0; ], | |
808 [ echo "*** The test program compiled, but did not run. This usually means" | |
809 echo "*** that the run-time linker is not finding ESD or finding the wrong" | |
810 echo "*** version of ESD. If it is not finding ESD, you'll need to set your" | |
811 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
812 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
813 echo "*** is required on your system" | |
814 echo "***" | |
815 echo "*** If you have an old version installed, it is best to remove it, although" | |
816 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
817 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
818 echo "*** exact error that occured. This usually means ESD was incorrectly installed" | |
819 echo "*** or that you have moved ESD since it was installed. In the latter case, you" | |
820 echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) | |
821 CFLAGS="$ac_save_CFLAGS" | |
822 LIBS="$ac_save_LIBS" | |
823 fi | |
824 fi | |
825 ESD_CFLAGS="" | |
826 ESD_LIBS="" | |
827 ifelse([$3], , :, [$3]) | |
828 fi | |
829 AC_SUBST(ESD_CFLAGS) | |
830 AC_SUBST(ESD_LIBS) | |
831 rm -f conf.esdtest | |
832 ]) | |
833 | |
834 # Configure paths for AUDIOFILE | |
835 # Bertrand Guiheneuf 98-10-21 | |
836 # stolen from esd.m4 in esound : | |
837 # Manish Singh 98-9-30 | |
838 # stolen back from Frank Belew | |
839 # stolen from Manish Singh | |
840 # Shamelessly stolen from Owen Taylor | |
841 | |
842 dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
843 dnl Test for AUDIOFILE, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS | |
844 dnl | |
845 AC_DEFUN(AM_PATH_AUDIOFILE, | |
846 [dnl | |
847 dnl Get the cflags and libraries from the audiofile-config script | |
848 dnl | |
849 AC_ARG_WITH(audiofile-prefix,[ --with-audiofile-prefix=PFX Prefix where AUDIOFILE is installed (optional)], | |
850 audiofile_prefix="$withval", audiofile_prefix="") | |
851 AC_ARG_WITH(audiofile-exec-prefix,[ --with-audiofile-exec-prefix=PFX Exec prefix where AUDIOFILE is installed | |
852 (optional)], | |
853 audiofile_exec_prefix="$withval", audiofile_exec_prefix="") | |
854 AC_ARG_ENABLE(audiofiletest, [ --disable-audiofiletest Do not try to compile and run a test AUDIOFILE program], | |
855 , enable_audiofiletest=yes) | |
856 | |
857 if test x$audiofile_exec_prefix != x ; then | |
858 audiofile_args="$audiofile_args --exec-prefix=$audiofile_exec_prefix" | |
859 if test x${AUDIOFILE_CONFIG+set} != xset ; then | |
860 AUDIOFILE_CONFIG=$audiofile_exec_prefix/bin/audiofile-config | |
861 fi | |
862 fi | |
863 if test x$audiofile_prefix != x ; then | |
864 audiofile_args="$audiofile_args --prefix=$audiofile_prefix" | |
865 if test x${AUDIOFILE_CONFIG+set} != xset ; then | |
866 AUDIOFILE_CONFIG=$audiofile_prefix/bin/audiofile-config | |
867 fi | |
868 fi | |
869 | |
870 AC_PATH_PROG(AUDIOFILE_CONFIG, audiofile-config, no) | |
871 min_audiofile_version=ifelse([$1], ,0.1.5,$1) | |
872 AC_MSG_CHECKING(for AUDIOFILE - version >= $min_audiofile_version) | |
873 no_audiofile="" | |
874 if test "$AUDIOFILE_CONFIG" = "no" ; then | |
875 no_audiofile=yes | |
876 else | |
877 AUDIOFILE_LIBS=`$AUDIOFILE_CONFIG $audiofileconf_args --libs` | |
878 AUDIOFILE_CFLAGS=`$AUDIOFILE_CONFIG $audiofileconf_args --cflags` | |
879 audiofile_major_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ | |
880 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
881 audiofile_minor_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \ | |
882 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
883 audiofile_micro_version=`$AUDIOFILE_CONFIG $audiofile_config_args --version | \ | |
884 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
885 if test "x$enable_audiofiletest" = "xyes" ; then | |
886 ac_save_CFLAGS="$CFLAGS" | |
887 ac_save_LIBS="$LIBS" | |
888 CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" | |
889 LIBS="$LIBS $AUDIOFILE_LIBS" | |
890 dnl | |
891 dnl Now check if the installed AUDIOFILE is sufficiently new. (Also sanity | |
892 dnl checks the results of audiofile-config to some extent | |
893 dnl | |
894 rm -f conf.audiofiletest | |
895 AC_TRY_RUN([ | |
896 #include <stdio.h> | |
897 #include <stdlib.h> | |
898 #include <audiofile.h> | |
899 | |
900 int main () | |
901 { | |
902 int major, minor, micro; | |
903 char *tmp_version; | |
904 | |
905 system ("touch conf.audiofiletest"); | |
906 | |
907 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
908 tmp_version = g_strdup("$min_audiofile_version"); | |
909 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
910 printf("%s, bad version string\n", "$min_audiofile_version"); | |
911 exit(1); | |
912 } | |
913 | |
914 if (($audiofile_major_version > major) || | |
915 (($audiofile_major_version == major) && ($audiofile_minor_version > minor)) || | |
916 (($audiofile_major_version == major) && ($audiofile_minor_version == minor) && ($audiofile_micro_version >= micro))) | |
917 { | |
918 return 0; | |
919 } | |
920 else | |
921 { | |
922 printf("\n*** 'audiofile-config --version' returned %d.%d.%d, but the minimum version\n", $audiofile_major_version, $audiofile_minor_version, $audiofile_micro_version); | |
923 printf("*** of AUDIOFILE required is %d.%d.%d. If audiofile-config is correct, then it is\n", major, minor, micro); | |
924 printf("*** best to upgrade to the required version.\n"); | |
925 printf("*** If audiofile-config was wrong, set the environment variable AUDIOFILE_CONFIG\n"); | |
926 printf("*** to point to the correct copy of audiofile-config, and remove the file\n"); | |
927 printf("*** config.cache before re-running configure\n"); | |
928 return 1; | |
929 } | |
930 } | |
931 | |
932 ],, no_audiofile=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
933 CFLAGS="$ac_save_CFLAGS" | |
934 LIBS="$ac_save_LIBS" | |
935 fi | |
936 fi | |
937 if test "x$no_audiofile" = x ; then | |
938 AC_MSG_RESULT(yes) | |
939 ifelse([$2], , :, [$2]) | |
940 else | |
941 AC_MSG_RESULT(no) | |
942 if test "$AUDIOFILE_CONFIG" = "no" ; then | |
943 echo "*** The audiofile-config script installed by AUDIOFILE could not be found" | |
944 echo "*** If AUDIOFILE was installed in PREFIX, make sure PREFIX/bin is in" | |
945 echo "*** your path, or set the AUDIOFILE_CONFIG environment variable to the" | |
946 echo "*** full path to audiofile-config." | |
947 else | |
948 if test -f conf.audiofiletest ; then | |
949 : | |
950 else | |
951 echo "*** Could not run AUDIOFILE test program, checking why..." | |
952 CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS" | |
953 LIBS="$LIBS $AUDIOFILE_LIBS" | |
954 AC_TRY_LINK([ | |
955 #include <stdio.h> | |
956 #include <audiofile.h> | |
957 ], [ return 0; ], | |
958 [ echo "*** The test program compiled, but did not run. This usually means" | |
959 echo "*** that the run-time linker is not finding AUDIOFILE or finding the wrong" | |
960 echo "*** version of AUDIOFILE. If it is not finding AUDIOFILE, you'll need to set your" | |
961 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
962 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
963 echo "*** is required on your system" | |
964 echo "***" | |
965 echo "*** If you have an old version installed, it is best to remove it, although" | |
966 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
967 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
968 echo "*** exact error that occured. This usually means AUDIOFILE was incorrectly installed" | |
969 echo "*** or that you have moved AUDIOFILE since it was installed. In the latter case, you" | |
970 echo "*** may want to edit the audiofile-config script: $AUDIOFILE_CONFIG" ]) | |
971 CFLAGS="$ac_save_CFLAGS" | |
972 LIBS="$ac_save_LIBS" | |
973 fi | |
974 fi | |
975 AUDIOFILE_CFLAGS="" | |
976 AUDIOFILE_LIBS="" | |
977 ifelse([$3], , :, [$3]) | |
978 fi | |
979 AC_SUBST(AUDIOFILE_CFLAGS) | |
980 AC_SUBST(AUDIOFILE_LIBS) | |
981 rm -f conf.audiofiletest | |
982 ]) | |
983 # Configure paths for GNOME | |
984 # David Walluck 99-9-24 | |
985 | |
986 dnl AM_PATH_GNOME([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
987 dnl Test for GNOME, and define GNOME_CFLAGS and GNOME_LIBS | |
988 dnl | |
989 AC_DEFUN(AM_PATH_GNOME, | |
990 [dnl | |
991 dnl Get the cflags and libraries from the gnome-config script | |
992 dnl | |
993 AC_ARG_WITH(gnome-prefix,[ --with-gnome-prefix=PFX Prefix where GNOME is installed (optional)], | |
994 gnome_prefix="$withval", gnome_prefix="") | |
995 AC_ARG_WITH(gnome-exec-prefix,[ --with-gnome-exec-prefix=PFX Exec prefix where GNOME is installed (optional)], | |
996 gnome_exec_prefix="$withval", gnome_exec_prefix="") | |
997 AC_ARG_ENABLE(gnometest, [ --disable-gnometest Do not try to compile and run a test GNOME program], | |
998 , enable_gnometest=yes) | |
999 | |
1000 if test x$gnome_exec_prefix != x ; then | |
1001 gnome_args="$gnome_args --exec-prefix=$gnome_exec_prefix" | |
1002 if test x${GNOME_CONFIG+set} != xset ; then | |
1003 GNOME_CONFIG=$gnome_exec_prefix/bin/gnome-config | |
1004 fi | |
1005 fi | |
1006 if test x$gnome_prefix != x ; then | |
1007 gnome_args="$gnome_args --prefix=$gnome_prefix" | |
1008 if test x${GNOME_CONFIG+set} != xset ; then | |
1009 GNOME_CONFIG=$gnome_prefix/bin/gnome-config | |
1010 fi | |
1011 fi | |
1012 | |
1013 AC_PATH_PROG(GNOME_CONFIG, gnome-config, no) | |
1014 min_gnome_version=ifelse([$1], ,0.2.7,$1) | |
1015 AC_MSG_CHECKING(for GNOME - version >= $min_gnome_version) | |
1016 no_gnome="" | |
1017 if test "$GNOME_CONFIG" = "no" ; then | |
1018 no_gnome=yes | |
1019 else | |
1020 GNOME_CFLAGS=`$GNOME_CONFIG $gnomeconf_args gnome --cflags` | |
1021 GNOME_LIBS=`$GNOME_CONFIG $gnomeconf_args gnome --libs` | |
1022 | |
1023 gnome_major_version=`$GNOME_CONFIG $gnome_args --version | \ | |
1024 sed 's/gnome-libs //' | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
1025 gnome_minor_version=`$GNOME_CONFIG $gnome_args --version | \ | |
1026 sed 's/gnome-libs //' | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
1027 gnome_micro_version=`$GNOME_CONFIG $gnome_config_args --version | \ | |
1028 sed 's/gnome-libs //' | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
1029 if test "x$enable_gnometest" = "xyes" ; then | |
1030 ac_save_CFLAGS="$CFLAGS" | |
1031 ac_save_LIBS="$LIBS" | |
1032 CFLAGS="$CFLAGS $GNOME_CFLAGS" | |
1033 LIBS="$LIBS $GNOME_LIBS" | |
1034 dnl | |
1035 dnl Now check if the installed GNOME is sufficiently new. (Also sanity | |
1036 dnl checks the results of gnome-config to some extent | |
1037 dnl | |
1038 rm -f conf.gnometest | |
1039 AC_TRY_RUN([ | |
1040 #include <stdio.h> | |
1041 #include <stdlib.h> | |
1042 #include <string.h> | |
1043 #include <gnome.h> | |
1044 | |
1045 int main () | |
1046 { | |
1047 int major, minor, micro; | |
1048 char *tmp_version; | |
1049 | |
1050 system ("touch conf.gnometest"); | |
1051 | |
1052 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
1053 tmp_version = g_strdup("$min_gnome_version"); | |
1054 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
1055 printf("%s, bad version string\n", "$min_gnome_version"); | |
1056 exit(1); | |
1057 } | |
1058 | |
1059 if (($gnome_major_version > major) || | |
1060 (($gnome_major_version == major) && ($gnome_minor_version > minor)) || | |
1061 (($gnome_major_version == major) && ($gnome_minor_version == minor) && ($gnome_micro_version >= micro))) | |
1062 { | |
1063 return 0; | |
1064 } | |
1065 else | |
1066 { | |
1067 printf("\n*** 'gnome-config --version' returned %d.%d.%d, but the minimum version\n", $gnome_major_version, $gnome_minor_version, $gnome_micro_version); | |
1068 printf("*** of GNOME required is %d.%d.%d. If gnome-config is correct, then it is\n", major, minor, micro); | |
1069 printf("*** best to upgrade to the required version.\n"); | |
1070 printf("*** If gnome-config was wrong, set the environment variable GNOME_CONFIG\n"); | |
1071 printf("*** to point to the correct copy of gnome-config, and remove the file\n"); | |
1072 printf("*** config.cache before re-running configure\n"); | |
1073 return 1; | |
1074 } | |
1075 } | |
1076 | |
1077 ],, no_gnome=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
1078 CFLAGS="$ac_save_CFLAGS" | |
1079 LIBS="$ac_save_LIBS" | |
1080 fi | |
1081 fi | |
1082 if test "x$no_gnome" = x ; then | |
1083 AC_MSG_RESULT(yes) | |
1084 ifelse([$2], , :, [$2]) | |
1085 else | |
1086 AC_MSG_RESULT(no) | |
1087 if test "$GNOME_CONFIG" = "no" ; then | |
1088 echo "*** The gnome-config script installed by GNOME could not be found" | |
1089 echo "*** If GNOME was installed in PREFIX, make sure PREFIX/bin is in" | |
1090 echo "*** your path, or set the GNOME_CONFIG environment variable to the" | |
1091 echo "*** full path to gnome-config." | |
1092 else | |
1093 if test -f conf.gnometest ; then | |
1094 : | |
1095 else | |
1096 echo "*** Could not run GNOME test program, checking why..." | |
1097 CFLAGS="$CFLAGS $GNOME_CFLAGS" | |
1098 LIBS="$LIBS $GNOME_LIBS" | |
1099 AC_TRY_LINK([ | |
1100 #include <stdio.h> | |
1101 #include <gnome.h> | |
1102 ], [ return 0; ], | |
1103 [ echo "*** The test program compiled, but did not run. This usually means" | |
1104 echo "*** that the run-time linker is not finding GNOME or finding the wrong" | |
1105 echo "*** version of GNOME. If it is not finding GNOME, you'll need to set your" | |
1106 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
1107 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
1108 echo "*** is required on your system" | |
1109 echo "***" | |
1110 echo "*** If you have an old version installed, it is best to remove it, although" | |
1111 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
1112 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
1113 echo "*** exact error that occured. This usually means GNOME was incorrectly installed" | |
1114 echo "*** or that you have moved GNOME since it was installed. In the latter case, you" | |
1115 echo "*** may want to edit the gnome-config script: $GNOME_CONFIG" ]) | |
1116 CFLAGS="$ac_save_CFLAGS" | |
1117 LIBS="$ac_save_LIBS" | |
1118 fi | |
1119 fi | |
1120 GNOME_CFLAGS="" | |
1121 GNOME_LIBS="" | |
1122 ifelse([$3], , :, [$3]) | |
1123 fi | |
1124 AC_SUBST(GNOME_CFLAGS) | |
1125 AC_SUBST(GNOME_LIBS) | |
1126 rm -f conf.gnometest | |
1127 ]) |