summaryrefslogtreecommitdiffstats
path: root/cpukit/aclocal/check-newlib.m4
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2002-06-17 08:52:47 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2002-06-17 08:52:47 +0000
commited8ec1cf119e0886f816697e3ee367476d90bea2 (patch)
tree0b3c7846d92f35bd6fe8038814d8e89ac667e761 /cpukit/aclocal/check-newlib.m4
parent2002-06-15 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff)
downloadrtems-ed8ec1cf119e0886f816697e3ee367476d90bea2.tar.bz2
2002-06-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* copied over from aclocal/.
Diffstat (limited to 'cpukit/aclocal/check-newlib.m4')
-rw-r--r--cpukit/aclocal/check-newlib.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/cpukit/aclocal/check-newlib.m4 b/cpukit/aclocal/check-newlib.m4
new file mode 100644
index 0000000000..a26624702e
--- /dev/null
+++ b/cpukit/aclocal/check-newlib.m4
@@ -0,0 +1,31 @@
+dnl $Id$
+
+AC_DEFUN(RTEMS_CHECK_NEWLIB,
+[dnl
+AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl
+AC_REQUIRE([RTEMS_CANONICALIZE_TOOLS])dnl
+AC_CACHE_CHECK([for RTEMS newlib],
+ rtems_cv_use_newlib,
+ [
+dnl some versions of newlib provide not_required_by_rtems
+ AC_TRY_LINK(
+ [extern void not_required_by_rtems() ;],
+ [not_required_by_rtems()],
+ rtems_cv_use_newlib="yes")
+
+dnl some versions of newlib provide rtems_provides_crt0()
+ AS_IF([test -z "$rtems_cv_use_newlib"],
+ [AC_TRY_LINK(
+ [extern void rtems_provides_crt0() ;],
+ [rtems_provides_crt0()],
+ rtems_cv_use_newlib="yes",
+ rtems_cv_use_newlib="no")]
+ )
+ ])
+ RTEMS_USE_NEWLIB="$rtems_cv_use_newlib"
+ AC_SUBST(RTEMS_USE_NEWLIB)
+
+ AS_IF([test x"${RTEMS_USE_NEWLIB}" = x"yes"],
+ [ AC_DEFINE_UNQUOTED(RTEMS_NEWLIB,1,[if using newlib])]
+ )
+])