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