aclocal.m4 (gcc_AC_NEED_DECLARATION): This macro now requires INCLUDES to search and does not provide any of its own.

* aclocal.m4 (gcc_AC_NEED_DECLARATION): This macro now requires
       INCLUDES to search and does not provide any of its own.  Also it
       now accepts optional ACTION-IF-NEEDED and ACTION-IF-NOT-NEEDED
       parameters.  Also it does not call AC_DEFINE.
       (gcc_AC_NEED_DECLARATIONS): Likewise.  Also this macro now calls
       AC_DEFINE and provides for automatic entries for autoheader.
       (gcc_AC_FUNC_PRINTF_PTR): Cleanup C code in test.

       * configure.in (gcc_AC_NEED_DECLARATIONS): Save and restore CFLAGS
       so we can pass -I flags and include gansidecl.h/system.h in this
       test.

       * acconfig.h: Delete all NEED_DECLARATION_* entries.

From-SVN: r33428
This commit is contained in:
Kaveh R. Ghazi 2000-04-26 00:03:37 +00:00 committed by Kaveh Ghazi
parent 62076024ce
commit 86cf1cbd5f
6 changed files with 343 additions and 452 deletions

View File

@ -1,3 +1,19 @@
2000-04-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* aclocal.m4 (gcc_AC_NEED_DECLARATION): This macro now requires
INCLUDES to search and does not provide any of its own. Also it
now accepts optional ACTION-IF-NEEDED and ACTION-IF-NOT-NEEDED
parameters. Also it does not call AC_DEFINE.
(gcc_AC_NEED_DECLARATIONS): Likewise. Also this macro now calls
AC_DEFINE and provides for automatic entries for autoheader.
(gcc_AC_FUNC_PRINTF_PTR): Cleanup C code in test.
* configure.in (gcc_AC_NEED_DECLARATIONS): Save and restore CFLAGS
so we can pass -I flags and include gansidecl.h/system.h in this
test.
* acconfig.h: Delete all NEED_DECLARATION_* entries.
2000-04-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* acconfig.h (ENABLE_STD_NAMESPACE, ENABLE_CHECKING,

View File

@ -7,6 +7,12 @@
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define if your assembler supports specifying the maximum number
of bytes to skip when using the GAS .p2align command. */
#undef HAVE_GAS_MAX_SKIP_P2ALIGN
@ -17,82 +23,4 @@
/* Define if your assembler uses the old HImode fild and fist notation. */
#undef HAVE_GAS_FILDS_FISTS
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
/* Whether realloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_REALLOC
/* Whether calloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_CALLOC
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
/* Whether bcopy must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_BCOPY
/* Whether bcmp must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_BCMP
/* Whether bzero must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_BZERO
/* Whether index must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_INDEX
/* Whether rindex must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_RINDEX
/* Whether getenv must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_GETENV
/* Whether atol must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ATOL
/* Whether atof must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ATOF
/* Whether sbrk must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_SBRK
/* Whether abort must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ABORT
/* Whether strsignal must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSIGNAL
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
/* Whether getcwd must be declared even if <unistd.h> is included. */
#undef NEED_DECLARATION_GETCWD
/* Whether getwd must be declared even if <unistd.h> is included. */
#undef NEED_DECLARATION_GETWD
/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
#undef NEED_DECLARATION_GETRLIMIT
/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
#undef NEED_DECLARATION_SETRLIMIT
/* Whether getrusage must be declared even if <sys/resource.h> is included. */
#undef NEED_DECLARATION_GETRUSAGE
/* Whether putc_unlocked must be declared even if <stdio.h> is included. */
#undef NEED_DECLARATION_PUTC_UNLOCKED
/* Whether fputs_unlocked must be declared even if <stdio.h> is included. */
#undef NEED_DECLARATION_FPUTS_UNLOCKED
/* Whether environ must be declared. */
#undef NEED_DECLARATION_ENVIRON
@TOP@

69
gcc/aclocal.m4 vendored
View File

@ -10,59 +10,44 @@ fi
])
dnl See whether we need a declaration for a function.
dnl gcc_AC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
dnl The result is highly dependent on the INCLUDES passed in, so make sure
dnl to use a different cache variable name in this macro if it is invoked
dnl in a different context somewhere else.
dnl gcc_AC_NEED_DECLARATION(FUNCTION, INCLUDES,
dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED]])
AC_DEFUN(gcc_AC_NEED_DECLARATION,
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
[AC_TRY_COMPILE([
#include <stdio.h>
#ifdef STRING_WITH_STRINGS
# include <string.h>
# include <strings.h>
#else
# ifdef HAVE_STRING_H
# include <string.h>
# else
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
# endif
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef HAVE_RINDEX
#ifndef rindex
#define rindex strrchr
#endif
#endif
#ifndef HAVE_INDEX
#ifndef index
#define index strchr
#endif
#endif
$2],
[char *(*pfn) = (char *(*)) $1],
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
[AC_TRY_COMPILE([$2],
[#ifndef $1
char *(*pfn) = (char *(*)) $1 ;
#endif], eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($gcc_tr_decl)
AC_MSG_RESULT(yes) ; ifelse([$3], , :, [$3])
else
AC_MSG_RESULT(no)
AC_MSG_RESULT(no) ; ifelse([$4], , :, [$4])
fi
])dnl
dnl Check multiple functions to see whether each needs a declaration.
dnl gcc_AC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
dnl Arrange to define NEED_DECLARATION_<FUNCTION> if appropriate.
dnl gcc_AC_NEED_DECLARATIONS(FUNCTION... , INCLUDES,
dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED]])
AC_DEFUN(gcc_AC_NEED_DECLARATIONS,
[for ac_func in $1
do
gcc_AC_NEED_DECLARATION($ac_func, $2)
gcc_AC_NEED_DECLARATION($ac_func, [$2],
[changequote(, )dnl
ac_tr_decl=NEED_DECLARATION_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
changequote([, ])dnl
AC_DEFINE_UNQUOTED($ac_tr_decl) $3], $4)
done
dnl Automatically generate config.h entries via autoheader.
if test x = y ; then
patsubst(translit([$1], [a-z], [A-Z]), [\w+],
AC_DEFINE([NEED_DECLARATION_\&], 1,
[Define if you need to provide a declaration for this function.]))dnl
fi
])
dnl Check if we have vprintf and possibly _doprnt.
@ -87,13 +72,13 @@ AC_DEFUN(gcc_AC_FUNC_PRINTF_PTR,
gcc_cv_func_printf_ptr,
[AC_TRY_RUN([#include <stdio.h>
main()
int main()
{
char buf[64];
char *p = buf, *q = NULL;
sprintf(buf, "%p", p);
sscanf(buf, "%p", &q);
exit (p != q);
return (p != q);
}], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no,
gcc_cv_func_printf_ptr=no)
rm -f core core.* *.core])

View File

@ -8,6 +8,12 @@
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define if your assembler supports specifying the maximum number
of bytes to skip when using the GAS .p2align command. */
#undef HAVE_GAS_MAX_SKIP_P2ALIGN
@ -18,84 +24,6 @@
/* Define if your assembler uses the old HImode fild and fist notation. */
#undef HAVE_GAS_FILDS_FISTS
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
/* Whether realloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_REALLOC
/* Whether calloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_CALLOC
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
/* Whether bcopy must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_BCOPY
/* Whether bcmp must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_BCMP
/* Whether bzero must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_BZERO
/* Whether index must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_INDEX
/* Whether rindex must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_RINDEX
/* Whether getenv must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_GETENV
/* Whether atol must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ATOL
/* Whether atof must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ATOF
/* Whether sbrk must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_SBRK
/* Whether abort must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ABORT
/* Whether strsignal must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSIGNAL
/* Whether strstr must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRSTR
/* Whether getcwd must be declared even if <unistd.h> is included. */
#undef NEED_DECLARATION_GETCWD
/* Whether getwd must be declared even if <unistd.h> is included. */
#undef NEED_DECLARATION_GETWD
/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
#undef NEED_DECLARATION_GETRLIMIT
/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
#undef NEED_DECLARATION_SETRLIMIT
/* Whether getrusage must be declared even if <sys/resource.h> is included. */
#undef NEED_DECLARATION_GETRUSAGE
/* Whether putc_unlocked must be declared even if <stdio.h> is included. */
#undef NEED_DECLARATION_PUTC_UNLOCKED
/* Whether fputs_unlocked must be declared even if <stdio.h> is included. */
#undef NEED_DECLARATION_FPUTS_UNLOCKED
/* Whether environ must be declared. */
#undef NEED_DECLARATION_ENVIRON
/* Define if using alloca.c. */
#undef C_ALLOCA
@ -385,6 +313,78 @@
/* Define if read-only mmap of a plain file works. */
#undef HAVE_MMAP_FILE
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_BCOPY
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_BZERO
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_BCMP
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_INDEX
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_RINDEX
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_GETENV
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_ATOL
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_SBRK
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_ABORT
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_ATOF
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_GETCWD
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_GETWD
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_STRSIGNAL
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_PUTC_UNLOCKED
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_FPUTS_UNLOCKED
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_STRSTR
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_ENVIRON
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_MALLOC
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_REALLOC
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_CALLOC
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_FREE
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_GETRLIMIT
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_SETRLIMIT
/* Define if you need to provide a declaration for this function. */
#undef NEED_DECLARATION_GETRUSAGE
/* Define if host mkdir takes a single argument. */
#undef MKDIR_TAKES_ONE_ARG

450
gcc/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -446,23 +446,27 @@ AC_FUNC_VFORK
AC_FUNC_MMAP_ANYWHERE
AC_FUNC_MMAP_FILE
# We will need to find libiberty.h and ansidecl.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
gcc_AC_NEED_DECLARATIONS(bcopy bzero bcmp \
index rindex getenv atol sbrk abort atof getcwd getwd \
strsignal putc_unlocked fputs_unlocked strstr environ)
gcc_AC_NEED_DECLARATIONS(malloc realloc calloc free, [
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
])
strsignal putc_unlocked fputs_unlocked strstr environ \
malloc realloc calloc free, [
#include "gansidecl.h"
#include "system.h"])
gcc_AC_NEED_DECLARATIONS(getrlimit setrlimit getrusage, [
#include <sys/types.h>
#include "gansidecl.h"
#include "system.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
])
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
# mkdir takes a single argument on some systems.
gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG