8sa1-gcc/gcc/aclocal.m4
Doug Evans 2f51182ac3 Initial revision
From-SVN: r14486
1997-07-19 02:37:36 +00:00

28 lines
725 B
Plaintext

dnl See whether we need a declaration for a function.
AC_DEFUN(GCC_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 HAVE_STRING_H
#include <string.h>
#else
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#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
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
AC_DEFINE_UNQUOTED($gcc_tr_decl)
fi
])dnl