summaryrefslogtreecommitdiff
path: root/gcc/aclocal.m4
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-30 11:10:55 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-30 11:10:55 +0000
commit436f53839ce0c8a57c1122209f8517ee4a501a46 (patch)
tree6a1d94fc07040fc795481149a70a21bbded1f9e6 /gcc/aclocal.m4
parent9873126b725fe4f1ede89a3a839cf9750a9a6c51 (diff)
downloadgcc-436f53839ce0c8a57c1122209f8517ee4a501a46.tar.gz
Add the ability to GCC_NEED_DECLARATION{S} for looking in arbitrary
header files when searching for function declarations. Use this functionality to check for getrlimit/setrlimit. * aclocal.m4 (GCC_NEED_DECLARATION): Accept an optional second argument, which is typically preprocessor code used to draw in additional header files when looking for a function declaration. (GCC_NEED_DECLARATIONS): Likewise. * configure.in (GCC_NEED_DECLARATIONS): Add checks for getrlimit and setrlimit, search for them in sys/resource.h. * acconfig.h: Add stubs for NEED_DECLARATION_GETRLIMIT and NEED_DECLARATION_SETRLIMIT. * system.h: Prototype getrlimit/setrlimit if necessary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/aclocal.m4')
-rw-r--r--gcc/aclocal.m47
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 7149a2ab98a..fea020129d2 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -1,4 +1,5 @@
dnl See whether we need a declaration for a function.
+dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
AC_DEFUN(GCC_NEED_DECLARATION,
[AC_MSG_CHECKING([whether $1 must be declared])
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
@@ -22,7 +23,8 @@ AC_CACHE_VAL(gcc_cv_decl_needed_$1,
#endif
#ifndef HAVE_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
@@ -35,10 +37,11 @@ fi
])dnl
dnl Check multiple functions to see whether each needs a declaration.
+dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
AC_DEFUN(GCC_NEED_DECLARATIONS,
[for ac_func in $1
do
-GCC_NEED_DECLARATION($ac_func)
+GCC_NEED_DECLARATION($ac_func, $2)
done
])