X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Faclocal.m4;h=bf8a907100f9d2107df899e538e6a47f6fcd3058;hb=030a2e78acf66c5c12e073ec3887a167da7a7195;hp=103e246de7ec47ee26c0b7b5ddf5322c906af6fb;hpb=f348a7b160d3c55a2c42294149a4d1138c1c8df3;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 index 103e246de7..bf8a907100 100644 --- a/libiberty/aclocal.m4 +++ b/libiberty/aclocal.m4 @@ -1,3 +1,9 @@ +sinclude(../config/acx.m4) +sinclude(../config/no-executables.m4) +sinclude(../config/override.m4) +sinclude(../config/picflag.m4) +sinclude(../config/warnings.m4) + dnl See whether strncmp reads past the end of its string parameters. dnl On some versions of SunOS4 at least, strncmp reads a word at a time dnl but erroneously reads past the end of strings. This can cause @@ -66,10 +72,10 @@ main () exit (0); } ], ac_cv_func_strncmp_works=yes, ac_cv_func_strncmp_works=no, - ac_cv_func_strncmp_works=no) + ac_cv_func_strncmp_works=yes) rm -f core core.* *.core]) if test $ac_cv_func_strncmp_works = no ; then - LIBOBJS="$LIBOBJS strncmp.o" + AC_LIBOBJ([strncmp]) fi ]) @@ -87,56 +93,34 @@ then AC_DEFINE(NEED_DECLARATION_ERRNO, 1, fi ]) -# FIXME: We temporarily define our own version of AC_PROG_CC. This is -# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We -# are probably using a cross compiler, which will not be able to fully -# link an executable. This should really be fixed in autoconf -# itself. - -AC_DEFUN(LIB_AC_PROG_CC, -[AC_BEFORE([$0], [AC_PROG_CPP])dnl -AC_PROVIDE([AC_PROG_CC]) -AC_CHECK_PROG(CC, gcc, gcc) -if test -z "$CC"; then - AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) - test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -fi - -AC_PROG_CC_GNU - -if test $ac_cv_prog_gcc = yes; then - GCC=yes - ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic' -dnl Check whether -g works, even if CFLAGS is set, in case the package -dnl plays around with CFLAGS (such as to build both debugging and -dnl normal versions of a library), tasteless as that idea is. - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - AC_PROG_CC_G - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - elif test $ac_cv_prog_cc_g = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-O2" - fi -else - GCC= - ac_libiberty_warn_cflags= - test "${CFLAGS+set}" = set || CFLAGS="-g" +dnl See whether we need a declaration for a function. +AC_DEFUN(libiberty_NEED_DECLARATION, +[AC_MSG_CHECKING([whether $1 must be declared]) +AC_CACHE_VAL(libiberty_cv_decl_needed_$1, +[AC_TRY_COMPILE([ +#include "confdefs.h" +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif], +[char *(*pfn) = (char *(*)) $1], +libiberty_cv_decl_needed_$1=no, libiberty_cv_decl_needed_$1=yes)]) +AC_MSG_RESULT($libiberty_cv_decl_needed_$1) +if test $libiberty_cv_decl_needed_$1 = yes; then + AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, + [Define if $1 is not declared in system header files.]) fi -AC_SUBST(ac_libiberty_warn_cflags) -]) - -# Work around a bug in autoheader. This can go away when we switch to -# autoconf >2.50. The use of define instead of AC_DEFUN is -# deliberate. -define(AC_DEFINE_NOAUTOHEADER, -[cat >> confdefs.h <<\EOF -[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) -EOF -]) +])dnl # We always want a C version of alloca() compiled into libiberty, # because native-compiler support for the real alloca is so !@#$%