source: rtems/cpukit/aclocal/check-func.m4 @ 26c6706

4.115
Last change on this file since 26c6706 was 26c6706, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/03/10 at 15:42:44

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

  • aclocal/check-func.m4: New.
  • Property mode set to 100644
File size: 649 bytes
Line 
1# $Id$
2
3# Check whether FUNCTION is declared in INCLUDES
4# and whether rtems_stub_FUNCTION or FUNCTION is supplied.
5
6# RTEMS_CHECK_FUNC(FUNCTION[,INCLUDES])
7AC_DEFUN([RTEMS_CHECK_FUNC],
8[AC_REQUIRE([RTEMS_CHECK_NEWLIB])
9AC_CHECK_DECLS([$1],
10[
11  AC_CACHE_CHECK([for $1],[ac_cv_$1],[
12    AC_LINK_IFELSE(
13      [AC_LANG_PROGRAM([[$2]],[[rtems_stub_$1()]])],
14      [ac_cv_$1="stub"],
15      [AC_LINK_IFELSE(
16        [AC_LANG_PROGRAM([[$2]],[[$1()]])],
17        [ac_cv_$1="yes"],
18        [ac_cv_$1="no"])
19      ])
20    ])
21  ])
22AS_IF([test "$ac_cv_$1" = yes],
23  [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1),[1],[Define to 1 if you have the `$1' function.])])
24])
Note: See TracBrowser for help on using the repository browser.