1 dnl aclocal.m4 generated automatically by aclocal 1.2f
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in 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.
14 # progtest.m4 from gettext 0.32
15 # Search path for a program which passes the given test.
16 # Ulrich Drepper <drepper@cygnus.com>, 1996.
18 # This file file be copied and used freely without restrictions. It can
19 # be used in projects which are not available under the GNU Public License
20 # but which still want to provide support for the GNU gettext functionality.
21 # Please note that the actual code is *not* freely available.
25 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
26 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
27 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
28 [# Extract the first word of "$2", so it can be a program name with args.
29 set dummy $2; ac_word=[$]2
30 AC_MSG_CHECKING([for $ac_word])
31 AC_CACHE_VAL(ac_cv_path_$1,
34 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
37 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
38 for ac_dir in ifelse([$5], , $PATH, [$5]); do
39 test -z "$ac_dir" && ac_dir=.
40 if test -f $ac_dir/$ac_word; then
42 ac_cv_path_$1="$ac_dir/$ac_word"
48 dnl If no 4th arg is given, leave the cache variable unset,
49 dnl so AC_PATH_PROGS will keep looking.
50 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
55 if test -n "[$]$1"; then
64 # lcmessage.m4 from gettext 0.32
65 # Check whether LC_MESSAGES is available in <locale.h>.
66 # Ulrich Drepper <drepper@cygnus.com>, 1995.
68 # This file file be copied and used freely without restrictions. It can
69 # be used in projects which are not available under the GNU Public License
70 # but which still want to provide support for the GNU gettext functionality.
71 # Please note that the actual code is *not* freely available.
75 AC_DEFUN(AM_LC_MESSAGES,
76 [if test $ac_cv_header_locale_h = yes; then
77 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
78 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
79 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
80 if test $am_cv_val_LC_MESSAGES = yes; then
81 AC_DEFINE(HAVE_LC_MESSAGES)
87 # gettext.m4 from gettext 0.32
88 # Macro to add for using GNU gettext.
89 # Ulrich Drepper <drepper@cygnus.com>, 1995.
91 # This file file be copied and used freely without restrictions. It can
92 # be used in projects which are not available under the GNU Public License
93 # but which still want to provide support for the GNU gettext functionality.
94 # Please note that the actual code is *not* freely available.
99 [AC_MSG_CHECKING([whether NLS is requested])
100 dnl Default is enabled NLS
102 [ --disable-nls do not use Native Language Support],
103 USE_NLS=$enableval, USE_NLS=yes)
104 AC_MSG_RESULT($USE_NLS)
107 USE_INCLUDED_LIBINTL=no
109 dnl If we use NLS figure out what method
110 if test "$USE_NLS" = "yes"; then
111 AC_DEFINE(ENABLE_NLS)
112 AC_MSG_CHECKING([whether included gettext is requested])
113 AC_ARG_WITH(included-gettext,
114 [ --with-included-gettext use the GNU gettext library included here],
115 nls_cv_force_use_gnu_gettext=$withval,
116 nls_cv_force_use_gnu_gettext=no)
117 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
119 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
120 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
121 dnl User does not insist on using GNU NLS library. Figure out what
122 dnl to use. If gettext or catgets are available (in this order) we
123 dnl use this. Else we have to fall back to GNU NLS library.
124 dnl catgets is only used if permitted by option --with-catgets.
129 AC_CHECK_HEADER(libintl.h,
130 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
131 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
132 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
134 if test "$gt_cv_func_gettext_libc" != "yes"; then
135 AC_CHECK_LIB(intl, bindtextdomain,
136 [AC_CACHE_CHECK([for gettext in libintl],
137 gt_cv_func_gettext_libintl,
138 [AC_TRY_LINK([], [return (int) gettext ("")],
139 gt_cv_func_gettext_libintl=yes,
140 gt_cv_func_gettext_libintl=no)])])
143 if test "$gt_cv_func_gettext_libc" = "yes" \
144 || test "$gt_cv_func_gettext_libintl" = "yes"; then
145 AC_DEFINE(HAVE_GETTEXT)
146 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
147 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
148 if test "$MSGFMT" != "no"; then
149 AC_CHECK_FUNCS(dcgettext)
150 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
151 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
152 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
153 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
154 return _nl_msg_cat_cntr],
164 if test "$CATOBJEXT" = "NONE"; then
165 AC_MSG_CHECKING([whether catgets can be used])
167 [ --with-catgets use catgets functions if available],
168 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
169 AC_MSG_RESULT($nls_cv_use_catgets)
171 if test "$nls_cv_use_catgets" = "yes"; then
172 dnl No gettext in C library. Try catgets next.
173 AC_CHECK_LIB(i, main)
174 AC_CHECK_FUNC(catgets,
175 [AC_DEFINE(HAVE_CATGETS)
176 INTLOBJS="\$(CATOBJS)"
177 AC_PATH_PROG(GENCAT, gencat, no)dnl
178 if test "$GENCAT" != "no"; then
179 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
180 if test "$GMSGFMT" = "no"; then
181 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
182 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
184 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
185 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
186 USE_INCLUDED_LIBINTL=yes
190 INTLDEPS='$(top_builddir)/intl/libintl.a'
192 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
193 nls_cv_header_intl=intl/libintl.h
194 nls_cv_header_libgt=intl/libgettext.h
199 if test "$CATOBJEXT" = "NONE"; then
200 dnl Neither gettext nor catgets in included in the C library.
201 dnl Fall back on GNU gettext library.
202 nls_cv_use_gnu_gettext=yes
206 if test "$nls_cv_use_gnu_gettext" = "yes"; then
207 dnl Mark actions used to generate GNU NLS library.
208 INTLOBJS="\$(GETTOBJS)"
209 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
210 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
211 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
212 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
213 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
215 USE_INCLUDED_LIBINTL=yes
219 INTLDEPS='$(top_builddir)/intl/libintl.a'
221 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
222 nls_cv_header_intl=intl/libintl.h
223 nls_cv_header_libgt=intl/libgettext.h
226 dnl Test whether we really found GNU xgettext.
227 if test "$XGETTEXT" != ":"; then
228 dnl If it is no GNU xgettext we define it as : so that the
229 dnl Makefiles still can work.
230 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
234 [found xgettext programs is not GNU xgettext; ignore it])
239 # We need to process the po/ directory.
243 nls_cv_header_intl=intl/libintl.h
244 nls_cv_header_libgt=intl/libgettext.h
247 # If this is used in GNU gettext we have to set USE_NLS to `yes'
248 # because some of the sources are only built for this goal.
249 if test "$PACKAGE" = gettext; then
251 USE_INCLUDED_LIBINTL=yes
254 dnl These rules are solely for the distribution goal. While doing this
255 dnl we only have to keep exactly one list of the available catalogs
257 for lang in $ALL_LINGUAS; do
258 GMOFILES="$GMOFILES $lang.gmo"
259 POFILES="$POFILES $lang.po"
262 dnl Make all variables we use known to autoconf.
263 AC_SUBST(USE_INCLUDED_LIBINTL)
266 AC_SUBST(DATADIRNAME)
276 AC_DEFUN(AM_GNU_GETTEXT,
277 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
278 AC_REQUIRE([AC_PROG_CC])dnl
279 AC_REQUIRE([AC_PROG_RANLIB])dnl
280 AC_REQUIRE([AC_ISC_POSIX])dnl
281 AC_REQUIRE([AC_HEADER_STDC])dnl
282 AC_REQUIRE([AC_C_CONST])dnl
283 AC_REQUIRE([AC_C_INLINE])dnl
284 AC_REQUIRE([AC_TYPE_OFF_T])dnl
285 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
286 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
287 AC_REQUIRE([AC_FUNC_MMAP])dnl
289 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
290 unistd.h values.h sys/param.h])
291 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
292 __argz_count __argz_stringify __argz_next])
294 if test "${ac_cv_func_stpcpy+set}" != "set"; then
295 AC_CHECK_FUNCS(stpcpy)
297 if test "${ac_cv_func_stpcpy}" = "yes"; then
298 AC_DEFINE(HAVE_STPCPY)
304 if test "x$CATOBJEXT" != "x"; then
305 if test "x$ALL_LINGUAS" = "x"; then
308 AC_MSG_CHECKING(for catalogs to be installed)
310 for lang in ${LINGUAS=$ALL_LINGUAS}; do
311 case "$ALL_LINGUAS" in
312 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
316 AC_MSG_RESULT($LINGUAS)
319 dnl Construct list of names of catalog files to be constructed.
320 if test -n "$LINGUAS"; then
321 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
325 dnl The reference to <locale.h> in the installed <libintl.h> file
326 dnl must be resolved because we cannot expect the users of this
327 dnl to define HAVE_LOCALE_H.
328 if test $ac_cv_header_locale_h = yes; then
329 INCLUDE_LOCALE_H="#include <locale.h>"
332 /* The system does not provide the header <locale.h>. Take care yourself. */"
334 AC_SUBST(INCLUDE_LOCALE_H)
336 dnl Determine which catalog format we have (if any is needed)
337 dnl For now we know about two different formats:
338 dnl Linux libc-5 and the normal X/Open format
339 test -d intl || mkdir intl
340 if test "$CATOBJEXT" = ".cat"; then
341 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
343 dnl Transform the SED scripts while copying because some dumb SEDs
344 dnl cannot handle comments.
345 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
347 dnl po2tbl.sed is always needed.
348 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
349 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
351 dnl In the intl/Makefile.in we have a special dependency which makes
352 dnl only sense for gettext. We comment this out for non-gettext
354 if test "$PACKAGE" = "gettext"; then
364 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
365 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
366 dnl Try to locate is.
368 if test -z "$MKINSTALLDIRS"; then
369 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
371 AC_SUBST(MKINSTALLDIRS)
373 dnl *** For now the libtool support in intl/Makefile is not for real.
377 dnl Generate list of files to be processed by xgettext which will
378 dnl be included in po/Makefile.
379 test -d po || mkdir po
380 if test "x$srcdir" != "x."; then
381 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
382 posrcprefix="$srcdir/"
384 posrcprefix="../$srcdir/"
390 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
391 < $srcdir/po/POTFILES.in > po/POTFILES