home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / txtut122.zip / textutil / aclocal.m4 < prev    next >
M4 Source File  |  1997-01-26  |  19KB  |  625 lines

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