2010-08-03 Ralf Corsépius <ralf.corsepius@rtems.org>

* aclocal/check-func.m4: New.
This commit is contained in:
Ralf Corsepius
2010-08-03 15:42:44 +00:00
parent 1246d791ab
commit 26c6706cfc
2 changed files with 28 additions and 0 deletions
+4
View File
@@ -1,3 +1,7 @@
2010-08-03 Ralf Corsépius <ralf.corsepius@rtems.org>
* aclocal/check-func.m4: New.
2010-08-03 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Add checks for [get|set][e][uid,gid] family of
+24
View File
@@ -0,0 +1,24 @@
# $Id$
# Check whether FUNCTION is declared in INCLUDES
# and whether rtems_stub_FUNCTION or FUNCTION is supplied.
# RTEMS_CHECK_FUNC(FUNCTION[,INCLUDES])
AC_DEFUN([RTEMS_CHECK_FUNC],
[AC_REQUIRE([RTEMS_CHECK_NEWLIB])
AC_CHECK_DECLS([$1],
[
AC_CACHE_CHECK([for $1],[ac_cv_$1],[
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[$2]],[[rtems_stub_$1()]])],
[ac_cv_$1="stub"],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[$2]],[[$1()]])],
[ac_cv_$1="yes"],
[ac_cv_$1="no"])
])
])
])
AS_IF([test "$ac_cv_$1" = yes],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1),[1],[Define to 1 if you have the `$1' function.])])
])