source: rtems/cpukit/aclocal/prog-gnat.m4 @ d8befba2

4.104.114.84.95
Last change on this file since d8befba2 was 97b4bc1, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/22/02 at 14:00:56

2002-08-22 Ralf Corsepius <corsepiu@…>

  • aclocal/prog-gnat.m4: New.
  • configure.ac: Add ada subdir handling.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1## $Id$
2##
3## Partially borrowed from gcc-3.2
4##
5## WARNING: All the stuff below is pretty immature.
6
7AC_DEFUN([RTEMS_PROG_GNAT],
8[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
9AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])
10
11AC_CHECK_TOOL([GNATMAKE],[gnatmake],[])
12AC_CACHE_CHECK([for compiler driver that understands Ada],
13  [rtems_cv_prog_CCADA],
14[cat >conftest.adb <<EOF
15procedure conftest is begin null; end conftest;
16EOF
17rtems_cv_prog_CCADA=
18# Have to do ac_tool_prefix and user overrides by hand.
19user_ccada=$CCADA
20user_cc=$CC
21for cand in ${ac_tool_prefix}$user_ccada        $user_ccada     \
22            ${ac_tool_prefix}$user_cc           $user_cc        \
23            ${ac_tool_prefix}gcc                gcc             \
24            ${ac_tool_prefix}cc                 cc              \
25            ${ac_tool_prefix}gnatgcc            gnatgcc         \
26            ${ac_tool_prefix}gnatcc             gnatcc          \
27            ${ac_tool_prefix}adagcc             adagcc          \
28            ${ac_tool_prefix}adac               adac            ; do
29  # There is a bug in all released versions of GCC which causes the
30  # driver to exit successfully when the appropriate language module
31  # has not been installed.  This is fixed in 2.95.4, 3.0.2, and 3.1.
32  # Therefore we must check for the error message as well as an
33  # unsuccessful exit.
34  errors=`($cand -c conftest.adb) 2>&1 || echo failure`
35  AS_IF([test -z "$errors"],
36    [rtems_cv_prog_CCADA=$cand
37     break])
38done
39rm -f conftest.*])
40AC_SUBST([CCADA],[$rtems_cv_prog_CCADA])
41
42AS_IF([test -n "$GNATMAKE" && test -n "$CCADA"],
43  [HAVE_GNAT=yes],
44  [HAVE_GNAT=no])
45])
Note: See TracBrowser for help on using the repository browser.