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`
147 dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
148 AC_DEFUN(AM_PROG_LEX,
149 [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
150 AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
154 # This file is derived from `gettext.m4'. The difference is that the
155 # included macros assume Cygnus-style source and build trees.
157 # Macro to add for using GNU gettext.
158 # Ulrich Drepper <drepper@cygnus.com>, 1995.
160 # This file file be copied and used freely without restrictions. It can
161 # be used in projects which are not available under the GNU Public License
162 # but which still want to provide support for the GNU gettext functionality.
163 # Please note that the actual code is *not* freely available.
167 AC_DEFUN(CY_WITH_NLS,
168 [AC_MSG_CHECKING([whether NLS is requested])
169 dnl Default is enabled NLS
171 [ --disable-nls do not use Native Language Support],
172 USE_NLS=$enableval, USE_NLS=yes)
173 AC_MSG_RESULT($USE_NLS)
176 USE_INCLUDED_LIBINTL=no
178 dnl If we use NLS figure out what method
179 if test "$USE_NLS" = "yes"; then
180 AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested])
181 AC_MSG_CHECKING([whether included gettext is requested])
182 AC_ARG_WITH(included-gettext,
183 [ --with-included-gettext use the GNU gettext library included here],
184 nls_cv_force_use_gnu_gettext=$withval,
185 nls_cv_force_use_gnu_gettext=no)
186 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
188 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
189 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
190 dnl User does not insist on using GNU NLS library. Figure out what
191 dnl to use. If gettext or catgets are available (in this order) we
192 dnl use this. Else we have to fall back to GNU NLS library.
193 dnl catgets is only used if permitted by option --with-catgets.
198 AC_CHECK_HEADER(libintl.h,
199 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
200 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
201 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
203 if test "$gt_cv_func_gettext_libc" != "yes"; then
204 AC_CHECK_LIB(intl, bindtextdomain,
205 [AC_CACHE_CHECK([for gettext in libintl],
206 gt_cv_func_gettext_libintl,
207 [AC_TRY_LINK([], [return (int) gettext ("")],
208 gt_cv_func_gettext_libintl=yes,
209 gt_cv_func_gettext_libintl=no)])])
212 if test "$gt_cv_func_gettext_libc" = "yes" \
213 || test "$gt_cv_func_gettext_libintl" = "yes"; then
214 AC_DEFINE(HAVE_GETTEXT, 1,
215 [Define as 1 if you have gettext and don't want to use GNU gettext.])
216 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
217 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
218 if test "$MSGFMT" != "no"; then
219 AC_CHECK_FUNCS(dcgettext)
220 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
221 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
222 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
223 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
224 return _nl_msg_cat_cntr],
234 dnl In the standard gettext, we would now check for catgets.
235 dnl However, we never want to use catgets for our releases.
237 if test "$CATOBJEXT" = "NONE"; then
238 dnl Neither gettext nor catgets in included in the C library.
239 dnl Fall back on GNU gettext library.
240 nls_cv_use_gnu_gettext=yes
244 if test "$nls_cv_use_gnu_gettext" = "yes"; then
245 dnl Mark actions used to generate GNU NLS library.
246 INTLOBJS="\$(GETTOBJS)"
247 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
248 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
249 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
250 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
251 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
253 USE_INCLUDED_LIBINTL=yes
257 INTLDEPS='$(top_builddir)/../intl/libintl.a'
259 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
260 nls_cv_header_intl=libintl.h
261 nls_cv_header_libgt=libgettext.h
264 dnl Test whether we really found GNU xgettext.
265 if test "$XGETTEXT" != ":"; then
266 dnl If it is no GNU xgettext we define it as : so that the
267 dnl Makefiles still can work.
268 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
272 [found xgettext programs is not GNU xgettext; ignore it])
277 # We need to process the po/ directory.
281 nls_cv_header_intl=libintl.h
282 nls_cv_header_libgt=libgettext.h
285 # If this is used in GNU gettext we have to set USE_NLS to `yes'
286 # because some of the sources are only built for this goal.
287 if test "$PACKAGE" = gettext; then
289 USE_INCLUDED_LIBINTL=yes
292 dnl These rules are solely for the distribution goal. While doing this
293 dnl we only have to keep exactly one list of the available catalogs
295 for lang in $ALL_LINGUAS; do
296 GMOFILES="$GMOFILES $lang.gmo"
297 POFILES="$POFILES $lang.po"
300 dnl Make all variables we use known to autoconf.
301 AC_SUBST(USE_INCLUDED_LIBINTL)
304 AC_SUBST(DATADIRNAME)
314 AC_DEFUN(CY_GNU_GETTEXT,
315 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
316 AC_REQUIRE([AC_PROG_CC])dnl
317 AC_REQUIRE([AC_PROG_RANLIB])dnl
318 AC_REQUIRE([AC_ISC_POSIX])dnl
319 AC_REQUIRE([AC_HEADER_STDC])dnl
320 AC_REQUIRE([AC_C_CONST])dnl
321 AC_REQUIRE([AC_C_INLINE])dnl
322 AC_REQUIRE([AC_TYPE_OFF_T])dnl
323 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
324 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
325 AC_REQUIRE([AC_FUNC_MMAP])dnl
327 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
328 unistd.h values.h sys/param.h])
329 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
330 __argz_count __argz_stringify __argz_next])
332 if test "${ac_cv_func_stpcpy+set}" != "set"; then
333 AC_CHECK_FUNCS(stpcpy)
335 if test "${ac_cv_func_stpcpy}" = "yes"; then
336 AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function])
342 if test "x$CATOBJEXT" != "x"; then
343 if test "x$ALL_LINGUAS" = "x"; then
346 AC_MSG_CHECKING(for catalogs to be installed)
348 for lang in ${LINGUAS=$ALL_LINGUAS}; do
349 case "$ALL_LINGUAS" in
350 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
354 AC_MSG_RESULT($LINGUAS)
357 dnl Construct list of names of catalog files to be constructed.
358 if test -n "$LINGUAS"; then
359 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
363 dnl The reference to <locale.h> in the installed <libintl.h> file
364 dnl must be resolved because we cannot expect the users of this
365 dnl to define HAVE_LOCALE_H.
366 if test $ac_cv_header_locale_h = yes; then
367 INCLUDE_LOCALE_H="#include <locale.h>"
370 /* The system does not provide the header <locale.h>. Take care yourself. */"
372 AC_SUBST(INCLUDE_LOCALE_H)
374 dnl Determine which catalog format we have (if any is needed)
375 dnl For now we know about two different formats:
376 dnl Linux libc-5 and the normal X/Open format
377 if test -f $srcdir/po2tbl.sed.in; then
378 if test "$CATOBJEXT" = ".cat"; then
379 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
381 dnl Transform the SED scripts while copying because some dumb SEDs
382 dnl cannot handle comments.
383 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
385 dnl po2tbl.sed is always needed.
386 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
387 $srcdir/po2tbl.sed.in > po2tbl.sed
390 dnl In the intl/Makefile.in we have a special dependency which makes
391 dnl only sense for gettext. We comment this out for non-gettext
393 if test "$PACKAGE" = "gettext"; then
403 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
404 AC_SUBST(MKINSTALLDIRS)
406 dnl *** For now the libtool support in intl/Makefile is not for real.
410 dnl Generate list of files to be processed by xgettext which will
411 dnl be included in po/Makefile. But only do this if the po directory
412 dnl exists in srcdir.
413 if test -d $srcdir/po; then
414 test -d po || mkdir po
415 if test "x$srcdir" != "x."; then
416 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
417 posrcprefix="$srcdir/"
419 posrcprefix="../$srcdir/"
425 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
426 < $srcdir/po/POTFILES.in > po/POTFILES
430 # Search path for a program which passes the given test.
431 # Ulrich Drepper <drepper@cygnus.com>, 1996.
433 # This file file be copied and used freely without restrictions. It can
434 # be used in projects which are not available under the GNU Public License
435 # but which still want to provide support for the GNU gettext functionality.
436 # Please note that the actual code is *not* freely available.
440 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
441 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
442 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
443 [# Extract the first word of "$2", so it can be a program name with args.
444 set dummy $2; ac_word=[$]2
445 AC_MSG_CHECKING([for $ac_word])
446 AC_CACHE_VAL(ac_cv_path_$1,
449 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
452 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
453 for ac_dir in ifelse([$5], , $PATH, [$5]); do
454 test -z "$ac_dir" && ac_dir=.
455 if test -f $ac_dir/$ac_word; then
457 ac_cv_path_$1="$ac_dir/$ac_word"
463 dnl If no 4th arg is given, leave the cache variable unset,
464 dnl so AC_PATH_PROGS will keep looking.
465 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
470 if test -n "[$]$1"; then
478 # Check whether LC_MESSAGES is available in <locale.h>.
479 # Ulrich Drepper <drepper@cygnus.com>, 1995.
481 # This file file be copied and used freely without restrictions. It can
482 # be used in projects which are not available under the GNU Public License
483 # but which still want to provide support for the GNU gettext functionality.
484 # Please note that the actual code is *not* freely available.
488 AC_DEFUN(AM_LC_MESSAGES,
489 [if test $ac_cv_header_locale_h = yes; then
490 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
491 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
492 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
493 if test $am_cv_val_LC_MESSAGES = yes; then
494 AC_DEFINE(HAVE_LC_MESSAGES, 1,
495 [Define if your locale.h file contains LC_MESSAGES.])
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,