home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / gnu / tar.txt / tar-1.12 / aclocal.m4 < prev    next >
M4 Source File  |  1997-04-25  |  19KB  |  616 lines

  1. dnl aclocal.m4 generated automatically by aclocal 1.1n
  2.  
  3.  
  4. # Once this macro is called, you may output with no echo in a Makefile or
  5. # script using:  echo @ECHO_N@ "STRING_TO_OUTPUT@ECHO_C@".
  6.  
  7. AC_DEFUN(fp_PROG_ECHO,
  8. [AC_MSG_CHECKING(how to suppress newlines using echo)
  9. AC_CACHE_VAL(fp_cv_prog_echo_nonl,
  10. [if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  11.   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  12.     fp_cv_prog_echo_nonl=no
  13.   else
  14.     fp_cv_prog_echo_nonl=option
  15.   fi
  16. else
  17.   fp_cv_prog_echo_nonl=escape
  18. fi
  19. ])
  20. AC_MSG_RESULT($fp_cv_prog_echo_nonl)
  21. case $fp_cv_prog_echo_nonl in
  22.   no) ECHO_N= ECHO_C= ;;
  23.   option) ECHO_N=-n ECHO_C= ;;
  24.   escape) ECHO_N= ECHO_C='\c' ;;
  25. esac
  26. AC_SUBST(ECHO_N)dnl
  27. AC_SUBST(ECHO_C)dnl
  28. ])
  29.  
  30.  
  31. # In 1992, Michael Bushnell (now Thomas Bushnell <thomas@gnu.ai.mit.edu>)
  32. # devised a test for avoiding HP/UX malloc and using GNU malloc instead.
  33. # Bruno Haible <haible@ma2s2.mathematik.uni-karlsruhe.de> recycled this
  34. # test for CLISP Common LISP and extended it to cover broken mallocs from
  35. # Sun and SGI.  I (<pinard@iro.umontreal.ca>) reworked it a little so
  36. # it is independent of config.guess, and overridable by the installer.
  37.  
  38. # On IRIX 5.2, libc malloc is broken, but the -lmalloc one was usable.
  39. # So in my packages, I once unconditionally used -lmalloc if it existed.
  40. # This does not do anymore, because the -lmalloc malloc is broken on
  41. # Solaris 2.4 to 2.5.1 (alignment is 4 bytes instead of 8 bytes, as
  42. # reported by John Wells <john@bitsmart.com>).
  43.  
  44. # Bruno also notes: "HP-UX has two different malloc() implementations.
  45. # Both are broken.  When used with CLISP, the one in the default libc.a
  46. # leads to a SIGSEGV, the one in libmalloc.a leads to a SIGBUS.  The SunOS
  47. # 4.1.1 malloc() breaks when used by CLISP's generational GC.  The IRIX
  48. # 5.2 malloc() breaks when used by CLISP's generational GC."
  49.  
  50. # If the installer does not give a preference, we use the included GNU
  51. # malloc if we have the slightest doubt that malloc could be broken, this
  52. # includes cross compilation, and *all* HP/UX, SunOS or IRIX systems.
  53. # It is crude indeed, but I just do not have enough information for truly
  54. # benchmarking malloc in all cases, but want safe packages nevertheless.
  55.  
  56. AC_DEFUN(fp_WITH_INCLUDED_MALLOC,
  57. [AC_MSG_CHECKING(if included GNU malloc is wanted)
  58. AC_ARG_WITH(included-malloc,
  59. [  --with-included-malloc  use the GNU malloc which is included here], ,
  60. [if test $cross_compiling = yes; then
  61.   withval=yes
  62. else
  63.   case `uname -s 2> /dev/null` in
  64.     HP-UX | SunOS | IRIX* ) withval=yes ;;
  65.     *) withval=no ;;
  66.   esac
  67. fi])
  68. test "$withval" = yes && LIBOBJS="$LIBOBJS gmalloc.o"
  69. AC_MSG_RESULT($withval)
  70. ])
  71.  
  72.  
  73. # Search path for a program which passes the given test.
  74. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  75.  
  76. # serial 1
  77.  
  78. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  79. dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  80. AC_DEFUN(AM_PATH_PROG_WITH_TEST,
  81. [# Extract the first word of "$2", so it can be a program name with args.
  82. set dummy $2; ac_word=[$]2
  83. AC_MSG_CHECKING([for $ac_word])
  84. AC_CACHE_VAL(ac_cv_path_$1,
  85. [case "[$]$1" in
  86.   /*)
  87.   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  88.   ;;
  89.   *)
  90.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  91.   for ac_dir in ifelse([$5], , $PATH, [$5]); do
  92.     test -z "$ac_dir" && ac_dir=.
  93.     if test -f $ac_dir/$ac_word; then
  94.       if [$3]; then
  95.     ac_cv_path_$1="$ac_dir/$ac_word"
  96.     break
  97.       fi
  98.     fi
  99.   done
  100.   IFS="$ac_save_ifs"
  101. dnl If no 4th arg is given, leave the cache variable unset,
  102. dnl so AC_PATH_PROGS will keep looking.
  103. ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  104. ])dnl
  105.   ;;
  106. esac])dnl
  107. $1="$ac_cv_path_$1"
  108. if test -n "[$]$1"; then
  109.   AC_MSG_RESULT([$]$1)
  110. else
  111.   AC_MSG_RESULT(no)
  112. fi
  113. AC_SUBST($1)dnl
  114. ])
  115.  
  116. # Check whether LC_MESSAGES is available in <locale.h>.
  117. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  118.  
  119. # serial 1
  120.  
  121. AC_DEFUN(AM_LC_MESSAGES,
  122.   [if test $ac_cv_header_locale_h = yes; then
  123.     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  124.       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  125.        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  126.     if test $am_cv_val_LC_MESSAGES = yes; then
  127.       AC_DEFINE(HAVE_LC_MESSAGES)
  128.     fi
  129.   fi])
  130.  
  131. # Macro to add for using GNU gettext.
  132. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  133.  
  134. # serial 1
  135.  
  136. AC_DEFUN(AM_WITH_NLS,
  137.   [AC_MSG_CHECKING([whether NLS is requested])
  138.     dnl Default is enabled NLS
  139.     AC_ARG_ENABLE(nls,
  140.       [  --disable-nls           do not use Native Language Support],
  141.       USE_NLS=$enableval, USE_NLS=yes)
  142.     AC_MSG_RESULT($USE_NLS)
  143.     AC_SUBST(USE_NLS)
  144.  
  145.     USE_INCLUDED_LIBINTL=no
  146.  
  147.     dnl If we use NLS figure out what method
  148.     if test "$USE_NLS" = "yes"; then
  149.       AC_DEFINE(ENABLE_NLS)
  150.       AC_MSG_CHECKING([whether included gettext is requested])
  151.       AC_ARG_WITH(included-gettext,
  152.         [  --with-included-gettext use the GNU gettext library included here],
  153.         nls_cv_force_use_gnu_gettext=$withval,
  154.         nls_cv_force_use_gnu_gettext=no)
  155.       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
  156.  
  157.       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  158.       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  159.         dnl User does not insist on using GNU NLS library.  Figure out what
  160.         dnl to use.  If gettext or catgets are available (in this order) we
  161.         dnl use this.  Else we have to fall back to GNU NLS library.
  162.     dnl catgets is only used if permitted by option --with-catgets.
  163.     nls_cv_header_intl=
  164.     nls_cv_header_libgt=
  165.     CATOBJEXT=NONE
  166.  
  167.     AC_CHECK_HEADER(libintl.h,
  168.       [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
  169.         [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
  170.            gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
  171.  
  172.        if test "$gt_cv_func_gettext_libc" != "yes"; then
  173.          AC_CHECK_LIB(intl, bindtextdomain,
  174.            [AC_CACHE_CHECK([for gettext in libintl],
  175.          gt_cv_func_gettext_libintl,
  176.          [AC_TRY_LINK([], [return (int) gettext ("")],
  177.          gt_cv_func_gettext_libintl=yes,
  178.          gt_cv_func_gettext_libintl=no)])])
  179.        fi
  180.  
  181.        if test "$gt_cv_func_gettext_libc" = "yes" \
  182.           || test "$gt_cv_func_gettext_libintl" = "yes"; then
  183.           AC_DEFINE(HAVE_GETTEXT)
  184.           AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  185.         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
  186.           if test "$MSGFMT" != "no"; then
  187.         AC_CHECK_FUNCS(dcgettext)
  188.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  189.         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  190.           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  191.         AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
  192.                    return _nl_msg_cat_cntr],
  193.           [CATOBJEXT=.gmo
  194.            DATADIRNAME=share],
  195.           [CATOBJEXT=.mo
  196.            DATADIRNAME=lib])
  197.         INSTOBJEXT=.mo
  198.           fi
  199.         fi
  200.     ])
  201.  
  202.         if test "$CATOBJEXT" = "NONE"; then
  203.       AC_MSG_CHECKING([whether catgets can be used])
  204.       AC_ARG_WITH(catgets,
  205.         [  --with-catgets          use catgets functions if available],
  206.         nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
  207.       AC_MSG_RESULT($nls_cv_use_catgets)
  208.  
  209.       if test "$nls_cv_use_catgets" = "yes"; then
  210.         dnl No gettext in C library.  Try catgets next.
  211.         AC_CHECK_LIB(i, main)
  212.         AC_CHECK_FUNC(catgets,
  213.           [AC_DEFINE(HAVE_CATGETS)
  214.            INTLOBJS="\$(CATOBJS)"
  215.            AC_PATH_PROG(GENCAT, gencat, no)dnl
  216.            if test "$GENCAT" != "no"; then
  217.          AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
  218.          if test "$GMSGFMT" = "no"; then
  219.            AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
  220.             [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
  221.          fi
  222.          AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  223.            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  224.          USE_INCLUDED_LIBINTL=yes
  225.          CATOBJEXT=.cat
  226.          INSTOBJEXT=.cat
  227.          DATADIRNAME=lib
  228.          INTLDEPS="../intl/libintl.a"
  229.          INTLLIBS=$INTLDEPS
  230.          LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  231.          nls_cv_header_intl=intl/libintl.h
  232.          nls_cv_header_libgt=intl/libgettext.h
  233.            fi])
  234.       fi
  235.         fi
  236.  
  237.         if test "$CATOBJEXT" = "NONE"; then
  238.       dnl Neither gettext nor catgets in included in the C library.
  239.       dnl Fall back on GNU gettext library.
  240.       nls_cv_use_gnu_gettext=yes
  241.         fi
  242.       fi
  243.  
  244.       if test "$nls_cv_use_gnu_gettext" = "yes"; then
  245.         dnl Mark actions used to generate GNU NLS library.
  246.         INTLOBJS="\$(GETTOBJS)"
  247.         AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  248.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
  249.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  250.         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  251.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  252.         AC_SUBST(MSGFMT)
  253.     USE_INCLUDED_LIBINTL=yes
  254.         CATOBJEXT=.gmo
  255.         INSTOBJEXT=.mo
  256.         DATADIRNAME=share
  257.     INTLDEPS="../intl/libintl.a"
  258.     INTLLIBS=$INTLDEPS
  259.     LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  260.         nls_cv_header_intl=intl/libintl.h
  261.         nls_cv_header_libgt=intl/libgettext.h
  262.       fi
  263.  
  264.       dnl Test whether we really found GNU xgettext.
  265.       if test "$XGETTEXT" != ":"; then
  266.     dnl If it is no GNU xgettext we define it as : so that the
  267.     dnl Makefiles still can work.
  268.     if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  269.       : ;
  270.     else
  271.       AC_MSG_RESULT(
  272.         [found xgettext programs is not GNU xgettext; ignore it])
  273.       XGETTEXT=":"
  274.     fi
  275.       fi
  276.  
  277.       # We need to process the po/ directory.
  278.       POSUB=po
  279.     else
  280.       DATADIRNAME=share
  281.       nls_cv_header_intl=intl/libintl.h
  282.       nls_cv_header_libgt=intl/libgettext.h
  283.     fi
  284.  
  285.     # If this is used in GNU gettext we have to set USE_NLS to `yes'
  286.     # because some of the sources are only built for this goal.
  287.     if test "$PACKAGE" = gettext; then
  288.       USE_NLS=yes
  289.       USE_INCLUDED_LIBINTL=yes
  290.     fi
  291.  
  292.     dnl These rules are solely for the distribution goal.  While doing this
  293.     dnl we only have to keep exactly one list of the available catalogs
  294.     dnl in configure.in.
  295.     for lang in $ALL_LINGUAS; do
  296.       GMOFILES="$GMOFILES $lang.gmo"
  297.       POFILES="$POFILES $lang.po"
  298.     done
  299.  
  300.     dnl Make all variables we use known to autoconf.
  301.     AC_SUBST(USE_INCLUDED_LIBINTL)
  302.     AC_SUBST(CATALOGS)
  303.     AC_SUBST(CATOBJEXT)
  304.     AC_SUBST(DATADIRNAME)
  305.     AC_SUBST(GMOFILES)
  306.     AC_SUBST(INSTOBJEXT)
  307.     AC_SUBST(INTLDEPS)
  308.     AC_SUBST(INTLLIBS)
  309.     AC_SUBST(INTLOBJS)
  310.     AC_SUBST(POFILES)
  311.     AC_SUBST(POSUB)
  312.   ])
  313.  
  314. AC_DEFUN(AM_GNU_GETTEXT,
  315.   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  316.    AC_REQUIRE([AC_PROG_CC])dnl
  317.    AC_REQUIRE([AC_ISC_POSIX])dnl
  318.    AC_REQUIRE([AC_PROG_RANLIB])dnl
  319.    AC_REQUIRE([AC_HEADER_STDC])dnl
  320.    AC_REQUIRE([AC_C_CONST])dnl
  321.    AC_REQUIRE([AC_C_INLINE])dnl
  322.    AC_REQUIRE([AC_TYPE_OFF_T])dnl
  323.    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  324.    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  325.    AC_REQUIRE([AC_FUNC_MMAP])dnl
  326.  
  327.    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
  328. unistd.h values.h])
  329.    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
  330. __argz_count __argz_stringify __argz_next])
  331.  
  332.    if test "${ac_cv_func_stpcpy+set}" != "set"; then
  333.      AC_CHECK_FUNCS(stpcpy)
  334.    fi
  335.    if test "${ac_cv_func_stpcpy}" = "yes"; then
  336.      AC_DEFINE(HAVE_STPCPY)
  337.    fi
  338.  
  339.    AM_LC_MESSAGES
  340.    AM_WITH_NLS
  341.  
  342.    if test "x$CATOBJEXT" != "x"; then
  343.      if test "x$ALL_LINGUAS" = "x"; then
  344.        LINGUAS=
  345.      else
  346.        AC_MSG_CHECKING(for catalogs to be installed)
  347.        NEW_LINGUAS=
  348.        for lang in ${LINGUAS=$ALL_LINGUAS}; do
  349.          case "$ALL_LINGUAS" in
  350.           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  351.          esac
  352.        done
  353.        LINGUAS=$NEW_LINGUAS
  354.        AC_MSG_RESULT($LINGUAS)
  355.      fi
  356.  
  357.      dnl Construct list of names of catalog files to be constructed.
  358.      if test -n "$LINGUAS"; then
  359.        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  360.      fi
  361.    fi
  362.  
  363.    dnl Determine which catalog format we have (if any is needed)
  364.    dnl For now we know about two different formats:
  365.    dnl   Linux libc-5 and the normal X/Open format
  366.    test -d intl || mkdir intl
  367.    if test "$CATOBJEXT" = ".cat"; then
  368.      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
  369.  
  370.      dnl Transform the SED scripts while copying because some dumb SEDs
  371.      dnl cannot handle comments.
  372.      sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
  373.    fi
  374.    dnl po2tbl.sed is always needed.
  375.    sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
  376.      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
  377.  
  378.    dnl In the intl/Makefile.in we have a special dependency which makes
  379.    dnl only sense for gettext.  We comment this out for non-gettext
  380.    dnl packages.
  381.    if test "$PACKAGE" = "gettext"; then
  382.      GT_NO="#NO#"
  383.      GT_YES=
  384.    else
  385.      GT_NO=
  386.      GT_YES="#YES#"
  387.    fi
  388.    AC_SUBST(GT_NO)
  389.    AC_SUBST(GT_YES)
  390.  
  391.    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
  392.    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
  393.    dnl Try to locate is.
  394.    MKINSTALLDIRS=
  395.    if test $ac_aux_dir; then
  396.      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
  397.    fi
  398.    if test -z $MKINSTALLDIRS; then
  399.      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
  400.    fi
  401.    AC_SUBST(MKINSTALLDIRS)
  402.  
  403.    dnl Generate list of files to be processed by xgettext which will
  404.    dnl be included in po/Makefile.
  405.    test -d po || mkdir po
  406.    if test "x$srcdir" != "x."; then
  407.      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
  408.        posrcprefix="$srcdir/"
  409.      else
  410.        posrcprefix="../$srcdir/"
  411.      fi
  412.    else
  413.      posrcprefix="../"
  414.    fi
  415.    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,    $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
  416.     < $srcdir/po/POTFILES.in > po/POTFILES
  417.   ])
  418.  
  419. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  420.  
  421. AC_DEFUN(AM_CONFIG_HEADER,
  422. [AC_PREREQ([2.12])
  423. AC_CONFIG_HEADER([$1])
  424. dnl When config.status generates a header, we must update the stamp-h file.
  425. dnl This file resides in the same directory as the config header
  426. dnl that is generated.  We must strip everything past the first ":",
  427. dnl and everything past the last "/".
  428. AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  429. test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl
  430. changequote([,]))])
  431.  
  432. # Do all the work for Automake.  This macro actually does too much --
  433. # some checks are only needed if your package does certain things.
  434. # But this isn't really a big deal.
  435.  
  436. # serial 1
  437.  
  438. dnl Usage:
  439. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  440.  
  441. AC_DEFUN(AM_INIT_AUTOMAKE,
  442. [AC_REQUIRE([AM_PROG_INSTALL])
  443. PACKAGE=[$1]
  444. AC_SUBST(PACKAGE)
  445. VERSION=[$2]
  446. AC_SUBST(VERSION)
  447. ifelse([$3],,
  448. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  449. AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
  450. AM_SANITY_CHECK
  451. AC_ARG_PROGRAM
  452. dnl FIXME This is truly gross.
  453. missing_dir=`cd $ac_aux_dir && pwd`
  454. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  455. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  456. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  457. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  458. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  459. AC_PROG_MAKE_SET])
  460.  
  461.  
  462. # serial 1
  463.  
  464. AC_DEFUN(AM_PROG_INSTALL,
  465. [AC_REQUIRE([AC_PROG_INSTALL])
  466. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
  467. AC_SUBST(INSTALL_SCRIPT)dnl
  468. ])
  469.  
  470. #
  471. # Check to make sure that the build environment is sane.
  472. #
  473.  
  474. AC_DEFUN(AM_SANITY_CHECK,
  475. [AC_MSG_CHECKING([whether build environment is sane])
  476. # Just in case
  477. sleep 1
  478. echo timestamp > conftestfile
  479. # Do `set' in a subshell so we don't clobber the current shell's
  480. # arguments.  Must try -L first in case configure is actually a
  481. # symlink; some systems play weird games with the mod time of symlinks
  482. # (eg FreeBSD returns the mod time of the symlink's containing
  483. # directory).
  484. if (
  485.    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  486.    if test "$@" = "X"; then
  487.       # -L didn't work.
  488.       set X `ls -t $srcdir/configure conftestfile`
  489.    fi
  490.    test "[$]2" = conftestfile
  491.    )
  492. then
  493.    # Ok.
  494.    :
  495. else
  496.    AC_MSG_ERROR([newly created file is older than distributed files!
  497. Check your system clock])
  498. fi
  499. rm -f conftest*
  500. AC_MSG_RESULT(yes)])
  501.  
  502. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  503. dnl The program must properly implement --version.
  504. AC_DEFUN(AM_MISSING_PROG,
  505. [AC_MSG_CHECKING(for working $2)
  506. # Run test in a subshell; some versions of sh will print an error if
  507. # an executable is not found, even if stderr is redirected.
  508. if ($2 --version) > /dev/null 2>&1; then
  509.    $1=$2
  510.    AC_MSG_RESULT(found)
  511. else
  512.    $1="$3/missing $2"
  513.    AC_MSG_RESULT(missing)
  514. fi
  515. AC_SUBST($1)])
  516.  
  517.  
  518. # serial 1
  519.  
  520. AC_DEFUN(AM_C_PROTOTYPES,
  521. [AC_REQUIRE([AM_PROG_CC_STDC])
  522. AC_MSG_CHECKING([for function prototypes])
  523. if test "$am_cv_prog_cc_stdc" != no; then
  524.   AC_MSG_RESULT(yes)
  525.   AC_DEFINE(PROTOTYPES)
  526.   U= ANSI2KNR=
  527. else
  528.   AC_MSG_RESULT(no)
  529.   U=_ ANSI2KNR=./ansi2knr
  530.   # Ensure some checks needed by ansi2knr itself.
  531.   AC_HEADER_STDC
  532.   AC_CHECK_HEADERS(string.h)
  533. fi
  534. AC_SUBST(U)dnl
  535. AC_SUBST(ANSI2KNR)dnl
  536. ])
  537.  
  538.  
  539. # serial 1
  540.  
  541. # @defmac AC_PROG_CC_STDC
  542. # @maindex PROG_CC_STDC
  543. # @ovindex CC
  544. # If the C compiler in not in ANSI C mode by default, try to add an option
  545. # to output variable @code{CC} to make it so.  This macro tries various
  546. # options that select ANSI C on some system or another.  It considers the
  547. # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
  548. # handles function prototypes correctly.
  549. #
  550. # If you use this macro, you should check after calling it whether the C
  551. # compiler has been set to accept ANSI C; if not, the shell variable
  552. # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  553. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  554. # program @code{ansi2knr}, which comes with Ghostscript.
  555. # @end defmac
  556.  
  557. AC_DEFUN(AM_PROG_CC_STDC,
  558. [AC_REQUIRE([AC_PROG_CC])
  559. AC_BEFORE([$0], [AC_C_INLINE])
  560. AC_BEFORE([$0], [AC_C_CONST])
  561. AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  562. AC_CACHE_VAL(am_cv_prog_cc_stdc,
  563. [am_cv_prog_cc_stdc=no
  564. ac_save_CC="$CC"
  565. # Don't try gcc -ansi; that turns off useful extensions and
  566. # breaks some systems' header files.
  567. # AIX            -qlanglvl=ansi
  568. # Ultrix and OSF/1    -std1
  569. # HP-UX            -Aa -D_HPUX_SOURCE
  570. # SVR4            -Xc -D__EXTENSIONS__
  571. for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  572. do
  573.   CC="$ac_save_CC $ac_arg"
  574.   AC_TRY_COMPILE(
  575. [#if !defined(__STDC__) || __STDC__ != 1
  576. choke me
  577. #endif
  578. /* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
  579. #ifdef _SEQUENT_
  580. # include <sys/types.h>
  581. # include <sys/stat.h>
  582. #endif
  583. ], [
  584. int test (int i, double x);
  585. struct s1 {int (*f) (int a);};
  586. struct s2 {int (*f) (double a);};],
  587. [am_cv_prog_cc_stdc="$ac_arg"; break])
  588. done
  589. CC="$ac_save_CC"
  590. ])
  591. AC_MSG_RESULT($am_cv_prog_cc_stdc)
  592. case "x$am_cv_prog_cc_stdc" in
  593.   x|xno) ;;
  594.   *) CC="$CC $am_cv_prog_cc_stdc" ;;
  595. esac
  596. ])
  597.  
  598.  
  599. # serial 1
  600.  
  601. AC_DEFUN(AM_WITH_DMALLOC,
  602. [AC_MSG_CHECKING(if malloc debugging is wanted)
  603. AC_ARG_WITH(dmalloc,
  604. [  --with-dmalloc          use dmalloc, as in
  605.                           ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
  606. [if test "$withval" = yes; then
  607.   AC_MSG_RESULT(yes)
  608.   AC_DEFINE(WITH_DMALLOC)
  609.   LIBS="$LIBS -ldmalloc"
  610.   LDFLAGS="$LDFLAGS -g"
  611. else
  612.   AC_MSG_RESULT(no)
  613. fi], [AC_MSG_RESULT(no)])
  614. ])
  615.  
  616.