From 3113727cc9263c2825271e96b58aa303858e88f7 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Thu, 21 Aug 2014 12:08:02 +0000 Subject: 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 --- configure.in | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/configure.in b/configure.in index 7a21f5640..d8f99d1dd 100644 --- a/configure.in +++ b/configure.in @@ -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. -- cgit v1.2.3