1 |
+ |
dnl aclocal.m4 generated automatically by aclocal 1.4 |
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 GTK+ |
14 |
|
# Owen Taylor 97-11-3 |
15 |
|
|
16 |
< |
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) |
16 |
> |
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
17 |
|
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS |
18 |
|
dnl |
19 |
|
AC_DEFUN(AM_PATH_GTK, |
27 |
|
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
28 |
|
, enable_gtktest=yes) |
29 |
|
|
30 |
+ |
for module in . $4 |
31 |
+ |
do |
32 |
+ |
case "$module" in |
33 |
+ |
gthread) |
34 |
+ |
gtk_config_args="$gtk_config_args gthread" |
35 |
+ |
;; |
36 |
+ |
esac |
37 |
+ |
done |
38 |
+ |
|
39 |
|
if test x$gtk_config_exec_prefix != x ; then |
40 |
|
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" |
41 |
|
if test x${GTK_CONFIG+set} != xset ; then |
68 |
|
ac_save_CFLAGS="$CFLAGS" |
69 |
|
ac_save_LIBS="$LIBS" |
70 |
|
CFLAGS="$CFLAGS $GTK_CFLAGS" |
71 |
< |
LIBS="$LIBS $GTK_LIBS" |
71 |
> |
LIBS="$GTK_LIBS $LIBS" |
72 |
|
dnl |
73 |
|
dnl Now check if the installed GTK is sufficiently new. (Also sanity |
74 |
|
dnl checks the results of gtk-config to some extent |
77 |
|
AC_TRY_RUN([ |
78 |
|
#include <gtk/gtk.h> |
79 |
|
#include <stdio.h> |
80 |
+ |
#include <stdlib.h> |
81 |
|
|
82 |
|
int |
83 |
|
main () |
84 |
|
{ |
85 |
|
int major, minor, micro; |
86 |
+ |
char *tmp_version; |
87 |
|
|
88 |
|
system ("touch conf.gtktest"); |
89 |
|
|
90 |
< |
if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) { |
90 |
> |
/* HP/UX 9 (%@#!) writes to sscanf strings */ |
91 |
> |
tmp_version = g_strdup("$min_gtk_version"); |
92 |
> |
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
93 |
|
printf("%s, bad version string\n", "$min_gtk_version"); |
94 |
|
exit(1); |
95 |
|
} |
110 |
|
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); |
111 |
|
printf("*** before re-running configure\n"); |
112 |
|
} |
113 |
+ |
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) |
114 |
+ |
else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
115 |
+ |
(gtk_minor_version != GTK_MINOR_VERSION) || |
116 |
+ |
(gtk_micro_version != GTK_MICRO_VERSION)) |
117 |
+ |
{ |
118 |
+ |
printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
119 |
+ |
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
120 |
+ |
printf("*** library (version %d.%d.%d)\n", |
121 |
+ |
gtk_major_version, gtk_minor_version, gtk_micro_version); |
122 |
+ |
} |
123 |
+ |
#endif /* defined (GTK_MAJOR_VERSION) ... */ |
124 |
|
else |
125 |
|
{ |
126 |
|
if ((gtk_major_version > major) || |
204 |
|
AC_SUBST(GTK_LIBS) |
205 |
|
rm -f conf.gtktest |
206 |
|
]) |
207 |
+ |
|
208 |
+ |
# Configure paths for ESD |
209 |
+ |
# Manish Singh 98-9-30 |
210 |
+ |
# stolen back from Frank Belew |
211 |
+ |
# stolen from Manish Singh |
212 |
+ |
# Shamelessly stolen from Owen Taylor |
213 |
+ |
|
214 |
+ |
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) |
215 |
+ |
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS |
216 |
+ |
dnl |
217 |
+ |
AC_DEFUN(AM_PATH_ESD, |
218 |
+ |
[dnl |
219 |
+ |
dnl Get the cflags and libraries from the esd-config script |
220 |
+ |
dnl |
221 |
+ |
AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], |
222 |
+ |
esd_prefix="$withval", esd_prefix="") |
223 |
+ |
AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], |
224 |
+ |
esd_exec_prefix="$withval", esd_exec_prefix="") |
225 |
+ |
AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], |
226 |
+ |
, enable_esdtest=yes) |
227 |
+ |
|
228 |
+ |
if test x$esd_exec_prefix != x ; then |
229 |
+ |
esd_args="$esd_args --exec-prefix=$esd_exec_prefix" |
230 |
+ |
if test x${ESD_CONFIG+set} != xset ; then |
231 |
+ |
ESD_CONFIG=$esd_exec_prefix/bin/esd-config |
232 |
+ |
fi |
233 |
+ |
fi |
234 |
+ |
if test x$esd_prefix != x ; then |
235 |
+ |
esd_args="$esd_args --prefix=$esd_prefix" |
236 |
+ |
if test x${ESD_CONFIG+set} != xset ; then |
237 |
+ |
ESD_CONFIG=$esd_prefix/bin/esd-config |
238 |
+ |
fi |
239 |
+ |
fi |
240 |
+ |
|
241 |
+ |
AC_PATH_PROG(ESD_CONFIG, esd-config, no) |
242 |
+ |
min_esd_version=ifelse([$1], ,0.2.7,$1) |
243 |
+ |
AC_MSG_CHECKING(for ESD - version >= $min_esd_version) |
244 |
+ |
no_esd="" |
245 |
+ |
if test "$ESD_CONFIG" = "no" ; then |
246 |
+ |
no_esd=yes |
247 |
+ |
else |
248 |
+ |
AC_LANG_SAVE |
249 |
+ |
AC_LANG_C |
250 |
+ |
ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` |
251 |
+ |
ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` |
252 |
+ |
|
253 |
+ |
esd_major_version=`$ESD_CONFIG $esd_args --version | \ |
254 |
+ |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
255 |
+ |
esd_minor_version=`$ESD_CONFIG $esd_args --version | \ |
256 |
+ |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
257 |
+ |
esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ |
258 |
+ |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
259 |
+ |
if test "x$enable_esdtest" = "xyes" ; then |
260 |
+ |
ac_save_CFLAGS="$CFLAGS" |
261 |
+ |
ac_save_LIBS="$LIBS" |
262 |
+ |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
263 |
+ |
LIBS="$LIBS $ESD_LIBS" |
264 |
+ |
dnl |
265 |
+ |
dnl Now check if the installed ESD is sufficiently new. (Also sanity |
266 |
+ |
dnl checks the results of esd-config to some extent |
267 |
+ |
dnl |
268 |
+ |
rm -f conf.esdtest |
269 |
+ |
AC_TRY_RUN([ |
270 |
+ |
#include <stdio.h> |
271 |
+ |
#include <stdlib.h> |
272 |
+ |
#include <string.h> |
273 |
+ |
#include <esd.h> |
274 |
+ |
|
275 |
+ |
char* |
276 |
+ |
my_strdup (char *str) |
277 |
+ |
{ |
278 |
+ |
char *new_str; |
279 |
+ |
|
280 |
+ |
if (str) |
281 |
+ |
{ |
282 |
+ |
new_str = malloc ((strlen (str) + 1) * sizeof(char)); |
283 |
+ |
strcpy (new_str, str); |
284 |
+ |
} |
285 |
+ |
else |
286 |
+ |
new_str = NULL; |
287 |
+ |
|
288 |
+ |
return new_str; |
289 |
+ |
} |
290 |
+ |
|
291 |
+ |
int main () |
292 |
+ |
{ |
293 |
+ |
int major, minor, micro; |
294 |
+ |
char *tmp_version; |
295 |
+ |
|
296 |
+ |
system ("touch conf.esdtest"); |
297 |
+ |
|
298 |
+ |
/* HP/UX 9 (%@#!) writes to sscanf strings */ |
299 |
+ |
tmp_version = my_strdup("$min_esd_version"); |
300 |
+ |
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
301 |
+ |
printf("%s, bad version string\n", "$min_esd_version"); |
302 |
+ |
exit(1); |
303 |
+ |
} |
304 |
+ |
|
305 |
+ |
if (($esd_major_version > major) || |
306 |
+ |
(($esd_major_version == major) && ($esd_minor_version > minor)) || |
307 |
+ |
(($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) |
308 |
+ |
{ |
309 |
+ |
return 0; |
310 |
+ |
} |
311 |
+ |
else |
312 |
+ |
{ |
313 |
+ |
printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); |
314 |
+ |
printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); |
315 |
+ |
printf("*** best to upgrade to the required version.\n"); |
316 |
+ |
printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); |
317 |
+ |
printf("*** to point to the correct copy of esd-config, and remove the file\n"); |
318 |
+ |
printf("*** config.cache before re-running configure\n"); |
319 |
+ |
return 1; |
320 |
+ |
} |
321 |
+ |
} |
322 |
+ |
|
323 |
+ |
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
324 |
+ |
CFLAGS="$ac_save_CFLAGS" |
325 |
+ |
LIBS="$ac_save_LIBS" |
326 |
+ |
AC_LANG_RESTORE |
327 |
+ |
fi |
328 |
+ |
fi |
329 |
+ |
if test "x$no_esd" = x ; then |
330 |
+ |
AC_MSG_RESULT(yes) |
331 |
+ |
ifelse([$2], , :, [$2]) |
332 |
+ |
else |
333 |
+ |
AC_MSG_RESULT(no) |
334 |
+ |
if test "$ESD_CONFIG" = "no" ; then |
335 |
+ |
echo "*** The esd-config script installed by ESD could not be found" |
336 |
+ |
echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" |
337 |
+ |
echo "*** your path, or set the ESD_CONFIG environment variable to the" |
338 |
+ |
echo "*** full path to esd-config." |
339 |
+ |
else |
340 |
+ |
if test -f conf.esdtest ; then |
341 |
+ |
: |
342 |
+ |
else |
343 |
+ |
echo "*** Could not run ESD test program, checking why..." |
344 |
+ |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
345 |
+ |
LIBS="$LIBS $ESD_LIBS" |
346 |
+ |
AC_LANG_SAVE |
347 |
+ |
AC_LANG_C |
348 |
+ |
AC_TRY_LINK([ |
349 |
+ |
#include <stdio.h> |
350 |
+ |
#include <esd.h> |
351 |
+ |
], [ return 0; ], |
352 |
+ |
[ echo "*** The test program compiled, but did not run. This usually means" |
353 |
+ |
echo "*** that the run-time linker is not finding ESD or finding the wrong" |
354 |
+ |
echo "*** version of ESD. If it is not finding ESD, you'll need to set your" |
355 |
+ |
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
356 |
+ |
echo "*** to the installed location Also, make sure you have run ldconfig if that" |
357 |
+ |
echo "*** is required on your system" |
358 |
+ |
echo "***" |
359 |
+ |
echo "*** If you have an old version installed, it is best to remove it, although" |
360 |
+ |
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], |
361 |
+ |
[ echo "*** The test program failed to compile or link. See the file config.log for the" |
362 |
+ |
echo "*** exact error that occured. This usually means ESD was incorrectly installed" |
363 |
+ |
echo "*** or that you have moved ESD since it was installed. In the latter case, you" |
364 |
+ |
echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) |
365 |
+ |
CFLAGS="$ac_save_CFLAGS" |
366 |
+ |
LIBS="$ac_save_LIBS" |
367 |
+ |
AC_LANG_RESTORE |
368 |
+ |
fi |
369 |
+ |
fi |
370 |
+ |
ESD_CFLAGS="" |
371 |
+ |
ESD_LIBS="" |
372 |
+ |
ifelse([$3], , :, [$3]) |
373 |
+ |
fi |
374 |
+ |
AC_SUBST(ESD_CFLAGS) |
375 |
+ |
AC_SUBST(ESD_LIBS) |
376 |
+ |
rm -f conf.esdtest |
377 |
+ |
]) |
378 |
+ |
|