1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 sinclude(../libtool.m4)
14 dnl The lines below arrange for aclocal not to bring libtool.m4
15 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
16 dnl to add a definition of LIBTOOL to Makefile.in.
18 AC_DEFUN([AM_PROG_LIBTOOL],)
22 sinclude(../gettext.m4)
24 AC_DEFUN([CY_WITH_NLS],)
28 # Do all the work for Automake. This macro actually does too much --
29 # some checks are only needed if your package does certain things.
30 # But this isn't really a big deal.
35 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
37 AC_DEFUN(AM_INIT_AUTOMAKE,
38 [AC_REQUIRE([AC_PROG_INSTALL])
43 dnl test to see if srcdir already configured
44 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
45 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
48 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
49 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
50 AC_REQUIRE([AM_SANITY_CHECK])
51 AC_REQUIRE([AC_ARG_PROGRAM])
52 dnl FIXME This is truly gross.
53 missing_dir=`cd $ac_aux_dir && pwd`
54 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
55 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
56 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
57 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
58 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
59 AC_REQUIRE([AC_PROG_MAKE_SET])])
62 # Check to make sure that the build environment is sane.
65 AC_DEFUN(AM_SANITY_CHECK,
66 [AC_MSG_CHECKING([whether build environment is sane])
69 echo timestamp > conftestfile
70 # Do `set' in a subshell so we don't clobber the current shell's
71 # arguments. Must try -L first in case configure is actually a
72 # symlink; some systems play weird games with the mod time of symlinks
73 # (eg FreeBSD returns the mod time of the symlink's containing
76 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
77 if test "[$]*" = "X"; then
79 set X `ls -t $srcdir/configure conftestfile`
81 if test "[$]*" != "X $srcdir/configure conftestfile" \
82 && test "[$]*" != "X conftestfile $srcdir/configure"; then
84 # If neither matched, then we have a broken ls. This can happen
85 # if, for instance, CONFIG_SHELL is bash and it inherits a
86 # broken ls alias from the environment. This has actually
87 # happened. Such a system could not be considered "sane".
88 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
89 alias in your environment])
92 test "[$]2" = conftestfile
98 AC_MSG_ERROR([newly created file is older than distributed files!
99 Check your system clock])
104 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
105 dnl The program must properly implement --version.
106 AC_DEFUN(AM_MISSING_PROG,
107 [AC_MSG_CHECKING(for working $2)
108 # Run test in a subshell; some versions of sh will print an error if
109 # an executable is not found, even if stderr is redirected.
110 # Redirect stdin to placate older versions of autoconf. Sigh.
111 if ($2 --version) < /dev/null > /dev/null 2>&1; then
116 AC_MSG_RESULT(missing)
120 # Like AC_CONFIG_HEADER, but automatically create stamp file.
122 AC_DEFUN(AM_CONFIG_HEADER,
124 AC_CONFIG_HEADER([$1])
125 dnl When config.status generates a header, we must update the stamp-h file.
126 dnl This file resides in the same directory as the config header
127 dnl that is generated. We must strip everything past the first ":",
128 dnl and everything past the last "/".
129 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
130 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
131 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
133 for am_file in <<$1>>; do
134 case " <<$>>CONFIG_HEADERS " in
135 *" <<$>>am_file "*<<)>>
136 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
139 am_indx=`expr "<<$>>am_indx" + 1`
143 # This file is derived from `gettext.m4'. The difference is that the
144 # included macros assume Cygnus-style source and build trees.
146 # Macro to add for using GNU gettext.
147 # Ulrich Drepper <drepper@cygnus.com>, 1995.
149 # This file file be copied and used freely without restrictions. It can
150 # be used in projects which are not available under the GNU Public License
151 # but which still want to provide support for the GNU gettext functionality.
152 # Please note that the actual code is *not* freely available.
156 AC_DEFUN(CY_WITH_NLS,
157 [AC_MSG_CHECKING([whether NLS is requested])
158 dnl Default is enabled NLS
160 [ --disable-nls do not use Native Language Support],
161 USE_NLS=$enableval, USE_NLS=yes)
162 AC_MSG_RESULT($USE_NLS)
165 USE_INCLUDED_LIBINTL=no
167 dnl If we use NLS figure out what method
168 if test "$USE_NLS" = "yes"; then
169 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
170 AC_MSG_CHECKING([whether included gettext is requested])
171 AC_ARG_WITH(included-gettext,
172 [ --with-included-gettext use the GNU gettext library included here],
173 nls_cv_force_use_gnu_gettext=$withval,
174 nls_cv_force_use_gnu_gettext=no)
175 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
177 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
178 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
179 dnl User does not insist on using GNU NLS library. Figure out what
180 dnl to use. If gettext or catgets are available (in this order) we
181 dnl use this. Else we have to fall back to GNU NLS library.
182 dnl catgets is only used if permitted by option --with-catgets.
187 AC_CHECK_HEADER(libintl.h,
188 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
189 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
190 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
192 if test "$gt_cv_func_gettext_libc" != "yes"; then
193 AC_CHECK_LIB(intl, bindtextdomain,
194 [AC_CACHE_CHECK([for gettext in libintl],
195 gt_cv_func_gettext_libintl,
196 [AC_TRY_LINK([], [return (int) gettext ("")],
197 gt_cv_func_gettext_libintl=yes,
198 gt_cv_func_gettext_libintl=no)])])
201 if test "$gt_cv_func_gettext_libc" = "yes" \
202 || test "$gt_cv_func_gettext_libintl" = "yes"; then
203 AC_DEFINE(HAVE_GETTEXT, 1,
204 [Define as 1 if you have gettext and don't want to use GNU gettext.])
205 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
206 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
207 if test "$MSGFMT" != "no"; then
208 AC_CHECK_FUNCS(dcgettext)
209 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
210 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
211 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
212 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
213 return _nl_msg_cat_cntr],
223 dnl In the standard gettext, we would now check for catgets.
224 dnl However, we never want to use catgets for our releases.
226 if test "$CATOBJEXT" = "NONE"; then
227 dnl Neither gettext nor catgets in included in the C library.
228 dnl Fall back on GNU gettext library.
229 nls_cv_use_gnu_gettext=yes
233 if test "$nls_cv_use_gnu_gettext" = "yes"; then
234 dnl Mark actions used to generate GNU NLS library.
235 INTLOBJS="\$(GETTOBJS)"
236 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
237 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
238 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
239 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
240 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
242 USE_INCLUDED_LIBINTL=yes
246 INTLDEPS='$(top_builddir)/../intl/libintl.a'
248 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
249 nls_cv_header_intl=libintl.h
250 nls_cv_header_libgt=libgettext.h
253 dnl Test whether we really found GNU xgettext.
254 if test "$XGETTEXT" != ":"; then
255 dnl If it is no GNU xgettext we define it as : so that the
256 dnl Makefiles still can work.
257 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
261 [found xgettext programs is not GNU xgettext; ignore it])
266 # We need to process the po/ directory.
270 nls_cv_header_intl=libintl.h
271 nls_cv_header_libgt=libgettext.h
274 # If this is used in GNU gettext we have to set USE_NLS to `yes'
275 # because some of the sources are only built for this goal.
276 if test "$PACKAGE" = gettext; then
278 USE_INCLUDED_LIBINTL=yes
281 dnl These rules are solely for the distribution goal. While doing this
282 dnl we only have to keep exactly one list of the available catalogs
284 for lang in $ALL_LINGUAS; do
285 GMOFILES="$GMOFILES $lang.gmo"
286 POFILES="$POFILES $lang.po"
289 dnl Make all variables we use known to autoconf.
290 AC_SUBST(USE_INCLUDED_LIBINTL)
293 AC_SUBST(DATADIRNAME)
303 AC_DEFUN(CY_GNU_GETTEXT,
304 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
305 AC_REQUIRE([AC_PROG_CC])dnl
306 AC_REQUIRE([AC_PROG_RANLIB])dnl
307 AC_REQUIRE([AC_ISC_POSIX])dnl
308 AC_REQUIRE([AC_HEADER_STDC])dnl
309 AC_REQUIRE([AC_C_CONST])dnl
310 AC_REQUIRE([AC_C_INLINE])dnl
311 AC_REQUIRE([AC_TYPE_OFF_T])dnl
312 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
313 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
314 AC_REQUIRE([AC_FUNC_MMAP])dnl
316 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
317 unistd.h values.h sys/param.h])
318 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
319 __argz_count __argz_stringify __argz_next])
321 if test "${ac_cv_func_stpcpy+set}" != "set"; then
322 AC_CHECK_FUNCS(stpcpy)
324 if test "${ac_cv_func_stpcpy}" = "yes"; then
325 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
331 if test "x$CATOBJEXT" != "x"; then
332 if test "x$ALL_LINGUAS" = "x"; then
335 AC_MSG_CHECKING(for catalogs to be installed)
337 for lang in ${LINGUAS=$ALL_LINGUAS}; do
338 case "$ALL_LINGUAS" in
339 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
343 AC_MSG_RESULT($LINGUAS)
346 dnl Construct list of names of catalog files to be constructed.
347 if test -n "$LINGUAS"; then
348 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
352 dnl The reference to <locale.h> in the installed <libintl.h> file
353 dnl must be resolved because we cannot expect the users of this
354 dnl to define HAVE_LOCALE_H.
355 if test $ac_cv_header_locale_h = yes; then
356 INCLUDE_LOCALE_H="#include <locale.h>"
359 /* The system does not provide the header <locale.h>. Take care yourself. */"
361 AC_SUBST(INCLUDE_LOCALE_H)
363 dnl Determine which catalog format we have (if any is needed)
364 dnl For now we know about two different formats:
365 dnl Linux libc-5 and the normal X/Open format
366 if test -f $srcdir/po2tbl.sed.in; then
367 if test "$CATOBJEXT" = ".cat"; then
368 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
370 dnl Transform the SED scripts while copying because some dumb SEDs
371 dnl cannot handle comments.
372 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
374 dnl po2tbl.sed is always needed.
375 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
376 $srcdir/po2tbl.sed.in > po2tbl.sed
379 dnl In the intl/Makefile.in we have a special dependency which makes
380 dnl only sense for gettext. We comment this out for non-gettext
382 if test "$PACKAGE" = "gettext"; then
392 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
393 AC_SUBST(MKINSTALLDIRS)
395 dnl *** For now the libtool support in intl/Makefile is not for real.
399 dnl Generate list of files to be processed by xgettext which will
400 dnl be included in po/Makefile. But only do this if the po directory
401 dnl exists in srcdir.
402 if test -d $srcdir/po; then
403 test -d po || mkdir po
404 if test "x$srcdir" != "x."; then
405 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
406 posrcprefix="$srcdir/"
408 posrcprefix="../$srcdir/"
414 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
415 < $srcdir/po/POTFILES.in > po/POTFILES
419 # Search path for a program which passes the given test.
420 # Ulrich Drepper <drepper@cygnus.com>, 1996.
422 # This file file be copied and used freely without restrictions. It can
423 # be used in projects which are not available under the GNU Public License
424 # but which still want to provide support for the GNU gettext functionality.
425 # Please note that the actual code is *not* freely available.
429 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
430 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
431 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
432 [# Extract the first word of "$2", so it can be a program name with args.
433 set dummy $2; ac_word=[$]2
434 AC_MSG_CHECKING([for $ac_word])
435 AC_CACHE_VAL(ac_cv_path_$1,
438 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
441 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
442 for ac_dir in ifelse([$5], , $PATH, [$5]); do
443 test -z "$ac_dir" && ac_dir=.
444 if test -f $ac_dir/$ac_word; then
446 ac_cv_path_$1="$ac_dir/$ac_word"
452 dnl If no 4th arg is given, leave the cache variable unset,
453 dnl so AC_PATH_PROGS will keep looking.
454 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
459 if test -n "[$]$1"; then
467 # Check whether LC_MESSAGES is available in <locale.h>.
468 # Ulrich Drepper <drepper@cygnus.com>, 1995.
470 # This file file be copied and used freely without restrictions. It can
471 # be used in projects which are not available under the GNU Public License
472 # but which still want to provide support for the GNU gettext functionality.
473 # Please note that the actual code is *not* freely available.
477 AC_DEFUN(AM_LC_MESSAGES,
478 [if test $ac_cv_header_locale_h = yes; then
479 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
480 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
481 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
482 if test $am_cv_val_LC_MESSAGES = yes; then
483 AC_DEFINE(HAVE_LC_MESSAGES, 1,
484 [Define if your locale.h file contains LC_MESSAGES.])
488 # Add --enable-maintainer-mode option to configure.
493 AC_DEFUN(AM_MAINTAINER_MODE,
494 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
495 dnl maintainer-mode is disabled by default
496 AC_ARG_ENABLE(maintainer-mode,
497 [ --enable-maintainer-mode enable make rules and dependencies not useful
498 (and sometimes confusing) to the casual installer],
499 USE_MAINTAINER_MODE=$enableval,
500 USE_MAINTAINER_MODE=no)
501 AC_MSG_RESULT($USE_MAINTAINER_MODE)
502 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
503 MAINT=$MAINTAINER_MODE_TRUE
508 # Define a conditional.
510 AC_DEFUN(AM_CONDITIONAL,