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