diff options
author | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 10:36:21 +0000 |
---|---|---|
committer | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 10:36:21 +0000 |
commit | 3443eac11878221a7c639e6238f31c7907797797 (patch) | |
tree | ab5c51fd8c311955361c7dfdccdab0a7612968e7 /libgfortran/configure.ac | |
parent | 7f7f16d4deb75c7ea1eb3de1ad1c32c2ab154526 (diff) | |
download | gcc-3443eac11878221a7c639e6238f31c7907797797.tar.gz |
* configure.ac: Test for -ffunction-sections -fdata-sections and
set SECTION_FLAGS accordingly.
* configure: Regenerate.
* Makefile.am: Add SECTION_FLAGS to AM_CFLAGS.
* Makefile.in: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146241 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/configure.ac')
-rw-r--r-- | libgfortran/configure.ac | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 0e0b5a7e31f..c0709bbbe51 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -149,6 +149,27 @@ LDFLAGS="$save_LDFLAGS" AC_MSG_RESULT($gfortran_use_symver) AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" = xyes]) +# Figure out whether the compiler supports "-ffunction-sections -fdata-sections", +# similarly to how libstdc++ does it +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" + +# Check for -ffunction-sections -fdata-sections +AC_MSG_CHECKING([for gcc that supports -ffunction-sections -fdata-sections]) +CFLAGS='-Werror -ffunction-sections -fdata-sections' +AC_TRY_COMPILE(, [int foo;], [ac_fdsections=yes], [ac_fdsections=no]) +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +else + # this is the suspicious part + CFLAGS="" +fi +if test x"$ac_fdsections" = x"yes"; then + SECTION_FLAGS='-ffunction-sections -fdata-sections' +fi +AC_MSG_RESULT($ac_fdsections) +AC_SUBST(SECTION_FLAGS) + # Find other programs we need. AC_CHECK_TOOL(AS, as) AC_CHECK_TOOL(AR, ar) |