]> git.lyx.org Git - lyx.git/blob - boost/aclocal.m4
compilation fixes when using lyxstring
[lyx.git] / boost / aclocal.m4
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
14 dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
15 dnl if the cache file is inconsistent with the current host,
16 dnl target and build system types, execute CMD or print a default
17 dnl error message.
18 AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
19     AC_REQUIRE([AC_CANONICAL_SYSTEM])
20     AC_MSG_CHECKING([config.cache system type])
21     if { test x"${ac_cv_host_system_type+set}" = x"set" &&
22          test x"$ac_cv_host_system_type" != x"$host"; } ||
23        { test x"${ac_cv_build_system_type+set}" = x"set" &&
24          test x"$ac_cv_build_system_type" != x"$build"; } ||
25        { test x"${ac_cv_target_system_type+set}" = x"set" &&
26          test x"$ac_cv_target_system_type" != x"$target"; }; then
27         AC_MSG_RESULT([different])
28         ifelse($#, 1, [$1],
29                 [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
30     else
31         AC_MSG_RESULT([same])
32     fi
33     ac_cv_host_system_type="$host"
34     ac_cv_build_system_type="$build"
35     ac_cv_target_system_type="$target"
36 ])
37
38
39 # serial 40 AC_PROG_LIBTOOL
40 AC_DEFUN(AC_PROG_LIBTOOL,
41 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
42
43 # Save cache, so that ltconfig can load it
44 AC_CACHE_SAVE
45
46 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
47 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
48 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
49 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
50 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
51 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
52 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
53 || AC_MSG_ERROR([libtool configure failed])
54
55 # Reload cache, that may have been modified by ltconfig
56 AC_CACHE_LOAD
57
58 # This can be used to rebuild libtool when needed
59 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
60
61 # Always use our own libtool.
62 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
63 AC_SUBST(LIBTOOL)dnl
64
65 # Redirect the config.log output again, so that the ltconfig log is not
66 # clobbered by the next message.
67 exec 5>>./config.log
68 ])
69
70 AC_DEFUN(AC_LIBTOOL_SETUP,
71 [AC_PREREQ(2.13)dnl
72 AC_REQUIRE([AC_ENABLE_SHARED])dnl
73 AC_REQUIRE([AC_ENABLE_STATIC])dnl
74 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
75 AC_REQUIRE([AC_CANONICAL_HOST])dnl
76 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
77 AC_REQUIRE([AC_PROG_RANLIB])dnl
78 AC_REQUIRE([AC_PROG_CC])dnl
79 AC_REQUIRE([AC_PROG_LD])dnl
80 AC_REQUIRE([AC_PROG_NM])dnl
81 AC_REQUIRE([AC_PROG_LN_S])dnl
82 dnl
83
84 case "$target" in
85 NONE) lt_target="$host" ;;
86 *) lt_target="$target" ;;
87 esac
88
89 # Check for any special flags to pass to ltconfig.
90 libtool_flags="--cache-file=$cache_file"
91 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
92 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
93 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
94 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
95 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
96 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
97 [libtool_flags="$libtool_flags --enable-dlopen"])
98 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
99 [libtool_flags="$libtool_flags --enable-win32-dll"])
100 AC_ARG_ENABLE(libtool-lock,
101   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
102 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
103 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
104
105 # Some flags need to be propagated to the compiler or linker for good
106 # libtool support.
107 case "$lt_target" in
108 *-*-irix6*)
109   # Find out which ABI we are using.
110   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
111   if AC_TRY_EVAL(ac_compile); then
112     case "`/usr/bin/file conftest.o`" in
113     *32-bit*)
114       LD="${LD-ld} -32"
115       ;;
116     *N32*)
117       LD="${LD-ld} -n32"
118       ;;
119     *64-bit*)
120       LD="${LD-ld} -64"
121       ;;
122     esac
123   fi
124   rm -rf conftest*
125   ;;
126
127 *-*-sco3.2v5*)
128   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
129   SAVE_CFLAGS="$CFLAGS"
130   CFLAGS="$CFLAGS -belf"
131   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
132     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
133   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
134     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
135     CFLAGS="$SAVE_CFLAGS"
136   fi
137   ;;
138
139 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
140 [*-*-cygwin* | *-*-mingw*)
141   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
142   AC_CHECK_TOOL(AS, as, false)
143   AC_CHECK_TOOL(OBJDUMP, objdump, false)
144   ;;
145 ])
146 esac
147 ])
148
149 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
150 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
151
152 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
153 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
154
155 # AC_ENABLE_SHARED - implement the --enable-shared flag
156 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
157 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
158 #   `yes'.
159 AC_DEFUN(AC_ENABLE_SHARED, [dnl
160 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
161 AC_ARG_ENABLE(shared,
162 changequote(<<, >>)dnl
163 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
164 changequote([, ])dnl
165 [p=${PACKAGE-default}
166 case "$enableval" in
167 yes) enable_shared=yes ;;
168 no) enable_shared=no ;;
169 *)
170   enable_shared=no
171   # Look at the argument we got.  We use all the common list separators.
172   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
173   for pkg in $enableval; do
174     if test "X$pkg" = "X$p"; then
175       enable_shared=yes
176     fi
177   done
178   IFS="$ac_save_ifs"
179   ;;
180 esac],
181 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
182 ])
183
184 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
185 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
186 AC_ENABLE_SHARED(no)])
187
188 # AC_ENABLE_STATIC - implement the --enable-static flag
189 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
190 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
191 #   `yes'.
192 AC_DEFUN(AC_ENABLE_STATIC, [dnl
193 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
194 AC_ARG_ENABLE(static,
195 changequote(<<, >>)dnl
196 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
197 changequote([, ])dnl
198 [p=${PACKAGE-default}
199 case "$enableval" in
200 yes) enable_static=yes ;;
201 no) enable_static=no ;;
202 *)
203   enable_static=no
204   # Look at the argument we got.  We use all the common list separators.
205   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
206   for pkg in $enableval; do
207     if test "X$pkg" = "X$p"; then
208       enable_static=yes
209     fi
210   done
211   IFS="$ac_save_ifs"
212   ;;
213 esac],
214 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
215 ])
216
217 # AC_DISABLE_STATIC - set the default static flag to --disable-static
218 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
219 AC_ENABLE_STATIC(no)])
220
221
222 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
223 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
224 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
225 #   `yes'.
226 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
227 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
228 AC_ARG_ENABLE(fast-install,
229 changequote(<<, >>)dnl
230 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
231 changequote([, ])dnl
232 [p=${PACKAGE-default}
233 case "$enableval" in
234 yes) enable_fast_install=yes ;;
235 no) enable_fast_install=no ;;
236 *)
237   enable_fast_install=no
238   # Look at the argument we got.  We use all the common list separators.
239   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
240   for pkg in $enableval; do
241     if test "X$pkg" = "X$p"; then
242       enable_fast_install=yes
243     fi
244   done
245   IFS="$ac_save_ifs"
246   ;;
247 esac],
248 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
249 ])
250
251 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
252 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
253 AC_ENABLE_FAST_INSTALL(no)])
254
255 # AC_PROG_LD - find the path to the GNU or non-GNU linker
256 AC_DEFUN(AC_PROG_LD,
257 [AC_ARG_WITH(gnu-ld,
258 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
259 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
260 AC_REQUIRE([AC_PROG_CC])dnl
261 AC_REQUIRE([AC_CANONICAL_HOST])dnl
262 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
263 ac_prog=ld
264 if test "$ac_cv_prog_gcc" = yes; then
265   # Check if gcc -print-prog-name=ld gives a path.
266   AC_MSG_CHECKING([for ld used by GCC])
267   ac_prog=`($CC -print-prog-name=ld) 2>&5`
268   case "$ac_prog" in
269     # Accept absolute paths.
270 changequote(,)dnl
271     [\\/]* | [A-Za-z]:[\\/]*)
272       re_direlt='/[^/][^/]*/\.\./'
273 changequote([,])dnl
274       # Canonicalize the path of ld
275       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
276       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
277         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
278       done
279       test -z "$LD" && LD="$ac_prog"
280       ;;
281   "")
282     # If it fails, then pretend we aren't using GCC.
283     ac_prog=ld
284     ;;
285   *)
286     # If it is relative, then search for the first ld in PATH.
287     with_gnu_ld=unknown
288     ;;
289   esac
290 elif test "$with_gnu_ld" = yes; then
291   AC_MSG_CHECKING([for GNU ld])
292 else
293   AC_MSG_CHECKING([for non-GNU ld])
294 fi
295 AC_CACHE_VAL(ac_cv_path_LD,
296 [if test -z "$LD"; then
297   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
298   for ac_dir in $PATH; do
299     test -z "$ac_dir" && ac_dir=.
300     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
301       ac_cv_path_LD="$ac_dir/$ac_prog"
302       # Check to see if the program is GNU ld.  I'd rather use --version,
303       # but apparently some GNU ld's only accept -v.
304       # Break only if it was the GNU/non-GNU ld that we prefer.
305       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
306         test "$with_gnu_ld" != no && break
307       else
308         test "$with_gnu_ld" != yes && break
309       fi
310     fi
311   done
312   IFS="$ac_save_ifs"
313 else
314   ac_cv_path_LD="$LD" # Let the user override the test with a path.
315 fi])
316 LD="$ac_cv_path_LD"
317 if test -n "$LD"; then
318   AC_MSG_RESULT($LD)
319 else
320   AC_MSG_RESULT(no)
321 fi
322 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
323 AC_PROG_LD_GNU
324 ])
325
326 AC_DEFUN(AC_PROG_LD_GNU,
327 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
328 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
329 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
330   ac_cv_prog_gnu_ld=yes
331 else
332   ac_cv_prog_gnu_ld=no
333 fi])
334 ])
335
336 # AC_PROG_NM - find the path to a BSD-compatible name lister
337 AC_DEFUN(AC_PROG_NM,
338 [AC_MSG_CHECKING([for BSD-compatible nm])
339 AC_CACHE_VAL(ac_cv_path_NM,
340 [if test -n "$NM"; then
341   # Let the user override the test.
342   ac_cv_path_NM="$NM"
343 else
344   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
345   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
346     test -z "$ac_dir" && ac_dir=.
347     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
348       # Check to see if the nm accepts a BSD-compat flag.
349       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
350       #   nm: unknown option "B" ignored
351       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
352         ac_cv_path_NM="$ac_dir/nm -B"
353         break
354       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
355         ac_cv_path_NM="$ac_dir/nm -p"
356         break
357       else
358         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
359         continue # so that we can try to find one that supports BSD flags
360       fi
361     fi
362   done
363   IFS="$ac_save_ifs"
364   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
365 fi])
366 NM="$ac_cv_path_NM"
367 AC_MSG_RESULT([$NM])
368 ])
369
370 # AC_CHECK_LIBM - check for math library
371 AC_DEFUN(AC_CHECK_LIBM,
372 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
373 LIBM=
374 case "$lt_target" in
375 *-*-beos* | *-*-cygwin*)
376   # These system don't have libm
377   ;;
378 *-ncr-sysv4.3*)
379   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
380   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
381   ;;
382 *)
383   AC_CHECK_LIB(m, main, LIBM="-lm")
384   ;;
385 esac
386 ])
387
388 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
389 # the libltdl convenience library, adds --enable-ltdl-convenience to
390 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
391 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
392 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
393 # '${top_builddir}/' (note the single quotes!) if your package is not
394 # flat, and, if you're not using automake, define top_builddir as
395 # appropriate in the Makefiles.
396 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
397   case "$enable_ltdl_convenience" in
398   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
399   "") enable_ltdl_convenience=yes
400       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
401   esac
402   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
403   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
404 ])
405
406 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
407 # the libltdl installable library, and adds --enable-ltdl-install to
408 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
409 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
410 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
411 # '${top_builddir}/' (note the single quotes!) if your package is not
412 # flat, and, if you're not using automake, define top_builddir as
413 # appropriate in the Makefiles.
414 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
415 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
416   AC_CHECK_LIB(ltdl, main,
417   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
418   [if test x"$enable_ltdl_install" = xno; then
419      AC_MSG_WARN([libltdl not installed, but installation disabled])
420    else
421      enable_ltdl_install=yes
422    fi
423   ])
424   if test x"$enable_ltdl_install" = x"yes"; then
425     ac_configure_args="$ac_configure_args --enable-ltdl-install"
426     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
427     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
428   else
429     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
430     LIBLTDL="-lltdl"
431     INCLTDL=
432   fi
433 ])
434
435 dnl old names
436 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
437 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
438 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
439 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
440 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
441 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
442 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
443
444 dnl This is just to silence aclocal about the macro not being used
445 ifelse([AC_DISABLE_FAST_INSTALL])dnl
446
447 # Like AC_CONFIG_HEADER, but automatically create stamp file.
448
449 AC_DEFUN(AM_CONFIG_HEADER,
450 [AC_PREREQ([2.12])
451 AC_CONFIG_HEADER([$1])
452 dnl When config.status generates a header, we must update the stamp-h file.
453 dnl This file resides in the same directory as the config header
454 dnl that is generated.  We must strip everything past the first ":",
455 dnl and everything past the last "/".
456 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
457 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
458 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
459 <<am_indx=1
460 for am_file in <<$1>>; do
461   case " <<$>>CONFIG_HEADERS " in
462   *" <<$>>am_file "*<<)>>
463     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
464     ;;
465   esac
466   am_indx=`expr "<<$>>am_indx" + 1`
467 done<<>>dnl>>)
468 changequote([,]))])
469
470 # Do all the work for Automake.  This macro actually does too much --
471 # some checks are only needed if your package does certain things.
472 # But this isn't really a big deal.
473
474 # serial 1
475
476 dnl Usage:
477 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
478
479 AC_DEFUN(AM_INIT_AUTOMAKE,
480 [AC_REQUIRE([AC_PROG_INSTALL])
481 PACKAGE=[$1]
482 AC_SUBST(PACKAGE)
483 VERSION=[$2]
484 AC_SUBST(VERSION)
485 dnl test to see if srcdir already configured
486 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
487   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
488 fi
489 ifelse([$3],,
490 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
491 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
492 AC_REQUIRE([AM_SANITY_CHECK])
493 AC_REQUIRE([AC_ARG_PROGRAM])
494 dnl FIXME This is truly gross.
495 missing_dir=`cd $ac_aux_dir && pwd`
496 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
497 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
498 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
499 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
500 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
501 AC_REQUIRE([AC_PROG_MAKE_SET])])
502
503 #
504 # Check to make sure that the build environment is sane.
505 #
506
507 AC_DEFUN(AM_SANITY_CHECK,
508 [AC_MSG_CHECKING([whether build environment is sane])
509 # Just in case
510 sleep 1
511 echo timestamp > conftestfile
512 # Do `set' in a subshell so we don't clobber the current shell's
513 # arguments.  Must try -L first in case configure is actually a
514 # symlink; some systems play weird games with the mod time of symlinks
515 # (eg FreeBSD returns the mod time of the symlink's containing
516 # directory).
517 if (
518    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
519    if test "[$]*" = "X"; then
520       # -L didn't work.
521       set X `ls -t $srcdir/configure conftestfile`
522    fi
523    if test "[$]*" != "X $srcdir/configure conftestfile" \
524       && test "[$]*" != "X conftestfile $srcdir/configure"; then
525
526       # If neither matched, then we have a broken ls.  This can happen
527       # if, for instance, CONFIG_SHELL is bash and it inherits a
528       # broken ls alias from the environment.  This has actually
529       # happened.  Such a system could not be considered "sane".
530       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
531 alias in your environment])
532    fi
533
534    test "[$]2" = conftestfile
535    )
536 then
537    # Ok.
538    :
539 else
540    AC_MSG_ERROR([newly created file is older than distributed files!
541 Check your system clock])
542 fi
543 rm -f conftest*
544 AC_MSG_RESULT(yes)])
545
546 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
547 dnl The program must properly implement --version.
548 AC_DEFUN(AM_MISSING_PROG,
549 [AC_MSG_CHECKING(for working $2)
550 # Run test in a subshell; some versions of sh will print an error if
551 # an executable is not found, even if stderr is redirected.
552 # Redirect stdin to placate older versions of autoconf.  Sigh.
553 if ($2 --version) < /dev/null > /dev/null 2>&1; then
554    $1=$2
555    AC_MSG_RESULT(found)
556 else
557    $1="$3/missing $2"
558    AC_MSG_RESULT(missing)
559 fi
560 AC_SUBST($1)])
561