Use symbolic and sectioned builds if supported by the toolchain.

These help both shared lib size, as well as app size when statically linking. STR #3097


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10230 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Lauri Kasanen 2014-08-21 12:08:02 +00:00
parent 3a5f3f1820
commit 3113727cc9

View File

@ -1165,6 +1165,30 @@ if test -n "$GCC"; then
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
# See if ld supports -Bsymbolic-functions...
AC_MSG_CHECKING(if ld supports -Bsymbolic-functions)
OLDLDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
AC_TRY_LINK(,,
[DSOFLAGS="$DSOFLAGS -Wl,-Bsymbolic-functions"]
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
LDFLAGS="$OLDLDFLAGS"
# See if toolchain supports a sectioned build...
AC_MSG_CHECKING(if toolchain supports sections)
OLDLDFLAGS="$LDFLAGS"
OLDCFLAGS="$CFLAGS"
LDFLAGS="$LDFLAGS -Wl,-gc-sections"
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
AC_TRY_LINK(,,
[DSOFLAGS="$DSOFLAGS -Wl,-gc-sections"
OPTIM="$OPTIM -ffunction-sections -fdata-sections"]
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
LDFLAGS="$OLDLDFLAGS"
CFLAGS="$OLDCFLAGS"
# See if we are running Solaris; if so, try the -fpermissive option...
# This option is required on some versions of Solaris to work around
# bugs in the X headers up through Solaris 7.