summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorbfriesen <bfriesen>2012-01-22 19:50:36 +0000
committerbfriesen <bfriesen>2012-01-22 19:50:36 +0000
commitcb7dd34673597d999fd97b4d77f8465e2641b02b (patch)
tree140c6bf10976a6f8fc83ea1b27fae9ca3031e042 /configure.ac
parentf56e4c4f68a590def16e71b828d50f172dbcc336 (diff)
downloadlibtiff-cb7dd34673597d999fd97b4d77f8465e2641b02b.tar.gz
* configure.ac: Add support for using library symbol versioning on
ELF systems with the GNU linker. Support is enabled via --enable-ld-version-script. Disabled by default for now until there is a decision for how to deploy a libtiff with versioned symbols after libtiff 4.0.0 was already released.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 32 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index da8e6a56..30d7c065 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,6 +112,37 @@ VL_PROG_CC_WARNINGS()
AC_PROG_INSTALL
AC_PROG_LN_S
+
+# Check if LD supports linker scripts, and define automake conditional
+# HAVE_LD_VERSION_SCRIPT if so. This functionality is currently
+# constrained to compilers using GNU ld on ELF systems or systems
+# which provide an adequate emulation thereof.
+AC_ARG_ENABLE([ld-version-script],
+ AS_HELP_STRING([--enable-ld-version-script],
+ [enable linker version script (default is disabled)]),
+ [have_ld_version_script=$enableval], [have_ld_version_script=no])
+if test "$have_ld_version_script" != no; 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_PROGRAM([], [])],
+ [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")
+
+
dnl Tests for Windows
AC_EXEEXT
AC_OBJEXT
@@ -967,6 +998,7 @@ LOC_MSG([ Documentation directory: ${LIBTIFF_DOCDIR}])
LOC_MSG([ C compiler: ${CC} ${CFLAGS}])
LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
LOC_MSG([ Enable runtime linker paths: ${HAVE_RPATH}])
+LOC_MSG([ Enable linker symbol versioning: ${have_ld_version_script}])
LOC_MSG([ Support Microsoft Document Imaging: ${HAVE_MDI}])
LOC_MSG([ Use win32 IO: ${win32_io_ok}])
LOC_MSG()