dnl acinclude.m4 -- Extra macros needed for GNU make. dnl dnl Automake will incorporate this into its generated aclocal.m4. dnl --------------------------------------------------------------------------- dnl Got this from the lynx 2.8 distribution. dnl by T.E.Dickey dnl and Jim Spath dnl and Philippe De Muyter dnl dnl Created: 1997/1/28 dnl Updated: 1997/12/23 dnl --------------------------------------------------------------------------- dnl After checking for functions in the default $LIBS, make a further check dnl for the functions that are netlib-related (these aren't always in the dnl libc, etc., and have to be handled specially because there are conflicting dnl and broken implementations. dnl Common library requirements (in order): dnl -lresolv -lsocket -lnsl dnl -lnsl -lsocket dnl -lsocket dnl -lbsd AC_DEFUN([CF_NETLIBS],[ cf_test_netlibs=no AC_MSG_CHECKING(for network libraries) AC_CACHE_VAL(cf_cv_netlibs,[ AC_MSG_RESULT(working...) cf_cv_netlibs="" cf_test_netlibs=yes AC_CHECK_FUNCS(gethostname,,[ CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[ CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])]) # # FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but # I don't know the entrypoints - 97/7/22 TD AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs") # if test "$ac_cv_func_lsocket" != no ; then AC_CHECK_FUNCS(socket,,[ CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[ CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])]) fi # AC_CHECK_FUNCS(gethostbyname,,[ CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)]) # AC_CHECK_FUNCS(strcasecmp,,[ CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)]) ]) LIBS="$LIBS $cf_cv_netlibs" test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG ])dnl dnl --------------------------------------------------------------------------- dnl Re-check on a function to see if we can pick it up by adding a library. dnl $1 = function to check dnl $2 = library to check in dnl $3 = environment to update (e.g., $LIBS) dnl $4 = what to do if this fails dnl dnl This uses 'unset' if the shell happens to support it, but leaves the dnl configuration variable set to 'unknown' if not. This is a little better dnl than the normal autoconf test, which gives misleading results if a test dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is dnl used (autoconf does not distinguish between a null token and one that is dnl set to 'no'). AC_DEFUN([CF_RECHECK_FUNC],[ AC_CHECK_LIB($2,$1,[ CF_UPPER(cf_tr_func,$1) AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func) ac_cv_func_$1=yes $3="-l$2 [$]$3"],[ ac_cv_func_$1=unknown unset ac_cv_func_$1 2>/dev/null $4], [[$]$3]) ])dnl dnl --------------------------------------------------------------------------- dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ changequote(,)dnl $1=`echo $2 | tr '[a-z]' '[A-Z]'` changequote([,])dnl ])dnl dnl --------------------------------------------------------------------------- dnl Got this from the GNU tar 1.13.11 distribution dnl by Paul Eggert dnl --------------------------------------------------------------------------- dnl By default, many hosts won't let programs access large files; dnl one must use special compiler options to get large-file access to work. dnl For more details about this brain damage please see: dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html dnl Written by Paul Eggert . dnl Internal subroutine of AC_SYS_LARGEFILE. dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME) AC_DEFUN(AC_SYS_LARGEFILE_FLAGS, [AC_CACHE_CHECK([for $1 value to request large file support], ac_cv_sys_largefile_$1, [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2 then ac_cv_sys_largefile_$1=`cat conftest.1` else ac_cv_sys_largefile_$1=no ifelse($1, CFLAGS, [case "$host_os" in # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1. changequote(, )dnl hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) changequote([, ])dnl if test "$GCC" = yes; then ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ fi ;; # IRIX 6.2 and later require cc -n32. changequote(, )dnl irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) changequote([, ])dnl if test "$GCC" != yes; then ac_cv_sys_largefile_CFLAGS=-n32 fi esac if test "$ac_cv_sys_largefile_CFLAGS" != no; then ac_save_CC="$CC" CC="$CC $ac_cv_sys_largefile_CFLAGS" AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) CC="$ac_save_CC" fi]) fi rm -f conftest*])]) dnl Internal subroutine of AC_SYS_LARGEFILE. dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL) AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND, [case $2 in no) ;; ?*) case "[$]$1" in '') $1=$2 ;; *) $1=[$]$1' '$2 ;; esac ;; esac]) dnl Internal subroutine of AC_SYS_LARGEFILE. dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, [AC_CACHE_CHECK([for $1], $2, [$2=no changequote(, )dnl $4 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do case "$ac_flag" in -D$1) $2=1 ;; -D$1=*) $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; esac done changequote([, ])dnl ]) if test "[$]$2" != no; then AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) fi]) AC_DEFUN(AC_SYS_LARGEFILE, [AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_ENABLE(largefile, [ --disable-largefile omit support for large files]) if test "$enable_largefile" != no; then AC_CHECK_TOOL(GETCONF, getconf) AC_SYS_LARGEFILE_FLAGS(CFLAGS) AC_SYS_LARGEFILE_FLAGS(LDFLAGS) AC_SYS_LARGEFILE_FLAGS(LIBS) for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do case "$ac_flag" in no) ;; -D_FILE_OFFSET_BITS=*) ;; -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; -D_LARGE_FILES | -D_LARGE_FILES=*) ;; -D?* | -I?*) AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; *) AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; esac done AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, ac_cv_sys_file_offset_bits, [Number of bits in a file offset, on hosts where this is settable.], [case "$host_os" in # HP-UX 10.20 and later hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) ac_cv_sys_file_offset_bits=64 ;; esac]) AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, ac_cv_sys_largefile_source, [Define to make fseeko etc. visible, on some hosts.], [case "$host_os" in # HP-UX 10.20 and later hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) ac_cv_sys_largefile_source=1 ;; esac]) AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, ac_cv_sys_large_files, [Define for large files, on AIX-style hosts.], [case "$host_os" in # AIX 4.2 and later aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) ac_cv_sys_large_files=1 ;; esac]) fi ]) dnl --------------------------------------------------------------------------- dnl From Paul Eggert dnl Define HAVE_INTTYPES_H if exists, dnl doesn't clash with , and declares uintmax_t. AC_DEFUN(jm_AC_HEADER_INTTYPES_H, [ if test x = y; then dnl This code is deliberately never run via ./configure. dnl FIXME: this is a gross hack to make autoheader put an entry dnl for `HAVE_INTTYPES_H' in config.h.in. AC_CHECK_FUNCS(INTTYPES_H) fi AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], jm_ac_cv_header_inttypes_h=yes, jm_ac_cv_header_inttypes_h=no)]) if test $jm_ac_cv_header_inttypes_h = yes; then ac_kludge=HAVE_INTTYPES_H AC_DEFINE_UNQUOTED($ac_kludge) fi ]) dnl --------------------------------------------------------------------------- dnl From Paul Eggert AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC, [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim], ac_cv_struct_st_mtim_nsec, [ac_save_CPPFLAGS="$CPPFLAGS" ac_cv_struct_st_mtim_nsec=no # tv_nsec -- the usual case # _tv_nsec -- Solaris 2.6, if # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1 # && !defined __EXTENSIONS__) # st__tim.tv_nsec -- UnixWare 2.1.2 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val" AC_TRY_COMPILE([#include #include ], [struct stat s; s.st_mtim.ST_MTIM_NSEC;], [ac_cv_struct_st_mtim_nsec=$ac_val; break]) done CPPFLAGS="$ac_save_CPPFLAGS"]) if test $ac_cv_struct_st_mtim_nsec != no; then AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec) fi ] ) dnl --------------------------------------------------------------------------- dnl From Paul Eggert dnl Define uintmax_t to `unsigned long' or `unsigned long long' dnl if does not exist. AC_DEFUN(jm_AC_TYPE_UINTMAX_T, [ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) if test $jm_ac_cv_header_inttypes_h = no; then AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(uintmax_t, unsigned long long) else AC_DEFINE(uintmax_t, unsigned long) fi fi ]) dnl --------------------------------------------------------------------------- dnl From Steve Robbins dnl From a proposed change made on the autoconf list on 2 Feb 1999 dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html dnl Patch for AIX 3.2 by Lars Hecking on 17 May 1999 AC_DEFUN(AC_FUNC_SELECT, [AC_CHECK_FUNCS(select) if test "$ac_cv_func_select" = yes; then AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h) AC_MSG_CHECKING([argument types of select()]) AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl [AC_CACHE_VAL(ac_cv_type_fd_set,dnl [for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_type_timeval in 'struct timeval' 'const struct timeval'; do AC_TRY_COMPILE(dnl [#ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif], [#ifdef __STDC__ extern select ($ac_cv_type_fd_set_size_t, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_type_timeval *); #else extern select (); $ac_cv_type_fd_set_size_t s; $ac_cv_type_fd_set *p; $ac_type_timeval *t; #endif], [ac_found=yes ; break 3],ac_found=no) done done done ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL if test "$ac_found" = no; then AC_MSG_ERROR([can't determine argument types]) fi AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)]) AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t) ac_cast= if test "$ac_cv_type_fd_set" != fd_set; then # Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for # FD_SET macros, but insist that you cast the argument to select. I don't # understand why that might be, but it means we cannot define fd_set. AC_EGREP_CPP(dnl changequote(<<,>>)dnl <<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl changequote([,]),dnl [#ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif],dnl # We found fd_set type in a header, need special cast ac_cast="($ac_cv_type_fd_set *)",dnl # No fd_set type; it is safe to define it AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set)) fi AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast) fi ]) # The following is taken from automake 1.4, # except that it prefers the compiler option -Ae to "-Aa -D_HPUX_SOURCE" # because only the former supports 64-bit integral types on HP-UX 10.20. ## ----------------------------------------- ## ## ANSIfy the C compiler whenever possible. ## ## From Franc,ois Pinard ## ## ----------------------------------------- ## # serial 2 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC # 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 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{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(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 -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" AC_TRY_COMPILE( [#include #include #include #include /* 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);}; 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" ]) 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 $am_cv_prog_cc_stdc" ;; esac ]) dnl --------------------------------------------------------------------------- dnl Got these from the gettext 0.10.35 distribution dnl # Macro to add for using GNU gettext. # Ulrich Drepper , 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 5 AC_DEFUN(AM_WITH_NLS, [AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) USE_INCLUDED_LIBINTL=no dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then AC_DEFINE(ENABLE_NLS) 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, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If gettext or catgets are available (in this order) we dnl use this. Else we have to fall back to GNU NLS library. dnl catgets is only used if permitted by option --with-catgets. nls_cv_header_intl= nls_cv_header_libgt= CATOBJEXT=NONE AC_CHECK_HEADER(libintl.h, [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, [AC_TRY_LINK([#include ], [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)]) fi if test "$gt_cv_func_gettext_libc" = "yes" \ || test "$gt_cv_func_gettext_libintl" = "yes"; then AC_DEFINE(HAVE_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) 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], [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) INSTOBJEXT=.mo fi fi ]) if test "$CATOBJEXT" = "NONE"; then AC_MSG_CHECKING([whether catgets can be used]) AC_ARG_WITH(catgets, [ --with-catgets use catgets functions if available], nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) AC_MSG_RESULT($nls_cv_use_catgets) if test "$nls_cv_use_catgets" = "yes"; then dnl No gettext in C library. Try catgets next. AC_CHECK_LIB(i, main) AC_CHECK_FUNC(catgets, [AC_DEFINE(HAVE_CATGETS) 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 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) fi 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='$(top_builddir)/intl/libintl.a' INTLLIBS=$INTLDEPS LIBS=`echo $LIBS | sed -e 's/-lintl//'` nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi]) fi fi if test "$CATOBJEXT" = "NONE"; then dnl Neither gettext nor catgets in included in the C library. dnl Fall back on GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. INTLOBJS="\$(GETTOBJS)" 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) 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='$(top_builddir)/intl/libintl.a' INTLLIBS=$INTLDEPS LIBS=`echo $LIBS | sed -e 's/-lintl//'` nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.h fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po else DATADIRNAME=share nls_cv_header_intl=intl/libintl.h nls_cv_header_libgt=intl/libgettext.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. if test "$PACKAGE" = gettext; then USE_NLS=yes USE_INCLUDED_LIBINTL=yes fi dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLDEPS) AC_SUBST(INTLLIBS) AC_SUBST(INTLOBJS) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) AC_DEFUN(AM_GNU_GETTEXT, [AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_CC])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 AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ unistd.h sys/param.h]) AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ 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) fi AM_LC_MESSAGES AM_WITH_NLS if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; esac done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl The reference to in the installed 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 " else INCLUDE_LOCALE_H="\ /* The system does not provide the header . 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 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) dnl Transform the SED scripts while copying because some dumb SEDs dnl cannot handle comments. sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed fi dnl po2tbl.sed is always needed. sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed dnl In the intl/Makefile.in we have a special dependency which makes dnl only sense for gettext. We comment this out for non-gettext dnl packages. if test "$PACKAGE" = "gettext"; then GT_NO="#NO#" GT_YES= else GT_NO= GT_YES="#YES#" fi AC_SUBST(GT_NO) AC_SUBST(GT_YES) dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi 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 if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # Check whether LC_MESSAGES is available in . # Ulrich Drepper , 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 1 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 ], [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) fi fi]) # Search path for a program which passes the given test. # Ulrich Drepper , 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 ])