]>
Commit | Line | Data |
---|---|---|
00459c3a JL |
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. | |
6599da04 | 12 | |
f8b2ac1e JL |
13 | # Macro to add for using GNU gettext. |
14 | # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
00459c3a | 15 | # |
38e01259 | 16 | # This file can be copied and used freely without restrictions. It can |
00459c3a JL |
17 | # be used in projects which are not available under the GNU Public License |
18 | # but which still want to provide support for the GNU gettext functionality. | |
19 | # Please note that the actual code is *not* freely available. | |
6599da04 | 20 | |
00459c3a | 21 | # serial 3 |
f8b2ac1e JL |
22 | |
23 | AC_DEFUN(AM_WITH_NLS, | |
24 | [AC_MSG_CHECKING([whether NLS is requested]) | |
25 | dnl Default is enabled NLS | |
26 | AC_ARG_ENABLE(nls, | |
27 | [ --disable-nls do not use Native Language Support], | |
28 | USE_NLS=$enableval, USE_NLS=yes) | |
29 | AC_MSG_RESULT($USE_NLS) | |
30 | AC_SUBST(USE_NLS) | |
31 | ||
32 | USE_INCLUDED_LIBINTL=no | |
33 | ||
34 | dnl If we use NLS figure out what method | |
35 | if test "$USE_NLS" = "yes"; then | |
36 | AC_DEFINE(ENABLE_NLS) | |
37 | AC_MSG_CHECKING([whether included gettext is requested]) | |
38 | AC_ARG_WITH(included-gettext, | |
39 | [ --with-included-gettext use the GNU gettext library included here], | |
40 | nls_cv_force_use_gnu_gettext=$withval, | |
41 | nls_cv_force_use_gnu_gettext=no) | |
42 | AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) | |
43 | ||
44 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" | |
45 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then | |
46 | dnl User does not insist on using GNU NLS library. Figure out what | |
47 | dnl to use. If gettext or catgets are available (in this order) we | |
48 | dnl use this. Else we have to fall back to GNU NLS library. | |
49 | dnl catgets is only used if permitted by option --with-catgets. | |
50 | nls_cv_header_intl= | |
51 | nls_cv_header_libgt= | |
52 | CATOBJEXT=NONE | |
53 | ||
54 | AC_CHECK_HEADER(libintl.h, | |
55 | [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, | |
56 | [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")], | |
57 | gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) | |
58 | ||
59 | if test "$gt_cv_func_gettext_libc" != "yes"; then | |
60 | AC_CHECK_LIB(intl, bindtextdomain, | |
61 | [AC_CACHE_CHECK([for gettext in libintl], | |
62 | gt_cv_func_gettext_libintl, | |
63 | [AC_TRY_LINK([], [return (int) gettext ("")], | |
64 | gt_cv_func_gettext_libintl=yes, | |
65 | gt_cv_func_gettext_libintl=no)])]) | |
66 | fi | |
67 | ||
68 | if test "$gt_cv_func_gettext_libc" = "yes" \ | |
69 | || test "$gt_cv_func_gettext_libintl" = "yes"; then | |
70 | AC_DEFINE(HAVE_GETTEXT) | |
71 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
72 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl | |
73 | if test "$MSGFMT" != "no"; then | |
74 | AC_CHECK_FUNCS(dcgettext) | |
75 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
76 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
77 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
78 | AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; | |
79 | return _nl_msg_cat_cntr], | |
80 | [CATOBJEXT=.gmo | |
81 | DATADIRNAME=share], | |
82 | [CATOBJEXT=.mo | |
83 | DATADIRNAME=lib]) | |
84 | INSTOBJEXT=.mo | |
85 | fi | |
86 | fi | |
87 | ]) | |
88 | ||
89 | if test "$CATOBJEXT" = "NONE"; then | |
90 | AC_MSG_CHECKING([whether catgets can be used]) | |
91 | AC_ARG_WITH(catgets, | |
92 | [ --with-catgets use catgets functions if available], | |
93 | nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) | |
94 | AC_MSG_RESULT($nls_cv_use_catgets) | |
95 | ||
96 | if test "$nls_cv_use_catgets" = "yes"; then | |
97 | dnl No gettext in C library. Try catgets next. | |
98 | AC_CHECK_LIB(i, main) | |
99 | AC_CHECK_FUNC(catgets, | |
100 | [AC_DEFINE(HAVE_CATGETS) | |
101 | INTLOBJS="\$(CATOBJS)" | |
102 | AC_PATH_PROG(GENCAT, gencat, no)dnl | |
103 | if test "$GENCAT" != "no"; then | |
104 | AC_PATH_PROG(GMSGFMT, gmsgfmt, no) | |
105 | if test "$GMSGFMT" = "no"; then | |
106 | AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, | |
107 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) | |
108 | fi | |
109 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
110 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
111 | USE_INCLUDED_LIBINTL=yes | |
112 | CATOBJEXT=.cat | |
113 | INSTOBJEXT=.cat | |
114 | DATADIRNAME=lib | |
00459c3a | 115 | INTLDEPS='$(top_builddir)/intl/libintl.a' |
f8b2ac1e JL |
116 | INTLLIBS=$INTLDEPS |
117 | LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
118 | nls_cv_header_intl=intl/libintl.h | |
119 | nls_cv_header_libgt=intl/libgettext.h | |
120 | fi]) | |
121 | fi | |
122 | fi | |
123 | ||
124 | if test "$CATOBJEXT" = "NONE"; then | |
125 | dnl Neither gettext nor catgets in included in the C library. | |
126 | dnl Fall back on GNU gettext library. | |
127 | nls_cv_use_gnu_gettext=yes | |
128 | fi | |
129 | fi | |
130 | ||
131 | if test "$nls_cv_use_gnu_gettext" = "yes"; then | |
132 | dnl Mark actions used to generate GNU NLS library. | |
133 | INTLOBJS="\$(GETTOBJS)" | |
134 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | |
135 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) | |
136 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | |
137 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | |
138 | [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) | |
139 | AC_SUBST(MSGFMT) | |
140 | USE_INCLUDED_LIBINTL=yes | |
141 | CATOBJEXT=.gmo | |
142 | INSTOBJEXT=.mo | |
143 | DATADIRNAME=share | |
00459c3a | 144 | INTLDEPS='$(top_builddir)/intl/libintl.a' |
f8b2ac1e JL |
145 | INTLLIBS=$INTLDEPS |
146 | LIBS=`echo $LIBS | sed -e 's/-lintl//'` | |
147 | nls_cv_header_intl=intl/libintl.h | |
148 | nls_cv_header_libgt=intl/libgettext.h | |
149 | fi | |
150 | ||
151 | dnl Test whether we really found GNU xgettext. | |
152 | if test "$XGETTEXT" != ":"; then | |
153 | dnl If it is no GNU xgettext we define it as : so that the | |
154 | dnl Makefiles still can work. | |
155 | if $XGETTEXT --omit-header /dev/null 2> /dev/null; then | |
156 | : ; | |
157 | else | |
158 | AC_MSG_RESULT( | |
159 | [found xgettext programs is not GNU xgettext; ignore it]) | |
160 | XGETTEXT=":" | |
161 | fi | |
162 | fi | |
163 | ||
164 | # We need to process the po/ directory. | |
165 | POSUB=po | |
166 | else | |
167 | DATADIRNAME=share | |
168 | nls_cv_header_intl=intl/libintl.h | |
169 | nls_cv_header_libgt=intl/libgettext.h | |
170 | fi | |
171 | ||
172 | # If this is used in GNU gettext we have to set USE_NLS to `yes' | |
173 | # because some of the sources are only built for this goal. | |
174 | if test "$PACKAGE" = gettext; then | |
175 | USE_NLS=yes | |
176 | USE_INCLUDED_LIBINTL=yes | |
177 | fi | |
178 | ||
179 | dnl These rules are solely for the distribution goal. While doing this | |
180 | dnl we only have to keep exactly one list of the available catalogs | |
181 | dnl in configure.in. | |
182 | for lang in $ALL_LINGUAS; do | |
183 | GMOFILES="$GMOFILES $lang.gmo" | |
184 | POFILES="$POFILES $lang.po" | |
185 | done | |
186 | ||
187 | dnl Make all variables we use known to autoconf. | |
188 | AC_SUBST(USE_INCLUDED_LIBINTL) | |
189 | AC_SUBST(CATALOGS) | |
190 | AC_SUBST(CATOBJEXT) | |
191 | AC_SUBST(DATADIRNAME) | |
192 | AC_SUBST(GMOFILES) | |
193 | AC_SUBST(INSTOBJEXT) | |
194 | AC_SUBST(INTLDEPS) | |
195 | AC_SUBST(INTLLIBS) | |
196 | AC_SUBST(INTLOBJS) | |
197 | AC_SUBST(POFILES) | |
198 | AC_SUBST(POSUB) | |
199 | ]) | |
200 | ||
201 | AC_DEFUN(AM_GNU_GETTEXT, | |
202 | [AC_REQUIRE([AC_PROG_MAKE_SET])dnl | |
203 | AC_REQUIRE([AC_PROG_CC])dnl | |
00459c3a | 204 | AC_REQUIRE([AC_PROG_RANLIB])dnl |
f8b2ac1e JL |
205 | AC_REQUIRE([AC_ISC_POSIX])dnl |
206 | AC_REQUIRE([AC_HEADER_STDC])dnl | |
207 | AC_REQUIRE([AC_C_CONST])dnl | |
208 | AC_REQUIRE([AC_C_INLINE])dnl | |
209 | AC_REQUIRE([AC_TYPE_OFF_T])dnl | |
210 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl | |
211 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl | |
212 | AC_REQUIRE([AC_FUNC_MMAP])dnl | |
213 | ||
214 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ | |
00459c3a | 215 | unistd.h values.h sys/param.h]) |
f8b2ac1e JL |
216 | AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ |
217 | __argz_count __argz_stringify __argz_next]) | |
218 | ||
219 | if test "${ac_cv_func_stpcpy+set}" != "set"; then | |
220 | AC_CHECK_FUNCS(stpcpy) | |
221 | fi | |
222 | if test "${ac_cv_func_stpcpy}" = "yes"; then | |
223 | AC_DEFINE(HAVE_STPCPY) | |
224 | fi | |
225 | ||
226 | AM_LC_MESSAGES | |
227 | AM_WITH_NLS | |
228 | ||
229 | if test "x$CATOBJEXT" != "x"; then | |
230 | if test "x$ALL_LINGUAS" = "x"; then | |
231 | LINGUAS= | |
232 | else | |
233 | AC_MSG_CHECKING(for catalogs to be installed) | |
234 | NEW_LINGUAS= | |
235 | for lang in ${LINGUAS=$ALL_LINGUAS}; do | |
236 | case "$ALL_LINGUAS" in | |
237 | *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; | |
238 | esac | |
239 | done | |
240 | LINGUAS=$NEW_LINGUAS | |
241 | AC_MSG_RESULT($LINGUAS) | |
242 | fi | |
243 | ||
244 | dnl Construct list of names of catalog files to be constructed. | |
245 | if test -n "$LINGUAS"; then | |
246 | for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done | |
247 | fi | |
248 | fi | |
249 | ||
00459c3a JL |
250 | dnl The reference to <locale.h> in the installed <libintl.h> file |
251 | dnl must be resolved because we cannot expect the users of this | |
252 | dnl to define HAVE_LOCALE_H. | |
253 | if test $ac_cv_header_locale_h = yes; then | |
254 | INCLUDE_LOCALE_H="#include <locale.h>" | |
255 | else | |
256 | INCLUDE_LOCALE_H="\ | |
257 | /* The system does not provide the header <locale.h>. Take care yourself. */" | |
258 | fi | |
259 | AC_SUBST(INCLUDE_LOCALE_H) | |
260 | ||
f8b2ac1e JL |
261 | dnl Determine which catalog format we have (if any is needed) |
262 | dnl For now we know about two different formats: | |
263 | dnl Linux libc-5 and the normal X/Open format | |
264 | test -d intl || mkdir intl | |
265 | if test "$CATOBJEXT" = ".cat"; then | |
266 | AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) | |
267 | ||
268 | dnl Transform the SED scripts while copying because some dumb SEDs | |
269 | dnl cannot handle comments. | |
270 | sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed | |
271 | fi | |
272 | dnl po2tbl.sed is always needed. | |
273 | sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ | |
274 | $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed | |
275 | ||
276 | dnl In the intl/Makefile.in we have a special dependency which makes | |
277 | dnl only sense for gettext. We comment this out for non-gettext | |
278 | dnl packages. | |
279 | if test "$PACKAGE" = "gettext"; then | |
280 | GT_NO="#NO#" | |
281 | GT_YES= | |
282 | else | |
283 | GT_NO= | |
284 | GT_YES="#YES#" | |
285 | fi | |
286 | AC_SUBST(GT_NO) | |
287 | AC_SUBST(GT_YES) | |
288 | ||
289 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly | |
290 | dnl find the mkinstalldirs script in another subdir but ($top_srcdir). | |
291 | dnl Try to locate is. | |
292 | MKINSTALLDIRS= | |
00459c3a | 293 | if test -n "$ac_aux_dir"; then |
f8b2ac1e JL |
294 | MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" |
295 | fi | |
00459c3a | 296 | if test -z "$MKINSTALLDIRS"; then |
f8b2ac1e JL |
297 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" |
298 | fi | |
299 | AC_SUBST(MKINSTALLDIRS) | |
300 | ||
301 | dnl *** For now the libtool support in intl/Makefile is not for real. | |
302 | l= | |
303 | AC_SUBST(l) | |
304 | ||
305 | dnl Generate list of files to be processed by xgettext which will | |
306 | dnl be included in po/Makefile. | |
307 | test -d po || mkdir po | |
308 | if test "x$srcdir" != "x."; then | |
309 | if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then | |
310 | posrcprefix="$srcdir/" | |
311 | else | |
312 | posrcprefix="../$srcdir/" | |
313 | fi | |
314 | else | |
315 | posrcprefix="../" | |
316 | fi | |
00459c3a | 317 | rm -f po/POTFILES |
f8b2ac1e JL |
318 | sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ |
319 | < $srcdir/po/POTFILES.in > po/POTFILES | |
320 | ]) | |
321 | ||
322 | # Search path for a program which passes the given test. | |
323 | # Ulrich Drepper <drepper@cygnus.com>, 1996. | |
00459c3a | 324 | # |
38e01259 | 325 | # This file can be copied and used freely without restrictions. It can |
00459c3a JL |
326 | # be used in projects which are not available under the GNU Public License |
327 | # but which still want to provide support for the GNU gettext functionality. | |
328 | # Please note that the actual code is *not* freely available. | |
f8b2ac1e JL |
329 | |
330 | # serial 1 | |
331 | ||
332 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | |
333 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | |
334 | AC_DEFUN(AM_PATH_PROG_WITH_TEST, | |
335 | [# Extract the first word of "$2", so it can be a program name with args. | |
336 | set dummy $2; ac_word=[$]2 | |
337 | AC_MSG_CHECKING([for $ac_word]) | |
338 | AC_CACHE_VAL(ac_cv_path_$1, | |
339 | [case "[$]$1" in | |
340 | /*) | |
341 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | |
342 | ;; | |
343 | *) | |
344 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
345 | for ac_dir in ifelse([$5], , $PATH, [$5]); do | |
346 | test -z "$ac_dir" && ac_dir=. | |
347 | if test -f $ac_dir/$ac_word; then | |
348 | if [$3]; then | |
349 | ac_cv_path_$1="$ac_dir/$ac_word" | |
350 | break | |
351 | fi | |
352 | fi | |
353 | done | |
354 | IFS="$ac_save_ifs" | |
355 | dnl If no 4th arg is given, leave the cache variable unset, | |
356 | dnl so AC_PATH_PROGS will keep looking. | |
357 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | |
358 | ])dnl | |
359 | ;; | |
360 | esac])dnl | |
361 | $1="$ac_cv_path_$1" | |
362 | if test -n "[$]$1"; then | |
363 | AC_MSG_RESULT([$]$1) | |
364 | else | |
365 | AC_MSG_RESULT(no) | |
366 | fi | |
367 | AC_SUBST($1)dnl | |
368 | ]) | |
369 | ||
370 | # Check whether LC_MESSAGES is available in <locale.h>. | |
371 | # Ulrich Drepper <drepper@cygnus.com>, 1995. | |
00459c3a | 372 | # |
38e01259 | 373 | # This file can be copied and used freely without restrictions. It can |
00459c3a JL |
374 | # be used in projects which are not available under the GNU Public License |
375 | # but which still want to provide support for the GNU gettext functionality. | |
376 | # Please note that the actual code is *not* freely available. | |
f8b2ac1e JL |
377 | |
378 | # serial 1 | |
379 | ||
380 | AC_DEFUN(AM_LC_MESSAGES, | |
381 | [if test $ac_cv_header_locale_h = yes; then | |
382 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | |
383 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | |
384 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | |
385 | if test $am_cv_val_LC_MESSAGES = yes; then | |
386 | AC_DEFINE(HAVE_LC_MESSAGES) | |
387 | fi | |
388 | fi]) | |
389 | ||
390 | ||
391 | # Like AC_CONFIG_HEADER, but automatically create stamp file. | |
392 | ||
393 | AC_DEFUN(AM_CONFIG_HEADER, | |
394 | [AC_PREREQ([2.12]) | |
395 | AC_CONFIG_HEADER([$1]) | |
396 | dnl When config.status generates a header, we must update the stamp-h file. | |
397 | dnl This file resides in the same directory as the config header | |
398 | dnl that is generated. We must strip everything past the first ":", | |
399 | dnl and everything past the last "/". | |
400 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
401 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
402 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
403 | <<am_indx=1 | |
404 | for am_file in <<$1>>; do | |
405 | case " <<$>>CONFIG_HEADERS " in | |
406 | *" <<$>>am_file "*<<)>> | |
407 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
408 | ;; | |
409 | esac | |
410 | am_indx=`expr "<<$>>am_indx" + 1` | |
411 | done<<>>dnl>>) | |
412 | changequote([,]))]) | |
413 | ||
414 | # Do all the work for Automake. This macro actually does too much -- | |
415 | # some checks are only needed if your package does certain things. | |
416 | # But this isn't really a big deal. | |
417 | ||
418 | # serial 1 | |
419 | ||
420 | dnl Usage: | |
421 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
422 | ||
423 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
424 | [AC_REQUIRE([AM_PROG_INSTALL]) | |
425 | PACKAGE=[$1] | |
426 | AC_SUBST(PACKAGE) | |
427 | VERSION=[$2] | |
428 | AC_SUBST(VERSION) | |
429 | dnl test to see if srcdir already configured | |
430 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
431 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
432 | fi | |
433 | ifelse([$3],, | |
434 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
435 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")) | |
00459c3a JL |
436 | AC_REQUIRE([AM_SANITY_CHECK]) |
437 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
f8b2ac1e JL |
438 | dnl FIXME This is truly gross. |
439 | missing_dir=`cd $ac_aux_dir && pwd` | |
440 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
441 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
442 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
443 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
444 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
00459c3a | 445 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
f8b2ac1e JL |
446 | |
447 | ||
448 | # serial 1 | |
449 | ||
450 | AC_DEFUN(AM_PROG_INSTALL, | |
451 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
452 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
453 | AC_SUBST(INSTALL_SCRIPT)dnl | |
454 | ]) | |
455 | ||
456 | # | |
457 | # Check to make sure that the build environment is sane. | |
458 | # | |
459 | ||
460 | AC_DEFUN(AM_SANITY_CHECK, | |
461 | [AC_MSG_CHECKING([whether build environment is sane]) | |
462 | # Just in case | |
463 | sleep 1 | |
464 | echo timestamp > conftestfile | |
465 | # Do `set' in a subshell so we don't clobber the current shell's | |
466 | # arguments. Must try -L first in case configure is actually a | |
467 | # symlink; some systems play weird games with the mod time of symlinks | |
468 | # (eg FreeBSD returns the mod time of the symlink's containing | |
469 | # directory). | |
470 | if ( | |
471 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
00459c3a | 472 | if test "[$]*" = "X"; then |
f8b2ac1e JL |
473 | # -L didn't work. |
474 | set X `ls -t $srcdir/configure conftestfile` | |
475 | fi | |
00459c3a JL |
476 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
477 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
478 | ||
479 | # If neither matched, then we have a broken ls. This can happen | |
480 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
481 | # broken ls alias from the environment. This has actually | |
482 | # happened. Such a system could not be considered "sane". | |
483 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
484 | alias in your environment]) | |
485 | fi | |
486 | ||
f8b2ac1e JL |
487 | test "[$]2" = conftestfile |
488 | ) | |
489 | then | |
490 | # Ok. | |
491 | : | |
492 | else | |
493 | AC_MSG_ERROR([newly created file is older than distributed files! | |
494 | Check your system clock]) | |
495 | fi | |
496 | rm -f conftest* | |
497 | AC_MSG_RESULT(yes)]) | |
498 | ||
499 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
500 | dnl The program must properly implement --version. | |
501 | AC_DEFUN(AM_MISSING_PROG, | |
502 | [AC_MSG_CHECKING(for working $2) | |
503 | # Run test in a subshell; some versions of sh will print an error if | |
504 | # an executable is not found, even if stderr is redirected. | |
505 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
506 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
507 | $1=$2 | |
508 | AC_MSG_RESULT(found) | |
509 | else | |
510 | $1="$3/missing $2" | |
511 | AC_MSG_RESULT(missing) | |
512 | fi | |
513 | AC_SUBST($1)]) | |
514 | ||
515 | # Add --enable-maintainer-mode option to configure. | |
516 | # From Jim Meyering | |
517 | ||
518 | # serial 1 | |
519 | ||
520 | AC_DEFUN(AM_MAINTAINER_MODE, | |
521 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) | |
522 | dnl maintainer-mode is disabled by default | |
523 | AC_ARG_ENABLE(maintainer-mode, | |
524 | [ --enable-maintainer-mode enable make rules and dependencies not useful | |
525 | (and sometimes confusing) to the casual installer], | |
526 | USE_MAINTAINER_MODE=$enableval, | |
527 | USE_MAINTAINER_MODE=no) | |
528 | AC_MSG_RESULT($USE_MAINTAINER_MODE) | |
529 | if test $USE_MAINTAINER_MODE = yes; then | |
530 | MAINT= | |
531 | else | |
532 | MAINT='#M#' | |
533 | fi | |
534 | AC_SUBST(MAINT)dnl | |
535 | ] | |
536 | ) | |
6599da04 JM |
537 | |
538 | # Check to see if we're running under Win32, without using | |
539 | # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe". | |
540 | # Otherwise set it to "". | |
541 | ||
542 | dnl AM_EXEEXT() | |
543 | dnl This knows we add .exe if we're building in the Cygwin32 | |
544 | dnl environment. But if we're not, then it compiles a test program | |
545 | dnl to see if there is a suffix for executables. | |
546 | AC_DEFUN(AM_EXEEXT, | |
f8b2ac1e | 547 | [AC_REQUIRE([AM_CYGWIN32]) |
00459c3a | 548 | AC_REQUIRE([AM_MINGW32]) |
6599da04 | 549 | AC_MSG_CHECKING([for executable suffix]) |
f8b2ac1e | 550 | AC_CACHE_VAL(am_cv_exeext, |
00459c3a | 551 | [if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then |
6599da04 JM |
552 | am_cv_exeext=.exe |
553 | else | |
554 | cat > am_c_test.c << 'EOF' | |
555 | int main() { | |
556 | /* Nothing needed here */ | |
557 | } | |
558 | EOF | |
559 | ${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5 | |
f8b2ac1e | 560 | am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//` |
6599da04 JM |
561 | rm -f am_c_test*]) |
562 | test x"${am_cv_exeext}" = x && am_cv_exeext=no | |
563 | fi | |
564 | EXEEXT="" | |
565 | test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext} | |
566 | AC_MSG_RESULT(${am_cv_exeext}) | |
567 | AC_SUBST(EXEEXT)]) | |
568 | ||
00459c3a JL |
569 | # Check to see if we're running under Cygwin32, without using |
570 | # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes". | |
571 | # Otherwise set it to "no". | |
572 | ||
573 | dnl AM_CYGWIN32() | |
574 | AC_DEFUN(AM_CYGWIN32, | |
575 | [AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32, | |
576 | [AC_TRY_COMPILE(,[return __CYGWIN32__;], | |
577 | am_cv_cygwin32=yes, am_cv_cygwin32=no) | |
578 | rm -f conftest*]) | |
579 | CYGWIN32= | |
580 | test "$am_cv_cygwin32" = yes && CYGWIN32=yes]) | |
581 | ||
582 | # Check to see if we're running under Mingw, without using | |
583 | # AC_CANONICAL_*. If so, set output variable MINGW32 to "yes". | |
584 | # Otherwise set it to "no". | |
585 | ||
586 | dnl AM_MINGW32() | |
587 | AC_DEFUN(AM_MINGW32, | |
588 | [AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32, | |
589 | [AC_TRY_COMPILE(,[return __MINGW32__;], | |
590 | am_cv_mingw32=yes, am_cv_mingw32=no) | |
591 | rm -f conftest*]) | |
592 | MINGW32= | |
593 | test "$am_cv_mingw32" = yes && MINGW32=yes]) | |
594 | ||
999087f6 JL |
595 | AC_DEFUN(EGCS_PROG_INSTALL, |
596 | [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl | |
597 | # Find a good install program. We prefer a C program (faster), | |
598 | # so one script is as good as another. But avoid the broken or | |
599 | # incompatible versions: | |
600 | # SysV /etc/install, /usr/sbin/install | |
601 | # SunOS /usr/etc/install | |
602 | # IRIX /sbin/install | |
603 | # AIX /bin/install | |
604 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args | |
605 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
606 | # ./install, which can be erroneously created by make from ./install.sh. | |
607 | AC_MSG_CHECKING(for a BSD compatible install) | |
608 | if test -z "$INSTALL"; then | |
609 | AC_CACHE_VAL(ac_cv_path_install, | |
610 | [ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" | |
611 | for ac_dir in $PATH; do | |
612 | # Account for people who put trailing slashes in PATH elements. | |
613 | case "$ac_dir/" in | |
614 | /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; | |
615 | *) | |
616 | # OSF1 and SCO ODT 3.0 have their own names for install. | |
617 | for ac_prog in ginstall scoinst install; do | |
618 | if test -f $ac_dir/$ac_prog; then | |
619 | if test $ac_prog = install && | |
620 | grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then | |
621 | # AIX install. It has an incompatible calling convention. | |
622 | # OSF/1 installbsd also uses dspmsg, but is usable. | |
623 | : | |
624 | else | |
625 | ac_cv_path_install="$ac_dir/$ac_prog -c" | |
626 | break 2 | |
627 | fi | |
628 | fi | |
629 | done | |
630 | ;; | |
631 | esac | |
632 | done | |
633 | IFS="$ac_save_IFS" | |
634 | ])dnl | |
635 | if test "${ac_cv_path_install+set}" = set; then | |
636 | INSTALL="$ac_cv_path_install" | |
637 | else | |
638 | # As a last resort, use the slow shell script. We don't cache a | |
639 | # path for INSTALL within a source directory, because that will | |
640 | # break other packages using the cache if that directory is | |
641 | # removed, or if the path is relative. | |
642 | INSTALL="$ac_install_sh" | |
643 | fi | |
644 | fi | |
645 | dnl We do special magic for INSTALL instead of AC_SUBST, to get | |
646 | dnl relative paths right. | |
647 | AC_MSG_RESULT($INSTALL) | |
5643c767 | 648 | AC_SUBST(INSTALL)dnl |
999087f6 JL |
649 | |
650 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. | |
651 | # It thinks the first close brace ends the variable substitution. | |
652 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' | |
653 | AC_SUBST(INSTALL_PROGRAM)dnl | |
654 | ||
655 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
656 | AC_SUBST(INSTALL_DATA)dnl | |
657 | ]) |