1 dnl aclocal.m4 generated automatically by aclocal 1.4a
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.
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.
13 # Like AC_CONFIG_HEADER, but automatically create stamp file.
15 AC_DEFUN(AM_CONFIG_HEADER,
17 AC_CONFIG_HEADER([$1])
18 dnl When config.status generates a header, we must update the stamp-h file.
19 dnl This file resides in the same directory as the config header
20 dnl that is generated. We must strip everything past the first ":",
21 dnl and everything past the last "/".
22 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
23 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
24 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
26 for am_file in <<$1>>; do
27 case " <<$>>CONFIG_HEADERS " in
28 *" <<$>>am_file "*<<)>>
29 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
32 am_indx=`expr "<<$>>am_indx" + 1`
36 # Do all the work for Automake. This macro actually does too much --
37 # some checks are only needed if your package does certain things.
38 # But this isn't really a big deal.
43 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
45 AC_DEFUN(AM_INIT_AUTOMAKE,
46 [AC_REQUIRE([AC_PROG_INSTALL])
47 dnl We require 2.13 because we rely on SHELL being computed by configure.
53 dnl test to see if srcdir already configured
54 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
55 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
58 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
59 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
60 AC_REQUIRE([AM_SANITY_CHECK])
61 AC_REQUIRE([AC_ARG_PROGRAM])
62 dnl FIXME This is truly gross.
63 missing_dir=`cd $ac_aux_dir && pwd`
64 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
65 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
66 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
67 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
68 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
69 AC_REQUIRE([AC_PROG_MAKE_SET])])
72 # Check to make sure that the build environment is sane.
75 AC_DEFUN(AM_SANITY_CHECK,
76 [AC_MSG_CHECKING([whether build environment is sane])
79 echo timestamp > conftestfile
80 # Do `set' in a subshell so we don't clobber the current shell's
81 # arguments. Must try -L first in case configure is actually a
82 # symlink; some systems play weird games with the mod time of symlinks
83 # (eg FreeBSD returns the mod time of the symlink's containing
86 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
87 if test "[$]*" = "X"; then
89 set X `ls -t $srcdir/configure conftestfile`
91 if test "[$]*" != "X $srcdir/configure conftestfile" \
92 && test "[$]*" != "X conftestfile $srcdir/configure"; then
94 # If neither matched, then we have a broken ls. This can happen
95 # if, for instance, CONFIG_SHELL is bash and it inherits a
96 # broken ls alias from the environment. This has actually
97 # happened. Such a system could not be considered "sane".
98 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
99 alias in your environment])
102 test "[$]2" = conftestfile
108 AC_MSG_ERROR([newly created file is older than distributed files!
109 Check your system clock])
114 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
115 dnl The program must properly implement --version.
116 AC_DEFUN(AM_MISSING_PROG,
117 [AC_MSG_CHECKING(for working $2)
118 # Run test in a subshell; some versions of sh will print an error if
119 # an executable is not found, even if stderr is redirected.
120 # Redirect stdin to placate older versions of autoconf. Sigh.
121 if ($2 --version) < /dev/null > /dev/null 2>&1; then
126 AC_MSG_RESULT(missing)
132 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
133 AC_DEFUN(AM_PROG_LEX,
134 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
135 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
139 # Configure paths for GLIB
140 # Owen Taylor 97-11-3
142 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
143 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
144 dnl gthread is specified in MODULES, pass to glib-config
146 AC_DEFUN(AM_PATH_GLIB,
148 dnl Get the cflags and libraries from the glib-config script
150 AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
151 glib_config_prefix="$withval", glib_config_prefix="")
152 AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
153 glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
154 AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
155 , enable_glibtest=yes)
157 if test x$glib_config_exec_prefix != x ; then
158 glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
159 if test x${GLIB_CONFIG+set} != xset ; then
160 GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
163 if test x$glib_config_prefix != x ; then
164 glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
165 if test x${GLIB_CONFIG+set} != xset ; then
166 GLIB_CONFIG=$glib_config_prefix/bin/glib-config
174 glib_config_args="$glib_config_args gmodule"
177 glib_config_args="$glib_config_args gthread"
182 AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
183 min_glib_version=ifelse([$1], ,0.99.7,$1)
184 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
186 if test "$GLIB_CONFIG" = "no" ; then
189 GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
190 GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
191 glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
192 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
193 glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
194 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
195 glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
196 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
197 if test "x$enable_glibtest" = "xyes" ; then
198 ac_save_CFLAGS="$CFLAGS"
200 CFLAGS="$CFLAGS $GLIB_CFLAGS"
201 LIBS="$GLIB_LIBS $LIBS"
203 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
204 dnl checks the results of glib-config to some extent
215 int major, minor, micro;
218 system ("touch conf.glibtest");
220 /* HP/UX 9 (%@#!) writes to sscanf strings */
221 tmp_version = g_strdup("$min_glib_version");
222 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
223 printf("%s, bad version string\n", "$min_glib_version");
227 if ((glib_major_version != $glib_config_major_version) ||
228 (glib_minor_version != $glib_config_minor_version) ||
229 (glib_micro_version != $glib_config_micro_version))
231 printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
232 $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
233 glib_major_version, glib_minor_version, glib_micro_version);
234 printf ("*** was found! If glib-config was correct, then it is best\n");
235 printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
236 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
237 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
238 printf("*** required on your system.\n");
239 printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
240 printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
241 printf("*** before re-running configure\n");
243 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
244 (glib_minor_version != GLIB_MINOR_VERSION) ||
245 (glib_micro_version != GLIB_MICRO_VERSION))
247 printf("*** GLIB header files (version %d.%d.%d) do not match\n",
248 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
249 printf("*** library (version %d.%d.%d)\n",
250 glib_major_version, glib_minor_version, glib_micro_version);
254 if ((glib_major_version > major) ||
255 ((glib_major_version == major) && (glib_minor_version > minor)) ||
256 ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
262 printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
263 glib_major_version, glib_minor_version, glib_micro_version);
264 printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
265 major, minor, micro);
266 printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
268 printf("*** If you have already installed a sufficiently new version, this error\n");
269 printf("*** probably means that the wrong copy of the glib-config shell script is\n");
270 printf("*** being found. The easiest way to fix this is to remove the old version\n");
271 printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
272 printf("*** correct copy of glib-config. (In this case, you will have to\n");
273 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
274 printf("*** so that the correct libraries are found at run-time))\n");
279 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
280 CFLAGS="$ac_save_CFLAGS"
284 if test "x$no_glib" = x ; then
286 ifelse([$2], , :, [$2])
289 if test "$GLIB_CONFIG" = "no" ; then
290 echo "*** The glib-config script installed by GLIB could not be found"
291 echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
292 echo "*** your path, or set the GLIB_CONFIG environment variable to the"
293 echo "*** full path to glib-config."
295 if test -f conf.glibtest ; then
298 echo "*** Could not run GLIB test program, checking why..."
299 CFLAGS="$CFLAGS $GLIB_CFLAGS"
300 LIBS="$LIBS $GLIB_LIBS"
304 ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
305 [ echo "*** The test program compiled, but did not run. This usually means"
306 echo "*** that the run-time linker is not finding GLIB or finding the wrong"
307 echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
308 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
309 echo "*** to the installed location Also, make sure you have run ldconfig if that"
310 echo "*** is required on your system"
312 echo "*** If you have an old version installed, it is best to remove it, although"
313 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
315 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
316 echo "*** came with the system with the command"
318 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
319 [ echo "*** The test program failed to compile or link. See the file config.log for the"
320 echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
321 echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
322 echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
323 CFLAGS="$ac_save_CFLAGS"
329 ifelse([$3], , :, [$3])
331 AC_SUBST(GLIB_CFLAGS)
336 # Add --enable-maintainer-mode option to configure.
341 AC_DEFUN(AM_MAINTAINER_MODE,
342 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
343 dnl maintainer-mode is disabled by default
344 AC_ARG_ENABLE(maintainer-mode,
345 [ --enable-maintainer-mode enable make rules and dependencies not useful
346 (and sometimes confusing) to the casual installer],
347 USE_MAINTAINER_MODE=$enableval,
348 USE_MAINTAINER_MODE=no)
349 AC_MSG_RESULT($USE_MAINTAINER_MODE)
350 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
351 MAINT=$MAINTAINER_MODE_TRUE
356 # Define a conditional.
358 AC_DEFUN(AM_CONDITIONAL,