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
This commit is contained in:
Albrecht Schlosser 2015-02-17 12:47:07 +00:00
parent 4d823c0d4a
commit 3fe71d118c
1 changed files with 12 additions and 0 deletions

View File

@ -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"