home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnututil.zip / aclocal.m4 < prev    next >
Text File  |  1996-07-11  |  17KB  |  542 lines

  1. # Local additions to Autoconf macros.
  2. # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  3. # Franτois Pinard <pinard@iro.umontreal.ca>, 1992.
  4.  
  5. AC_DEFUN(jm_MAINTAINER_MODE,
  6. [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  7.   dnl maintainer-mode is disabled by default
  8.   AC_ARG_ENABLE(maintainer-mode,
  9. [  --enable-maintainer-mode enable make rules and dependencies not useful
  10.                           (and sometimes confusing) to the casual installer],
  11.       USE_MAINTAINER_MODE=$enableval,
  12.       USE_MAINTAINER_MODE=no)
  13.   AC_MSG_RESULT($USE_MAINTAINER_MODE)
  14.   if test $USE_MAINTAINER_MODE = yes; then
  15.     MAINT=
  16.   else
  17.     MAINT='#M#'
  18.   fi
  19.   AC_SUBST(MAINT)dnl
  20. ]
  21. )
  22.  
  23. AC_DEFUN(AM_SYS_POSIX_TERMIOS,
  24. [AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
  25.   [AC_TRY_LINK([#include <sys/types.h>
  26. #include <unistd.h>
  27. #include <termios.h>],
  28.   [/* SunOS 4.0.3 has termios.h but not the library calls.  */
  29.    tcgetattr(0, 0);],
  30.   am_cv_sys_posix_termios=yes,
  31.   am_cv_sys_posix_termios=no)])
  32. ])
  33.  
  34. AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
  35. [AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
  36.  AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
  37.             am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
  38.   [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
  39.  
  40.   gwinsz_in_termios_h=no
  41.   if test $am_cv_sys_posix_termios = yes; then
  42.     AC_EGREP_CPP([yes],
  43.     [#include <sys/types.h>
  44. #     include <termios.h>
  45. #     ifdef TIOCGWINSZ
  46.         yes
  47. #     endif
  48.     ], gwinsz_in_termios_h=yes)
  49.   fi
  50.  
  51.   if test $gwinsz_in_termios_h = no; then
  52.     AC_EGREP_CPP([yes],
  53.     [#include <sys/types.h>
  54. #     include <sys/ioctl.h>
  55. #     ifdef TIOCGWINSZ
  56.         yes
  57. #     endif
  58.     ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
  59.   fi
  60.   ])
  61.   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
  62.     AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
  63.   fi
  64. ])
  65.  
  66. AC_DEFUN(AM_FUNC_STRTOD,
  67. [AC_CACHE_CHECK([for working strtod], ac_cv_func_strtod,
  68. [AC_TRY_RUN([
  69. double strtod ();
  70. int
  71. main()
  72. {
  73.   {
  74.     /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
  75.     char *string = " +69";
  76.     char *term;
  77.     double value;
  78.     value = strtod (string, &term);
  79.     if (value != 69 || term != (string + 4))
  80.       exit (1);
  81.   }
  82.  
  83.   {
  84.     /* Under Solaris 2.4, strtod returns the wrong value for the
  85.        terminating character under some conditions.  */
  86.     char *string = "NaN";
  87.     char *term;
  88.     strtod (string, &term);
  89.     if (term != string && *(term - 1) == 0)
  90.       exit (1);
  91.   }
  92.   exit (0);
  93. }
  94. ], ac_cv_func_strtod=yes, ac_cv_func_strtod=no, ac_cv_func_strtod=no)])
  95. test $ac_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
  96. AC_SUBST(LIBOBJS)dnl
  97. if test $ac_cv_func_strtod = no; then
  98.   AC_CHECK_FUNCS(pow)
  99.   if test $ac_cv_func_pow = no; then
  100.     AC_CHECK_LIB(m, pow)
  101.   fi
  102. fi
  103. ])
  104.  
  105. ## --------------------------------------------------------- ##
  106. ## Use A*_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
  107. ## substitution.                         ##
  108. ## --------------------------------------------------------- ##
  109.  
  110. AC_DEFUN(fp_PROG_INSTALL,
  111. [AC_PROG_INSTALL
  112. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
  113. AC_SUBST(INSTALL_SCRIPT)dnl
  114. ])
  115.  
  116. ## ------------------------------- ##
  117. ## Check for function prototypes.  ##
  118. ## ------------------------------- ##
  119.  
  120. AC_DEFUN(fp_C_PROTOTYPES,
  121. [AC_REQUIRE([fp_PROG_CC_STDC])
  122. AC_MSG_CHECKING([for function prototypes])
  123. if test "$ac_cv_prog_cc_stdc" != no; then
  124.   AC_MSG_RESULT(yes)
  125.   AC_DEFINE(PROTOTYPES)
  126.   U= ANSI2KNR=
  127. else
  128.   AC_MSG_RESULT(no)
  129.   U=_ ANSI2KNR=./ansi2knr
  130. fi
  131. AC_SUBST(U)dnl
  132. AC_SUBST(ANSI2KNR)dnl
  133. ])
  134.  
  135. ## ----------------------------------------- ##
  136. ## ANSIfy the C compiler whenever possible.  ##
  137. ## ----------------------------------------- ##
  138.  
  139. # @defmac AC_PROG_CC_STDC
  140. # @maindex PROG_CC_STDC
  141. # @ovindex CC
  142. # If the C compiler in not in ANSI C mode by default, try to add an option
  143. # to output variable @code{CC} to make it so.  This macro tries various
  144. # options that select ANSI C on some system or another.  It considers the
  145. # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
  146. # handles function prototypes correctly.
  147. #
  148. # If you use this macro, you should check after calling it whether the C
  149. # compiler has been set to accept ANSI C; if not, the shell variable
  150. # @code{ac_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  151. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  152. # program @code{ansi2knr}, which comes with Ghostscript.
  153. # @end defmac
  154.  
  155. AC_DEFUN(fp_PROG_CC_STDC,
  156. [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  157. AC_CACHE_VAL(ac_cv_prog_cc_stdc,
  158. [ac_cv_prog_cc_stdc=no
  159. ac_save_CFLAGS="$CFLAGS"
  160. # Don't try gcc -ansi; that turns off useful extensions and
  161. # breaks some systems' header files.
  162. # AIX            -qlanglvl=ansi
  163. # Ultrix and OSF/1    -std1
  164. # HP-UX            -Aa -D_HPUX_SOURCE
  165. # SVR4            -Xc -D__EXTENSIONS__
  166. for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  167. do
  168.   CFLAGS="$ac_save_CFLAGS $ac_arg"
  169.   AC_TRY_COMPILE(
  170. [#if !defined(__STDC__) || __STDC__ != 1
  171. choke me
  172. #endif
  173. ], [/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
  174. #include <sys/types.h>
  175. #include <sys/stat.h>
  176. int test (int i, double x);
  177. struct s1 {int (*f) (int a);};
  178. struct s2 {int (*f) (double a);};],
  179. [ac_cv_prog_cc_stdc="$ac_arg"; break])
  180. done
  181. CFLAGS="$ac_save_CFLAGS"
  182. ])
  183. AC_MSG_RESULT($ac_cv_prog_cc_stdc)
  184. case "x$ac_cv_prog_cc_stdc" in
  185.   x|xno) ;;
  186.   *) CC="$CC $ac_cv_prog_cc_stdc" ;;
  187. esac
  188. ])
  189.  
  190. ## -------------------------------------------- ##
  191. ## Check if --with-regex was given.             ##
  192. ## Slightly modified version of fp_WITH_REGEX.  ##
  193. ## -------------------------------------------- ##
  194.  
  195. AC_DEFUN(ud_WITH_REGEX,
  196. [AC_MSG_CHECKING(which of rx or regex is wanted)
  197. AC_ARG_WITH(regex,
  198. [  --with-regex            use older regex in lieu of GNU rx for matching],
  199. [if test "$withval" = yes; then
  200.   ac_with_regex=1
  201.   AC_MSG_RESULT(regex)
  202.   AC_DEFINE(WITH_REGEX)
  203.   REGEXOBJ=regex.o
  204. fi])
  205. if test -z "$ac_with_regex"; then
  206.   AC_MSG_RESULT(rx)
  207.   AC_CHECK_FUNC(re_rx_search, , [REGEXOBJ=rx.o])
  208. fi
  209. AC_SUBST(REGEXOBJ)dnl
  210. ])
  211.  
  212. dnl AC_REPLACE_GNU_GETOPT
  213. AC_DEFUN(AC_REPLACE_GNU_GETOPT,
  214. [AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
  215. AC_SUBST(LIBOBJS)dnl
  216. ])
  217.  
  218. dnl --------------------------------------------------------- ##
  219. dnl The following definitions and this message have to go     ##
  220. dnl into the aclocal.m4 files of the packages to be           ##
  221. dnl internationalized.                                        ##
  222. dnl Last updated for gettext-0.10.22.                         ##
  223. dnl --------------------------------------------------------- ##
  224.  
  225. dnl ud_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  226. dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  227. AC_DEFUN(ud_PATH_PROG_WITH_TEST,
  228. [# Extract the first word of "$2", so it can be a program name with args.
  229. set dummy $2; ac_word=[$]2
  230. AC_MSG_CHECKING([for $ac_word])
  231. AC_CACHE_VAL(ac_cv_path_$1,
  232. [case "[$]$1" in
  233.   /*)
  234.   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  235.   ;;
  236.   *)
  237.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  238.   for ac_dir in ifelse([$5], , $PATH, [$5]); do
  239.     test -z "$ac_dir" && ac_dir=.
  240.     if test -f $ac_dir/$ac_word; then
  241.       if [$3]; then
  242.     ac_cv_path_$1="$ac_dir/$ac_word"
  243.     break
  244.       fi
  245.     fi
  246.   done
  247.   IFS="$ac_save_ifs"
  248. dnl If no 4th arg is given, leave the cache variable unset,
  249. dnl so AC_PATH_PROGS will keep looking.
  250. ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  251. ])dnl
  252.   ;;
  253. esac])dnl
  254. $1="$ac_cv_path_$1"
  255. if test -n "[$]$1"; then
  256.   AC_MSG_RESULT([$]$1)
  257. else
  258.   AC_MSG_RESULT(no)
  259. fi
  260. AC_SUBST($1)dnl
  261. ])
  262.  
  263. dnl Check NLS options
  264.  
  265. AC_DEFUN(ud_LC_MESSAGES,
  266.   [if test $ac_cv_header_locale_h = yes; then
  267.     AC_CACHE_CHECK([for LC_MESSAGES], ud_cv_val_LC_MESSAGES,
  268.       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  269.        ud_cv_val_LC_MESSAGES=yes, ud_cv_val_LC_MESSAGES=no)])
  270.     if test $ud_cv_val_LC_MESSAGES = yes; then
  271.       AC_DEFINE(HAVE_LC_MESSAGES)
  272.     fi
  273.   fi])
  274.  
  275. AC_DEFUN(ud_WITH_NLS,
  276.   [AC_MSG_CHECKING([whether NLS is requested])
  277.     dnl Default is enabled NLS
  278.     AC_ARG_ENABLE(nls,
  279.       [  --disable-nls           do not use Native Language Support],
  280.       USE_NLS=$enableval, USE_NLS=yes)
  281.     AC_MSG_RESULT($USE_NLS)
  282.     AC_SUBST(USE_NLS)
  283.  
  284.     USE_INCLUDED_LIBINTL=no
  285.  
  286.     dnl If we use NLS figure out what method
  287.     if test "$USE_NLS" = "yes"; then
  288.       AC_DEFINE(ENABLE_NLS)
  289.       AC_MSG_CHECKING([for explicitly using GNU gettext])
  290.       AC_ARG_WITH(included-gettext,
  291.         [  --with-included-gettext use the GNU gettext library included here],
  292.         nls_cv_force_use_gnu_gettext=$withval,
  293.         nls_cv_force_use_gnu_gettext=no)
  294.       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
  295.  
  296.       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  297.       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  298.         dnl User does not insist on using GNU NLS library.  Figure out what
  299.         dnl to use.  If gettext or catgets are available (in this order) we
  300.         dnl use this.  Else we have to fall back to GNU NLS library.
  301.     dnl catgets is only used if permitted by option --with-catgets.
  302.     nls_cv_header_intl=
  303.     nls_cv_header_libgt=
  304.     CATOBJEXT=NONE
  305.  
  306.     AC_CHECK_HEADER(libintl.h,
  307.       [AC_CHECK_LIB(intl, bindtextdomain)
  308.        AC_CHECK_FUNC(gettext,
  309.          [AC_DEFINE(HAVE_GETTEXT)
  310.           ud_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  311.         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
  312.           if test "$MSGFMT" != "no"; then
  313.         AC_CHECK_FUNCS(dcgettext)
  314.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  315.         ud_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  316.           [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  317.         AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
  318.                    return _nl_msg_cat_cntr],
  319.           [CATOBJEXT=.gmo
  320.            DATADIRNAME=share],
  321.           [CATOBJEXT=.mo
  322.            DATADIRNAME=lib])
  323.         INSTOBJEXT=.mo
  324.           fi])])
  325.  
  326.         if test "$CATOBJEXT" = "NONE"; then
  327.       AC_MSG_CHECKING([whether catgets can be used])
  328.       AC_ARG_WITH(catgets,
  329.         [  --with-catgets          use catgets functions if available],
  330.         nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
  331.       AC_MSG_RESULT($nls_cv_use_catgets)
  332.  
  333.       if test "$nls_cv_use_catgets" = "yes"; then
  334.         dnl No gettext in C library.  Try catgets next.
  335.         AC_CHECK_LIB(i, main)
  336.         AC_CHECK_FUNC(catgets,
  337.           [AC_DEFINE(HAVE_CATGETS)
  338.            INTLOBJS="\$(CATOBJS)"
  339.            AC_PATH_PROG(GENCAT, gencat, no)dnl
  340.            if test "$GENCAT" != "no"; then
  341.          AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
  342.          if test "$GMSGFMT" = "no"; then
  343.            ud_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
  344.             [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
  345.          fi
  346.          ud_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  347.            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  348.          USE_INCLUDED_LIBINTL=yes
  349.          CATOBJEXT=.cat
  350.          INSTOBJEXT=.cat
  351.          DATADIRNAME=lib
  352.          INTLDEPS="../intl/libintl.a"
  353.          INTLLIBS=$INTLDEPS
  354.          LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  355.          nls_cv_header_intl=intl/libintl.h
  356.          nls_cv_header_libgt=intl/libgettext.h
  357.            fi])
  358.       fi
  359.         fi
  360.  
  361.         if test "$CATOBJEXT" = "NONE"; then
  362.       dnl Neither gettext nor catgets in included in the C library.
  363.       dnl Fall back on GNU gettext library.
  364.       nls_cv_use_gnu_gettext=yes
  365.         fi
  366.       fi
  367.  
  368.       if test "$nls_cv_use_gnu_gettext" = "yes"; then
  369.         dnl Mark actions used to generate GNU NLS library.
  370.         INTLOBJS="\$(GETTOBJS)"
  371.         ud_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  372.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
  373.         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  374.         ud_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  375.       [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  376.         AC_SUBST(MSGFMT)
  377.     USE_INCLUDED_LIBINTL=yes
  378.         CATOBJEXT=.gmo
  379.         INSTOBJEXT=.mo
  380.         DATADIRNAME=share
  381.     INTLDEPS="../intl/libintl.a"
  382.     INTLLIBS=$INTLDEPS
  383.     LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  384.         nls_cv_header_intl=intl/libintl.h
  385.         nls_cv_header_libgt=intl/libgettext.h
  386.       fi
  387.  
  388.       dnl Test whether we really found GNU xgettext.
  389.       if test "$XGETTEXT" != ":"; then
  390.     dnl If it is no GNU xgettext we define it as : so that the
  391.     dnl Makefiles still can work.
  392.     if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  393.       : ;
  394.     else
  395.       AC_MSG_RESULT(
  396.         [found xgettext programs is not GNU xgettext; ignore it])
  397.       XGETTEXT=":"
  398.     fi
  399.       fi
  400.  
  401.       # We need to process the po/ directory.
  402.       POSUB=po
  403.     else
  404.       DATADIRNAME=share
  405.       nls_cv_header_intl=intl/libintl.h
  406.       nls_cv_header_libgt=intl/libgettext.h
  407.     fi
  408.  
  409.     # If this is used in GNU gettext we have to set USE_NLS to `yes'
  410.     # because some of the sources are only built for this goal.
  411.     if test "$PACKAGE" = gettext; then
  412.       USE_NLS=yes
  413.       USE_INCLUDED_LIBINTL=yes
  414.     fi
  415.  
  416.     dnl These rules are solely for the distribution goal.  While doing this
  417.     dnl we only have to keep exactly one list of the available catalogs
  418.     dnl in configure.in.
  419.     for lang in $ALL_LINGUAS; do
  420.       GMOFILES="$GMOFILES $lang.gmo"
  421.       POFILES="$POFILES $lang.po"
  422.     done
  423.  
  424.     dnl Make all variables we use known to autoconf.
  425.     AC_SUBST(USE_INCLUDED_LIBINTL)
  426.     AC_SUBST(CATALOGS)
  427.     AC_SUBST(CATOBJEXT)
  428.     AC_SUBST(DATADIRNAME)
  429.     AC_SUBST(GMOFILES)
  430.     AC_SUBST(INSTOBJEXT)
  431.     AC_SUBST(INTLDEPS)
  432.     AC_SUBST(INTLLIBS)
  433.     AC_SUBST(INTLOBJS)
  434.     AC_SUBST(POFILES)
  435.     AC_SUBST(POSUB)
  436.   ])
  437.  
  438. AC_DEFUN(ud_GNU_GETTEXT,
  439.   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  440.    AC_REQUIRE([AC_PROG_CC])dnl
  441.    AC_REQUIRE([AC_ISC_POSIX])dnl
  442.    AC_REQUIRE([AC_PROG_RANLIB])dnl
  443.    AC_REQUIRE([AC_HEADER_STDC])dnl
  444.    AC_REQUIRE([AC_C_CONST])dnl
  445.    AC_REQUIRE([AC_C_INLINE])dnl
  446.    AC_REQUIRE([AC_TYPE_OFF_T])dnl
  447.    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  448.    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  449.    AC_REQUIRE([AC_FUNC_MMAP])dnl
  450.  
  451.    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
  452. unistd.h values.h])
  453.    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
  454. __argz_count __argz_stringify __argz_next])
  455.  
  456.    if test "${ac_cv_func_stpcpy+set}" != "set"; then
  457.      AC_CHECK_FUNCS(stpcpy)
  458.    fi
  459.    if test "${ac_cv_func_stpcpy}" = "yes"; then
  460.      AC_DEFINE(HAVE_STPCPY)
  461.    fi
  462.  
  463.    ud_LC_MESSAGES
  464.    ud_WITH_NLS
  465.  
  466.    if test "x$CATOBJEXT" != "x"; then
  467.      if test "x$ALL_LINGUAS" = "x"; then
  468.        LINGUAS=
  469.      else
  470.        AC_MSG_CHECKING(for catalogs to be installed)
  471.        NEW_LINGUAS=
  472.        for lang in ${LINGUAS=$ALL_LINGUAS}; do
  473.          case "$ALL_LINGUAS" in
  474.           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  475.          esac
  476.        done
  477.        LINGUAS=$NEW_LINGUAS
  478.        AC_MSG_RESULT($LINGUAS)
  479.      fi
  480.  
  481.      dnl Construct list of names of catalog files to be constructed.
  482.      if test -n "$LINGUAS"; then
  483.        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  484.      fi
  485.    fi
  486.  
  487.    dnl Determine which catalog format we have (if any is needed)
  488.    dnl For now we know about two different formats:
  489.    dnl   Linux and the normal X/Open format
  490.    test -d intl || mkdir intl
  491.    if test "$CATOBJEXT" = ".cat"; then
  492.      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
  493.  
  494.      dnl Transform the SED scripts while copying because some dumb SEDs
  495.      dnl cannot handle comments.
  496.      sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
  497.    fi
  498.    dnl po2tbl.sed is always needed.
  499.    sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
  500.      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
  501.  
  502.    dnl In the intl/Makefile.in we have a special dependency which makes
  503.    dnl only sense for gettext.  We comment this out for non-gettext
  504.    dnl packages.
  505.    if test "$PACKAGE" = "gettext"; then
  506.      GT_NO="#NO#"
  507.      GT_YES=
  508.    else
  509.      GT_NO=
  510.      GT_YES="#YES#"
  511.    fi
  512.    AC_SUBST(GT_NO)
  513.    AC_SUBST(GT_YES)
  514.  
  515.    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
  516.    dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
  517.    dnl Try to locate is.
  518.    MKINSTALLDIRS=
  519.    if test $ac_aux_dir; then
  520.      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
  521.    fi
  522.    if test -z $MKINSTALLDIRS; then
  523.      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
  524.    fi
  525.    AC_SUBST(MKINSTALLDIRS)
  526.  
  527.    dnl Generate list of files to be processed by xgettext which will
  528.    dnl be included in po/Makefile.
  529.    test -d po || mkdir po
  530.    if test "x$srcdir" != "x."; then
  531.      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
  532.        posrcprefix="$srcdir/"
  533.      else
  534.        posrcprefix="../$srcdir/"
  535.      fi
  536.    else
  537.      posrcprefix="../"
  538.    fi
  539.    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,    $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
  540.     < $srcdir/po/POTFILES.in > po/POTFILES
  541.   ])
  542.