summaryrefslogtreecommitdiffstats
path: root/cpukit/aclocal
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2010-08-03 15:42:44 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2010-08-03 15:42:44 +0000
commit26c6706cfc87f58fef164d49f623720f848dc980 (patch)
treea8288ba467bf1df6d80444db5764530ae2ec860e /cpukit/aclocal
parent2010-08-03 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff)
downloadrtems-26c6706cfc87f58fef164d49f623720f848dc980.tar.bz2
2010-08-03 Ralf Corsépius <ralf.corsepius@rtems.org>
* aclocal/check-func.m4: New.
Diffstat (limited to 'cpukit/aclocal')
-rw-r--r--cpukit/aclocal/check-func.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/cpukit/aclocal/check-func.m4 b/cpukit/aclocal/check-func.m4
new file mode 100644
index 0000000000..85a019a961
--- /dev/null
+++ b/cpukit/aclocal/check-func.m4
@@ -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.])])
+])