1 | ## |
---|
2 | ## Partially borrowed from gcc-3.2 |
---|
3 | ## |
---|
4 | ## WARNING: All the stuff below is pretty immature. |
---|
5 | |
---|
6 | AC_DEFUN([RTEMS_PROG_GNAT], |
---|
7 | [AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) |
---|
8 | AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET]) |
---|
9 | |
---|
10 | AC_CHECK_TOOL([GNATMAKE],[gnatmake],[]) |
---|
11 | AC_CACHE_CHECK([for compiler driver that understands Ada], |
---|
12 | [rtems_cv_prog_CCADA], |
---|
13 | [cat >conftest.adb <<EOF |
---|
14 | procedure conftest is begin null; end conftest; |
---|
15 | EOF |
---|
16 | rtems_cv_prog_CCADA= |
---|
17 | # Have to do ac_tool_prefix and user overrides by hand. |
---|
18 | user_ccada=$CCADA |
---|
19 | user_cc=$CC |
---|
20 | for 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]) |
---|
37 | done |
---|
38 | rm -f conftest.*]) |
---|
39 | AC_SUBST([CCADA],[$rtems_cv_prog_CCADA]) |
---|
40 | |
---|
41 | AS_IF([test -n "$GNATMAKE" && test -n "$CCADA"], |
---|
42 | [HAVE_GNAT=yes], |
---|
43 | [HAVE_GNAT=no]) |
---|
44 | ]) |
---|