/aclocal/gcc-weak.m4

http://rtems-atapi.googlecode.com/ · m4 · 19 lines · 17 code · 2 blank · 0 comment · 0 complexity · 421e562ece8c307e01696a39a71833a5 MD5 · raw file

  1. AC_DEFUN([RTEMS_CHECK_GCC_WEAK],[
  2. AC_CACHE_CHECK([whether $CC supports function __attribute__((weak))],
  3. [rtems_cv_cc_attribute_weak],[
  4. AS_IF([test x"$GCC" = xyes],[
  5. save_CFLAGS=$CFLAGS
  6. CFLAGS=-Werror])
  7. AC_COMPILE_IFELSE([
  8. AC_LANG_PROGRAM(
  9. [void myfunc(char c) __attribute__ ((weak));
  10. void myfunc(char c) {}],
  11. [])],
  12. [rtems_cv_cc_attribute_weak=yes],
  13. [rtems_cv_cc_attribute_weak=no])
  14. AS_IF([test x"$GCC" = xyes],[
  15. CFLAGS=$save_CFLAGS])
  16. ])
  17. ])