Commit a81fb89e by Kaveh R. Ghazi Committed by Jeff Law

aclocal.m4 (GCC_NEED_DECLARATION): Modify macro to accept a shell variable…

aclocal.m4 (GCC_NEED_DECLARATION): Modify macro to accept a shell variable argument instead of only hard coded...

        * aclocal.m4 (GCC_NEED_DECLARATION): Modify macro to accept a
        shell variable argument instead of only hard coded functions.
        (GCC_NEED_DECLARATIONS): New macro to accept multiple functions.
        * configure.in: Collapse multiple calls to AC_CHECK_FUNCS into one
        call.  Collapse multiple calls to GCC_NEED_DECLARATION into one
        call to GCC_NEED_DECLARATIONS (new macro.)  Check if we need
        declarations for bcopy, bcmp and bzero.
        * acconfig.h: Add stubs for bcopy, bcmp and bzero declarations.
        * gansidecl.h: If we have bcopy but don't declare it, then do so.
        Likewise for bcmp and bzero.  Only define macros for bcopy, bcmp,
        bzero, index and rindex if they aren't already present.

From-SVN: r17563
parent f65a7138
Sun Feb 1 01:48:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* aclocal.m4 (GCC_NEED_DECLARATION): Modify macro to accept a
shell variable argument instead of only hard coded functions.
(GCC_NEED_DECLARATIONS): New macro to accept multiple functions.
* configure.in: Collapse multiple calls to AC_CHECK_FUNCS into one
call. Collapse multiple calls to GCC_NEED_DECLARATION into one
call to GCC_NEED_DECLARATIONS (new macro.) Check if we need
declarations for bcopy, bcmp and bzero.
* acconfig.h: Add stubs for bcopy, bcmp and bzero declarations.
* gansidecl.h: If we have bcopy but don't declare it, then do so.
Likewise for bcmp and bzero. Only define macros for bcopy, bcmp,
bzero, index and rindex if they aren't already present.
Sat Jan 31 11:26:58 1998 Jeffrey A Law (law@cygnus.com)
* toplev.c (close_dump_file): Wrap function prototype for
......
......@@ -16,6 +16,15 @@
/* 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
......
......@@ -24,14 +24,24 @@ AC_CACHE_VAL(gcc_cv_decl_needed_$1,
#define index strchr
#endif],
[char *(*pfn) = (char *(*)) $1],
gcc_cv_decl_needed_$1=no, gcc_cv_decl_needed_$1=yes)])
AC_MSG_RESULT($gcc_cv_decl_needed_$1)
if test $gcc_cv_decl_needed_$1 = yes; then
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)
else
AC_MSG_RESULT(no)
fi
])dnl
dnl Check multiple functions to see whether each needs a declaration.
AC_DEFUN(GCC_NEED_DECLARATIONS,
[for ac_func in $1
do
GCC_NEED_DECLARATION($ac_func)
done
])
dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
AC_DEFUN(GCC_PROG_LN_S,
[AC_MSG_CHECKING(whether ln -s works)
......
......@@ -17,6 +17,15 @@
/* 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
......
......@@ -177,33 +177,11 @@ AC_CACHE_VAL(gcc_cv_header_inttypes_h,
gcc_cv_header_inttypes_h=no)])
AC_MSG_RESULT($gcc_cv_header_inttypes_h)
AC_CHECK_FUNCS(strtoul)
AC_CHECK_FUNCS(bsearch)
AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(putenv)
AC_CHECK_FUNCS(popen)
AC_CHECK_FUNCS(vprintf)
AC_CHECK_FUNCS(bcopy)
AC_CHECK_FUNCS(bzero)
AC_CHECK_FUNCS(bcmp)
AC_CHECK_FUNCS(index)
AC_CHECK_FUNCS(rindex)
AC_CHECK_FUNCS(kill)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(setrlimit)
AC_CHECK_FUNCS(atoll)
AC_CHECK_FUNCS(atoq)
GCC_NEED_DECLARATION(malloc)
GCC_NEED_DECLARATION(realloc)
GCC_NEED_DECLARATION(calloc)
GCC_NEED_DECLARATION(free)
GCC_NEED_DECLARATION(index)
GCC_NEED_DECLARATION(rindex)
GCC_NEED_DECLARATION(getenv)
GCC_NEED_DECLARATION(atol)
GCC_NEED_DECLARATION(sbrk)
GCC_NEED_DECLARATION(abort)
AC_CHECK_FUNCS(strtoul bsearch strerror putenv popen vprintf bcopy bzero bcmp \
index rindex kill getrlimit setrlimit atoll atoq)
GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \
index rindex getenv atol sbrk abort)
AC_DECL_SYS_SIGLIST
......
/* ANSI and traditional C compatability macros.
Copyright (C) 1996 Free Software Foundation, Inc.
/* ANSI and traditional C compatibility macros.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
......@@ -46,14 +46,6 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
#ifndef STDIO_PROTO
#ifdef BUFSIZ
#define STDIO_PROTO(ARGS) PROTO(ARGS)
#else
#define STDIO_PROTO(ARGS) ()
#endif
#endif
/* Define a generic NULL if one hasn't already been defined. */
#ifndef NULL
......@@ -85,4 +77,46 @@ Boston, MA 02111-1307, USA. */
#endif /* ! __STDC__ */
#ifdef HAVE_BCOPY
# ifdef NEED_DECLARATION_BCOPY
void bcopy ();
# endif
#else
# ifndef bcopy
# define bcopy(src,dst,len) memcpy ((dst),(src),(len))
# endif
#endif
#ifdef HAVE_BZERO
# ifdef NEED_DECLARATION_BZERO
void bzero ();
# endif
#else
# ifndef bzero
# define bzero(dst,len) memset ((dst),0,(len))
# endif
#endif
#ifdef HAVE_BCMP
# ifdef NEED_DECLARATION_BCMP
int bcmp ();
# endif
#else
# ifndef bcmp
# define bcmp(left,right,len) memcmp ((left),(right),(len))
# endif
#endif
#ifndef HAVE_RINDEX
# ifndef rindex
# define rindex strrchr
# endif
#endif
#ifndef HAVE_INDEX
# ifndef index
# define index strchr
# endif
#endif
#endif /* ANSIDECL_H */
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