|
@@ -29,6 +29,36 @@ AC_CHECK_SIZEOF(int)
|
|
|
AC_CHECK_SIZEOF(long)
|
|
|
AC_CHECK_SIZEOF(size_t)
|
|
|
|
|
|
+#########################################
|
|
|
+# See if linker supports version scripts
|
|
|
+#########################################
|
|
|
+# Check if LD supports linker scripts,
|
|
|
+# and define automake conditional HAVE_LD_VERSION_SCRIPT if so.
|
|
|
+AC_ARG_ENABLE([ld-version-script],
|
|
|
+ AS_HELP_STRING([--enable-ld-version-script],
|
|
|
+ [enable linker version script (default is enabled when possible)]),
|
|
|
+ [have_ld_version_script=$enableval], [])
|
|
|
+if test -z "$have_ld_version_script"; then
|
|
|
+ AC_MSG_CHECKING([if LD -Wl,--version-script works])
|
|
|
+ save_LDFLAGS="$LDFLAGS"
|
|
|
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
|
|
|
+ cat > conftest.map <<EOF
|
|
|
+VERS_1 {
|
|
|
+ global: sym;
|
|
|
+};
|
|
|
+
|
|
|
+VERS_2 {
|
|
|
+ global: sym;
|
|
|
+} VERS_1;
|
|
|
+EOF
|
|
|
+ AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
|
|
|
+ [have_ld_version_script=yes], [have_ld_version_script=no])
|
|
|
+ rm -f conftest.map
|
|
|
+ LDFLAGS="$save_LDFLAGS"
|
|
|
+ AC_MSG_RESULT($have_ld_version_script)
|
|
|
+fi
|
|
|
+AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
|
|
+
|
|
|
################################
|
|
|
# Deal with debugging options
|
|
|
################################
|