mirror of
https://github.com/pmret/gcc-papermario.git
synced 2024-11-08 20:02:47 +01:00
34 lines
822 B
Plaintext
34 lines
822 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
|
||
|
#ifndef HAVE_RINDEX
|
||
|
#define rindex strrchr
|
||
|
#endif
|
||
|
#ifndef HAVE_INDEX
|
||
|
#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
|
||
|
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
||
|
AC_DEFINE_UNQUOTED($gcc_tr_decl)
|
||
|
fi
|
||
|
])dnl
|