mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-18 18:22:07 +08:00
New configure option --disable-as-needed
Some linkers don't support that option
This commit is contained in:
20
configure.ac
20
configure.ac
@@ -67,7 +67,25 @@ AC_SUBST(SQL)
|
||||
AC_SUBST(LFLAGS)
|
||||
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
LDFLAGS="$LDFLAGS -Wl,--as-needed"
|
||||
dnl Enable -Wl,--as-needed by default to prevent overlinking
|
||||
|
||||
AC_ARG_ENABLE([as-needed],
|
||||
AC_HELP_STRING([--disable-as-needed],
|
||||
[Disable overlinking protection]),
|
||||
[enable_as_needed=$enableval], [enable_as_needed=yes])
|
||||
|
||||
if test "x$enable_as_needed" != "xno"; then
|
||||
AC_MSG_CHECKING([whether $LD accepts --as-needed])
|
||||
case `$LD --as-needed -v 2>&1 </dev/null` in
|
||||
*GNU* | *'with BFD'*)
|
||||
LDFLAGS="$LDFLAGS -Wl,--as-needed"
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl check whether ld supports --version-script
|
||||
VERSION_SCRIPT=yes
|
||||
|
Reference in New Issue
Block a user