]>
Commit | Line | Data |
---|---|---|
cf058bf8 JB |
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 | |
3 | @@ -78,314 +78,3 @@ | |
4 | AC_SUBST(translit($1,[a-z],[A-Z])) | |
5 | ]) | |
6 | ||
7 | -###################################################################### | |
8 | -# gettext.m4 from gettext 0.32 | |
9 | -###################################################################### | |
10 | -# Macro to add for using GNU gettext. | |
11 | -# Ulrich Drepper <drepper@cygnus.com>, 1995. | |
12 | -# | |
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. | |
17 | - | |
18 | -# serial 3 | |
19 | - | |
20 | -AC_DEFUN(AM_WITH_NLS, | |
21 | - [AC_MSG_CHECKING([whether NLS is requested]) | |
22 | - dnl Default is enabled NLS | |
23 | - AC_ARG_ENABLE(nls, | |
24 | - [ --disable-nls do not use Native Language Support], | |
25 | - USE_NLS=$enableval, USE_NLS=yes) | |
26 | - AC_MSG_RESULT($USE_NLS) | |
27 | - AC_SUBST(USE_NLS) | |
28 | - | |
29 | - USE_INCLUDED_LIBINTL=no | |
30 | - | |
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) | |
40 | - | |
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. | |
47 | - nls_cv_header_intl= | |
48 | - nls_cv_header_libgt= | |
49 | - CATOBJEXT=NONE | |
50 | - | |
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)]) | |
55 | - | |
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)])]) | |
63 | - fi | |
64 | - | |
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], | |
77 | - [CATOBJEXT=.gmo | |
78 | - DATADIRNAME=share], | |
79 | - [CATOBJEXT=.mo | |
80 | - DATADIRNAME=lib]) | |
81 | - INSTOBJEXT=.mo | |
82 | - fi | |
83 | - fi | |
84 | - ]) | |
85 | - | |
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) | |
92 | - | |
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) | |
105 | - fi | |
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 | |
109 | - CATOBJEXT=.cat | |
110 | - INSTOBJEXT=.cat | |
111 | - DATADIRNAME=lib | |
112 | - INTLDEPS='$(top_builddir)/intl/libintl.a' | |
113 | - INTLLIBS=$INTLDEPS | |
114 | - LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
115 | - nls_cv_header_intl=intl/libintl.h | |
116 | - nls_cv_header_libgt=intl/libgettext.h | |
117 | - fi]) | |
118 | - fi | |
119 | - fi | |
120 | - | |
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 | |
125 | - fi | |
126 | - fi | |
127 | - | |
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)'`"], :) | |
136 | - AC_SUBST(MSGFMT) | |
137 | - USE_INCLUDED_LIBINTL=yes | |
138 | - CATOBJEXT=.gmo | |
139 | - INSTOBJEXT=.mo | |
140 | - DATADIRNAME=share | |
141 | - INTLDEPS='$(top_builddir)/intl/libintl.a' | |
142 | - INTLLIBS=$INTLDEPS | |
143 | - LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
144 | - nls_cv_header_intl=intl/libintl.h | |
145 | - nls_cv_header_libgt=intl/libgettext.h | |
146 | - fi | |
147 | - | |
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 | |
153 | - : ; | |
154 | - else | |
155 | - AC_MSG_RESULT( | |
156 | - [found xgettext programs is not GNU xgettext; ignore it]) | |
157 | - XGETTEXT=":" | |
158 | - fi | |
159 | - fi | |
160 | - | |
161 | - # We need to process the po/ directory. | |
162 | - POSUB=po | |
163 | - else | |
164 | - DATADIRNAME=share | |
165 | - nls_cv_header_intl=intl/libintl.h | |
166 | - nls_cv_header_libgt=intl/libgettext.h | |
167 | - fi | |
168 | - | |
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 | |
172 | - USE_NLS=yes | |
173 | - USE_INCLUDED_LIBINTL=yes | |
174 | - fi | |
175 | - | |
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" | |
182 | - done | |
183 | - | |
184 | - dnl Make all variables we use known to autoconf. | |
185 | - AC_SUBST(USE_INCLUDED_LIBINTL) | |
186 | - AC_SUBST(CATALOGS) | |
187 | - AC_SUBST(CATOBJEXT) | |
188 | - AC_SUBST(DATADIRNAME) | |
189 | - AC_SUBST(GMOFILES) | |
190 | - AC_SUBST(INSTOBJEXT) | |
191 | - AC_SUBST(INTLDEPS) | |
192 | - AC_SUBST(INTLLIBS) | |
193 | - AC_SUBST(INTLOBJS) | |
194 | - AC_SUBST(POFILES) | |
195 | - AC_SUBST(POSUB) | |
196 | - ]) | |
197 | - | |
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 | |
210 | - | |
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]) | |
215 | - | |
216 | - if test "${ac_cv_func_stpcpy+set}" != "set"; then | |
217 | - AC_CHECK_FUNCS(stpcpy) | |
218 | - fi | |
219 | - if test "${ac_cv_func_stpcpy}" = "yes"; then | |
220 | - AC_DEFINE(HAVE_STPCPY) | |
221 | - fi | |
222 | - | |
223 | - AM_LC_MESSAGES | |
224 | - AM_WITH_NLS | |
225 | - | |
226 | - if test "x$CATOBJEXT" != "x"; then | |
227 | - if test "x$ALL_LINGUAS" = "x"; then | |
228 | - LINGUAS= | |
229 | - else | |
230 | - AC_MSG_CHECKING(for catalogs to be installed) | |
231 | - NEW_LINGUAS= | |
232 | - for lang in ${LINGUAS=$ALL_LINGUAS}; do | |
233 | - case "$ALL_LINGUAS" in | |
234 | - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; | |
235 | - esac | |
236 | - done | |
237 | - LINGUAS=$NEW_LINGUAS | |
238 | - AC_MSG_RESULT($LINGUAS) | |
239 | - fi | |
240 | - | |
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 | |
244 | - fi | |
245 | - fi | |
246 | - | |
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>" | |
252 | - else | |
253 | - INCLUDE_LOCALE_H="\ | |
254 | -/* The system does not provide the header <locale.h>. Take care yourself. */" | |
255 | - fi | |
256 | - AC_SUBST(INCLUDE_LOCALE_H) | |
257 | - | |
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) | |
264 | - | |
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 | |
268 | - fi | |
269 | - dnl po2tbl.sed is always needed. | |
270 | - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ | |
271 | - $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed | |
272 | - | |
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 | |
275 | - dnl packages. | |
276 | - if test "$PACKAGE" = "gettext"; then | |
277 | - GT_NO="#NO#" | |
278 | - GT_YES= | |
279 | - else | |
280 | - GT_NO= | |
281 | - GT_YES="#YES#" | |
282 | - fi | |
283 | - AC_SUBST(GT_NO) | |
284 | - AC_SUBST(GT_YES) | |
285 | - | |
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. | |
289 | - MKINSTALLDIRS= | |
290 | - if test -n "$ac_aux_dir"; then | |
291 | - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" | |
292 | - fi | |
293 | - if test -z "$MKINSTALLDIRS"; then | |
294 | - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" | |
295 | - fi | |
296 | - AC_SUBST(MKINSTALLDIRS) | |
297 | - | |
298 | - dnl *** For now the libtool support in intl/Makefile is not for real. | |
299 | - l= | |
300 | - AC_SUBST(l) | |
301 | - | |
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/" | |
308 | - else | |
309 | - posrcprefix="../$srcdir/" | |
310 | - fi | |
311 | - else | |
312 | - posrcprefix="../" | |
313 | - fi | |
314 | - rm -f po/POTFILES | |
315 | - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ | |
316 | - < $srcdir/po/POTFILES.in > po/POTFILES | |
317 | - ]) |