summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2015-02-17 12:47:07 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2015-02-17 12:47:07 +0000
commit3fe71d118c861bff12ba243a350a94133c526d9d (patch)
tree839df33f56f49b08fad55c5c9142fb59d037367b
parent4d823c0d4a513c6b8dc57394e428d3347a96c351 (diff)
Add linker option -Wl,-no-undefined if supported (with configure check).
Experimental. Thanks to Greg for finding this option. If this option is supported by the linker, it is used when linking shared libraries like libfltk_gl.so. With this option linking of the shared library fails instead of postponing failure to linking programs with this library, if any undefined references exist in this library. See STR #3191. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10582 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--configure.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 7144aba8f..c4b9be54a 100644
--- a/configure.in
+++ b/configure.in
@@ -1194,6 +1194,18 @@ if test -n "$GCC"; then
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
+dnl Experimental (as of 17 Feb 2015):
+dnl Make sure that shared libraries don't have undefined references
+ # See if ld supports -no-undefined...
+ AC_MSG_CHECKING(if ld supports -no-undefined)
+ OLDLDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,-no-undefined"
+ AC_TRY_LINK(,,
+ [DSOFLAGS="$DSOFLAGS -Wl,-no-undefined"]
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+ LDFLAGS="$OLDLDFLAGS"
+
# See if ld supports -Bsymbolic-functions...
AC_MSG_CHECKING(if ld supports -Bsymbolic-functions)
OLDLDFLAGS="$LDFLAGS"