Commit 86cf1cbd by Kaveh R. Ghazi Committed by Kaveh Ghazi

aclocal.m4 (gcc_AC_NEED_DECLARATION): This macro now requires INCLUDES to search…

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
parent 62076024
2000-04-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 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, * acconfig.h (ENABLE_STD_NAMESPACE, ENABLE_CHECKING,
ENABLE_TREE_CHECKING, ENABLE_RTL_CHECKING, ENABLE_GC_CHECKING, ENABLE_TREE_CHECKING, ENABLE_RTL_CHECKING, ENABLE_GC_CHECKING,
ENABLE_GC_ALWAYS_COLLECT): Delete entries. ENABLE_GC_ALWAYS_COLLECT): Delete entries.
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
/* Define as 1 if you have gettext and don't want to use GNU gettext. */ /* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_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 /* Define if your assembler supports specifying the maximum number
of bytes to skip when using the GAS .p2align command. */ of bytes to skip when using the GAS .p2align command. */
#undef HAVE_GAS_MAX_SKIP_P2ALIGN #undef HAVE_GAS_MAX_SKIP_P2ALIGN
...@@ -17,82 +23,4 @@ ...@@ -17,82 +23,4 @@
/* Define if your assembler uses the old HImode fild and fist notation. */ /* Define if your assembler uses the old HImode fild and fist notation. */
#undef HAVE_GAS_FILDS_FISTS #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@ @TOP@
...@@ -10,59 +10,44 @@ fi ...@@ -10,59 +10,44 @@ fi
]) ])
dnl See whether we need a declaration for a function. 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_DEFUN(gcc_AC_NEED_DECLARATION,
[AC_MSG_CHECKING([whether $1 must be declared]) [AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1, AC_CACHE_VAL(gcc_cv_decl_needed_$1,
[AC_TRY_COMPILE([ [AC_TRY_COMPILE([$2],
#include <stdio.h> [#ifndef $1
#ifdef STRING_WITH_STRINGS char *(*pfn) = (char *(*)) $1 ;
# include <string.h> #endif], eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
# 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")])
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes) ; ifelse([$3], , :, [$3])
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($gcc_tr_decl)
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no) ; ifelse([$4], , :, [$4])
fi fi
])dnl ])dnl
dnl Check multiple functions to see whether each needs a declaration. 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, AC_DEFUN(gcc_AC_NEED_DECLARATIONS,
[for ac_func in $1 [for ac_func in $1
do 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 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. dnl Check if we have vprintf and possibly _doprnt.
...@@ -87,13 +72,13 @@ AC_DEFUN(gcc_AC_FUNC_PRINTF_PTR, ...@@ -87,13 +72,13 @@ AC_DEFUN(gcc_AC_FUNC_PRINTF_PTR,
gcc_cv_func_printf_ptr, gcc_cv_func_printf_ptr,
[AC_TRY_RUN([#include <stdio.h> [AC_TRY_RUN([#include <stdio.h>
main() int main()
{ {
char buf[64]; char buf[64];
char *p = buf, *q = NULL; char *p = buf, *q = NULL;
sprintf(buf, "%p", p); sprintf(buf, "%p", p);
sscanf(buf, "%p", &q); 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=yes, gcc_cv_func_printf_ptr=no,
gcc_cv_func_printf_ptr=no) gcc_cv_func_printf_ptr=no)
rm -f core core.* *.core]) rm -f core core.* *.core])
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
/* Define as 1 if you have gettext and don't want to use GNU gettext. */ /* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_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 /* Define if your assembler supports specifying the maximum number
of bytes to skip when using the GAS .p2align command. */ of bytes to skip when using the GAS .p2align command. */
#undef HAVE_GAS_MAX_SKIP_P2ALIGN #undef HAVE_GAS_MAX_SKIP_P2ALIGN
...@@ -18,84 +24,6 @@ ...@@ -18,84 +24,6 @@
/* Define if your assembler uses the old HImode fild and fist notation. */ /* Define if your assembler uses the old HImode fild and fist notation. */
#undef HAVE_GAS_FILDS_FISTS #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. */ /* Define if using alloca.c. */
#undef C_ALLOCA #undef C_ALLOCA
...@@ -385,6 +313,78 @@ ...@@ -385,6 +313,78 @@
/* Define if read-only mmap of a plain file works. */ /* Define if read-only mmap of a plain file works. */
#undef HAVE_MMAP_FILE #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. */ /* Define if host mkdir takes a single argument. */
#undef MKDIR_TAKES_ONE_ARG #undef MKDIR_TAKES_ONE_ARG
......
...@@ -446,23 +446,27 @@ AC_FUNC_VFORK ...@@ -446,23 +446,27 @@ AC_FUNC_VFORK
AC_FUNC_MMAP_ANYWHERE AC_FUNC_MMAP_ANYWHERE
AC_FUNC_MMAP_FILE 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 \ gcc_AC_NEED_DECLARATIONS(bcopy bzero bcmp \
index rindex getenv atol sbrk abort atof getcwd getwd \ index rindex getenv atol sbrk abort atof getcwd getwd \
strsignal putc_unlocked fputs_unlocked strstr environ) strsignal putc_unlocked fputs_unlocked strstr environ \
malloc realloc calloc free, [
gcc_AC_NEED_DECLARATIONS(malloc realloc calloc free, [ #include "gansidecl.h"
#ifdef HAVE_MALLOC_H #include "system.h"])
#include <malloc.h>
#endif
])
gcc_AC_NEED_DECLARATIONS(getrlimit setrlimit getrusage, [ gcc_AC_NEED_DECLARATIONS(getrlimit setrlimit getrusage, [
#include <sys/types.h> #include "gansidecl.h"
#include "system.h"
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
]) ])
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
# mkdir takes a single argument on some systems. # mkdir takes a single argument on some systems.
gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment