1 dnl -*-fundamental-*- *@--GLOB-HEADER--@*
3 dnl $Id: aclocal.glob,v 1.2 1999/05/13 22:57:23 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.2 1999/05/13 22:57:23 mdw
32 dnl Change `-ise' to `-ize' throughout.
34 dnl Revision 1.1.1.1 1999/05/05 19:23:47 mdw
35 dnl New import. The old CVS repository was lost in a disk disaster.
38 dnl----- Common files distribution --------------------------- *@--NOTICE--@*
40 dnl $Id: aclocal.glob,v 1.2 1999/05/13 22:57:23 mdw Exp $
42 dnl --- *@-AC_PROG_CC_STDC-@* ---
44 dnl Author: Franc,ois Pinard
46 dnl Synopsis: AC_PROG_CC_STDC
50 dnl Use: If the C compiler in not in ANSI C mode by default, try to
51 dnl add an option to output variable `CC' to make it so. This
52 dnl macro tries various options that select ANSI C on some system
53 dnl or another. It considers the compiler to be in ANSI C mode
54 dnl if it defines `__STDC__' to 1 and handles function prototypes
57 dnl If you use this macro, you should check after calling it
58 dnl whether the C compiler has been set to accept ANSI C; if not,
59 dnl the shell variable `ac_cv_prog_cc_stdc' is set to `no'. If
60 dnl you wrote your source code in ANSI C, you can make an
61 dnl un-ANSIfied copy of it by using the program `ansi2knr', which
62 dnl comes with Ghostscript.
64 dnl (documentation by Franc,ois Pinard)
66 AC_DEFUN(AM_PROG_CC_STDC,
67 [AC_REQUIRE([AC_PROG_CC])
68 AC_BEFORE([$0], [AC_C_INLINE])
69 AC_BEFORE([$0], [AC_C_CONST])
70 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
71 AC_CACHE_VAL(am_cv_prog_cc_stdc,
72 [am_cv_prog_cc_stdc=no
74 # Don't try gcc -ansi; that turns off useful extensions and
75 # breaks some systems' header files.
77 # Ultrix and OSF/1 -std1
78 # HP-UX -Aa -D_HPUX_SOURCE
79 # SVR4 -Xc -D__EXTENSIONS__
80 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
82 CC="$ac_save_CC $ac_arg"
84 [#if !defined(__STDC__) || __STDC__ != 1
87 /* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
89 # include <sys/types.h>
90 # include <sys/stat.h>
93 int test (int i, double x);
94 struct s1 {int (*f) (int a);};
95 struct s2 {int (*f) (double a);};],
96 [am_cv_prog_cc_stdc="$ac_arg"; break])
100 if test -z "$am_cv_prog_cc_stdc"; then
101 AC_MSG_RESULT([none needed])
103 AC_MSG_RESULT($am_cv_prog_cc_stdc)
105 case "x$am_cv_prog_cc_stdc" in
107 *) CC="$CC $am_cv_prog_cc_stdc" ;;
111 dnl----- AutoMake macros ------------------------------------- *@--IGNORE--@*
113 dnl --- *@-AM_CONDITIONAL-@* ---
117 dnl Synopsis: AM_CONDITIONAL(NAME, TEST)
119 dnl Arguments: NAME = name of the conditional
120 dnl TEST = a shell list to execute
122 dnl Use: Allows conditional sections in Makefiles.
124 AC_DEFUN(AM_CONDITIONAL,
135 dnl --- *@-AM_CYGWIN32-@* ---
137 dnl Author: Cygnus (I guess)
139 dnl Synopsis: AM_CYGWIN32
143 dnl Use: Check to see if we're running under Cygwin32, without using
144 dnl AC_CANONICAL_*. If so, set output variable EXEEXT to
145 dnl ".exe". Otherwise set it to "".
148 dnl You might think we can do this by checking for a cygwin32-specific
149 dnl cpp define. We can't, because cross-compilers that target
150 dnl cygwin32 don't use the .exe suffix. I don't know why.
151 AC_DEFUN(AM_CYGWIN32,
152 [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
153 [cat > conftest.$ac_ext << 'EOF'
158 if AC_TRY_EVAL(ac_link) && test -s conftest.exe; then
165 test "$am_cv_cygwin32" = yes && EXEEXT=.exe
168 dnl --- *@-AM_WITH_DMALLOC-@* ---
170 dnl Author: Franc,ois Pinard
172 dnl Synopsis: AM_WITH_DMALLOC
176 dnl Use: Links with `-dmalloc' if told to by the user.
178 ## ----------------------------------- ##
179 ## Check if --with-dmalloc was given. ##
180 ## From Franc,ois Pinard ##
181 ## ----------------------------------- ##
185 AC_DEFUN(AM_WITH_DMALLOC,
186 [AC_MSG_CHECKING(if malloc debugging is wanted)
188 [ --with-dmalloc use dmalloc, as in
189 ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
190 [if test "$withval" = yes; then
192 AC_DEFINE(WITH_DMALLOC)
193 LIBS="$LIBS -ldmalloc"
194 LDFLAGS="$LDFLAGS -g"
197 fi], [AC_MSG_RESULT(no)])
200 dnl --- *@-AM_FUNC_ERROR_AT_LINE-@* ---
202 dnl Author: Jim Meyering
204 dnl Synopsis: AM_FUNC_ERROR_AT_LINE
208 dnl Use: Use this if you use the GNU error.[ch].
210 dnl FIXME: Migrate into libit
212 AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
213 [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
214 [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
215 am_cv_lib_error_at_line=yes,
216 am_cv_lib_error_at_line=no)])
217 if test $am_cv_lib_error_at_line = no; then
218 LIBOBJS="$LIBOBJS error.o"
223 dnl --- *@-AM_INIT_GUILE_MODULE-@* ---
227 dnl Synopsis: AM_INIT_GUILE_MODULE(MODNAME)
229 dnl Arguments: MODNAME = value to initialize `module' variable with
231 dnl Use: This macro will automatically get the guile version from the
232 dnl top-level srcdir, and will initialize automake. It also
233 dnl defines the `module' variable.
235 AC_DEFUN([AM_INIT_GUILE_MODULE],[
236 . $srcdir/../GUILE-VERSION
237 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
238 AC_CONFIG_AUX_DIR(..)
242 dnl --- *@-AM_CONFIG_HEADER-@* ---
246 dnl Synopsis: AM_CONFIG_HEADER(HEADER ...)
248 dnl Arguments: HEADER = a header spec, as for AC_CONFIG_HEADER
250 dnl Use: Like AC_CONFIG_HEADER, but automatically create stamp file.
252 AC_DEFUN(AM_CONFIG_HEADER,
254 AC_CONFIG_HEADER([$1])
255 dnl When config.status generates a header, we must update the stamp-h file.
256 dnl This file resides in the same directory as the config header
257 dnl that is generated. We must strip everything past the first ":",
258 dnl and everything past the last "/".
259 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
260 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
261 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/
262 \)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
264 for am_file in <<$1>>; do
265 case " <<$>>CONFIG_HEADERS " in
266 *" <<$>>am_file "*<<)>>
267 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
270 am_indx=`expr "<<$>>am_indx" + 1`
274 dnl --- *@-AM_INIT_AUTOMAKE-@*
278 dnl Synopsis: AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
280 dnl Arguments: PACKAGE = package name
281 dnl VERSION = version number
282 dnl NO-DEFINE = if set, don't define package and version number
284 dnl Use: Do all the work for Automake. This macro actually does too
285 dnl much -- some checks are only needed if your package does
286 dnl certain things. But this isn't really a big deal.
290 AC_DEFUN(AM_INIT_AUTOMAKE,
291 [AC_REQUIRE([AM_PROG_INSTALL])
296 dnl test to see if srcdir already configured
297 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
298 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
301 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
302 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
305 dnl FIXME This is truly gross.
306 missing_dir=`cd $ac_aux_dir && pwd`
307 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
308 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
309 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
310 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
311 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
314 dnl --- *@-AM_PROG_INSTALL-@* ---
316 dnl Author: Franc,ois Pinard
318 dnl Synopsis: AM_PROG_INSTALL
322 dnl Use: Calls `AC_PROG_INSTALL' to find an installer. Then it sets
323 dnl `INSTALL_SCRIPT' to a suitable value if necessary.
327 AC_DEFUN(AM_PROG_INSTALL,
329 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
330 AC_SUBST(INSTALL_SCRIPT)dnl
333 dnl --- *@-AM_PROG_LEX-@* ---
335 dnl Author: Alexandre Oliva
337 dnl Synopsis: AM_PROG_LEX
341 dnl Use: Replacement for AC_PROG_LEX and AC_DECL_YYTEXT
344 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
345 AC_DEFUN(AM_PROG_LEX,
346 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
347 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
351 dnl --- *@-AM_PROG_LIBTOOL-@* ---
355 dnl Synopsis: AM_PROG_LIBTOOL
359 dnl Use: Configures `libtool' for the target architecture.
362 ## Configure libtool for the target system.
364 # serial 1 AM_PROG_LIBTOOL
365 AC_DEFUN(AM_PROG_LIBTOOL,
366 [AC_REQUIRE([AC_CANONICAL_HOST])
367 AC_REQUIRE([AC_PROG_CC])
368 AC_REQUIRE([AC_PROG_RANLIB])
370 # Always use our own libtool.
371 LIBTOOL='$(top_builddir)/libtool'
374 dnl Allow the --disable-shared flag to stop us from building shared libs.
375 AC_ARG_ENABLE(shared,
376 [ --enable-shared build shared libraries [default=yes]],
377 test "$enableval" = no && libtool_shared=" --disable-shared",
380 libtool_flags="$libtool_shared"
381 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
382 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
384 # Actually configure libtool. ac_aux_dir is where install-sh is found.
385 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LD="$LD" RANLIB="$RANLIB" \
386 $ac_aux_dir/ltconfig $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
387 || AC_MSG_ERROR([libtool configure failed])
390 dnl --- *@-AM_PATH_LISPDIR-@* ---
392 dnl Author: Ulrich Drepper
394 dnl Synopsis: AM_PATH_LISPDIR
398 dnl Use: Sets the variable `lispdir' to point to a place to install
399 dnl Emacs lisp files.
401 ## ------------------------
402 ## Emacs LISP file handling
403 ## From Ulrich Drepper
404 ## ------------------------
408 AC_DEFUN(AM_PATH_LISPDIR,
409 [# If set to t, that means we are running in a shell under Emacs.
410 # If you have an Emacs named "t", then use the full path.
411 test "$EMACS" = t && EMACS=
412 AC_PATH_PROG(EMACS, emacs xemacs, no)
413 if test $EMACS != "no"; then
414 AC_MSG_CHECKING([where .elc files should go])
415 dnl Set default value
416 lispdir="\$(datadir)/emacs/site-lisp"
417 if test "x$prefix" = "xNONE"; then
418 if test -d $ac_default_prefix/share/emacs/site-lisp; then
419 lispdir="\$(prefix)/share/emacs/site-lisp"
421 if test -d $ac_default_prefix/lib/emacs/site-lisp; then
422 lispdir="\$(prefix)/lib/emacs/site-lisp"
426 if test -d $prefix/share/emacs/site-lisp; then
427 lispdir="\$(prefix)/share/emacs/site-lisp"
429 if test -d $prefix/lib/emacs/site-lisp; then
430 lispdir="\$(prefix)/lib/emacs/site-lisp"
434 AC_MSG_RESULT($lispdir)
438 dnl --- *@-AM_MAINTAINTER_MODE-@* ---
440 dnl Author: Jim Meyering
442 dnl Synopsis: jm_MAINTAINER_MODE
446 dnl Use: Provides an option `--enable-maintainer-mode' which turns
447 dnl on rules which might normally be commented out. The
448 dnl substitution variable `MAINT' is set to be a comment when
449 dnl this option is disabled, which it is by default.
453 AC_DEFUN(AM_MAINTAINER_MODE,
454 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
455 dnl maintainer-mode is disabled by default
456 AC_ARG_ENABLE(maintainer-mode,
457 [ --enable-maintainer-mode enable make rules and dependencies not useful
458 (and sometimes confusing) to the casual installer],
459 USE_MAINTAINER_MODE=$enableval,
460 USE_MAINTAINER_MODE=no)
461 AC_MSG_RESULT($USE_MAINTAINER_MODE)
462 if test $USE_MAINTAINER_MODE = yes; then
471 dnl --- *@-AM_MISSING_PROG-@* ---
475 dnl Synopsis: AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
477 dnl Arguments: NAME = variable to set to the file's location
478 dnl PROGRAM = name of program to find
479 dnl DIRECTORY = directory to look in
481 dnl Use: Fakes existence of a useful GNU maintainer tool.
483 AC_DEFUN(AM_MISSING_PROG,
484 [AC_MSG_CHECKING(for working $2)
485 # Run test in a subshell; some versions of sh will print an error if
486 # an executable is not found, even if stderr is redirected.
487 # Redirect stdin to placate older versions of autoconf. Sigh.
488 if ($2 --version) < /dev/null > /dev/null 2>&1; then
493 AC_MSG_RESULT(missing)
497 dnl --- *@-AM_FUNC_MKTIME-@* ---
499 dnl Author: Jim Meyering
501 dnl Synopsis: AM_FUNC_MKTIME
505 dnl Use: Checks for a working mktime function.
507 AC_DEFUN(AM_FUNC_MKTIME,
508 [AC_REQUIRE([AC_HEADER_TIME])dnl
509 AC_CHECK_HEADERS(sys/time.h)
510 AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
512 changequote(<<, >>)dnl
513 <</* Test program from Paul Eggert (eggert@twinsun.com)
514 and Tony Leneis (tony@plaza.ds.adp.com). */
515 #if TIME_WITH_SYS_TIME
516 # include <sys/time.h>
520 # include <sys/time.h>
526 static time_t time_t_max;
528 /* Values we'll use to set the TZ environment variable. */
529 static const char *const tz_strings[] = {
530 NULL, "GMT0", "JST-9", "EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
532 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
538 if (mktime (localtime (&now)) != now)
540 now = time_t_max - now;
541 if (mktime (localtime (&now)) != now)
551 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
554 delta = time_t_max / 997; /* a suitable prime number */
555 for (i = 0; i < N_STRINGS; i++)
558 putenv (tz_strings[i]);
560 for (t = 0; t <= time_t_max - delta; t += delta)
562 mktime_test ((time_t) 60 * 60);
563 mktime_test ((time_t) 60 * 60 * 24);
569 am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
570 dnl When crosscompiling, assume mktime is missing or broken.
571 am_cv_func_working_mktime=no)
573 if test $am_cv_func_working_mktime = no; then
574 LIBOBJS="$LIBOBJS mktime.o"
578 dnl --- *@-AM_FUNC_OBSTACK-@* ---
580 dnl Author: Jim Meyering
582 dnl Synopsis: AM_FUNC_OBSTACK
586 dnl Use: Checks for GNU obstacks.
588 AC_DEFUN(AM_FUNC_OBSTACK,
589 [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
590 [AC_TRY_LINK([#include "obstack.h"],
591 [struct obstack *mem;obstack_free(mem,(char *) 0)],
592 am_cv_func_obstack=yes,
593 am_cv_func_obstack=no)])
594 if test $am_cv_func_obstack = yes; then
595 AC_DEFINE(HAVE_OBSTACK)
597 LIBOBJS="$LIBOBJS obstack.o"
601 dnl --- *@-AC_C_PROTOTYPES-@* ---
603 dnl Author: Franc,ois Pinard
605 dnl Synopsis: AC_C_PROTOTYPES
609 dnl Use: If the C compiler understands ANSI C, define `PROTOTYPES',
610 dnl and clear the `U' and `ANSI2KNR' variables. Otherwise,
611 dnl set `U' to be `_' and `ANSI2KNR' to be `./ansi2knr'.
615 AC_DEFUN(fp_C_PROTOTYPES,
616 [AC_REQUIRE([fp_PROG_CC_STDC])
617 AC_MSG_CHECKING([for function prototypes])
618 if test "$ac_cv_prog_cc_stdc" != no; then
620 AC_DEFINE(PROTOTYPES)
624 U=_ ANSI2KNR=./ansi2knr
627 AC_SUBST(ANSI2KNR)dnl
630 dnl --- *@-AM_PATH_GTK-@* ---
632 dnl Author: Owen Taylor
634 dnl Synopsis: AM_PATH_GTK(MIN-VERSION, [ACTION-IF-FOUND], [ACTION-IF-NOT])
636 dnl Arguments: MIN-VERSION = minimum version of GTK required
637 dnl ACTION-IF-FOUND = executed if GTK found OK
638 dnl ACTION-IF-NOT-FOUND = what to do if GTK not available
640 dnl Use: Sets up compilation environment suitably for GTK programming.
642 # Configure paths for GTK+
643 # Owen Taylor 97-11-3
645 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
646 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
648 AC_DEFUN(AM_PATH_GTK,
650 dnl Get the cflags and libraries from the gtk-config script
652 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
653 gtk_config_prefix="$withval", gtk_config_prefix="")
654 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
655 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
656 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
657 , enable_gtktest=yes)
659 if test x$gtk_config_exec_prefix != x ; then
660 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
661 if test x${GTK_CONFIG+set} != xset ; then
662 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
665 if test x$gtk_config_prefix != x ; then
666 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
667 if test x${GTK_CONFIG+set} != xset ; then
668 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
672 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
673 min_gtk_version=ifelse([$1], ,0.99.7,$1)
674 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
676 if test "$GTK_CONFIG" = "no" ; then
679 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
680 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
681 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
682 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
683 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
684 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
685 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
686 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
687 if test "x$enable_gtktest" = "xyes" ; then
688 ac_save_CFLAGS="$CFLAGS"
690 CFLAGS="$CFLAGS $GTK_CFLAGS"
691 LIBS="$LIBS $GTK_LIBS"
693 dnl Now check if the installed GTK is sufficiently new. (Also sanity
694 dnl checks the results of gtk-config to some extent
704 int major, minor, micro;
707 system ("touch conf.gtktest");
709 /* HP/UX 9 (%@#!) writes to sscanf strings */
710 tmp_version = g_strdup("$min_gtk_version");
711 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
712 printf("%s, bad version string\n", "$min_gtk_version");
716 if ((gtk_major_version != $gtk_config_major_version) ||
717 (gtk_minor_version != $gtk_config_minor_version) ||
718 (gtk_micro_version != $gtk_config_micro_version))
720 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
721 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
722 gtk_major_version, gtk_minor_version, gtk_micro_version);
723 printf ("*** was found! If gtk-config was correct, then it is best\n");
724 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
725 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
726 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
727 printf("*** required on your system.\n");
728 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
729 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
730 printf("*** before re-running configure\n");
734 if ((gtk_major_version > major) ||
735 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
736 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
742 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
743 gtk_major_version, gtk_minor_version, gtk_micro_version);
744 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
745 major, minor, micro);
746 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
748 printf("*** If you have already installed a sufficiently new version, this error\n");
749 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
750 printf("*** being found. The easiest way to fix this is to remove the old version\n");
751 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
752 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
753 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
754 printf("*** so that the correct libraries are found at run-time))\n");
759 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
760 CFLAGS="$ac_save_CFLAGS"
764 if test "x$no_gtk" = x ; then
766 ifelse([$2], , :, [$2])
769 if test "$GTK_CONFIG" = "no" ; then
770 echo "*** The gtk-config script installed by GTK could not be found"
771 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
772 echo "*** your path, or set the GTK_CONFIG environment variable to the"
773 echo "*** full path to gtk-config."
775 if test -f conf.gtktest ; then
778 echo "*** Could not run GTK test program, checking why..."
779 CFLAGS="$CFLAGS $GTK_CFLAGS"
780 LIBS="$LIBS $GTK_LIBS"
784 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
785 [ echo "*** The test program compiled, but did not run. This usually means"
786 echo "*** that the run-time linker is not finding GTK or finding the wrong"
787 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
788 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
789 echo "*** to the installed location Also, make sure you have run ldconfig if that"
790 echo "*** is required on your system"
792 echo "*** If you have an old version installed, it is best to remove it, although"
793 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
795 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
796 echo "*** came with the system with the command"
798 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
799 [ echo "*** The test program failed to compile or link. See the file config.log for the"
800 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
801 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
802 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
803 CFLAGS="$ac_save_CFLAGS"
809 ifelse([$3], , :, [$3])
816 dnl --- *@-AC_TYPE_PTRDIFF_T-@* ---
818 dnl Author: Ulrich Drepper
820 dnl Synopsis: AC_TYPE_PTRDIFF_T
824 dnl Use: Sets HAVE_PTRDIFF_T if the type exists.
826 AC_DEFUN(AM_TYPE_PTRDIFF_T,
827 [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
828 [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
829 am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
830 if test $am_cv_type_ptrdiff_t = yes; then
831 AC_DEFINE(HAVE_PTRDIFF_T)
835 dnl --- *@-AM_WITH_REGEX-@* ---
837 dnl Author: Unknown (possibly Franc,ois Pinard)
839 dnl Synopsis: AM_WITH_REGEX
844 dnl The idea is to distribute rx.[hc] and regex.[hc] together,
845 dnl for a while. The WITH_REGEX symbol (which should also be
846 dnl documented in acconfig.h) is used to decide which of regex.h
847 dnl or rx.h should be included in the application. If
848 dnl `./configure --with-regex' is given (the default), the
849 dnl package will use gawk's regex. If `./configure
850 dnl --without-regex', a check is made to see if rx is already
851 dnl installed, as with newer Linux'es. If not found, the package
852 dnl will use the rx from the distribution. If found, the package
853 dnl will use the system's rx which, on Linux at least, will
854 dnl result in a smaller executable file.
856 AC_DEFUN(AM_WITH_REGEX,
857 [AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted)
859 [ --without-regex use GNU rx in lieu of gawk's regex for matching],
860 [test "$withval" = yes && am_with_regex=1],
862 if test -n "$am_with_regex"; then
864 AC_DEFINE(WITH_REGEX)
865 AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex,
866 AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1],
867 am_cv_gnu_regex=yes, am_cv_gnu_regex=no))
868 if test $am_cv_gnu_regex = no; then
869 LIBOBJS="$LIBOBJS regex.o"
873 AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
878 dnl --- *@-AM_SANITY_CHECK-@*
882 dnl Synopsis: AM_SANITY_CHECK
886 dnl Use: Check for build environment sanity.
888 AC_DEFUN(AM_SANITY_CHECK,
889 [AC_MSG_CHECKING([whether build environment is sane])
892 echo timestamp > conftestfile
893 # Do `set' in a subshell so we don't clobber the current shell's
894 # arguments. Must try -L first in case configure is actually a
895 # symlink; some systems play weird games with the mod time of symlinks
896 # (eg FreeBSD returns the mod time of the symlink's containing
899 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
900 if test "$@" = "X"; then
902 set X `ls -t $srcdir/configure conftestfile`
904 test "[$]2" = conftestfile
910 AC_MSG_ERROR([newly created file is older than distributed files!
911 Check your system clock])
916 dnl --- *@-AM_FUNC_STRDOD-@* ---
918 dnl Author: Jim Meyering
920 dnl Synopsis: AM_FUNC_STRTOD
924 dnl Use: Checks for a working strtod function.
926 ## Copyright (C) 1996 Free Software Foundation, Inc.
928 ## This program is free software; you can redistribute it and/or modify
929 ## it under the terms of the GNU General Public License as published by
930 ## the Free Software Foundation; either version 2, or (at your option)
931 ## any later version.
933 ## This program is distributed in the hope that it will be useful,
934 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
935 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
936 ## GNU General Public License for more details.
938 ## You should have received a copy of the GNU General Public License
939 ## along with this program; if not, write to the Free Software
940 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
943 ## From Jim Meyering.
947 ## @defmac AC_FUNC_STRTOD
948 ## @maindex FUNC_STRTOD
950 ## If the @code{strtod} function is not available, or does not work
951 ## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
952 ## variable @code{LIBOBJS}.
955 AC_DEFUN(AM_FUNC_STRTOD,
956 [AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
963 /* Some versions of Linux strtod mis-parse strings with leading '+'. */
964 char *string = " +69";
967 value = strtod (string, &term);
968 if (value != 69 || term != (string + 4))
973 /* Under Solaris 2.4, strtod returns the wrong value for the
974 terminating character under some conditions. */
976 ## @defmac AC_FUNC_STRTOD
977 ## @maindex FUNC_STRTOD
979 ## If the @code{strtod} function is not available, or does not work
980 ## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
981 ## variable @code{LIBOBJS}.
984 AC_DEFUN(AM_FUNC_STRTOD,
985 [AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
992 /* Some versions of Linux strtod mis-parse strings with leading '+'. */
993 char *string = " +69";
996 value = strtod (string, &term);
997 if (value != 69 || term != (string + 4))
1002 /* Under Solaris 2.4, strtod returns the wrong value for the
1003 terminating character under some conditions. */
1004 char *string = "NaN";
1006 strtod (string, &term);
1007 if (term != string && *(term - 1) == 0)
1012 ], am_cv_func_strtod=yes, am_cv_func_strtod=no, am_cv_func_strtod=no)])
1013 test $am_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
1014 AC_SUBST(LIBOBJS)dnl
1015 am_cv_func_strtod_needs_libm=no
1016 if test $am_cv_func_strtod = no; then
1018 if test $ac_cv_func_pow = no; then
1019 AC_CHECK_LIB(m, pow, [am_cv_func_strtod_needs_libm=yes],
1020 [AC_MSG_WARN(can't find library containing definition of pow)])
1025 dnl --- *@-AM_SYS_POSIX_TERMIOS-@* ---
1027 dnl Author: Jim Meyering
1029 dnl Synopsis: AM_SYS_POSIX_TERMIOS
1033 dnl Use: Checks for a POSIX termios.h.
1035 AC_DEFUN(AM_SYS_POSIX_TERMIOS,
1036 [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
1037 [AC_TRY_LINK([#include <sys/types.h>
1039 #include <termios.h>],
1040 [/* SunOS 4.0.3 has termios.h but not the library calls. */
1042 am_cv_sys_posix_termios=yes,
1043 am_cv_sys_posix_termios=no)])
1046 dnl----- Macros by Mark Wooding ------------------------------ *@--IGNORE--@*
1048 dnl --- *@-mdw_REQUIRE-@* ---
1050 dnl Author: Mark Wooding
1052 dnl Synopsis: mdw_REQUIRE(MACRO, ARGS...)
1054 dnl Arguments: MACRO = name of a macro which should have been called
1055 dnl ARGS = arguments to pass
1057 dnl Use: Like `AC_REQUIRE', only it handles arguments.
1059 AC_DEFUN(mdw_REQUIRE,
1060 [ifdef([AC_PROVIDED_$1], ,
1061 [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
1066 dnl --- *@-mdw_CHECK_MANYLIBS-@* ---
1068 dnl Author: Mark Wooding
1070 dnl Synopsis: mdw_CHECK_MANYLIBS(FUNC, LIBS, [IF-FOUND], [IF-NOT-FOUND])
1072 dnl Arguments: FUNC = a function to try to find
1073 dnl LIBS = a whitespace-separated list of libraries to search
1074 dnl IF-FOUND = what to do when the function is found
1075 dnl IF-NOT-FOUND = what to do when the function isn't found
1077 dnl Use: Searches for a library which defines FUNC. It first tries
1078 dnl without any libraries; then it tries each library specified
1079 dnl in LIBS in turn. If it finds a match, it adds the
1080 dnl appropriate library to `LIBS'.
1082 dnl This is particularly handy under DIREIX: if you link with
1083 dnl `-lnsl' then you get non-NIS-aware versions of getpwnam and
1084 dnl so on, which is clearly a Bad Thing.
1086 AC_DEFUN(mdw_CHECK_MANYLIBS,
1087 [AC_CACHE_CHECK([for library containing $1], [mdw_cv_lib_$1],
1088 [mdw_save_LIBS="$LIBS"
1090 AC_TRY_LINK(,[$1()], [mdw_cv_lib_$1="none required"])
1091 test "$mdw_cv_lib_$1" = "no" && for i in $2; do
1092 LIBS="-l$i $mdw_save_LIBS"
1093 AC_TRY_LINK(,[$1()],
1094 [mdw_cv_lib_$1="-l$i"
1097 LIBS="$mdw_save_LIBS"])
1098 if test "$mdw_cv_lib_$1" != "no"; then
1099 test "$mdw_cv_lib_$1" = "none required" || LIBS="$mdw_cv_lib_$1 $LIBS"
1105 dnl --- *@-mdw__PERL_VERSION-@* ---
1107 dnl AC_DEFUN relies on `[', `]' being quotes, so I have to drop down a level.
1110 define(mdw__PERL_VERSION, <<$1 -e 'exit ($] < $2);' >&5 2>&5>>)
1113 dnl --- *@-mdw_PROG_PERL-@* ---
1115 dnl Author: Mark Wooding
1117 dnl Synopsis: mdw_PROG_PERL(VERSION, [IF-FOUND], [IF-NOT-FOUND])
1119 dnl Arguments: VERSION = version number of Perl required
1120 dnl IF-FOUND = what to do if it's found
1121 dnl IF-NOT-FOUND = what to do if it isn't
1123 dnl Use: Attempts to find a working version of Perl with a late
1124 dnl enough version number. It supplies an option `--with-perl'
1125 dnl to allow the user to provide a Perl interpreter. If one
1126 dnl isn't provided explicitly, it searches for `perl' and `perl5'
1127 dnl in the current PATH, asking them whether they have a late
1128 dnl enough version number. The path of the working Perl is
1129 dnl put into the `PERL' environment variable; `AC_SUBST' is used
1130 dnl to substitute its value into Perl scripts. If there is no
1131 dnl Perl to be found, the value of `PERL' is set to be `none'.
1133 AC_DEFUN(mdw_PROG_PERL,
1134 [AC_ARG_WITH([perl],
1135 [ --with-perl=PERL specify path to Perl version $1 or newer],
1137 if test -z "$PERL"; then
1138 [AC_CACHE_CHECK([for Perl version $1 or later], mdw_cv_prog_perl,
1139 [mdw_cv_prog_perl="none"
1140 for p in `echo "$PATH:/usr/local/bin" | tr ":" " "`; do
1141 case $p in /*) ;; *) p=`pwd`/$p ;; esac
1142 if mdw__PERL_VERSION(["$p/perl"], $1); then
1143 mdw_cv_prog_perl="$p/perl"
1146 if mdw__PERL_VERSION(["$p/perl5"], $1); then
1147 mdw_cv_prog_perl="$p/perl5"
1151 PERL="$mdw_cv_prog_perl"])
1155 if test "$PERL" = "none"; then :
1161 dnl --- *@-mdw_CHECK_PERL-@* ---
1163 dnl Author: Mark Wooding
1165 dnl Synopsis: mdw_CHECK_PERL(VERSION)
1167 dnl Arguments: VERSION = version number of Perl required
1169 dnl Use: Verifies that the Perl interpreter in the `PERL' shell
1170 dnl variable actually works and is of the right version. If it's
1171 dnl not, an error is raised and configuration is aborted.
1173 AC_DEFUN(mdw_CHECK_PERL,
1174 [mdw_REQUIRE([mdw_PROG_PERL], [$1])
1175 AC_MSG_CHECKING([whether Perl ($PERL) works])
1176 if test "$PERL" != "none" && mdw__PERL_VERSION("$PERL", $1); then
1177 AC_MSG_RESULT([yes])
1180 AC_MSG_ERROR([Perl version $1 or newer not found.
1181 If you have a recent enough Perl, and I just failed to find it, try using
1182 the --with-perl=PERL option to give me an explicit pathname.])
1185 dnl --- *@-mdw_PERLLIB_CHECK-@* ---
1187 dnl Author: Mark Wooding
1189 dnl Synopsis: mdw_PERLLIB_CHECK(LIBRARY)
1191 dnl Arguments: LIBRARY = name of a Perl library to check for
1193 dnl Use: Ensures that a Perl script can `use LIBRARY;'. If it can,
1194 dnl all's well and good; if it can't, `LIBRARY.pm' is added to
1195 dnl the variable `NEEDED_PERLLIBS' and a line which adds
1196 dnl `pkgdatadir' to Perl's `@INC' array is placed in the
1197 dnl variable `INC_PERLLIBS'; `AC_SUBST' is called for both of
1198 dnl these variables. It's expected that `NEEDED_PERLLIBS' will
1199 dnl be used in the `Makefile.in' to decide which versions from
1200 dnl the distribution need installing.
1202 dnl This macro isn't terribly useful in the general case. It
1203 dnl Also implicitly assumes that `$PERL' is Perl 5 or later.
1205 AC_DEFUN(mdw__PERLLIB_INIT,
1206 [AC_SUBST(INC_PERLLIBS)dnl
1207 AC_SUBST(NEEDED_PERLLIBS)dnl
1210 AC_DEFUN(mdw_PERLLIB_CHECK,
1211 [AC_REQUIRE([mdw__PERLLIB_INIT])
1212 mdw_REQUIRE([mdw_CHECK_PERL], 5)
1213 AC_CACHE_CHECK([for Perl library $1], mdw_cv_perllib_$1,
1214 [if $PERL -e 'use $1;' >&5 2>&5; then
1215 mdw_cv_perllib_$1="yes"
1217 mdw_cv_perllib_$1="no"
1220 if test "$mdw_cv_perllib_$1" = "no"; then
1221 NEEDED_PERLLIBS="$NEEDED_PERLLIBS $1.pm"
1223 # --- Deal with autoconf lossage ---
1225 # It doesn't want to define `prefix' until rather later on, so I have
1228 if test -z "$INC_PERLLIBS"; then
1229 mdw_old_prefix="$prefix"
1230 test "$prefix" = "NONE" && prefix="$ac_default_prefix";
1231 INC_PERLLIBS="BEGIN { push @INC, \"`eval echo $datadir/$PACKAGE`\"; }"
1232 prefix="$mdw_old_prefix";
1236 dnl --- *@-mdw_GCC_FLAGS-@* ---
1238 dnl Author: Mark Wooding
1240 dnl Synopsis: mdw_GCC_FLAGS([FLAGS], [CFLAGS], [C++FLAGS])
1242 dnl Arguments: FLAGS = GCC compiler flags to add (default is
1243 dnl `-pedantic -Wall')
1244 dnl CFLAGS = GCC C compiler flags to add (default is empty)
1245 dnl C++FLAGS = GCC C++ compiler flags to add (default is
1246 dnl `-fhandle-exceptions').
1248 dnl Use: If the C compiler is GCC, add the compiler flags.
1250 AC_DEFUN(mdw_GCC_FLAGS,
1251 [if test "$GCC" = "yes"; then
1252 CFLAGS="$CFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
1253 CFLAGS="$CFLAGS ifelse([$2], [], [], [$2])"
1255 if test "$GXX" = "yes"; then
1256 CXXFLAGS="$CXXFLAGS ifelse([$1], [], [-pedantic -Wall], [$1])"
1257 CXXFLAGS="$CXXFLAGS ifelse([$3], [], [-fhandle-exceptions], [$3])"
1260 dnl --- *@-mdw_OPT_NDEBUG-@* ---
1262 dnl Author: Mark Wooding
1264 dnl Synopsis: mdw_OPT_NDEBUG
1268 dnl Use: Turns off the `NDEBUG' flag if the user wants to do
1271 AC_DEFUN(mdw_OPT_NDEBUG,
1272 [AC_ARG_ENABLE(debugging,
1273 [ --enable-debugging spews vast swathes of useless information],
1274 [if test "$enableval" = "no"; then
1275 AC_DEFINE(NDEBUG, 1)
1277 [AC_DEFINE(NDEBUG, 1)])])
1279 dnl --- *@-mdw_OPT_EFENCE-@* ---
1281 dnl Author: Mark Wooding
1283 dnl Synopsis: mdw_OPT_EFENCE
1287 dnl Use: Links with the Electric Fence library.
1289 AC_DEFUN(mdw_OPT_EFENCE,
1290 [AC_ARG_WITH(electric-fence,
1291 [ --with-electric-fence link programs with Electric Fence],
1292 [if test "$withval" = "yes"; then
1293 AC_CHECK_LIB(efence, malloc)
1296 dnl --- *@-mdw_OPT_mLib_DEBUG-@* ---
1298 dnl Author: Mark Wooding
1300 dnl Synopsis: mdw_OPT_mLib_DEBUG(PROGRAM)
1304 dnl Use: Provides options for mLib debugging. In particular, the
1305 dnl following are defined:
1307 dnl --enable-tracing turns off the NTRACE variable
1308 dnl --enable-track turns on malloc tracking
1309 dnl --enable-blame-PROGRAM tracks malloc contexts in PROGRAM
1311 dnl There must be a separate `blame' option, so that the various
1312 dnl blame options work properly.
1314 AC_DEFUN(mdw_OPT_mLib_DEBUG,
1318 AC_ARG_ENABLE(tracing,
1319 [ --enable-tracing enable output of tracing information],
1320 [if test "$enableval" = "no"; then
1321 AC_DEFINE(NTRACE, 1)
1323 [AC_DEFINE(NTRACE, 1)])
1325 AC_ARG_ENABLE(track,
1326 [ --enable-track enable tracking of malloc and free],
1327 [AC_DEFINE(TRACK_ENABLE, 1)])
1329 AC_ARG_ENABLE(blame-$1,
1331 track malloc contexts while in $1],
1332 [AC_DEFINE(TRACK_BLAME, 1)])])
1334 dnl----- That's all, folks --------------------------------- *@--GLOB-END--@*