summaryrefslogtreecommitdiffstats
path: root/aclocal.m4
diff options
context:
space:
mode:
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m4635
1 files changed, 438 insertions, 197 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 6993c86..96c305a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,9 +1,135 @@
-# Local additions to Autoconf macros.
-# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-# François Pinard <pinard@iro.umontreal.ca>, 1992.
+dnl aclocal.m4 generated automatically by aclocal 1.4a
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
+
+# serial 1
+
AC_DEFUN(AM_MAINTAINER_MODE,
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
@@ -13,49 +139,35 @@ AC_DEFUN(AM_MAINTAINER_MODE,
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT($USE_MAINTAINER_MODE)
- if test $USE_MAINTAINER_MODE = yes; then
- MAINT=
- else
- MAINT='#M#'
- fi
+ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
-AC_DEFUN(md_TYPE_PTRDIFF_T,
- [AC_CACHE_CHECK([for ptrdiff_t], ac_cv_type_ptrdiff_t,
- [AC_TRY_COMPILE([#include <stddef.h>
-#include <sys/types.h>], [ptrdiff_t p],
- ac_cv_type_ptrdiff_t=yes, ac_cv_type_ptrdiff_t=no)])
- if test $ac_cv_type_ptrdiff_t = yes; then
- AC_DEFINE(HAVE_PTRDIFF_T)
- fi
-])
+# Define a conditional.
-## --------------------------------------------------------- ##
-## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
-## substitution. ##
-## From Franc,ois Pinard ##
-## --------------------------------------------------------- ##
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
-AC_DEFUN(AM_PROG_INSTALL,
-[AC_REQUIRE([AC_PROG_INSTALL])
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
-AC_SUBST(INSTALL_SCRIPT)dnl
-])
-## ------------------------------- ##
-## Check for function prototypes. ##
-## From Franc,ois Pinard ##
-## ------------------------------- ##
+# serial 1
AC_DEFUN(AM_C_PROTOTYPES,
[AC_REQUIRE([AM_PROG_CC_STDC])
-AC_BEFORE([$0], [AC_C_INLINE])
+AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([for function prototypes])
-if test "$ac_cv_prog_cc_stdc" != no; then
+if test "$am_cv_prog_cc_stdc" != no; then
AC_MSG_RESULT(yes)
- AC_DEFINE(PROTOTYPES)
+ AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
U= ANSI2KNR=
else
AC_MSG_RESULT(no)
@@ -68,10 +180,8 @@ AC_SUBST(U)dnl
AC_SUBST(ANSI2KNR)dnl
])
-## ----------------------------------------- ##
-## ANSIfy the C compiler whenever possible. ##
-## From Franc,ois Pinard ##
-## ----------------------------------------- ##
+
+# serial 1
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
@@ -79,182 +189,160 @@ AC_SUBST(ANSI2KNR)dnl
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
-# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
-# handles function prototypes correctly.
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{ac_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
-AC_CACHE_VAL(ac_cv_prog_cc_stdc,
-[ac_cv_prog_cc_stdc=no
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
-[#if !defined(__STDC__) || __STDC__ != 1
-choke me
-#endif
-], [/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
+[#include <stdarg.h>
+#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
int test (int i, double x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};],
-[ac_cv_prog_cc_stdc="$ac_arg"; break])
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
done
CC="$ac_save_CC"
])
-AC_MSG_RESULT($ac_cv_prog_cc_stdc)
-case "x$ac_cv_prog_cc_stdc" in
+if test -z "$am_cv_prog_cc_stdc"; then
+ AC_MSG_RESULT([none needed])
+else
+ AC_MSG_RESULT($am_cv_prog_cc_stdc)
+fi
+case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
- *) CC="$CC $ac_cv_prog_cc_stdc" ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
esac
])
-## -------------------------------------------- ##
-## Check if --with-regex was given. ##
-## Slightly modified version of fp_WITH_REGEX. ##
-## -------------------------------------------- ##
+# From Ulrich Drepper.
-AC_DEFUN(ud_WITH_REGEX,
-[AC_MSG_CHECKING(which of rx or regex is wanted)
-AC_ARG_WITH(regex,
-[ --with-regex use older regex in lieu of GNU rx for matching],
-[if test "$withval" = yes; then
- ac_with_regex=1
- AC_MSG_RESULT(regex)
- AC_DEFINE(WITH_REGEX)
- REGEXOBJ=regex.o
-fi])
-if test -z "$ac_with_regex"; then
- AC_MSG_RESULT(rx)
- AC_CHECK_FUNC(re_rx_search, , [REGEXOBJ=rx.o])
-fi
-AC_SUBST(REGEXOBJ)dnl
+# serial 1
+
+AC_DEFUN(AM_TYPE_PTRDIFF_T,
+ [AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
+ [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
+ am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
+ if test $am_cv_type_ptrdiff_t = yes; then
+ AC_DEFINE(HAVE_PTRDIFF_T,1,[Define if system has ptrdiff_t type])
+ fi
])
-dnl ------------------------
-dnl Emacs LISP file handling
-dnl ------------------------
-AC_DEFUN(ud_PATH_LISPDIR,
- [AC_PATH_PROG(EMACS, emacs, no)
- if test $EMACS != "no"; then
- AC_MSG_CHECKING([where .elc files should go])
- dnl Set default value
- LISPDIR="\$(datadir)/emacs/site-lisp"
- if test "x$prefix" = "xNONE"; then
- if test -d $ac_default_prefix/share/emacs/site-lisp; then
- LISPDIR="\$(prefix)/share/emacs/site-lisp"
- else
- if test -d $ac_default_prefix/lib/emacs/site-lisp; then
- LISPDIR="\$(prefix)/lib/emacs/site-lisp"
- fi
- fi
- else
- if test -d $prefix/share/emacs/site-lisp; then
- LISPDIR="\$(prefix)/share/emacs/site-lisp"
- else
- if test -d $prefix/lib/emacs/site-lisp; then
- LISPDIR="\$(prefix)/lib/emacs/site-lisp"
- fi
- fi
- fi
- AC_MSG_RESULT($LISPDIR)
- ELCFILES="\$(ELCFILES)"
- fi
- AC_SUBST(LISPDIR)
- AC_SUBST(ELCFILES)])
-dnl AC_REPLACE_GNU_GETOPT
-AC_DEFUN(AC_REPLACE_GNU_GETOPT,
-[AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
-AC_SUBST(LIBOBJS)dnl
-])
+# serial 1
+
+# The idea is to distribute rx.[hc] and regex.[hc] together, for a while.
+# The WITH_REGEX symbol (which should also be documented in acconfig.h)
+# is used to decide which of regex.h or rx.h should be included in the
+# application. If `./configure --with-regex' is given (the default), the
+# package will use gawk's regex. If `./configure --without-regex', a
+# check is made to see if rx is already installed, as with newer Linux'es.
+# If not found, the package will use the rx from the distribution.
+# If found, the package will use the system's rx which, on Linux at least,
+# will result in a smaller executable file.
-dnl AC_REPLACE_OBSTACK
-AC_DEFUN(AC_REPLACE_OBSTACK,
-[AC_CACHE_CHECK([for obstacks], gt_cv_func_obstack,
-[AC_TRY_LINK([#include "obstack.h"],
-[struct obstack *mem;obstack_free(mem,NULL)],
- gt_cv_func_obstack=yes, gt_cv_func_obstack=no)])
-if test $gt_cv_func_obstack = no; then
- LIBOBJS="$LIBOBJS obstack.o"
+AC_DEFUN(AM_WITH_REGEX,
+[AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted)
+AC_ARG_WITH(regex,
+[ --without-regex use GNU rx in lieu of gawk's regex for matching],
+[test "$withval" = yes && am_with_regex=1],
+[am_with_regex=1])
+if test -n "$am_with_regex"; then
+ AC_MSG_RESULT(regex)
+ AC_DEFINE(WITH_REGEX,1,[Define if using GNU regex])
+ AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex,
+ AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1],
+ am_cv_gnu_regex=yes, am_cv_gnu_regex=no))
+ if test $am_cv_gnu_regex = no; then
+ LIBOBJS="$LIBOBJS regex.o"
+ fi
+else
+ AC_MSG_RESULT(rx)
+ AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
fi
AC_SUBST(LIBOBJS)dnl
])
-dnl --------------------------------------------------------- ##
-dnl The following definitions and this message have to go ##
-dnl into the aclocal.m4 files of the packages to be ##
-dnl internationalized. ##
-dnl Last updated for gettext-0.10.20. ##
-dnl --------------------------------------------------------- ##
-
-dnl ud_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
-dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN(ud_PATH_PROG_WITH_TEST,
-[# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
- /*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in ifelse([$5], , $PATH, [$5]); do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if [$3]; then
- ac_cv_path_$1="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
-])dnl
- ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
- AC_MSG_RESULT([$]$1)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
+dnl From Jim Meyering.
+dnl FIXME: migrate into libit.
+
+AC_DEFUN(AM_FUNC_OBSTACK,
+[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
+ [AC_TRY_LINK([#include "obstack.h"],
+ [struct obstack *mem;obstack_free(mem,(char *) 0)],
+ am_cv_func_obstack=yes,
+ am_cv_func_obstack=no)])
+ if test $am_cv_func_obstack = yes; then
+ AC_DEFINE(HAVE_OBSTACK,1,[Define if libc includes obstacks])
+ else
+ LIBOBJS="$LIBOBJS obstack.o"
+ fi
])
-dnl Check NLS options
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
-AC_DEFUN(ud_LC_MESSAGES,
- [if test $ac_cv_header_locale_h = yes; then
- AC_CACHE_CHECK([for LC_MESSAGES], ud_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- ud_cv_val_LC_MESSAGES=yes, ud_cv_val_LC_MESSAGES=no)])
- if test $ud_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES)
- fi
- fi])
+# serial 106
-AC_DEFUN(ud_WITH_NLS,
+AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
@@ -267,8 +355,8 @@ AC_DEFUN(ud_WITH_NLS,
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
- AC_DEFINE(ENABLE_NLS)
- AC_MSG_CHECKING([for explicitly using GNU gettext])
+ AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
+ AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
@@ -286,15 +374,35 @@ AC_DEFUN(ud_WITH_NLS,
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
- [AC_CHECK_LIB(intl, bindtextdomain)
- AC_CHECK_FUNC(gettext,
- [AC_DEFINE(HAVE_GETTEXT)
- ud_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+ [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+ gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ AC_CHECK_LIB(intl, bindtextdomain,
+ [AC_CACHE_CHECK([for gettext in libintl],
+ gt_cv_func_gettext_libintl,
+ [AC_CHECK_LIB(intl, gettext,
+ gt_cv_func_gettext_libintl=yes,
+ gt_cv_func_gettext_libintl=no)],
+ gt_cv_func_gettext_libintl=no)])
+
+ if test "$gt_cv_func_gettext_libintl" = yes; then
+ LIBS="$LIBS -lintl"
+ fi
+
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT, 1,
+ [Define to 1 if you have gettext and don't want to use GNU gettext.])
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- ud_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
@@ -303,7 +411,9 @@ AC_DEFUN(ud_WITH_NLS,
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
- fi])])
+ fi
+ fi
+ ])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
@@ -316,22 +426,23 @@ AC_DEFUN(ud_WITH_NLS,
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
- [AC_DEFINE(HAVE_CATGETS)
+ [AC_DEFINE(HAVE_CATGETS, 1,
+ [Define as 1 if you have catgets and don't want to use GNU gettext.])
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
- ud_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
+ AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
- ud_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
- INTLDEPS="../intl/libintl.a"
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
@@ -350,17 +461,17 @@ AC_DEFUN(ud_WITH_NLS,
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
- ud_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
- ud_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
- INTLDEPS="../intl/libintl.a"
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
@@ -375,7 +486,7 @@ AC_DEFUN(ud_WITH_NLS,
: ;
else
AC_MSG_RESULT(
- [found xgettext programs is not GNU xgettext; ignore it])
+ [found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
@@ -387,6 +498,16 @@ AC_DEFUN(ud_WITH_NLS,
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
+ if test -z "$nsl_cv_header_intl"; then
+ # Clean out junk possibly left behind by a previous configuration.
+ rm -f intl/libintl.h
+ fi
+ AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+ AC_OUTPUT_COMMANDS(
+ [case "$CONFIG_FILES" in *po/Makefile.in*)
+ sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+ esac])
+
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
@@ -417,11 +538,11 @@ AC_DEFUN(ud_WITH_NLS,
AC_SUBST(POSUB)
])
-AC_DEFUN(ud_GNU_GETTEXT,
+AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
@@ -431,19 +552,19 @@ AC_DEFUN(ud_GNU_GETTEXT,
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h])
+unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
-__argz_count __argz_stringify __argz_next])
+strdup __argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
- AC_DEFINE(HAVE_STPCPY)
+ AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.])
fi
- ud_LC_MESSAGES
- ud_WITH_NLS
+ AM_LC_MESSAGES
+ AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
@@ -466,9 +587,20 @@ __argz_count __argz_stringify __argz_next])
fi
fi
+ dnl The reference to <locale.h> in the installed <libintl.h> file
+ dnl must be resolved because we cannot expect the users of this
+ dnl to define HAVE_LOCALE_H.
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+ AC_SUBST(INCLUDE_LOCALE_H)
+
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
- dnl Linux and the normal X/Open format
+ dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
@@ -498,14 +630,18 @@ __argz_count __argz_stringify __argz_next])
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
- if test $ac_aux_dir; then
+ if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
- if test -z $MKINSTALLDIRS; then
+ if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
+ dnl *** For now the libtool support in intl/Makefile is not for real.
+ l=
+ AC_SUBST(l)
+
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
@@ -518,6 +654,111 @@ __argz_count __argz_stringify __argz_next])
else
posrcprefix="../"
fi
+ rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 2
+
+AC_DEFUN(AM_LC_MESSAGES,
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your locale.h file contains LC_MESSAGES.])
+ fi
+ fi])
+
+
+# serial 1
+
+AC_DEFUN(AM_PATH_LISPDIR,
+ [# If set to t, that means we are running in a shell under Emacs.
+ # If you have an Emacs named "t", then use the full path.
+ test "$EMACS" = t && EMACS=
+ AC_PATH_PROGS(EMACS, emacs xemacs, no)
+ if test $EMACS != "no"; then
+ AC_MSG_CHECKING([where .elc files should go])
+ dnl Set default value
+ lispdir="\$(datadir)/emacs/site-lisp"
+ emacs_flavor=`echo "$EMACS" | sed -e 's,^.*/,,'`
+ if test "x$prefix" = "xNONE"; then
+ if test -d $ac_default_prefix/share/$emacs_flavor/site-lisp; then
+ lispdir="\$(prefix)/share/$emacs_flavor/site-lisp"
+ else
+ if test -d $ac_default_prefix/lib/$emacs_flavor/site-lisp; then
+ lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp"
+ fi
+ fi
+ else
+ if test -d $prefix/share/$emacs_flavor/site-lisp; then
+ lispdir="\$(prefix)/share/$emacs_flavor/site-lisp"
+ else
+ if test -d $prefix/lib/$emacs_flavor/site-lisp; then
+ lispdir="\$(prefix)/lib/$emacs_flavor/site-lisp"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($lispdir)
+ fi
+ AC_SUBST(lispdir)])
+