Use the --no-undefined linker option if it's available, which will catch references to undefined functions which could fail at runtime.

This commit is contained in:
Sam Lantinga 2012-10-11 15:05:00 -07:00
parent 44c73030e2
commit f89cf7c725
2 changed files with 213 additions and 177 deletions

View file

@ -180,6 +180,19 @@ if test x$enable_dependency_tracking = xyes; then
fi
fi
AC_MSG_CHECKING(for linker option --no-undefined)
have_no_undefined=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--no-undefined"
AC_TRY_LINK([
],[
],[
have_no_undefined=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
])
LDFLAGS="$save_LDFLAGS"
AC_MSG_RESULT($have_no_undefined)
dnl See whether we are allowed to use the system C library
AC_ARG_ENABLE(libc,
AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),