source: rtems/testsuites/ada/aclocal/prog-gnat.m4 @ 48aa4b5d

Last change on this file since 48aa4b5d was ee537ea, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 12, 2017 at 8:00:10 AM

ada-tests: Move to testsuites/ada

This solves a build dependency issue, e.g. building tests before
librtemsbsp.a exists.

Close #3079.

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