Commit c049309d by Ulrich Weigand Committed by Ulrich Weigand

configure.ac: Test for -ffunction-sections -fdata-sections and set SECTION_FLAGS accordingly.

	* 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.

From-SVN: r146241
parent e3ac77ff
2009-04-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* 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.
2009-04-15 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/38668
......
......@@ -33,6 +33,10 @@ AM_CPPFLAGS = -iquote$(srcdir)/io -I$(srcdir)/$(MULTISRCTOP)../gcc \
# Fortran rules for complex multiplication and division
AM_CFLAGS += -fcx-fortran-rules
# Use -ffunction-sections -fdata-sections if supported by the compiler
SECTION_FLAGS = @SECTION_FLAGS@
AM_CFLAGS += $(SECTION_FLAGS)
gfor_io_src= \
io/close.c \
io/file_pos.c \
......
......@@ -815,7 +815,7 @@ AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
# Fortran rules for complex multiplication and division
AM_CFLAGS = @AM_CFLAGS@ -fcx-fortran-rules
AM_CFLAGS = @AM_CFLAGS@ -fcx-fortran-rules $(SECTION_FLAGS)
AM_FCFLAGS = @AM_FCFLAGS@
AR = @AR@
AS = @AS@
......@@ -875,6 +875,9 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
# Use -ffunction-sections -fdata-sections if supported by the compiler
SECTION_FLAGS = @SECTION_FLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment