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