/testbed/aclocal/prog-cc.m4

http://rtems-atapi.googlecode.com/ · m4 · 37 lines · 32 code · 5 blank · 0 comment · 0 complexity · 007b1a4fcc9eec0c95f8c9c80c85f927 MD5 · raw file

  1. dnl
  2. dnl $Id: prog-cc.m4,v 1.11 2006/10/16 15:58:13 ralf Exp $
  3. dnl
  4. dnl Check for target gcc
  5. dnl
  6. AC_DEFUN([RTEMS_PROG_CC],
  7. [
  8. AC_BEFORE([$0], [AC_PROG_CPP])dnl
  9. AC_BEFORE([$0], [AC_PROG_CC])dnl
  10. AC_BEFORE([$0], [RTEMS_CANONICALIZE_TOOLS])dnl
  11. RTEMS_CHECK_TOOL(CC,gcc)
  12. test -z "$CC" && \
  13. AC_MSG_ERROR([no acceptable cc found in \$PATH])
  14. AC_PROG_CC
  15. AC_PROG_CXX
  16. AC_PROG_CPP
  17. ])
  18. AC_DEFUN([RTEMS_PROG_CC_FOR_TARGET],
  19. [
  20. dnl check target cc
  21. RTEMS_PROG_CC
  22. dnl check if the target compiler may use --pipe
  23. RTEMS_GCC_PIPE
  24. test "$rtems_cv_gcc_pipe" = "yes" && CC="$CC --pipe"
  25. if test "$GCC" = yes; then
  26. RTEMS_CFLAGS="$RTEMS_CFLAGS -Wall"
  27. m4_if([$1],,[],[RTEMS_CFLAGS="$RTEMS_CFLAGS $1"])
  28. fi
  29. AC_SUBST(RTEMS_CFLAGS)
  30. RTEMS_CPPFLAGS="-I\$(top_builddir) -I\$(PROJECT_INCLUDE)"
  31. AC_SUBST(RTEMS_CPPFLAGS)
  32. ])