home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / OS2 / gnuinfo.zip / aclocal.m4 < prev    next >
Text File  |  1997-07-31  |  14KB  |  465 lines

  1. dnl aclocal.m4 generated automatically by aclocal 1.2
  2.  
  3. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  4.  
  5. AC_DEFUN(AM_CONFIG_HEADER,
  6. [AC_PREREQ([2.12])
  7. AC_CONFIG_HEADER([$1])
  8. dnl When config.status generates a header, we must update the stamp-h file.
  9. dnl This file resides in the same directory as the config header
  10. dnl that is generated.  We must strip everything past the first ":",
  11. dnl and everything past the last "/".
  12. AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  13. ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
  14. <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
  15. <<am_indx=1
  16. for am_file in <<$1>>; do
  17.   case " <<$>>CONFIG_HEADERS " in
  18.   *" <<$>>am_file "*<<)>>
  19.     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
  20.     ;;
  21.   esac
  22.   am_indx=`expr "<<$>>am_indx" + 1`
  23. done<<>>dnl>>)
  24. changequote([,]))])
  25.  
  26. # Do all the work for Automake.  This macro actually does too much --
  27. # some checks are only needed if your package does certain things.
  28. # But this isn't really a big deal.
  29.  
  30. # serial 1
  31.  
  32. dnl Usage:
  33. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  34.  
  35. AC_DEFUN(AM_INIT_AUTOMAKE,
  36. [AC_REQUIRE([AM_PROG_INSTALL])
  37. PACKAGE=[$1]
  38. AC_SUBST(PACKAGE)
  39. VERSION=[$2]
  40. AC_SUBST(VERSION)
  41. dnl test to see if srcdir already configured
  42. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  43.   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  44. fi
  45. ifelse([$3],,
  46. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
  47. AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
  48. AM_SANITY_CHECK
  49. AC_ARG_PROGRAM
  50. dnl FIXME This is truly gross.
  51. missing_dir=`cd $ac_aux_dir && pwd`
  52. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  53. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  54. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  55. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  56. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  57. AC_PROG_MAKE_SET])
  58.  
  59.  
  60. # serial 1
  61.  
  62. AC_DEFUN(AM_PROG_INSTALL,
  63. [AC_REQUIRE([AC_PROG_INSTALL])
  64. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
  65. AC_SUBST(INSTALL_SCRIPT)dnl
  66. ])
  67.  
  68. #
  69. # Check to make sure that the build environment is sane.
  70. #
  71.  
  72. AC_DEFUN(AM_SANITY_CHECK,
  73. [AC_MSG_CHECKING([whether build environment is sane])
  74. # Just in case
  75. sleep 1
  76. echo timestamp > conftestfile
  77. # Do `set' in a subshell so we don't clobber the current shell's
  78. # arguments.  Must try -L first in case configure is actually a
  79. # symlink; some systems play weird games with the mod time of symlinks
  80. # (eg FreeBSD returns the mod time of the symlink's containing
  81. # directory).
  82. if (
  83.    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  84.    if test "$@" = "X"; then
  85.       # -L didn't work.
  86.       set X `ls -t $srcdir/configure conftestfile`
  87.    fi
  88.    test "[$]2" = conftestfile
  89.    )
  90. then
  91.    # Ok.
  92.    :
  93. else
  94.    AC_MSG_ERROR([newly created file is older than distributed files!
  95. Check your system clock])
  96. fi
  97. rm -f conftest*
  98. AC_MSG_RESULT(yes)])
  99.  
  100. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  101. dnl The program must properly implement --version.
  102. AC_DEFUN(AM_MISSING_PROG,
  103. [AC_MSG_CHECKING(for working $2)
  104. # Run test in a subshell; some versions of sh will print an error if
  105. # an executable is not found, even if stderr is redirected.
  106. # Redirect stdin to placate older versions of autoconf.  Sigh.
  107. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  108.    $1=$2
  109.    AC_MSG_RESULT(found)
  110. else
  111.    $1="$3/missing $2"
  112.    AC_MSG_RESULT(missing)
  113. fi
  114. AC_SUBST($1)])
  115.  
  116. # Macro to add for using GNU gettext.
  117. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  118.  
  119. # serial 2
  120.  
  121. AC_DEFUN(AM_WITH_NLS,
  122.   [AC_MSG_CHECKING([whether NLS is requested])
  123.     dnl Default is enabled NLS
  124.     AC_ARG_ENABLE(nls,
  125.       [  --disable-nls           do not use Native Language Support],
  126.       USE_NLS=$enableval, USE_NLS=yes)
  127.     AC_MSG_RESULT($USE_NLS)
  128.     AC_SUBST(USE_NLS)
  129.  
  130.     USE_INCLUDED_LIBINTL=no
  131.  
  132.     dnl If we use NLS figure out what method
  133.     if test "$USE_NLS" = "yes"; then
  134.       AC_DEFINE(ENABLE_NLS)
  135.       AC_MSG_CHECKING([whether included gettext is requested])
  136.       AC_ARG_WITH(included-gettext,
  137.         [  --with-included-gettext use the GNU gettext library included here],
  138.         nls_cv_force_use_gnu_gettext=$withval,
  139.         nls_cv_force_use_gnu_gettext=no)
  140.       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
  141.  
  142.       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  143.       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  144.         dnl User does not insist on using GNU NLS library.  Figure out what
  145.         dnl to use.  If gettext or catgets are available (in this order) we
  146.         dnl use this.  Else we have to fall back to GNU NLS library.
  147.     dnl catgets is only used if permitted by option --with-catgets.
  148.     nls_cv_header_intl=
  149.     nls_cv_header_libgt=
  150.     CATOBJEXT=NONE
  151.  
  152.     AC_CHECK_HEADER(libintl.h,
  153.       [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
  154.         [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
  155.            gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
  156.  
  157.        if test "$gt_cv_func_gettext_libc" != "yes"; then
  158.          AC_CHECK_LIB(intl, bindtextdomain,
  159.            [AC_CACHE_CHECK([for gettext in libintl],
  160.          gt_cv_func_gettext_libintl,
  161.          [AC_TRY_LINK([], [return (int) gettext ("")],
  162.          gt_cv_func_gettext_libintl=yes,
  163.          gt_cv_func_gettext_libintl=no)])])
  164.        fi
  165.  
  166.        if test "$gt_cv_func_gettext_libc" = "yes" \
  167.           || test "$gt_cv_func_gettext_libintl" = "yes"; then
  168.           AC_DEFINE(HAVE_GETTEXT)
  169.           AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  170.         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
  171.           if test "$MSGFMT" != "no"; then
  172.         AC_CHECK_FUNCS(dcgettext)
  173.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  174.         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  175.           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  176.         AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
  177.                    return _nl_msg_cat_cntr],
  178.           [CATOBJEXT=.gmo
  179.            DATADIRNAME=share],
  180.           [CATOBJEXT=.mo
  181.            DATADIRNAME=lib])
  182.         INSTOBJEXT=.mo
  183.           fi
  184.         fi
  185.     ])
  186.  
  187.         if test "$CATOBJEXT" = "NONE"; then
  188.       AC_MSG_CHECKING([whether catgets can be used])
  189.       AC_ARG_WITH(catgets,
  190.         [  --with-catgets          use catgets functions if available],
  191.         nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
  192.       AC_MSG_RESULT($nls_cv_use_catgets)
  193.  
  194.       if test "$nls_cv_use_catgets" = "yes"; then
  195.         dnl No gettext in C library.  Try catgets next.
  196.         AC_CHECK_LIB(i, main)
  197.         AC_CHECK_FUNC(catgets,
  198.           [AC_DEFINE(HAVE_CATGETS)
  199.            INTLOBJS="\$(CATOBJS)"
  200.            AC_PATH_PROG(GENCAT, gencat, no)dnl
  201.            if test "$GENCAT" != "no"; then
  202.          AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
  203.          if test "$GMSGFMT" = "no"; then
  204.            AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
  205.             [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
  206.          fi
  207.          AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  208.            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  209.          USE_INCLUDED_LIBINTL=yes
  210.          CATOBJEXT=.cat
  211.          INSTOBJEXT=.cat
  212.          DATADIRNAME=lib
  213.          INTLDEPS="../intl/libintl.a"
  214.          INTLLIBS=$INTLDEPS
  215.          LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  216.          nls_cv_header_intl=intl/libintl.h
  217.          nls_cv_header_libgt=intl/libgettext.h
  218.            fi])
  219.       fi
  220.         fi
  221.  
  222.         if test "$CATOBJEXT" = "NONE"; then
  223.       dnl Neither gettext nor catgets in included in the C library.
  224.       dnl Fall back on GNU gettext library.
  225.       nls_cv_use_gnu_gettext=yes
  226.         fi
  227.       fi
  228.  
  229.       if test "$nls_cv_use_gnu_gettext" = "yes"; then
  230.         dnl Mark actions used to generate GNU NLS library.
  231.         INTLOBJS="\$(GETTOBJS)"
  232.         AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  233.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
  234.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  235.         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  236.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  237.         AC_SUBST(MSGFMT)
  238.     USE_INCLUDED_LIBINTL=yes
  239.         CATOBJEXT=.gmo
  240.         INSTOBJEXT=.mo
  241.         DATADIRNAME=share
  242.     INTLDEPS="../intl/libintl.a"
  243.     INTLLIBS=$INTLDEPS
  244.     LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  245.         nls_cv_header_intl=intl/libintl.h
  246.         nls_cv_header_libgt=intl/libgettext.h
  247.       fi
  248.  
  249.       dnl Test whether we really found GNU xgettext.
  250.       if test "$XGETTEXT" != ":"; then
  251.     dnl If it is no GNU xgettext we define it as : so that the
  252.     dnl Makefiles still can work.
  253.     if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  254.       : ;
  255.     else
  256.       AC_MSG_RESULT(
  257.         [found xgettext programs is not GNU xgettext; ignore it])
  258.       XGETTEXT=":"
  259.     fi
  260.       fi
  261.  
  262.       # We need to process the po/ directory.
  263.       POSUB=po
  264.     else
  265.       DATADIRNAME=share
  266.       nls_cv_header_intl=intl/libintl.h
  267.       nls_cv_header_libgt=intl/libgettext.h
  268.     fi
  269.  
  270.     # If this is used in GNU gettext we have to set USE_NLS to `yes'
  271.     # because some of the sources are only built for this goal.
  272.     if test "$PACKAGE" = gettext; then
  273.       USE_NLS=yes
  274.       USE_INCLUDED_LIBINTL=yes
  275.     fi
  276.  
  277.     dnl These rules are solely for the distribution goal.  While doing this
  278.     dnl we only have to keep exactly one list of the available catalogs
  279.     dnl in configure.in.
  280.     for lang in $ALL_LINGUAS; do
  281.       GMOFILES="$GMOFILES $lang.gmo"
  282.       POFILES="$POFILES $lang.po"
  283.     done
  284.  
  285.     dnl Make all variables we use known to autoconf.
  286.     AC_SUBST(USE_INCLUDED_LIBINTL)
  287.     AC_SUBST(CATALOGS)
  288.     AC_SUBST(CATOBJEXT)
  289.     AC_SUBST(DATADIRNAME)
  290.     AC_SUBST(GMOFILES)
  291.     AC_SUBST(INSTOBJEXT)
  292.     AC_SUBST(INTLDEPS)
  293.     AC_SUBST(INTLLIBS)
  294.     AC_SUBST(INTLOBJS)
  295.     AC_SUBST(POFILES)
  296.     AC_SUBST(POSUB)
  297.   ])
  298.  
  299. AC_DEFUN(AM_GNU_GETTEXT,
  300.   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  301.    AC_REQUIRE([AC_PROG_CC])dnl
  302.    AC_REQUIRE([AC_ISC_POSIX])dnl
  303.    AC_REQUIRE([AC_HEADER_STDC])dnl
  304.    AC_REQUIRE([AC_C_CONST])dnl
  305.    AC_REQUIRE([AC_C_INLINE])dnl
  306.    AC_REQUIRE([AC_TYPE_OFF_T])dnl
  307.    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  308.    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  309.    AC_REQUIRE([AC_FUNC_MMAP])dnl
  310.  
  311.    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
  312. unistd.h values.h])
  313.    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
  314. __argz_count __argz_stringify __argz_next])
  315.  
  316.    if test "${ac_cv_func_stpcpy+set}" != "set"; then
  317.      AC_CHECK_FUNCS(stpcpy)
  318.    fi
  319.    if test "${ac_cv_func_stpcpy}" = "yes"; then
  320.      AC_DEFINE(HAVE_STPCPY)
  321.    fi
  322.  
  323.    AM_LC_MESSAGES
  324.    AM_WITH_NLS
  325.  
  326.    if test "x$CATOBJEXT" != "x"; then
  327.      if test "x$ALL_LINGUAS" = "x"; then
  328.        LINGUAS=
  329.      else
  330.        AC_MSG_CHECKING(for catalogs to be installed)
  331.        NEW_LINGUAS=
  332.        for lang in ${LINGUAS=$ALL_LINGUAS}; do
  333.          case "$ALL_LINGUAS" in
  334.           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  335.          esac
  336.        done
  337.        LINGUAS=$NEW_LINGUAS
  338.        AC_MSG_RESULT($LINGUAS)
  339.      fi
  340.  
  341.      dnl Construct list of names of catalog files to be constructed.
  342.      if test -n "$LINGUAS"; then
  343.        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  344.      fi
  345.    fi
  346.  
  347.    dnl Determine which catalog format we have (if any is needed)
  348.    dnl For now we know about two different formats:
  349.    dnl   Linux libc-5 and the normal X/Open format
  350.    test -d intl || mkdir intl
  351.    if test "$CATOBJEXT" = ".cat"; then
  352.      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
  353.  
  354.      dnl Transform the SED scripts while copying because some dumb SEDs
  355.      dnl cannot handle comments.
  356.      sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
  357.    fi
  358.    dnl po2tbl.sed is always needed.
  359.    sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
  360.      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
  361.  
  362.    dnl In the intl/Makefile.in we have a special dependency which makes
  363.    dnl only sense for gettext.  We comment this out for non-gettext
  364.    dnl packages.
  365.    if test "$PACKAGE" = "gettext"; then
  366.      GT_NO="#NO#"
  367.      GT_YES=
  368.    else
  369.      GT_NO=
  370.      GT_YES="#YES#"
  371.    fi
  372.    AC_SUBST(GT_NO)
  373.    AC_SUBST(GT_YES)
  374.  
  375.    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
  376.    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
  377.    dnl Try to locate is.
  378.    MKINSTALLDIRS=
  379.    if test $ac_aux_dir; then
  380.      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
  381.    fi
  382.    if test -z $MKINSTALLDIRS; then
  383.      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
  384.    fi
  385.    AC_SUBST(MKINSTALLDIRS)
  386.  
  387.    dnl *** For now the libtool support in intl/Makefile is not for real.
  388.    l=
  389.    AC_SUBST(l)
  390.  
  391.    dnl Generate list of files to be processed by xgettext which will
  392.    dnl be included in po/Makefile.
  393.    test -d po || mkdir po
  394.    if test "x$srcdir" != "x."; then
  395.      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
  396.        posrcprefix="$srcdir/"
  397.      else
  398.        posrcprefix="../$srcdir/"
  399.      fi
  400.    else
  401.      posrcprefix="../"
  402.    fi
  403.    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,    $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
  404.     < $srcdir/po/POTFILES.in > po/POTFILES
  405.   ])
  406.  
  407. # Search path for a program which passes the given test.
  408. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  409.  
  410. # serial 1
  411.  
  412. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  413. dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  414. AC_DEFUN(AM_PATH_PROG_WITH_TEST,
  415. [# Extract the first word of "$2", so it can be a program name with args.
  416. set dummy $2; ac_word=[$]2
  417. AC_MSG_CHECKING([for $ac_word])
  418. AC_CACHE_VAL(ac_cv_path_$1,
  419. [case "[$]$1" in
  420.   /*)
  421.   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  422.   ;;
  423.   *)
  424.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  425.   for ac_dir in ifelse([$5], , $PATH, [$5]); do
  426.     test -z "$ac_dir" && ac_dir=.
  427.     if test -f $ac_dir/$ac_word; then
  428.       if [$3]; then
  429.     ac_cv_path_$1="$ac_dir/$ac_word"
  430.     break
  431.       fi
  432.     fi
  433.   done
  434.   IFS="$ac_save_ifs"
  435. dnl If no 4th arg is given, leave the cache variable unset,
  436. dnl so AC_PATH_PROGS will keep looking.
  437. ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  438. ])dnl
  439.   ;;
  440. esac])dnl
  441. $1="$ac_cv_path_$1"
  442. if test -n "[$]$1"; then
  443.   AC_MSG_RESULT([$]$1)
  444. else
  445.   AC_MSG_RESULT(no)
  446. fi
  447. AC_SUBST($1)dnl
  448. ])
  449.  
  450. # Check whether LC_MESSAGES is available in <locale.h>.
  451. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  452.  
  453. # serial 1
  454.  
  455. AC_DEFUN(AM_LC_MESSAGES,
  456.   [if test $ac_cv_header_locale_h = yes; then
  457.     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  458.       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  459.        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  460.     if test $am_cv_val_LC_MESSAGES = yes; then
  461.       AC_DEFINE(HAVE_LC_MESSAGES)
  462.     fi
  463.   fi])
  464.  
  465.