home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / System / Mesa-3.1 / aclocal.m4 < prev    next >
Text File  |  1999-10-07  |  20KB  |  622 lines

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