1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file 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.
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.
13 sinclude(../bfd/acinclude.m4)
15 dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
16 dnl The lines below arrange for aclocal not to bring libtool.m4
17 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
18 dnl to add a definition of LIBTOOL to Makefile.in.
20 AC_DEFUN([AM_PROG_LIBTOOL],)
24 dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
26 AC_DEFUN([CY_WITH_NLS],)
30 # Do all the work for Automake. This macro actually does too much --
31 # some checks are only needed if your package does certain things.
32 # But this isn't really a big deal.
37 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
39 AC_DEFUN(AM_INIT_AUTOMAKE,
40 [AC_REQUIRE([AC_PROG_INSTALL])
45 dnl test to see if srcdir already configured
46 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
47 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
50 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
51 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
52 AC_REQUIRE([AM_SANITY_CHECK])
53 AC_REQUIRE([AC_ARG_PROGRAM])
54 dnl FIXME This is truly gross.
55 missing_dir=`cd $ac_aux_dir && pwd`
56 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
57 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
58 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
59 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
60 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
61 AC_REQUIRE([AC_PROG_MAKE_SET])])
64 # Check to make sure that the build environment is sane.
67 AC_DEFUN(AM_SANITY_CHECK,
68 [AC_MSG_CHECKING([whether build environment is sane])
71 echo timestamp > conftestfile
72 # Do `set' in a subshell so we don't clobber the current shell's
73 # arguments. Must try -L first in case configure is actually a
74 # symlink; some systems play weird games with the mod time of symlinks
75 # (eg FreeBSD returns the mod time of the symlink's containing
78 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
79 if test "[$]*" = "X"; then
81 set X `ls -t $srcdir/configure conftestfile`
83 if test "[$]*" != "X $srcdir/configure conftestfile" \
84 && test "[$]*" != "X conftestfile $srcdir/configure"; then
86 # If neither matched, then we have a broken ls. This can happen
87 # if, for instance, CONFIG_SHELL is bash and it inherits a
88 # broken ls alias from the environment. This has actually
89 # happened. Such a system could not be considered "sane".
90 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
91 alias in your environment])
94 test "[$]2" = conftestfile
100 AC_MSG_ERROR([newly created file is older than distributed files!
101 Check your system clock])
106 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
107 dnl The program must properly implement --version.
108 AC_DEFUN(AM_MISSING_PROG,
109 [AC_MSG_CHECKING(for working $2)
110 # Run test in a subshell; some versions of sh will print an error if
111 # an executable is not found, even if stderr is redirected.
112 # Redirect stdin to placate older versions of autoconf. Sigh.
113 if ($2 --version) < /dev/null > /dev/null 2>&1; then
118 AC_MSG_RESULT(missing)
122 # Like AC_CONFIG_HEADER, but automatically create stamp file.
124 AC_DEFUN(AM_CONFIG_HEADER,
126 AC_CONFIG_HEADER([$1])
127 dnl When config.status generates a header, we must update the stamp-h file.
128 dnl This file resides in the same directory as the config header
129 dnl that is generated. We must strip everything past the first ":",
130 dnl and everything past the last "/".
131 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
132 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
133 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
135 for am_file in <<$1>>; do
136 case " <<$>>CONFIG_HEADERS " in
137 *" <<$>>am_file "*<<)>>
138 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
141 am_indx=`expr "<<$>>am_indx" + 1`
145 # This file is derived from `gettext.m4'. The difference is that the
146 # included macros assume Cygnus-style source and build trees.
148 # Macro to add for using GNU gettext.
149 # Ulrich Drepper <drepper@cygnus.com>, 1995.
151 # This file file be copied and used freely without restrictions. It can
152 # be used in projects which are not available under the GNU Public License
153 # but which still want to provide support for the GNU gettext functionality.
154 # Please note that the actual code is *not* freely available.
158 AC_DEFUN(CY_WITH_NLS,
159 [AC_MSG_CHECKING([whether NLS is requested])
160 dnl Default is enabled NLS
162 [ --disable-nls do not use Native Language Support],
163 USE_NLS=$enableval, USE_NLS=yes)
164 AC_MSG_RESULT($USE_NLS)
167 USE_INCLUDED_LIBINTL=no
169 dnl If we use NLS figure out what method
170 if test "$USE_NLS" = "yes"; then
171 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
172 AC_MSG_CHECKING([whether included gettext is requested])
173 AC_ARG_WITH(included-gettext,
174 [ --with-included-gettext use the GNU gettext library included here],
175 nls_cv_force_use_gnu_gettext=$withval,
176 nls_cv_force_use_gnu_gettext=no)
177 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
179 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
180 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
181 dnl User does not insist on using GNU NLS library. Figure out what
182 dnl to use. If gettext or catgets are available (in this order) we
183 dnl use this. Else we have to fall back to GNU NLS library.
184 dnl catgets is only used if permitted by option --with-catgets.
189 AC_CHECK_HEADER(libintl.h,
190 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
191 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
192 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
194 if test "$gt_cv_func_gettext_libc" != "yes"; then
195 AC_CHECK_LIB(intl, bindtextdomain,
196 [AC_CACHE_CHECK([for gettext in libintl],
197 gt_cv_func_gettext_libintl,
198 [AC_TRY_LINK([], [return (int) gettext ("")],
199 gt_cv_func_gettext_libintl=yes,
200 gt_cv_func_gettext_libintl=no)])])
203 if test "$gt_cv_func_gettext_libc" = "yes" \
204 || test "$gt_cv_func_gettext_libintl" = "yes"; then
205 AC_DEFINE(HAVE_GETTEXT, 1,
206 [Define as 1 if you have gettext and don't want to use GNU gettext.])
207 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
208 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
209 if test "$MSGFMT" != "no"; then
210 AC_CHECK_FUNCS(dcgettext)
211 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
212 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
213 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
214 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
215 return _nl_msg_cat_cntr],
225 dnl In the standard gettext, we would now check for catgets.
226 dnl However, we never want to use catgets for our releases.
228 if test "$CATOBJEXT" = "NONE"; then
229 dnl Neither gettext nor catgets in included in the C library.
230 dnl Fall back on GNU gettext library.
231 nls_cv_use_gnu_gettext=yes
235 if test "$nls_cv_use_gnu_gettext" = "yes"; then
236 dnl Mark actions used to generate GNU NLS library.
237 INTLOBJS="\$(GETTOBJS)"
238 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
239 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
240 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
241 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
242 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
244 USE_INCLUDED_LIBINTL=yes
248 INTLDEPS='$(top_builddir)/../intl/libintl.a'
250 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
251 nls_cv_header_intl=libintl.h
252 nls_cv_header_libgt=libgettext.h
255 dnl Test whether we really found GNU xgettext.
256 if test "$XGETTEXT" != ":"; then
257 dnl If it is no GNU xgettext we define it as : so that the
258 dnl Makefiles still can work.
259 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
263 [found xgettext programs is not GNU xgettext; ignore it])
268 # We need to process the po/ directory.
272 nls_cv_header_intl=libintl.h
273 nls_cv_header_libgt=libgettext.h
276 # If this is used in GNU gettext we have to set USE_NLS to `yes'
277 # because some of the sources are only built for this goal.
278 if test "$PACKAGE" = gettext; then
280 USE_INCLUDED_LIBINTL=yes
283 dnl These rules are solely for the distribution goal. While doing this
284 dnl we only have to keep exactly one list of the available catalogs
286 for lang in $ALL_LINGUAS; do
287 GMOFILES="$GMOFILES $lang.gmo"
288 POFILES="$POFILES $lang.po"
291 dnl Make all variables we use known to autoconf.
292 AC_SUBST(USE_INCLUDED_LIBINTL)
295 AC_SUBST(DATADIRNAME)
305 AC_DEFUN(CY_GNU_GETTEXT,
306 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
307 AC_REQUIRE([AC_PROG_CC])dnl
308 AC_REQUIRE([AC_PROG_RANLIB])dnl
309 AC_REQUIRE([AC_ISC_POSIX])dnl
310 AC_REQUIRE([AC_HEADER_STDC])dnl
311 AC_REQUIRE([AC_C_CONST])dnl
312 AC_REQUIRE([AC_C_INLINE])dnl
313 AC_REQUIRE([AC_TYPE_OFF_T])dnl
314 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
315 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
316 AC_REQUIRE([AC_FUNC_MMAP])dnl
318 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
319 unistd.h values.h sys/param.h])
320 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
321 __argz_count __argz_stringify __argz_next])
323 if test "${ac_cv_func_stpcpy+set}" != "set"; then
324 AC_CHECK_FUNCS(stpcpy)
326 if test "${ac_cv_func_stpcpy}" = "yes"; then
327 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
333 if test "x$CATOBJEXT" != "x"; then
334 if test "x$ALL_LINGUAS" = "x"; then
337 AC_MSG_CHECKING(for catalogs to be installed)
339 for lang in ${LINGUAS=$ALL_LINGUAS}; do
340 case "$ALL_LINGUAS" in
341 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
345 AC_MSG_RESULT($LINGUAS)
348 dnl Construct list of names of catalog files to be constructed.
349 if test -n "$LINGUAS"; then
350 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
354 dnl The reference to <locale.h> in the installed <libintl.h> file
355 dnl must be resolved because we cannot expect the users of this
356 dnl to define HAVE_LOCALE_H.
357 if test $ac_cv_header_locale_h = yes; then
358 INCLUDE_LOCALE_H="#include <locale.h>"
361 /* The system does not provide the header <locale.h>. Take care yourself. */"
363 AC_SUBST(INCLUDE_LOCALE_H)
365 dnl Determine which catalog format we have (if any is needed)
366 dnl For now we know about two different formats:
367 dnl Linux libc-5 and the normal X/Open format
368 if test -f $srcdir/po2tbl.sed.in; then
369 if test "$CATOBJEXT" = ".cat"; then
370 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
372 dnl Transform the SED scripts while copying because some dumb SEDs
373 dnl cannot handle comments.
374 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
376 dnl po2tbl.sed is always needed.
377 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
378 $srcdir/po2tbl.sed.in > po2tbl.sed
381 dnl In the intl/Makefile.in we have a special dependency which makes
382 dnl only sense for gettext. We comment this out for non-gettext
384 if test "$PACKAGE" = "gettext"; then
394 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
395 AC_SUBST(MKINSTALLDIRS)
397 dnl *** For now the libtool support in intl/Makefile is not for real.
401 dnl Generate list of files to be processed by xgettext which will
402 dnl be included in po/Makefile. But only do this if the po directory
403 dnl exists in srcdir.
404 if test -d $srcdir/po; then
405 test -d po || mkdir po
406 if test "x$srcdir" != "x."; then
407 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
408 posrcprefix="$srcdir/"
410 posrcprefix="../$srcdir/"
416 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
417 < $srcdir/po/POTFILES.in > po/POTFILES
421 # Search path for a program which passes the given test.
422 # Ulrich Drepper <drepper@cygnus.com>, 1996.
424 # This file file be copied and used freely without restrictions. It can
425 # be used in projects which are not available under the GNU Public License
426 # but which still want to provide support for the GNU gettext functionality.
427 # Please note that the actual code is *not* freely available.
431 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
432 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
433 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
434 [# Extract the first word of "$2", so it can be a program name with args.
435 set dummy $2; ac_word=[$]2
436 AC_MSG_CHECKING([for $ac_word])
437 AC_CACHE_VAL(ac_cv_path_$1,
440 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
443 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
444 for ac_dir in ifelse([$5], , $PATH, [$5]); do
445 test -z "$ac_dir" && ac_dir=.
446 if test -f $ac_dir/$ac_word; then
448 ac_cv_path_$1="$ac_dir/$ac_word"
454 dnl If no 4th arg is given, leave the cache variable unset,
455 dnl so AC_PATH_PROGS will keep looking.
456 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
461 if test -n "[$]$1"; then
469 # Check whether LC_MESSAGES is available in <locale.h>.
470 # Ulrich Drepper <drepper@cygnus.com>, 1995.
472 # This file file be copied and used freely without restrictions. It can
473 # be used in projects which are not available under the GNU Public License
474 # but which still want to provide support for the GNU gettext functionality.
475 # Please note that the actual code is *not* freely available.
479 AC_DEFUN(AM_LC_MESSAGES,
480 [if test $ac_cv_header_locale_h = yes; then
481 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
482 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
483 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
484 if test $am_cv_val_LC_MESSAGES = yes; then
485 AC_DEFINE(HAVE_LC_MESSAGES, 1,
486 [Define if your locale.h file contains LC_MESSAGES.])
492 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
493 AC_DEFUN(AM_PROG_LEX,
494 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
495 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
499 # Add --enable-maintainer-mode option to configure.
504 AC_DEFUN(AM_MAINTAINER_MODE,
505 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
506 dnl maintainer-mode is disabled by default
507 AC_ARG_ENABLE(maintainer-mode,
508 [ --enable-maintainer-mode enable make rules and dependencies not useful
509 (and sometimes confusing) to the casual installer],
510 USE_MAINTAINER_MODE=$enableval,
511 USE_MAINTAINER_MODE=no)
512 AC_MSG_RESULT($USE_MAINTAINER_MODE)
513 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
514 MAINT=$MAINTAINER_MODE_TRUE
519 # Define a conditional.
521 AC_DEFUN(AM_CONDITIONAL,