1 dnl -*-fundamental-*- *@--GLOB-HEADER--@*
3 dnl $Id: aclocal.glob,v 1.1 1999/05/05 19:23:47 mdw Exp $
5 dnl Common library of autoconf macros
7 dnl (c) 1997 Mark Wooding, except for macros and documentation where noted.
10 dnl----- Licensing notice ---------------------------------------------------
12 dnl This file is part of the Common Files Distribution (`common')
14 dnl `Common' is free software; you can redistribute it and/or modify
15 dnl it under the terms of the GNU General Public License as published by
16 dnl the Free Software Foundation; either version 2 of the License, or
17 dnl (at your option) any later version.
19 dnl `Common' is distributed in the hope that it will be useful,
20 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 dnl GNU General Public License for more details.
24 dnl You should have received a copy of the GNU General Public License
25 dnl along with `common'; if not, write to the Free Software Foundation,
26 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 dnl----- Revision history ---------------------------------------------------
30 dnl $Log: aclocal.glob,v $
31 dnl Revision 1.1 1999/05/05 19:23:47 mdw
35 dnl----- Common files distribution --------------------------- *@--NOTICE--@*
37 dnl $Id: aclocal.glob,v 1.1 1999/05/05 19:23:47 mdw Exp $
39 dnl --- *@-AC_PROG_CC_STDC-@* ---
41 dnl Author: Franc,ois Pinard
43 dnl Synopsis: AC_PROG_CC_STDC
47 dnl Use: If the C compiler in not in ANSI C mode by default, try to
48 dnl add an option to output variable `CC' to make it so. This
49 dnl macro tries various options that select ANSI C on some system
50 dnl or another. It considers the compiler to be in ANSI C mode
51 dnl if it defines `__STDC__' to 1 and handles function prototypes
54 dnl If you use this macro, you should check after calling it
55 dnl whether the C compiler has been set to accept ANSI C; if not,
56 dnl the shell variable `ac_cv_prog_cc_stdc' is set to `no'. If
57 dnl you wrote your source code in ANSI C, you can make an
58 dnl un-ANSIfied copy of it by using the program `ansi2knr', which
59 dnl comes with Ghostscript.
61 dnl (documentation by Franc,ois Pinard)
63 AC_DEFUN(AM_PROG_CC_STDC,
64 [AC_REQUIRE([AC_PROG_CC])
65 AC_BEFORE([$0], [AC_C_INLINE])
66 AC_BEFORE([$0], [AC_C_CONST])
67 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
68 AC_CACHE_VAL(am_cv_prog_cc_stdc,
69 [am_cv_prog_cc_stdc=no
71 # Don't try gcc -ansi; that turns off useful extensions and
72 # breaks some systems' header files.
74 # Ultrix and OSF/1 -std1
75 # HP-UX -Aa -D_HPUX_SOURCE
76 # SVR4 -Xc -D__EXTENSIONS__
77 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
79 CC="$ac_save_CC $ac_arg"
81 [#if !defined(__STDC__) || __STDC__ != 1
84 /* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
86 # include <sys/types.h>
87 # include <sys/stat.h>
90 int test (int i, double x);
91 struct s1 {int (*f) (int a);};
92 struct s2 {int (*f) (double a);};],
93 [am_cv_prog_cc_stdc="$ac_arg"; break])
97 if test -z "$am_cv_prog_cc_stdc"; then
98 AC_MSG_RESULT([none needed])
100 AC_MSG_RESULT($am_cv_prog_cc_stdc)
102 case "x$am_cv_prog_cc_stdc" in
104 *) CC="$CC $am_cv_prog_cc_stdc" ;;
108 dnl----- AutoMake macros ------------------------------------- *@--IGNORE--@*
110 dnl --- *@-AM_CONDITIONAL-@* ---
114 dnl Synopsis: AM_CONDITIONAL(NAME, TEST)
116 dnl Arguments: NAME = name of the conditional
117 dnl TEST = a shell list to execute
119 dnl Use: Allows conditional sections in Makefiles.
121 AC_DEFUN(AM_CONDITIONAL,
132 dnl --- *@-AM_CYGWIN32-@* ---
134 dnl Author: Cygnus (I guess)
136 dnl Synopsis: AM_CYGWIN32
140 dnl Use: Check to see if we're running under Cygwin32, without using
141 dnl AC_CANONICAL_*. If so, set output variable EXEEXT to
142 dnl ".exe". Otherwise set it to "".
145 dnl You might think we can do this by checking for a cygwin32-specific
146 dnl cpp define. We can't, because cross-compilers that target
147 dnl cygwin32 don't use the .exe suffix. I don't know why.
148 AC_DEFUN(AM_CYGWIN32,
149 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
150 [cat > conftest.$ac_ext << 'EOF'
155 if AC_TRY_EVAL(ac_link) && test -s conftest.exe; then
162 test "$am_cv_cygwin32" = yes && EXEEXT=.exe
165 dnl --- *@-AM_WITH_DMALLOC-@* ---
167 dnl Author: Franc,ois Pinard
169 dnl Synopsis: AM_WITH_DMALLOC
173 dnl Use: Links with `-dmalloc' if told to by the user.
175 ## ----------------------------------- ##
176 ## Check if --with-dmalloc was given. ##
177 ## From Franc,ois Pinard ##
178 ## ----------------------------------- ##
182 AC_DEFUN(AM_WITH_DMALLOC,
183 [AC_MSG_CHECKING(if malloc debugging is wanted)
185 [ --with-dmalloc use dmalloc, as in
186 ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
187 [if test "$withval" = yes; then
189 AC_DEFINE(WITH_DMALLOC)
190 LIBS="$LIBS -ldmalloc"
191 LDFLAGS="$LDFLAGS -g"
194 fi], [AC_MSG_RESULT(no)])
197 dnl --- *@-AM_FUNC_ERROR_AT_LINE-@* ---
199 dnl Author: Jim Meyering
201 dnl Synopsis: AM_FUNC_ERROR_AT_LINE
205 dnl Use: Use this if you use the GNU error.[ch].
207 dnl FIXME: Migrate into libit
209 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
210 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
211 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
212 am_cv_lib_error_at_line=yes,
213 am_cv_lib_error_at_line=no)])
214 if test $am_cv_lib_error_at_line = no; then
215 LIBOBJS="$LIBOBJS error.o"
220 dnl --- *@-AM_INIT_GUILE_MODULE-@* ---
224 dnl Synopsis: AM_INIT_GUILE_MODULE(MODNAME)
226 dnl Arguments: MODNAME = value to initialise `module' variable with
228 dnl Use: This macro will automatically get the guile version from the
229 dnl top-level srcdir, and will initialize automake. It also
230 dnl defines the `module' variable.
232 AC_DEFUN([AM_INIT_GUILE_MODULE],[
233 . $srcdir/../GUILE-VERSION
234 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
235 AC_CONFIG_AUX_DIR(..)
239 dnl --- *@-AM_CONFIG_HEADER-@* ---
243 dnl Synopsis: AM_CONFIG_HEADER(HEADER ...)
245 dnl Arguments: HEADER = a header spec, as for AC_CONFIG_HEADER
247 dnl Use: Like AC_CONFIG_HEADER, but automatically create stamp file.
249 AC_DEFUN(AM_CONFIG_HEADER,
251 AC_CONFIG_HEADER([$1])
252 dnl When config.status generates a header, we must update the stamp-h file.
253 dnl This file resides in the same directory as the config header
254 dnl that is generated. We must strip everything past the first ":",
255 dnl and everything past the last "/".
256 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
257 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
258 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/
259 \)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
261 for am_file in <<$1>>; do
262 case " <<$>>CONFIG_HEADERS " in
263 *" <<$>>am_file "*<<)>>
264 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
267 am_indx=`expr "<<$>>am_indx" + 1`
271 dnl --- *@-AM_INIT_AUTOMAKE-@*
275 dnl Synopsis: AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
277 dnl Arguments: PACKAGE = package name
278 dnl VERSION = version number
279 dnl NO-DEFINE = if set, don't define package and version number
281 dnl Use: Do all the work for Automake. This macro actually does too
282 dnl much -- some checks are only needed if your package does
283 dnl certain things. But this isn't really a big deal.
287 AC_DEFUN(AM_INIT_AUTOMAKE,
288 [AC_REQUIRE([AM_PROG_INSTALL])
293 dnl test to see if srcdir already configured
294 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
295 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
298 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
299 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
302 dnl FIXME This is truly gross.
303 missing_dir=`cd $ac_aux_dir && pwd`
304 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
305 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
306 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
307 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
308 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
311 dnl --- *@-AM_PROG_INSTALL-@* ---
313 dnl Author: Franc,ois Pinard
315 dnl Synopsis: AM_PROG_INSTALL
319 dnl Use: Calls `AC_PROG_INSTALL' to find an installer. Then it sets
320 dnl `INSTALL_SCRIPT' to a suitable value if necessary.
324 AC_DEFUN(AM_PROG_INSTALL,
326 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
327 AC_SUBST(INSTALL_SCRIPT)dnl
330 dnl --- *@-AM_PROG_LEX-@* ---
332 dnl Author: Alexandre Oliva
334 dnl Synopsis: AM_PROG_LEX
338 dnl Use: Replacement for AC_PROG_LEX and AC_DECL_YYTEXT
341 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
342 AC_DEFUN(AM_PROG_LEX,
343 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
344 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
348 dnl --- *@-AM_PROG_LIBTOOL-@* ---
352 dnl Synopsis: AM_PROG_LIBTOOL
356 dnl Use: Configures `libtool' for the target architecture.
359 ## Configure libtool for the target system.
361 # serial 1 AM_PROG_LIBTOOL
362 AC_DEFUN(AM_PROG_LIBTOOL,
363 [AC_REQUIRE([AC_CANONICAL_HOST])
364 AC_REQUIRE([AC_PROG_CC])
365 AC_REQUIRE([AC_PROG_RANLIB])
367 # Always use our own libtool.
368 LIBTOOL='$(top_builddir)/libtool'
371 dnl Allow the --disable-shared flag to stop us from building shared libs.
372 AC_ARG_ENABLE(shared,
373 [ --enable-shared build shared libraries [default=yes]],
374 test "$enableval" = no && libtool_shared=" --disable-shared",
377 libtool_flags="$libtool_shared"
378 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
379 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
381 # Actually configure libtool. ac_aux_dir is where install-sh is found.
382 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" RANLIB="$RANLIB" \
383 $ac_aux_dir/ltconfig $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
384 || AC_MSG_ERROR([libtool configure failed])
387 dnl --- *@-AM_PATH_LISPDIR-@* ---
389 dnl Author: Ulrich Drepper
391 dnl Synopsis: AM_PATH_LISPDIR
395 dnl Use: Sets the variable `lispdir' to point to a place to install
396 dnl Emacs lisp files.
398 ## ------------------------
399 ## Emacs LISP file handling
400 ## From Ulrich Drepper
401 ## ------------------------
405 AC_DEFUN(AM_PATH_LISPDIR,
406 [# If set to t, that means we are running in a shell under Emacs.
407 # If you have an Emacs named "t", then use the full path.
408 test "$EMACS" = t && EMACS=
409 AC_PATH_PROG(EMACS, emacs xemacs, no)
410 if test $EMACS != "no"; then
411 AC_MSG_CHECKING([where .elc files should go])
412 dnl Set default value
413 lispdir="\$(datadir)/emacs/site-lisp"
414 if test "x$prefix" = "xNONE"; then
415 if test -d $ac_default_prefix/share/emacs/site-lisp; then
416 lispdir="\$(prefix)/share/emacs/site-lisp"
418 if test -d $ac_default_prefix/lib/emacs/site-lisp; then
419 lispdir="\$(prefix)/lib/emacs/site-lisp"
423 if test -d $prefix/share/emacs/site-lisp; then
424 lispdir="\$(prefix)/share/emacs/site-lisp"
426 if test -d $prefix/lib/emacs/site-lisp; then
427 lispdir="\$(prefix)/lib/emacs/site-lisp"
431 AC_MSG_RESULT($lispdir)
435 dnl --- *@-AM_MAINTAINTER_MODE-@* ---
437 dnl Author: Jim Meyering
439 dnl Synopsis: jm_MAINTAINER_MODE
443 dnl Use: Provides an option `--enable-maintainer-mode' which turns
444 dnl on rules which might normally be commented out. The
445 dnl substitution variable `MAINT' is set to be a comment when
446 dnl this option is disabled, which it is by default.
450 AC_DEFUN(AM_MAINTAINER_MODE,
451 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
452 dnl maintainer-mode is disabled by default
453 AC_ARG_ENABLE(maintainer-mode,
454 [ --enable-maintainer-mode enable make rules and dependencies not useful
455 (and sometimes confusing) to the casual installer],
456 USE_MAINTAINER_MODE=$enableval,
457 USE_MAINTAINER_MODE=no)
458 AC_MSG_RESULT($USE_MAINTAINER_MODE)
459 if test $USE_MAINTAINER_MODE = yes; then
468 dnl --- *@-AM_MISSING_PROG-@* ---
472 dnl Synopsis: AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
474 dnl Arguments: NAME = variable to set to the file's location
475 dnl PROGRAM = name of program to find
476 dnl DIRECTORY = directory to look in
478 dnl Use: Fakes existence of a useful GNU maintainer tool.
480 AC_DEFUN(AM_MISSING_PROG,
481 [AC_MSG_CHECKING(for working $2)
482 # Run test in a subshell; some versions of sh will print an error if
483 # an executable is not found, even if stderr is redirected.
484 # Redirect stdin to placate older versions of autoconf. Sigh.
485 if ($2 --version) < /dev/null > /dev/null 2>&1; then
490 AC_MSG_RESULT(missing)
494 dnl --- *@-AM_FUNC_MKTIME-@* ---
496 dnl Author: Jim Meyering
498 dnl Synopsis: AM_FUNC_MKTIME
502 dnl Use: Checks for a working mktime function.
504 AC_DEFUN(AM_FUNC_MKTIME,
505 [AC_REQUIRE([AC_HEADER_TIME])dnl
506 AC_CHECK_HEADERS(sys/time.h)
507 AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
509 changequote(<<, >>)dnl
510 <</* Test program from Paul Eggert (eggert@twinsun.com)
511 and Tony Leneis (tony@plaza.ds.adp.com). */
512 #if TIME_WITH_SYS_TIME
513 # include <sys/time.h>
517 # include <sys/time.h>
523 static time_t time_t_max;
525 /* Values we'll use to set the TZ environment variable. */
526 static const char *const tz_strings[] = {
527 NULL, "GMT0", "JST-9", "EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
529 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
535 if (mktime (localtime (&now)) != now)
537 now = time_t_max - now;
538 if (mktime (localtime (&now)) != now)
548 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
551 delta = time_t_max / 997; /* a suitable prime number */
552 for (i = 0; i < N_STRINGS; i++)
555 putenv (tz_strings[i]);
557 for (t = 0; t <= time_t_max - delta; t += delta)
559 mktime_test ((time_t) 60 * 60);
560 mktime_test ((time_t) 60 * 60 * 24);
566 am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
567 dnl When crosscompiling, assume mktime is missing or broken.
568 am_cv_func_working_mktime=no)
570 if test $am_cv_func_working_mktime = no; then
571 LIBOBJS="$LIBOBJS mktime.o"
575 dnl --- *@-AM_FUNC_OBSTACK-@* ---
577 dnl Author: Jim Meyering
579 dnl Synopsis: AM_FUNC_OBSTACK
583 dnl Use: Checks for GNU obstacks.
585 AC_DEFUN(AM_FUNC_OBSTACK,
586 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
587 [AC_TRY_LINK([#include "obstack.h"],
588 [struct obstack *mem;obstack_free(mem,(char *) 0)],
589 am_cv_func_obstack=yes,
590 am_cv_func_obstack=no)])
591 if test $am_cv_func_obstack = yes; then
592 AC_DEFINE(HAVE_OBSTACK)
594 LIBOBJS="$LIBOBJS obstack.o"
598 dnl --- *@-AC_C_PROTOTYPES-@* ---
600 dnl Author: Franc,ois Pinard
602 dnl Synopsis: AC_C_PROTOTYPES
606 dnl Use: If the C compiler understands ANSI C, define `PROTOTYPES',
607 dnl and clear the `U' and `ANSI2KNR' variables. Otherwise,
608 dnl set `U' to be `_' and `ANSI2KNR' to be `./ansi2knr'.
612 AC_DEFUN(fp_C_PROTOTYPES,
613 [AC_REQUIRE([fp_PROG_CC_STDC])
614 AC_MSG_CHECKING([for function prototypes])
615 if test "$ac_cv_prog_cc_stdc" != no; then
617 AC_DEFINE(PROTOTYPES)
621 U=_ ANSI2KNR=./ansi2knr
624 AC_SUBST(ANSI2KNR)dnl
627 dnl --- *@-AM_PATH_GTK-@* ---
629 dnl Author: Owen Taylor
631 dnl Synopsis: AM_PATH_GTK(MIN-VERSION, [ACTION-IF-FOUND], [ACTION-IF-NOT])
633 dnl Arguments: MIN-VERSION = minimum version of GTK required
634 dnl ACTION-IF-FOUND = executed if GTK found OK
635 dnl ACTION-IF-NOT-FOUND = what to do if GTK not available
637 dnl Use: Sets up compilation environment suitably for GTK programming.
639 # Configure paths for GTK+
640 # Owen Taylor 97-11-3
642 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
643 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
645 AC_DEFUN(AM_PATH_GTK,
647 dnl Get the cflags and libraries from the gtk-config script
649 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
650 gtk_config_prefix="$withval", gtk_config_prefix="")
651 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
652 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
653 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
654 , enable_gtktest=yes)
656 if test x$gtk_config_exec_prefix != x ; then
657 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
658 if test x${GTK_CONFIG+set} != xset ; then
659 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
662 if test x$gtk_config_prefix != x ; then
663 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
664 if test x${GTK_CONFIG+set} != xset ; then
665 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
669 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
670 min_gtk_version=ifelse([$1], ,0.99.7,$1)
671 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
673 if test "$GTK_CONFIG" = "no" ; then
676 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
677 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
678 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
679 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
680 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
681 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
682 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
683 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
684 if test "x$enable_gtktest" = "xyes" ; then
685 ac_save_CFLAGS="$CFLAGS"
687 CFLAGS="$CFLAGS $GTK_CFLAGS"
688 LIBS="$LIBS $GTK_LIBS"
690 dnl Now check if the installed GTK is sufficiently new. (Also sanity
691 dnl checks the results of gtk-config to some extent
701 int major, minor, micro;
704 system ("touch conf.gtktest");
706 /* HP/UX 9 (%@#!) writes to sscanf strings */
707 tmp_version = g_strdup("$min_gtk_version");
708 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
709 printf("%s, bad version string\n", "$min_gtk_version");
713 if ((gtk_major_version != $gtk_config_major_version) ||
714 (gtk_minor_version != $gtk_config_minor_version) ||
715 (gtk_micro_version != $gtk_config_micro_version))
717 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
718 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
719 gtk_major_version, gtk_minor_version, gtk_micro_version);
720 printf ("*** was found! If gtk-config was correct, then it is best\n");
721 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
722 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
723 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
724 printf("*** required on your system.\n");
725 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
726 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
727 printf("*** before re-running configure\n");
731 if ((gtk_major_version > major) ||
732 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
733 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
739 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
740 gtk_major_version, gtk_minor_version, gtk_micro_version);
741 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
742 major, minor, micro);
743 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
745 printf("*** If you have already installed a sufficiently new version, this error\n");
746 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
747 printf("*** being found. The easiest way to fix this is to remove the old version\n");
748 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
749 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
750 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
751 printf("*** so that the correct libraries are found at run-time))\n");
756 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
757 CFLAGS="$ac_save_CFLAGS"
761 if test "x$no_gtk" = x ; then
763 ifelse([$2], , :, [$2])
766 if test "$GTK_CONFIG" = "no" ; then
767 echo "*** The gtk-config script installed by GTK could not be found"
768 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
769 echo "*** your path, or set the GTK_CONFIG environment variable to the"
770 echo "*** full path to gtk-config."
772 if test -f conf.gtktest ; then
775 echo "*** Could not run GTK test program, checking why..."
776 CFLAGS="$CFLAGS $GTK_CFLAGS"
777 LIBS="$LIBS $GTK_LIBS"
781 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
782 [ echo "*** The test program compiled, but did not run. This usually means"
783 echo "*** that the run-time linker is not finding GTK or finding the wrong"
784 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
785 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
786 echo "*** to the installed location Also, make sure you have run ldconfig if that"
787 echo "*** is required on your system"
789 echo "*** If you have an old version installed, it is best to remove it, although"
790 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
792 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
793 echo "*** came with the system with the command"
795 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
796 [ echo "*** The test program failed to compile or link. See the file config.log for the"
797 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
798 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
799 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
800 CFLAGS="$ac_save_CFLAGS"
806 ifelse([$3], , :, [$3])
813 dnl --- *@-AC_TYPE_PTRDIFF_T-@* ---
815 dnl Author: Ulrich Drepper
817 dnl Synopsis: AC_TYPE_PTRDIFF_T
821 dnl Use: Sets HAVE_PTRDIFF_T if the type exists.
823 AC_DEFUN(AM_TYPE_PTRDIFF_T,
824 [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
825 [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
826 am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
827 if test $am_cv_type_ptrdiff_t = yes; then
828 AC_DEFINE(HAVE_PTRDIFF_T)
832 dnl --- *@-AM_WITH_REGEX-@* ---
834 dnl Author: Unknown (possibly Franc,ois Pinard)
836 dnl Synopsis: AM_WITH_REGEX
841 dnl The idea is to distribute rx.[hc] and regex.[hc] together,
842 dnl for a while. The WITH_REGEX symbol (which should also be
843 dnl documented in acconfig.h) is used to decide which of regex.h
844 dnl or rx.h should be included in the application. If
845 dnl `./configure --with-regex' is given (the default), the
846 dnl package will use gawk's regex. If `./configure
847 dnl --without-regex', a check is made to see if rx is already
848 dnl installed, as with newer Linux'es. If not found, the package
849 dnl will use the rx from the distribution. If found, the package
850 dnl will use the system's rx which, on Linux at least, will
851 dnl result in a smaller executable file.
853 AC_DEFUN(AM_WITH_REGEX,
854 [AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted)
856 [ --without-regex use GNU rx in lieu of gawk's regex for matching],
857 [test "$withval" = yes && am_with_regex=1],
859 if test -n "$am_with_regex"; then
861 AC_DEFINE(WITH_REGEX)
862 AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex,
863 AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1],
864 am_cv_gnu_regex=yes, am_cv_gnu_regex=no))
865 if test $am_cv_gnu_regex = no; then
866 LIBOBJS="$LIBOBJS regex.o"
870 AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
875 dnl --- *@-AM_SANITY_CHECK-@*
879 dnl Synopsis: AM_SANITY_CHECK
883 dnl Use: Check for build environment sanity.
885 AC_DEFUN(AM_SANITY_CHECK,
886 [AC_MSG_CHECKING([whether build environment is sane])
889 echo timestamp > conftestfile
890 # Do `set' in a subshell so we don't clobber the current shell's
891 # arguments. Must try -L first in case configure is actually a
892 # symlink; some systems play weird games with the mod time of symlinks
893 # (eg FreeBSD returns the mod time of the symlink's containing
896 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
897 if test "$@" = "X"; then
899 set X `ls -t $srcdir/configure conftestfile`
901 test "[$]2" = conftestfile
907 AC_MSG_ERROR([newly created file is older than distributed files!
908 Check your system clock])
913 dnl --- *@-AM_FUNC_STRDOD-@* ---
915 dnl Author: Jim Meyering
917 dnl Synopsis: AM_FUNC_STRTOD
921 dnl Use: Checks for a working strtod function.
923 ## Copyright (C) 1996 Free Software Foundation, Inc.
925 ## This program is free software; you can redistribute it and/or modify
926 ## it under the terms of the GNU General Public License as published by
927 ## the Free Software Foundation; either version 2, or (at your option)
928 ## any later version.
930 ## This program is distributed in the hope that it will be useful,
931 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
932 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
933 ## GNU General Public License for more details.
935 ## You should have received a copy of the GNU General Public License
936 ## along with this program; if not, write to the Free Software
937 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
940 ## From Jim Meyering.
944 ## @defmac AC_FUNC_STRTOD
945 ## @maindex FUNC_STRTOD
947 ## If the @code{strtod} function is not available, or does not work
948 ## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
949 ## variable @code{LIBOBJS}.
952 AC_DEFUN(AM_FUNC_STRTOD,
953 [AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
960 /* Some versions of Linux strtod mis-parse strings with leading '+'. */
961 char *string = " +69";
964 value = strtod (string, &term);
965 if (value != 69 || term != (string + 4))
970 /* Under Solaris 2.4, strtod returns the wrong value for the
971 terminating character under some conditions. */
973 ## @defmac AC_FUNC_STRTOD
974 ## @maindex FUNC_STRTOD
976 ## If the @code{strtod} function is not available, or does not work
977 ## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
978 ## variable @code{LIBOBJS}.
981 AC_DEFUN(AM_FUNC_STRTOD,
982 [AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
989 /* Some versions of Linux strtod mis-parse strings with leading '+'. */
990 char *string = " +69";
993 value = strtod (string, &term);
994 if (value != 69 || term != (string + 4))
999 /* Under Solaris 2.4, strtod returns the wrong value for the
1000 terminating character under some conditions. */
1001 char *string = "NaN";
1003 strtod (string, &term);
1004 if (term != string && *(term - 1) == 0)
1009 ], am_cv_func_strtod=yes, am_cv_func_strtod=no, am_cv_func_strtod=no)])
1010 test $am_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
1011 AC_SUBST(LIBOBJS)dnl
1012 am_cv_func_strtod_needs_libm=no
1013 if test $am_cv_func_strtod = no; then
1015 if test $ac_cv_func_pow = no; then
1016 AC_CHECK_LIB(m, pow, [am_cv_func_strtod_needs_libm=yes],
1017 [AC_MSG_WARN(can't find library containing definition of pow)])
1022 dnl --- *@-AM_SYS_POSIX_TERMIOS-@* ---
1024 dnl Author: Jim Meyering
1026 dnl Synopsis: AM_SYS_POSIX_TERMIOS
1030 dnl Use: Checks for a POSIX termios.h.
1032 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
1033 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
1034 [AC_TRY_LINK([#include <sys/types.h>
1036 #include <termios.h>],
1037 [/* SunOS 4.0.3 has termios.h but not the library calls. */
1039 am_cv_sys_posix_termios=yes,
1040 am_cv_sys_posix_termios=no)])
1043 dnl----- Macros by Mark Wooding ------------------------------ *@--IGNORE--@*
1045 dnl --- *@-mdw_REQUIRE-@* ---
1047 dnl Author: Mark Wooding
1049 dnl Synopsis: mdw_REQUIRE(MACRO, ARGS...)
1051 dnl Arguments: MACRO = name of a macro which should have been called
1052 dnl ARGS = arguments to pass
1054 dnl Use: Like `AC_REQUIRE', only it handles arguments.
1056 AC_DEFUN(mdw_REQUIRE,
1057 [ifdef([AC_PROVIDED_$1], ,
1058 [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
1063 dnl --- *@-mdw_CHECK_MANYLIBS-@* ---
1065 dnl Author: Mark Wooding
1067 dnl Synopsis: mdw_CHECK_MANYLIBS(FUNC, LIBS, [IF-FOUND], [IF-NOT-FOUND])
1069 dnl Arguments: FUNC = a function to try to find
1070 dnl LIBS = a whitespace-separated list of libraries to search
1071 dnl IF-FOUND = what to do when the function is found
1072 dnl IF-NOT-FOUND = what to do when the function isn't found
1074 dnl Use: Searches for a library which defines FUNC. It first tries
1075 dnl without any libraries; then it tries each library specified
1076 dnl in LIBS in turn. If it finds a match, it adds the
1077 dnl appropriate library to `LIBS'.
1079 dnl This is particularly handy under DIREIX: if you link with
1080 dnl `-lnsl' then you get non-NIS-aware versions of getpwnam and
1081 dnl so on, which is clearly a Bad Thing.
1083 AC_DEFUN(mdw_CHECK_MANYLIBS,
1084 [AC_CACHE_CHECK([for library containing $1], [mdw_cv_lib_$1],
1085 [mdw_save_LIBS="$LIBS"
1087 AC_TRY_LINK(,[$1()], [mdw_cv_lib_$1="none required"])
1088 test "$mdw_cv_lib_$1" = "no" && for i in $2; do
1089 LIBS="-l$i $mdw_save_LIBS"
1090 AC_TRY_LINK(,[$1()],
1091 [mdw_cv_lib_$1="-l$i"
1094 LIBS="$mdw_save_LIBS"])
1095 if test "$mdw_cv_lib_$1" != "no"; then
1096 test "$mdw_cv_lib_$1" = "none required" || LIBS="$mdw_cv_lib_$1 $LIBS"
1102 dnl --- *@-mdw__PERL_VERSION-@* ---
1104 dnl AC_DEFUN relies on `[', `]' being quotes, so I have to drop down a level.
1107 define(mdw__PERL_VERSION, <<$1 -e 'exit ($] < $2);' >&5 2>&5>>)
1110 dnl --- *@-mdw_PROG_PERL-@* ---
1112 dnl Author: Mark Wooding
1114 dnl Synopsis: mdw_PROG_PERL(VERSION, [IF-FOUND], [IF-NOT-FOUND])
1116 dnl Arguments: VERSION = version number of Perl required
1117 dnl IF-FOUND = what to do if it's found
1118 dnl IF-NOT-FOUND = what to do if it isn't
1120 dnl Use: Attempts to find a working version of Perl with a late
1121 dnl enough version number. It supplies an option `--with-perl'
1122 dnl to allow the user to provide a Perl interpreter. If one
1123 dnl isn't provided explicitly, it searches for `perl' and `perl5'
1124 dnl in the current PATH, asking them whether they have a late
1125 dnl enough version number. The path of the working Perl is
1126 dnl put into the `PERL' environment variable; `AC_SUBST' is used
1127 dnl to substitute its value into Perl scripts. If there is no
1128 dnl Perl to be found, the value of `PERL' is set to be `none'.
1130 AC_DEFUN(mdw_PROG_PERL,
1131 [AC_ARG_WITH([perl],
1132 [ --with-perl=PERL specify path to Perl version $1 or newer],
1134 if test -z "$PERL"; then
1135 [AC_CACHE_CHECK([for Perl version $1 or later], mdw_cv_prog_perl,
1136 [mdw_cv_prog_perl="none"
1137 for p in `echo "$PATH:/usr/local/bin" | tr ":" " "`; do
1138 case $p in /*) ;; *) p=`pwd`/$p ;; esac
1139 if mdw__PERL_VERSION(["$p/perl"], $1); then
1140 mdw_cv_prog_perl="$p/perl"
1143 if mdw__PERL_VERSION(["$p/perl5"], $1); then
1144 mdw_cv_prog_perl="$p/perl5"
1148 PERL="$mdw_cv_prog_perl"])
1152 if test "$PERL" = "none"; then :
1158 dnl --- *@-mdw_CHECK_PERL-@* ---
1160 dnl Author: Mark Wooding
1162 dnl Synopsis: mdw_CHECK_PERL(VERSION)
1164 dnl Arguments: VERSION = version number of Perl required
1166 dnl Use: Verifies that the Perl interpreter in the `PERL' shell
1167 dnl variable actually works and is of the right version. If it's
1168 dnl not, an error is raised and configuration is aborted.
1170 AC_DEFUN(mdw_CHECK_PERL,
1171 [mdw_REQUIRE([mdw_PROG_PERL], [$1])
1172 AC_MSG_CHECKING([whether Perl ($PERL) works])
1173 if test "$PERL" != "none" && mdw__PERL_VERSION("$PERL", $1); then
1174 AC_MSG_RESULT([yes])
1177 AC_MSG_ERROR([Perl version $1 or newer not found.
1178 If you have a recent enough Perl, and I just failed to find it, try using
1179 the --with-perl=PERL option to give me an explicit pathname.])
1182 dnl --- *@-mdw_PERLLIB_CHECK-@* ---
1184 dnl Author: Mark Wooding
1186 dnl Synopsis: mdw_PERLLIB_CHECK(LIBRARY)
1188 dnl Arguments: LIBRARY = name of a Perl library to check for
1190 dnl Use: Ensures that a Perl script can `use LIBRARY;'. If it can,
1191 dnl all's well and good; if it can't, `LIBRARY.pm' is added to
1192 dnl the variable `NEEDED_PERLLIBS' and a line which adds
1193 dnl `pkgdatadir' to Perl's `@INC' array is placed in the
1194 dnl variable `INC_PERLLIBS'; `AC_SUBST' is called for both of
1195 dnl these variables. It's expected that `NEEDED_PERLLIBS' will
1196 dnl be used in the `Makefile.in' to decide which versions from
1197 dnl the distribution need installing.
1199 dnl This macro isn't terribly useful in the general case. It
1200 dnl Also implicitly assumes that `$PERL' is Perl 5 or later.
1202 AC_DEFUN(mdw__PERLLIB_INIT,
1203 [AC_SUBST(INC_PERLLIBS)dnl
1204 AC_SUBST(NEEDED_PERLLIBS)dnl
1207 AC_DEFUN(mdw_PERLLIB_CHECK,
1208 [AC_REQUIRE([mdw__PERLLIB_INIT])
1209 mdw_REQUIRE([mdw_CHECK_PERL], 5)
1210 AC_CACHE_CHECK([for Perl library $1], mdw_cv_perllib_$1,
1211 [if $PERL -e 'use $1;' >&5 2>&5; then
1212 mdw_cv_perllib_$1="yes"
1214 mdw_cv_perllib_$1="no"
1217 if test "$mdw_cv_perllib_$1" = "no"; then
1218 NEEDED_PERLLIBS="$NEEDED_PERLLIBS $1.pm"
1220 # --- Deal with autoconf lossage ---
1222 # It doesn't want to define `prefix' until rather later on, so I have
1225 if test -z "$INC_PERLLIBS"; then
1226 mdw_old_prefix="$prefix"
1227 test "$prefix" = "NONE" && prefix="$ac_default_prefix";
1228 INC_PERLLIBS="BEGIN { push @INC, \"`eval echo $datadir/$PACKAGE`\"; }"
1229 prefix="$mdw_old_prefix";
1233 dnl --- *@-mdw_GCC_FLAGS-@* ---
1235 dnl Author: Mark Wooding
1237 dnl Synopsis: mdw_GCC_FLAGS([FLAGS], [CFLAGS], [C++FLAGS])
1239 dnl Arguments: FLAGS = GCC compiler flags to add (default is
1240 dnl `-pedantic -Wall')
1241 dnl CFLAGS = GCC C compiler flags to add (default is empty)
1242 dnl C++FLAGS = GCC C++ compiler flags to add (default is
1243 dnl `-fhandle-exceptions').
1245 dnl Use: If the C compiler is GCC, add the compiler flags.
1247 AC_DEFUN(mdw_GCC_FLAGS,
1248 [if test "$GCC" = "yes"; then
1249 CFLAGS="$CFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
1250 CFLAGS="$CFLAGS ifelse([$2], [], [], [$2])"
1252 if test "$GXX" = "yes"; then
1253 CXXFLAGS="$CXXFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
1254 CXXFLAGS="$CXXFLAGS ifelse([$3], [], [-fhandle-exceptions], [$3])"
1257 dnl --- *@-mdw_OPT_NDEBUG-@* ---
1259 dnl Author: Mark Wooding
1261 dnl Synopsis: mdw_OPT_NDEBUG
1265 dnl Use: Turns off the `NDEBUG' flag if the user wants to do
1268 AC_DEFUN(mdw_OPT_NDEBUG,
1269 [AC_ARG_ENABLE(debugging,
1270 [ --enable-debugging spews vast swathes of useless information],
1271 [if test "$enableval" = "no"; then
1272 AC_DEFINE(NDEBUG, 1)
1274 [AC_DEFINE(NDEBUG, 1)])])
1276 dnl --- *@-mdw_OPT_EFENCE-@* ---
1278 dnl Author: Mark Wooding
1280 dnl Synopsis: mdw_OPT_EFENCE
1284 dnl Use: Links with the Electric Fence library.
1286 AC_DEFUN(mdw_OPT_EFENCE,
1287 [AC_ARG_WITH(electric-fence,
1288 [ --with-electric-fence link programs with Electric Fence],
1289 [if test "$withval" = "yes"; then
1290 AC_CHECK_LIB(efence, malloc)
1293 dnl --- *@-mdw_OPT_mLib_DEBUG-@* ---
1295 dnl Author: Mark Wooding
1297 dnl Synopsis: mdw_OPT_mLib_DEBUG(PROGRAM)
1301 dnl Use: Provides options for mLib debugging. In particular, the
1302 dnl following are defined:
1304 dnl --enable-tracing turns off the NTRACE variable
1305 dnl --enable-track turns on malloc tracking
1306 dnl --enable-blame-PROGRAM tracks malloc contexts in PROGRAM
1308 dnl There must be a separate `blame' option, so that the various
1309 dnl blame options work properly.
1311 AC_DEFUN(mdw_OPT_mLib_DEBUG,
1315 AC_ARG_ENABLE(tracing,
1316 [ --enable-tracing enable output of tracing information],
1317 [if test "$enableval" = "no"; then
1318 AC_DEFINE(NTRACE, 1)
1320 [AC_DEFINE(NTRACE, 1)])
1322 AC_ARG_ENABLE(track,
1323 [ --enable-track enable tracking of malloc and free],
1324 [AC_DEFINE(TRACK_ENABLE, 1)])
1326 AC_ARG_ENABLE(blame-$1,
1328 track malloc contexts while in $1],
1329 [AC_DEFINE(TRACK_BLAME, 1)])])
1331 dnl----- That's all, folks --------------------------------- *@--GLOB-END--@*