source: rtems/aclocal/prog-cc.m4 @ 8262fda

4.104.114.84.95
Last change on this file since 8262fda was 1ea70d78, checked in by Joel Sherrill <joel.sherrill@…>, on 09/12/00 at 20:54:13

2000-09-12 Ralf Corsepius <corsepiu@…>

  • aclocal/check-cxx.m4: Add AC_SUBST(CPLUS_LD_LIBS)
  • aclocal/prog-cc.m4: Cleanup comments, require RTEMS_ENABLE_GCC28, add automake conditionals RTEMS_USE_GCC, RTEMS_USE_GCC272.
  • automake/compile.am: Replaced.
  • automake/local.am: Remove building variant handling.
  • Property mode set to 100644
File size: 2.4 KB
Line 
1dnl
2dnl $Id$
3dnl
4dnl Check for target gcc
5dnl
6
7AC_DEFUN(RTEMS_PROG_CC,
8[
9AC_BEFORE([$0], [AC_PROG_CPP])dnl
10AC_BEFORE([$0], [AC_PROG_CC])dnl
11AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
12AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
13AC_REQUIRE([RTEMS_ENABLE_LIBCDIR])dnl
14AC_REQUIRE([RTEMS_ENABLE_GCC28])dnl
15
16dnl Only accept gcc and cc
17dnl NOTE: This might be too restrictive for native compilation
18AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
19test -z "$CC_FOR_TARGET" \
20  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
21
22dnl backup
23rtems_save_CC=$CC
24rtems_save_CFLAGS=$CFLAGS
25
26dnl temporarily set CC
27CC=$CC_FOR_TARGET
28
29AC_PROG_CC_WORKS
30AC_PROG_CC_GNU
31
32if test $ac_cv_prog_gcc = yes; then
33  GCC=yes
34dnl Check whether -g works, even if CFLAGS is set, in case the package
35dnl plays around with CFLAGS (such as to build both debugging and
36dnl normal versions of a library), tasteless as that idea is.
37  ac_test_CFLAGS="${CFLAGS+set}"
38  ac_save_CFLAGS="$CFLAGS"
39  CFLAGS=
40  AC_PROG_CC_G
41  if test "$ac_test_CFLAGS" = set; then
42    CFLAGS="$ac_save_CFLAGS"
43  elif test $ac_cv_prog_cc_g = yes; then
44    CFLAGS="-g -O2"
45  else
46    CFLAGS="-O2"
47  fi
48else
49  GCC=
50  test "${CFLAGS+set}" = set || CFLAGS="-g"
51fi
52
53rtems_cv_prog_gcc=$ac_cv_prog_gcc
54rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
55rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
56rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
57
58dnl restore initial values
59CC=$rtems_save_CC
60CFLAGS=$rtems_save_CFLAGS
61
62unset ac_cv_prog_gcc
63unset ac_cv_prog_cc_g
64unset ac_cv_prog_cc_works
65unset ac_cv_prog_cc_cross
66
67AM_CONDITIONAL(RTEMS_USE_GCC,test x"$rtems_cv_prog_gcc" = x"yes")
68])
69
70AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
71[
72dnl check target cc
73RTEMS_PROG_CC
74dnl check if the compiler supports --specs
75RTEMS_GCC_SPECS
76dnl check if the target compiler may use --pipe
77RTEMS_GCC_PIPE
78dnl check if the compiler supports --specs if gcc28 is requested
79if test "$RTEMS_USE_GCC272" != "yes" ; then
80  if test "$rtems_cv_gcc_specs" = "no"; then
81    AC_MSG_WARN([*** disabling --enable-gcc28])
82      RTEMS_USE_GCC272=yes
83  fi
84fi
85test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
86
87## Conditional for automake files
88AM_CONDITIONAL(RTEMS_USE_GCC272, test x"$RTEMS_USE_GCC272" = x"yes")
89## Make variable for autoconf fragments (*.cfg)
90AC_SUBST(RTEMS_USE_GCC272)
91
92dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
93case $host_os in
94*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
95*) ;;
96esac
97AC_SUBST(GCCSED)
98])
Note: See TracBrowser for help on using the repository browser.