OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [aclocal/] [prog-cc.m4] - Blame information for rev 507

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
dnl
2
dnl $Id: prog-cc.m4,v 1.2 2001-09-27 11:59:11 chris Exp $
3
dnl
4
dnl Check for target gcc
5
dnl
6
dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
7
dnl                             Completely reworked
8
 
9
AC_DEFUN(RTEMS_PROG_CC,
10
[
11
AC_BEFORE([$0], [AC_PROG_CPP])dnl
12
AC_BEFORE([$0], [AC_PROG_CC])dnl
13
AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
14
AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
15
AC_REQUIRE([RTEMS_ENABLE_LIBCDIR])dnl
16
 
17
dnl Only accept gcc and cc
18
dnl NOTE: This might be too restrictive for native compilation
19
AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
20
test -z "$CC_FOR_TARGET" \
21
  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
22
 
23
dnl backup
24
rtems_save_CC=$CC
25
rtems_save_CFLAGS=$CFLAGS
26
 
27
dnl temporarily set CC
28
CC=$CC_FOR_TARGET
29
 
30
AC_PROG_CC_WORKS
31
AC_PROG_CC_GNU
32
 
33
if test $ac_cv_prog_gcc = yes; then
34
  GCC=yes
35
dnl Check whether -g works, even if CFLAGS is set, in case the package
36
dnl plays around with CFLAGS (such as to build both debugging and
37
dnl normal versions of a library), tasteless as that idea is.
38
  ac_test_CFLAGS="${CFLAGS+set}"
39
  ac_save_CFLAGS="$CFLAGS"
40
  CFLAGS=
41
  AC_PROG_CC_G
42
  if test "$ac_test_CFLAGS" = set; then
43
    CFLAGS="$ac_save_CFLAGS"
44
  elif test $ac_cv_prog_cc_g = yes; then
45
    CFLAGS="-g -O2"
46
  else
47
    CFLAGS="-O2"
48
  fi
49
else
50
  GCC=
51
  test "${CFLAGS+set}" = set || CFLAGS="-g"
52
fi
53
 
54
rtems_cv_prog_gcc=$ac_cv_prog_gcc
55
rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
56
rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
57
rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
58
 
59
dnl restore initial values
60
CC=$rtems_save_CC
61
CFLAGS=$rtems_save_CFLAGS
62
 
63
unset ac_cv_prog_gcc
64
unset ac_cv_prog_cc_g
65
unset ac_cv_prog_cc_works
66
unset ac_cv_prog_cc_cross
67
])
68
 
69
AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
70
[
71
dnl check target cc
72
RTEMS_PROG_CC
73
dnl check if the compiler supports --specs
74
RTEMS_GCC_SPECS
75
dnl check if the target compiler may use --pipe
76
RTEMS_GCC_PIPE
77
dnl check if the compiler supports --specs if gcc28 is requested
78
if test "$RTEMS_USE_GCC272" != "yes" ; then
79
  if test "$rtems_cv_gcc_specs" = "no"; then
80
    AC_MSG_WARN([*** disabling --enable-gcc28])
81
      RTEMS_USE_GCC272=yes
82
  fi
83
fi
84
test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
85
 
86
dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
87
case $host_os in
88
*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
89
*) ;;
90
esac
91
AC_SUBST(GCCSED)
92
])

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.