Deleted Added
full compact
aclocal.m4 (50397) aclocal.m4 (52284)
1dnl See whether we can include both string.h and strings.h.
2AC_DEFUN(GCC_HEADER_STRING,
3[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
4 gcc_cv_header_string,
5[AC_TRY_COMPILE([#include <string.h>
6#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
7if test $gcc_cv_header_string = yes; then
8 AC_DEFINE(STRING_WITH_STRINGS)
9fi
10])
11
1dnl See whether we need a declaration for a function.
2dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
3AC_DEFUN(GCC_NEED_DECLARATION,
4[AC_MSG_CHECKING([whether $1 must be declared])
5AC_CACHE_VAL(gcc_cv_decl_needed_$1,
6[AC_TRY_COMPILE([
7#include <stdio.h>
12dnl See whether we need a declaration for a function.
13dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
14AC_DEFUN(GCC_NEED_DECLARATION,
15[AC_MSG_CHECKING([whether $1 must be declared])
16AC_CACHE_VAL(gcc_cv_decl_needed_$1,
17[AC_TRY_COMPILE([
18#include <stdio.h>
8#ifdef HAVE_STRING_H
9#include
19#ifdef STRING_WITH_STRINGS
20# include <string.h>
21# include <strings.h>
10#else
22#else
11#ifdef HAVE_STRINGS_H
12#include <strings.h>
23# ifdef HAVE_STRING_H
24# include <string.h>
25# else
26# ifdef HAVE_STRINGS_H
27# include <strings.h>
28# endif
29# endif
13#endif
30#endif
14#endif
15#ifdef HAVE_STDLIB_H
16#include <stdlib.h>
17#endif
18#ifdef HAVE_UNISTD_H
19#include <unistd.h>
20#endif
21#ifndef HAVE_RINDEX
22#define rindex strrchr

--- 128 unchanged lines hidden (view full) ---

151[AC_CACHE_CHECK([for volatile], gcc_cv_c_volatile,
152[AC_TRY_COMPILE(, [volatile int foo;],
153 gcc_cv_c_volatile=yes, gcc_cv_c_volatile=no)])
154if test $gcc_cv_c_volatile = yes ; then
155 AC_DEFINE(HAVE_VOLATILE)
156fi
157])
158
31#ifdef HAVE_STDLIB_H
32#include <stdlib.h>
33#endif
34#ifdef HAVE_UNISTD_H
35#include <unistd.h>
36#endif
37#ifndef HAVE_RINDEX
38#define rindex strrchr

--- 128 unchanged lines hidden (view full) ---

167[AC_CACHE_CHECK([for volatile], gcc_cv_c_volatile,
168[AC_TRY_COMPILE(, [volatile int foo;],
169 gcc_cv_c_volatile=yes, gcc_cv_c_volatile=no)])
170if test $gcc_cv_c_volatile = yes ; then
171 AC_DEFINE(HAVE_VOLATILE)
172fi
173])
174
175dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
176dnl of the usual 2.
177AC_DEFUN(GCC_FUNC_MKDIR_TAKES_ONE_ARG,
178[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
179[AC_TRY_COMPILE([
180#include <sys/types.h>
181#ifdef HAVE_SYS_STAT_H
182# include <sys/stat.h>
183#endif
184#ifdef HAVE_UNISTD_H
185# include <unistd.h>
186#endif
187#ifdef HAVE_DIRECT_H
188# include <direct.h>
189#endif], [mkdir ("foo", 0);],
190 gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)])
191if test $gcc_cv_mkdir_takes_one_arg = yes ; then
192 AC_DEFINE(MKDIR_TAKES_ONE_ARG)
193fi
194])
195
159AC_DEFUN(EGCS_PROG_INSTALL,
160[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
161# Find a good install program. We prefer a C program (faster),
162# so one script is as good as another. But avoid the broken or
163# incompatible versions:
164# SysV /etc/install, /usr/sbin/install
165# SunOS /usr/etc/install
166# IRIX /sbin/install

--- 47 unchanged lines hidden (view full) ---

214# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
215# It thinks the first close brace ends the variable substitution.
216test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
217AC_SUBST(INSTALL_PROGRAM)dnl
218
219test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
220AC_SUBST(INSTALL_DATA)dnl
221])
196AC_DEFUN(EGCS_PROG_INSTALL,
197[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
198# Find a good install program. We prefer a C program (faster),
199# so one script is as good as another. But avoid the broken or
200# incompatible versions:
201# SysV /etc/install, /usr/sbin/install
202# SunOS /usr/etc/install
203# IRIX /sbin/install

--- 47 unchanged lines hidden (view full) ---

251# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
252# It thinks the first close brace ends the variable substitution.
253test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
254AC_SUBST(INSTALL_PROGRAM)dnl
255
256test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
257AC_SUBST(INSTALL_DATA)dnl
258])
259
260#serial 1
261dnl This test replaces the one in autoconf.
262dnl Currently this macro should have the same name as the autoconf macro
263dnl because gettext's gettext.m4 (distributed in the automake package)
264dnl still uses it. Otherwise, the use in gettext.m4 makes autoheader
265dnl give these diagnostics:
266dnl configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
267dnl configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
268
269undefine([AC_ISC_POSIX])
270AC_DEFUN(AC_ISC_POSIX,
271 [
272 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
273 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
274 ]
275)
276
277# Macro to add for using GNU gettext.
278# Ulrich Drepper <drepper@cygnus.com>, 1995.
279#
280# This file can be copied and used freely without restrictions. It can
281# be used in projects which are not available under the GNU Public License
282# but which still want to provide support for the GNU gettext functionality.
283# Please note that the actual code is *not* freely available.
284
285# serial 5
286
287AC_DEFUN(AM_WITH_NLS,
288 [AC_MSG_CHECKING([whether NLS is requested])
289 dnl Default is enabled NLS
290 AC_ARG_ENABLE(nls,
291 [ --disable-nls do not use Native Language Support],
292 USE_NLS=$enableval, USE_NLS=yes)
293 AC_MSG_RESULT($USE_NLS)
294 AC_SUBST(USE_NLS)
295
296 USE_INCLUDED_LIBINTL=no
297
298 dnl If we use NLS figure out what method
299 if test "$USE_NLS" = "yes"; then
300 AC_DEFINE(ENABLE_NLS)
301 AC_MSG_CHECKING([whether included gettext is requested])
302 AC_ARG_WITH(included-gettext,
303 [ --with-included-gettext use the GNU gettext library included here],
304 nls_cv_force_use_gnu_gettext=$withval,
305 nls_cv_force_use_gnu_gettext=no)
306 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
307
308 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
309 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
310 dnl User does not insist on using GNU NLS library. Figure out what
311 dnl to use. If gettext or catgets are available (in this order) we
312 dnl use this. Else we have to fall back to GNU NLS library.
313 dnl catgets is only used if permitted by option --with-catgets.
314 nls_cv_header_intl=
315 nls_cv_header_libgt=
316 CATOBJEXT=NONE
317
318 AC_CHECK_HEADER(libintl.h,
319 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
320 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
321 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
322
323 if test "$gt_cv_func_gettext_libc" != "yes"; then
324 AC_CHECK_LIB(intl, bindtextdomain,
325 [AC_CACHE_CHECK([for gettext in libintl],
326 gt_cv_func_gettext_libintl,
327 [AC_CHECK_LIB(intl, gettext,
328 gt_cv_func_gettext_libintl=yes,
329 gt_cv_func_gettext_libintl=no)],
330 gt_cv_func_gettext_libintl=no)])
331 fi
332
333 if test "$gt_cv_func_gettext_libc" = "yes" \
334 || test "$gt_cv_func_gettext_libintl" = "yes"; then
335 AC_DEFINE(HAVE_GETTEXT)
336 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
337 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
338 if test "$MSGFMT" != "no"; then
339 AC_CHECK_FUNCS(dcgettext)
340 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
341 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
342 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
343 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
344 return _nl_msg_cat_cntr],
345 [CATOBJEXT=.gmo
346 DATADIRNAME=share],
347 [CATOBJEXT=.mo
348 DATADIRNAME=lib])
349 INSTOBJEXT=.mo
350 fi
351 fi
352 ])
353
354 if test "$CATOBJEXT" = "NONE"; then
355 AC_MSG_CHECKING([whether catgets can be used])
356 AC_ARG_WITH(catgets,
357 [ --with-catgets use catgets functions if available],
358 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
359 AC_MSG_RESULT($nls_cv_use_catgets)
360
361 if test "$nls_cv_use_catgets" = "yes"; then
362 dnl No gettext in C library. Try catgets next.
363 AC_CHECK_LIB(i, main)
364 AC_CHECK_FUNC(catgets,
365 [AC_DEFINE(HAVE_CATGETS)
366 INTLOBJS="\$(CATOBJS)"
367 AC_PATH_PROG(GENCAT, gencat, no)dnl
368 if test "$GENCAT" != "no"; then
369 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
370 if test "$GMSGFMT" = "no"; then
371 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
372 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
373 fi
374 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
375 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
376 USE_INCLUDED_LIBINTL=yes
377 CATOBJEXT=.cat
378 INSTOBJEXT=.cat
379 DATADIRNAME=lib
380 INTLDEPS='$(top_builddir)/intl/libintl.a'
381 INTLLIBS=$INTLDEPS
382 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
383 nls_cv_header_intl=intl/libintl.h
384 nls_cv_header_libgt=intl/libgettext.h
385 fi])
386 fi
387 fi
388
389 if test "$CATOBJEXT" = "NONE"; then
390 dnl Neither gettext nor catgets in included in the C library.
391 dnl Fall back on GNU gettext library.
392 nls_cv_use_gnu_gettext=yes
393 fi
394 fi
395
396 if test "$nls_cv_use_gnu_gettext" = "yes"; then
397 dnl Mark actions used to generate GNU NLS library.
398 INTLOBJS="\$(GETTOBJS)"
399 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
400 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
401 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
402 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
403 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
404 AC_SUBST(MSGFMT)
405 USE_INCLUDED_LIBINTL=yes
406 CATOBJEXT=.gmo
407 INSTOBJEXT=.mo
408 DATADIRNAME=share
409 INTLDEPS='$(top_builddir)/intl/libintl.a'
410 INTLLIBS=$INTLDEPS
411 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
412 nls_cv_header_intl=intl/libintl.h
413 nls_cv_header_libgt=intl/libgettext.h
414 fi
415
416 dnl Test whether we really found GNU xgettext.
417 if test "$XGETTEXT" != ":"; then
418 dnl If it is no GNU xgettext we define it as : so that the
419 dnl Makefiles still can work.
420 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
421 : ;
422 else
423 AC_MSG_RESULT(
424 [found xgettext program is not GNU xgettext; ignore it])
425 XGETTEXT=":"
426 fi
427 fi
428
429 # We need to process the po/ directory.
430 POSUB=po
431 else
432 DATADIRNAME=share
433 nls_cv_header_intl=intl/libintl.h
434 nls_cv_header_libgt=intl/libgettext.h
435 fi
436 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
437 AC_OUTPUT_COMMANDS(
438 [case "$CONFIG_FILES" in *po/Makefile.in*)
439 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
440 esac])
441
442
443 # If this is used in GNU gettext we have to set USE_NLS to `yes'
444 # because some of the sources are only built for this goal.
445 if test "$PACKAGE" = gettext; then
446 USE_NLS=yes
447 USE_INCLUDED_LIBINTL=yes
448 fi
449
450 dnl These rules are solely for the distribution goal. While doing this
451 dnl we only have to keep exactly one list of the available catalogs
452 dnl in configure.in.
453 for lang in $ALL_LINGUAS; do
454 GMOFILES="$GMOFILES $lang.gmo"
455 POFILES="$POFILES $lang.po"
456 done
457
458 dnl Make all variables we use known to autoconf.
459 AC_SUBST(USE_INCLUDED_LIBINTL)
460 AC_SUBST(CATALOGS)
461 AC_SUBST(CATOBJEXT)
462 AC_SUBST(DATADIRNAME)
463 AC_SUBST(GMOFILES)
464 AC_SUBST(INSTOBJEXT)
465 AC_SUBST(INTLDEPS)
466 AC_SUBST(INTLLIBS)
467 AC_SUBST(INTLOBJS)
468 AC_SUBST(POFILES)
469 AC_SUBST(POSUB)
470 ])
471
472AC_DEFUN(AM_GNU_GETTEXT,
473 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
474 AC_REQUIRE([AC_PROG_CC])dnl
475 AC_REQUIRE([AC_PROG_RANLIB])dnl
476 AC_REQUIRE([AC_ISC_POSIX])dnl
477 AC_REQUIRE([AC_HEADER_STDC])dnl
478 AC_REQUIRE([AC_C_CONST])dnl
479 AC_REQUIRE([AC_C_INLINE])dnl
480 AC_REQUIRE([AC_TYPE_OFF_T])dnl
481 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
482 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
483 AC_REQUIRE([AC_FUNC_MMAP])dnl
484
485 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
486unistd.h sys/param.h])
487 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
488strdup __argz_count __argz_stringify __argz_next])
489
490 if test "${ac_cv_func_stpcpy+set}" != "set"; then
491 AC_CHECK_FUNCS(stpcpy)
492 fi
493 if test "${ac_cv_func_stpcpy}" = "yes"; then
494 AC_DEFINE(HAVE_STPCPY)
495 fi
496
497 AM_LC_MESSAGES
498 AM_WITH_NLS
499
500 if test "x$CATOBJEXT" != "x"; then
501 if test "x$ALL_LINGUAS" = "x"; then
502 LINGUAS=
503 else
504 AC_MSG_CHECKING(for catalogs to be installed)
505 NEW_LINGUAS=
506 for lang in ${LINGUAS=$ALL_LINGUAS}; do
507 case "$ALL_LINGUAS" in
508 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
509 esac
510 done
511 LINGUAS=$NEW_LINGUAS
512 AC_MSG_RESULT($LINGUAS)
513 fi
514
515 dnl Construct list of names of catalog files to be constructed.
516 if test -n "$LINGUAS"; then
517 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
518 fi
519 fi
520
521 dnl The reference to <locale.h> in the installed <libintl.h> file
522 dnl must be resolved because we cannot expect the users of this
523 dnl to define HAVE_LOCALE_H.
524 if test $ac_cv_header_locale_h = yes; then
525 INCLUDE_LOCALE_H="#include <locale.h>"
526 else
527 INCLUDE_LOCALE_H="\
528/* The system does not provide the header <locale.h>. Take care yourself. */"
529 fi
530 AC_SUBST(INCLUDE_LOCALE_H)
531
532 dnl Determine which catalog format we have (if any is needed)
533 dnl For now we know about two different formats:
534 dnl Linux libc-5 and the normal X/Open format
535 test -d intl || mkdir intl
536 if test "$CATOBJEXT" = ".cat"; then
537 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
538
539 dnl Transform the SED scripts while copying because some dumb SEDs
540 dnl cannot handle comments.
541 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
542 fi
543 dnl po2tbl.sed is always needed.
544 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
545 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
546
547 dnl In the intl/Makefile.in we have a special dependency which makes
548 dnl only sense for gettext. We comment this out for non-gettext
549 dnl packages.
550 if test "$PACKAGE" = "gettext"; then
551 GT_NO="#NO#"
552 GT_YES=
553 else
554 GT_NO=
555 GT_YES="#YES#"
556 fi
557 AC_SUBST(GT_NO)
558 AC_SUBST(GT_YES)
559
560 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
561 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
562 dnl Try to locate is.
563 MKINSTALLDIRS=
564 if test -n "$ac_aux_dir"; then
565 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
566 fi
567 if test -z "$MKINSTALLDIRS"; then
568 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
569 fi
570 AC_SUBST(MKINSTALLDIRS)
571
572 dnl *** For now the libtool support in intl/Makefile is not for real.
573 l=
574 AC_SUBST(l)
575
576 dnl Generate list of files to be processed by xgettext which will
577 dnl be included in po/Makefile.
578 test -d po || mkdir po
579 if test "x$srcdir" != "x."; then
580 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
581 posrcprefix="$srcdir/"
582 else
583 posrcprefix="../$srcdir/"
584 fi
585 else
586 posrcprefix="../"
587 fi
588 rm -f po/POTFILES
589 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
590 < $srcdir/po/POTFILES.in > po/POTFILES
591 ])
592
593# Check whether LC_MESSAGES is available in <locale.h>.
594# Ulrich Drepper <drepper@cygnus.com>, 1995.
595#
596# This file can be copied and used freely without restrictions. It can
597# be used in projects which are not available under the GNU Public License
598# but which still want to provide support for the GNU gettext functionality.
599# Please note that the actual code is *not* freely available.
600
601# serial 1
602
603AC_DEFUN(AM_LC_MESSAGES,
604 [if test $ac_cv_header_locale_h = yes; then
605 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
606 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
607 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
608 if test $am_cv_val_LC_MESSAGES = yes; then
609 AC_DEFINE(HAVE_LC_MESSAGES)
610 fi
611 fi])
612
613# Search path for a program which passes the given test.
614# Ulrich Drepper <drepper@cygnus.com>, 1996.
615#
616# This file can be copied and used freely without restrictions. It can
617# be used in projects which are not available under the GNU Public License
618# but which still want to provide support for the GNU gettext functionality.
619# Please note that the actual code is *not* freely available.
620
621# serial 1
622
623dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
624dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
625AC_DEFUN(AM_PATH_PROG_WITH_TEST,
626[# Extract the first word of "$2", so it can be a program name with args.
627set dummy $2; ac_word=[$]2
628AC_MSG_CHECKING([for $ac_word])
629AC_CACHE_VAL(ac_cv_path_$1,
630[case "[$]$1" in
631 /*)
632 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
633 ;;
634 *)
635 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
636 for ac_dir in ifelse([$5], , $PATH, [$5]); do
637 test -z "$ac_dir" && ac_dir=.
638 if test -f $ac_dir/$ac_word; then
639 if [$3]; then
640 ac_cv_path_$1="$ac_dir/$ac_word"
641 break
642 fi
643 fi
644 done
645 IFS="$ac_save_ifs"
646dnl If no 4th arg is given, leave the cache variable unset,
647dnl so AC_PATH_PROGS will keep looking.
648ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
649])dnl
650 ;;
651esac])dnl
652$1="$ac_cv_path_$1"
653if test -n "[$]$1"; then
654 AC_MSG_RESULT([$]$1)
655else
656 AC_MSG_RESULT(no)
657fi
658AC_SUBST($1)dnl
659])