1 --- console-tools-0.3.3/acinclude.m4.orig Thu Apr 8 23:29:39 1999
2 +++ console-tools-0.3.3/acinclude.m4 Mon Oct 8 21:52:40 2001
4 AC_SUBST(translit($1,[a-z],[A-Z]))
7 -######################################################################
8 -# gettext.m4 from gettext 0.32
9 -######################################################################
10 -# Macro to add for using GNU gettext.
11 -# Ulrich Drepper <drepper@cygnus.com>, 1995.
13 -# This file file be copied and used freely without restrictions. It can
14 -# be used in projects which are not available under the GNU Public License
15 -# but which still want to provide support for the GNU gettext functionality.
16 -# Please note that the actual code is *not* freely available.
20 -AC_DEFUN(AM_WITH_NLS,
21 - [AC_MSG_CHECKING([whether NLS is requested])
22 - dnl Default is enabled NLS
24 - [ --disable-nls do not use Native Language Support],
25 - USE_NLS=$enableval, USE_NLS=yes)
26 - AC_MSG_RESULT($USE_NLS)
29 - USE_INCLUDED_LIBINTL=no
31 - dnl If we use NLS figure out what method
32 - if test "$USE_NLS" = "yes"; then
33 - AC_DEFINE(ENABLE_NLS)
34 - AC_MSG_CHECKING([whether included gettext is requested])
35 - AC_ARG_WITH(included-gettext,
36 - [ --with-included-gettext use the GNU gettext library included here],
37 - nls_cv_force_use_gnu_gettext=$withval,
38 - nls_cv_force_use_gnu_gettext=no)
39 - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
41 - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
42 - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
43 - dnl User does not insist on using GNU NLS library. Figure out what
44 - dnl to use. If gettext or catgets are available (in this order) we
45 - dnl use this. Else we have to fall back to GNU NLS library.
46 - dnl catgets is only used if permitted by option --with-catgets.
48 - nls_cv_header_libgt=
51 - AC_CHECK_HEADER(libintl.h,
52 - [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
53 - [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
54 - gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
56 - if test "$gt_cv_func_gettext_libc" != "yes"; then
57 - AC_CHECK_LIB(intl, bindtextdomain,
58 - [AC_CACHE_CHECK([for gettext in libintl],
59 - gt_cv_func_gettext_libintl,
60 - [AC_TRY_LINK([], [return (int) gettext ("")],
61 - gt_cv_func_gettext_libintl=yes,
62 - gt_cv_func_gettext_libintl=no)])])
65 - if test "$gt_cv_func_gettext_libc" = "yes" \
66 - || test "$gt_cv_func_gettext_libintl" = "yes"; then
67 - AC_DEFINE(HAVE_GETTEXT)
68 - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
69 - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
70 - if test "$MSGFMT" != "no"; then
71 - AC_CHECK_FUNCS(dcgettext)
72 - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
73 - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
74 - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
75 - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
76 - return _nl_msg_cat_cntr],
86 - if test "$CATOBJEXT" = "NONE"; then
87 - AC_MSG_CHECKING([whether catgets can be used])
88 - AC_ARG_WITH(catgets,
89 - [ --with-catgets use catgets functions if available],
90 - nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
91 - AC_MSG_RESULT($nls_cv_use_catgets)
93 - if test "$nls_cv_use_catgets" = "yes"; then
94 - dnl No gettext in C library. Try catgets next.
95 - AC_CHECK_LIB(i, main)
96 - AC_CHECK_FUNC(catgets,
97 - [AC_DEFINE(HAVE_CATGETS)
98 - INTLOBJS="\$(CATOBJS)"
99 - AC_PATH_PROG(GENCAT, gencat, no)dnl
100 - if test "$GENCAT" != "no"; then
101 - AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
102 - if test "$GMSGFMT" = "no"; then
103 - AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
104 - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
106 - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
107 - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
108 - USE_INCLUDED_LIBINTL=yes
112 - INTLDEPS='$(top_builddir)/intl/libintl.a'
114 - LIBS=`echo $LIBS | sed -e 's/-lintl//'`
115 - nls_cv_header_intl=intl/libintl.h
116 - nls_cv_header_libgt=intl/libgettext.h
121 - if test "$CATOBJEXT" = "NONE"; then
122 - dnl Neither gettext nor catgets in included in the C library.
123 - dnl Fall back on GNU gettext library.
124 - nls_cv_use_gnu_gettext=yes
128 - if test "$nls_cv_use_gnu_gettext" = "yes"; then
129 - dnl Mark actions used to generate GNU NLS library.
130 - INTLOBJS="\$(GETTOBJS)"
131 - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
132 - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
133 - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
134 - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
135 - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
137 - USE_INCLUDED_LIBINTL=yes
141 - INTLDEPS='$(top_builddir)/intl/libintl.a'
143 - LIBS=`echo $LIBS | sed -e 's/-lintl//'`
144 - nls_cv_header_intl=intl/libintl.h
145 - nls_cv_header_libgt=intl/libgettext.h
148 - dnl Test whether we really found GNU xgettext.
149 - if test "$XGETTEXT" != ":"; then
150 - dnl If it is no GNU xgettext we define it as : so that the
151 - dnl Makefiles still can work.
152 - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
156 - [found xgettext programs is not GNU xgettext; ignore it])
161 - # We need to process the po/ directory.
165 - nls_cv_header_intl=intl/libintl.h
166 - nls_cv_header_libgt=intl/libgettext.h
169 - # If this is used in GNU gettext we have to set USE_NLS to `yes'
170 - # because some of the sources are only built for this goal.
171 - if test "$PACKAGE" = gettext; then
173 - USE_INCLUDED_LIBINTL=yes
176 - dnl These rules are solely for the distribution goal. While doing this
177 - dnl we only have to keep exactly one list of the available catalogs
178 - dnl in configure.in.
179 - for lang in $ALL_LINGUAS; do
180 - GMOFILES="$GMOFILES $lang.gmo"
181 - POFILES="$POFILES $lang.po"
184 - dnl Make all variables we use known to autoconf.
185 - AC_SUBST(USE_INCLUDED_LIBINTL)
187 - AC_SUBST(CATOBJEXT)
188 - AC_SUBST(DATADIRNAME)
190 - AC_SUBST(INSTOBJEXT)
198 -AC_DEFUN(AM_GNU_GETTEXT,
199 - [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
200 - AC_REQUIRE([AC_PROG_CC])dnl
201 - AC_REQUIRE([AC_PROG_RANLIB])dnl
202 - AC_REQUIRE([AC_ISC_POSIX])dnl
203 - AC_REQUIRE([AC_HEADER_STDC])dnl
204 - AC_REQUIRE([AC_C_CONST])dnl
205 - AC_REQUIRE([AC_C_INLINE])dnl
206 - AC_REQUIRE([AC_TYPE_OFF_T])dnl
207 - AC_REQUIRE([AC_TYPE_SIZE_T])dnl
208 - AC_REQUIRE([AC_FUNC_ALLOCA])dnl
209 - AC_REQUIRE([AC_FUNC_MMAP])dnl
211 - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
212 -unistd.h values.h sys/param.h])
213 - AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
214 -__argz_count __argz_stringify __argz_next])
216 - if test "${ac_cv_func_stpcpy+set}" != "set"; then
217 - AC_CHECK_FUNCS(stpcpy)
219 - if test "${ac_cv_func_stpcpy}" = "yes"; then
220 - AC_DEFINE(HAVE_STPCPY)
226 - if test "x$CATOBJEXT" != "x"; then
227 - if test "x$ALL_LINGUAS" = "x"; then
230 - AC_MSG_CHECKING(for catalogs to be installed)
232 - for lang in ${LINGUAS=$ALL_LINGUAS}; do
233 - case "$ALL_LINGUAS" in
234 - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
237 - LINGUAS=$NEW_LINGUAS
238 - AC_MSG_RESULT($LINGUAS)
241 - dnl Construct list of names of catalog files to be constructed.
242 - if test -n "$LINGUAS"; then
243 - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
247 - dnl The reference to <locale.h> in the installed <libintl.h> file
248 - dnl must be resolved because we cannot expect the users of this
249 - dnl to define HAVE_LOCALE_H.
250 - if test $ac_cv_header_locale_h = yes; then
251 - INCLUDE_LOCALE_H="#include <locale.h>"
253 - INCLUDE_LOCALE_H="\
254 -/* The system does not provide the header <locale.h>. Take care yourself. */"
256 - AC_SUBST(INCLUDE_LOCALE_H)
258 - dnl Determine which catalog format we have (if any is needed)
259 - dnl For now we know about two different formats:
260 - dnl Linux libc-5 and the normal X/Open format
261 - test -d intl || mkdir intl
262 - if test "$CATOBJEXT" = ".cat"; then
263 - AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
265 - dnl Transform the SED scripts while copying because some dumb SEDs
266 - dnl cannot handle comments.
267 - sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
269 - dnl po2tbl.sed is always needed.
270 - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
271 - $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
273 - dnl In the intl/Makefile.in we have a special dependency which makes
274 - dnl only sense for gettext. We comment this out for non-gettext
276 - if test "$PACKAGE" = "gettext"; then
286 - dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
287 - dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
288 - dnl Try to locate is.
290 - if test -n "$ac_aux_dir"; then
291 - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
293 - if test -z "$MKINSTALLDIRS"; then
294 - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
296 - AC_SUBST(MKINSTALLDIRS)
298 - dnl *** For now the libtool support in intl/Makefile is not for real.
302 - dnl Generate list of files to be processed by xgettext which will
303 - dnl be included in po/Makefile.
304 - test -d po || mkdir po
305 - if test "x$srcdir" != "x."; then
306 - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
307 - posrcprefix="$srcdir/"
309 - posrcprefix="../$srcdir/"
315 - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
316 - < $srcdir/po/POTFILES.in > po/POTFILES