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