Commit | Line | Data |
---|---|---|
bb69a2b6 TT |
1 | dnl aclocal.m4 generated automatically by aclocal 1.2e |
2 | ||
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. | |
7 | ||
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. | |
12 | ||
13 | # Like AC_CONFIG_HEADER, but automatically create stamp file. | |
14 | ||
15 | AC_DEFUN(AM_CONFIG_HEADER, | |
16 | [AC_PREREQ([2.12]) | |
17 | AC_CONFIG_HEADER([$1]) | |
18 | dnl When config.status generates a header, we must update the stamp-h file. | |
19 | dnl This file resides in the same directory as the config header | |
20 | dnl that is generated. We must strip everything past the first ":", | |
21 | dnl and everything past the last "/". | |
22 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
23 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
24 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
25 | <<am_indx=1 | |
26 | for am_file in <<$1>>; do | |
27 | case " <<$>>CONFIG_HEADERS " in | |
28 | *" <<$>>am_file "*<<)>> | |
29 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
30 | ;; | |
31 | esac | |
32 | am_indx=`expr "<<$>>am_indx" + 1` | |
33 | done<<>>dnl>>) | |
34 | changequote([,]))]) | |
35 | ||
36 | ||
37 | # serial 1 | |
38 | ||
39 | AC_DEFUN(AM_PROG_INSTALL, | |
40 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
41 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
42 | AC_SUBST(INSTALL_SCRIPT)dnl | |
43 | ]) | |
44 | ||
45 | # This file is derived from `gettext.m4'. The difference is that the | |
46 | # included macros assume Cygnus-style source and build trees. | |
47 | ||
48 | # Macro to add for using GNU gettext. | |
49 | # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
50 | # | |
51 | # This file file be copied and used freely without restrictions. It can | |
52 | # be used in projects which are not available under the GNU Public License | |
53 | # but which still want to provide support for the GNU gettext functionality. | |
54 | # Please note that the actual code is *not* freely available. | |
55 | ||
56 | # serial 3 | |
57 | ||
58 | AC_DEFUN(CY_WITH_NLS, | |
59 | [AC_MSG_CHECKING([whether NLS is requested]) | |
60 | dnl Default is enabled NLS | |
61 | AC_ARG_ENABLE(nls, | |
62 | [ --disable-nls do not use Native Language Support], | |
63 | USE_NLS=$enableval, USE_NLS=yes) | |
64 | AC_MSG_RESULT($USE_NLS) | |
65 | AC_SUBST(USE_NLS) | |
66 | ||
67 | USE_INCLUDED_LIBINTL=no | |
68 | ||
69 | dnl If we use NLS figure out what method | |
70 | if test "$USE_NLS" = "yes"; then | |
71 | AC_DEFINE(ENABLE_NLS) | |
72 | AC_MSG_CHECKING([whether included gettext is requested]) | |
73 | AC_ARG_WITH(included-gettext, | |
74 | [ --with-included-gettext use the GNU gettext library included here], | |
75 | nls_cv_force_use_gnu_gettext=$withval, | |
76 | nls_cv_force_use_gnu_gettext=no) | |
77 | AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) | |
78 | ||
79 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" | |
80 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then | |
81 | dnl User does not insist on using GNU NLS library. Figure out what | |
82 | dnl to use. If gettext or catgets are available (in this order) we | |
83 | dnl use this. Else we have to fall back to GNU NLS library. | |
84 | dnl catgets is only used if permitted by option --with-catgets. | |
85 | nls_cv_header_intl= | |
86 | nls_cv_header_libgt= | |
87 | CATOBJEXT=NONE | |
88 | ||
89 | AC_CHECK_HEADER(libintl.h, | |
90 | [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, | |
91 | [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], | |
92 | gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) | |
93 | ||
94 | if test "$gt_cv_func_gettext_libc" != "yes"; then | |
95 | AC_CHECK_LIB(intl, bindtextdomain, | |
96 | [AC_CACHE_CHECK([for gettext in libintl], | |
97 | gt_cv_func_gettext_libintl, | |
98 | [AC_TRY_LINK([], [return (int) gettext ("")], | |
99 | gt_cv_func_gettext_libintl=yes, | |
100 | gt_cv_func_gettext_libintl=no)])]) | |
101 | fi | |
102 | ||
103 | if test "$gt_cv_func_gettext_libc" = "yes" \ | |
104 | || test "$gt_cv_func_gettext_libintl" = "yes"; then | |
105 | AC_DEFINE(HAVE_GETTEXT) | |
106 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
107 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl | |
108 | if test "$MSGFMT" != "no"; then | |
109 | AC_CHECK_FUNCS(dcgettext) | |
110 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
111 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
112 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
113 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; | |
114 | return _nl_msg_cat_cntr], | |
115 | [CATOBJEXT=.gmo | |
116 | DATADIRNAME=share], | |
117 | [CATOBJEXT=.mo | |
118 | DATADIRNAME=lib]) | |
119 | INSTOBJEXT=.mo | |
120 | fi | |
121 | fi | |
122 | ]) | |
123 | ||
124 | if test "$CATOBJEXT" = "NONE"; then | |
125 | AC_MSG_CHECKING([whether catgets can be used]) | |
126 | AC_ARG_WITH(catgets, | |
127 | [ --with-catgets use catgets functions if available], | |
128 | nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) | |
129 | AC_MSG_RESULT($nls_cv_use_catgets) | |
130 | ||
131 | if test "$nls_cv_use_catgets" = "yes"; then | |
132 | dnl No gettext in C library. Try catgets next. | |
133 | AC_CHECK_LIB(i, main) | |
134 | AC_CHECK_FUNC(catgets, | |
135 | [AC_DEFINE(HAVE_CATGETS) | |
136 | INTLOBJS="\$(CATOBJS)" | |
137 | AC_PATH_PROG(GENCAT, gencat, no)dnl | |
138 | if test "$GENCAT" != "no"; then | |
139 | AC_PATH_PROG(GMSGFMT, gmsgfmt, no) | |
140 | if test "$GMSGFMT" = "no"; then | |
141 | AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, | |
142 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) | |
143 | fi | |
144 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
145 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
146 | USE_INCLUDED_LIBINTL=yes | |
147 | CATOBJEXT=.cat | |
148 | INSTOBJEXT=.cat | |
149 | DATADIRNAME=lib | |
150 | INTLDEPS='$(top_builddir)/../intl/libintl.a' | |
151 | INTLLIBS=$INTLDEPS | |
152 | LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
153 | nls_cv_header_intl=intl/libintl.h | |
154 | nls_cv_header_libgt=intl/libgettext.h | |
155 | fi]) | |
156 | fi | |
157 | fi | |
158 | ||
159 | if test "$CATOBJEXT" = "NONE"; then | |
160 | dnl Neither gettext nor catgets in included in the C library. | |
161 | dnl Fall back on GNU gettext library. | |
162 | nls_cv_use_gnu_gettext=yes | |
163 | fi | |
164 | fi | |
165 | ||
166 | if test "$nls_cv_use_gnu_gettext" = "yes"; then | |
167 | dnl Mark actions used to generate GNU NLS library. | |
168 | INTLOBJS="\$(GETTOBJS)" | |
169 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
170 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) | |
171 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
172 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
173 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
174 | AC_SUBST(MSGFMT) | |
175 | USE_INCLUDED_LIBINTL=yes | |
176 | CATOBJEXT=.gmo | |
177 | INSTOBJEXT=.mo | |
178 | DATADIRNAME=share | |
179 | INTLDEPS='$(top_builddir)/../intl/libintl.a' | |
180 | INTLLIBS=$INTLDEPS | |
181 | LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
182 | nls_cv_header_intl=intl/libintl.h | |
183 | nls_cv_header_libgt=intl/libgettext.h | |
184 | fi | |
185 | ||
186 | dnl Test whether we really found GNU xgettext. | |
187 | if test "$XGETTEXT" != ":"; then | |
188 | dnl If it is no GNU xgettext we define it as : so that the | |
189 | dnl Makefiles still can work. | |
190 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then | |
191 | : ; | |
192 | else | |
193 | AC_MSG_RESULT( | |
194 | [found xgettext programs is not GNU xgettext; ignore it]) | |
195 | XGETTEXT=":" | |
196 | fi | |
197 | fi | |
198 | ||
199 | # We need to process the po/ directory. | |
200 | POSUB=po | |
201 | else | |
202 | DATADIRNAME=share | |
203 | nls_cv_header_intl=intl/libintl.h | |
204 | nls_cv_header_libgt=intl/libgettext.h | |
205 | fi | |
206 | ||
207 | # If this is used in GNU gettext we have to set USE_NLS to `yes' | |
208 | # because some of the sources are only built for this goal. | |
209 | if test "$PACKAGE" = gettext; then | |
210 | USE_NLS=yes | |
211 | USE_INCLUDED_LIBINTL=yes | |
212 | fi | |
213 | ||
214 | dnl These rules are solely for the distribution goal. While doing this | |
215 | dnl we only have to keep exactly one list of the available catalogs | |
216 | dnl in configure.in. | |
217 | for lang in $ALL_LINGUAS; do | |
218 | GMOFILES="$GMOFILES $lang.gmo" | |
219 | POFILES="$POFILES $lang.po" | |
220 | done | |
221 | ||
222 | dnl Make all variables we use known to autoconf. | |
223 | AC_SUBST(USE_INCLUDED_LIBINTL) | |
224 | AC_SUBST(CATALOGS) | |
225 | AC_SUBST(CATOBJEXT) | |
226 | AC_SUBST(DATADIRNAME) | |
227 | AC_SUBST(GMOFILES) | |
228 | AC_SUBST(INSTOBJEXT) | |
229 | AC_SUBST(INTLDEPS) | |
230 | AC_SUBST(INTLLIBS) | |
231 | AC_SUBST(INTLOBJS) | |
232 | AC_SUBST(POFILES) | |
233 | AC_SUBST(POSUB) | |
234 | ]) | |
235 | ||
236 | AC_DEFUN(CY_GNU_GETTEXT, | |
237 | [AC_REQUIRE([AC_PROG_MAKE_SET])dnl | |
238 | AC_REQUIRE([AC_PROG_CC])dnl | |
239 | AC_REQUIRE([AC_PROG_RANLIB])dnl | |
240 | AC_REQUIRE([AC_ISC_POSIX])dnl | |
241 | AC_REQUIRE([AC_HEADER_STDC])dnl | |
242 | AC_REQUIRE([AC_C_CONST])dnl | |
243 | AC_REQUIRE([AC_C_INLINE])dnl | |
244 | AC_REQUIRE([AC_TYPE_OFF_T])dnl | |
245 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl | |
246 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl | |
247 | AC_REQUIRE([AC_FUNC_MMAP])dnl | |
248 | ||
249 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ | |
250 | unistd.h values.h sys/param.h]) | |
251 | AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ | |
252 | __argz_count __argz_stringify __argz_next]) | |
253 | ||
254 | if test "${ac_cv_func_stpcpy+set}" != "set"; then | |
255 | AC_CHECK_FUNCS(stpcpy) | |
256 | fi | |
257 | if test "${ac_cv_func_stpcpy}" = "yes"; then | |
258 | AC_DEFINE(HAVE_STPCPY) | |
259 | fi | |
260 | ||
261 | AM_LC_MESSAGES | |
262 | CY_WITH_NLS | |
263 | ||
264 | if test "x$CATOBJEXT" != "x"; then | |
265 | if test "x$ALL_LINGUAS" = "x"; then | |
266 | LINGUAS= | |
267 | else | |
268 | AC_MSG_CHECKING(for catalogs to be installed) | |
269 | NEW_LINGUAS= | |
270 | for lang in ${LINGUAS=$ALL_LINGUAS}; do | |
271 | case "$ALL_LINGUAS" in | |
272 | *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; | |
273 | esac | |
274 | done | |
275 | LINGUAS=$NEW_LINGUAS | |
276 | AC_MSG_RESULT($LINGUAS) | |
277 | fi | |
278 | ||
279 | dnl Construct list of names of catalog files to be constructed. | |
280 | if test -n "$LINGUAS"; then | |
281 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done | |
282 | fi | |
283 | fi | |
284 | ||
285 | dnl The reference to <locale.h> in the installed <libintl.h> file | |
286 | dnl must be resolved because we cannot expect the users of this | |
287 | dnl to define HAVE_LOCALE_H. | |
288 | if test $ac_cv_header_locale_h = yes; then | |
289 | INCLUDE_LOCALE_H="#include <locale.h>" | |
290 | else | |
291 | INCLUDE_LOCALE_H="\ | |
292 | /* The system does not provide the header <locale.h>. Take care yourself. */" | |
293 | fi | |
294 | AC_SUBST(INCLUDE_LOCALE_H) | |
295 | ||
296 | dnl Determine which catalog format we have (if any is needed) | |
297 | dnl For now we know about two different formats: | |
298 | dnl Linux libc-5 and the normal X/Open format | |
299 | if test -f $srcdir/po2tbl.sed.in; then | |
300 | if test "$CATOBJEXT" = ".cat"; then | |
301 | AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) | |
302 | ||
303 | dnl Transform the SED scripts while copying because some dumb SEDs | |
304 | dnl cannot handle comments. | |
305 | sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed | |
306 | fi | |
307 | dnl po2tbl.sed is always needed. | |
308 | sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ | |
309 | $srcdir/po2tbl.sed.in > po2tbl.sed | |
310 | fi | |
311 | ||
312 | dnl In the intl/Makefile.in we have a special dependency which makes | |
313 | dnl only sense for gettext. We comment this out for non-gettext | |
314 | dnl packages. | |
315 | if test "$PACKAGE" = "gettext"; then | |
316 | GT_NO="#NO#" | |
317 | GT_YES= | |
318 | else | |
319 | GT_NO= | |
320 | GT_YES="#YES#" | |
321 | fi | |
322 | AC_SUBST(GT_NO) | |
323 | AC_SUBST(GT_YES) | |
324 | ||
325 | MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" | |
326 | AC_SUBST(MKINSTALLDIRS) | |
327 | ||
328 | dnl *** For now the libtool support in intl/Makefile is not for real. | |
329 | l= | |
330 | AC_SUBST(l) | |
331 | ||
332 | dnl Generate list of files to be processed by xgettext which will | |
333 | dnl be included in po/Makefile. But only do this if the po directory | |
334 | dnl exists in srcdir. | |
335 | if test -d $srcdir/po; then | |
336 | test -d po || mkdir po | |
337 | if test "x$srcdir" != "x."; then | |
338 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then | |
339 | posrcprefix="$srcdir/" | |
340 | else | |
341 | posrcprefix="../$srcdir/" | |
342 | fi | |
343 | else | |
344 | posrcprefix="../" | |
345 | fi | |
346 | rm -f po/POTFILES | |
347 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ | |
348 | < $srcdir/po/POTFILES.in > po/POTFILES | |
349 | fi | |
350 | ]) | |
351 | ||
352 | # Search path for a program which passes the given test. | |
353 | # Ulrich Drepper <drepper@cygnus.com>, 1996. | |
354 | # | |
355 | # This file file be copied and used freely without restrictions. It can | |
356 | # be used in projects which are not available under the GNU Public License | |
357 | # but which still want to provide support for the GNU gettext functionality. | |
358 | # Please note that the actual code is *not* freely available. | |
359 | ||
360 | # serial 1 | |
361 | ||
362 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | |
363 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | |
364 | AC_DEFUN(AM_PATH_PROG_WITH_TEST, | |
365 | [# Extract the first word of "$2", so it can be a program name with args. | |
366 | set dummy $2; ac_word=[$]2 | |
367 | AC_MSG_CHECKING([for $ac_word]) | |
368 | AC_CACHE_VAL(ac_cv_path_$1, | |
369 | [case "[$]$1" in | |
370 | /*) | |
371 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | |
372 | ;; | |
373 | *) | |
374 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
375 | for ac_dir in ifelse([$5], , $PATH, [$5]); do | |
376 | test -z "$ac_dir" && ac_dir=. | |
377 | if test -f $ac_dir/$ac_word; then | |
378 | if [$3]; then | |
379 | ac_cv_path_$1="$ac_dir/$ac_word" | |
380 | break | |
381 | fi | |
382 | fi | |
383 | done | |
384 | IFS="$ac_save_ifs" | |
385 | dnl If no 4th arg is given, leave the cache variable unset, | |
386 | dnl so AC_PATH_PROGS will keep looking. | |
387 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | |
388 | ])dnl | |
389 | ;; | |
390 | esac])dnl | |
391 | $1="$ac_cv_path_$1" | |
392 | if test -n "[$]$1"; then | |
393 | AC_MSG_RESULT([$]$1) | |
394 | else | |
395 | AC_MSG_RESULT(no) | |
396 | fi | |
397 | AC_SUBST($1)dnl | |
398 | ]) | |
399 | ||
400 | # Check whether LC_MESSAGES is available in <locale.h>. | |
401 | # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
402 | # | |
403 | # This file file be copied and used freely without restrictions. It can | |
404 | # be used in projects which are not available under the GNU Public License | |
405 | # but which still want to provide support for the GNU gettext functionality. | |
406 | # Please note that the actual code is *not* freely available. | |
407 | ||
408 | # serial 1 | |
409 | ||
410 | AC_DEFUN(AM_LC_MESSAGES, | |
411 | [if test $ac_cv_header_locale_h = yes; then | |
412 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | |
413 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | |
414 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | |
415 | if test $am_cv_val_LC_MESSAGES = yes; then | |
416 | AC_DEFINE(HAVE_LC_MESSAGES) | |
417 | fi | |
418 | fi]) | |
419 |