* 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.
This commit is contained in:
Bob Friesenhahn 2012-01-22 19:50:36 +00:00
parent 306ae2fb9f
commit b326998fc2
8 changed files with 137 additions and 10 deletions

View File

@ -1,3 +1,11 @@
2012-01-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* 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.
2011-12-22 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* libtiff/tif_win32.c: Eliminate some minor 64-bit warnings in

71
configure vendored
View File

@ -672,6 +672,8 @@ LIBTOOL
OBJDUMP
DLLTOOL
AS
HAVE_LD_VERSION_SCRIPT_FALSE
HAVE_LD_VERSION_SCRIPT_TRUE
LN_S
am__fastdepCC_FALSE
am__fastdepCC_TRUE
@ -774,6 +776,7 @@ ac_user_opts='
enable_option_checking
enable_maintainer_mode
enable_dependency_tracking
enable_ld_version_script
enable_shared
enable_static
with_pic
@ -1460,6 +1463,8 @@ Optional Features:
(and sometimes confusing) to the casual installer
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--enable-ld-version-script
enable linker version script (default is disabled)
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
@ -4561,6 +4566,66 @@ fi
# 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.
# Check whether --enable-ld-version-script was given.
if test "${enable_ld_version_script+set}" = set; then :
enableval=$enable_ld_version_script; have_ld_version_script=$enableval
else
have_ld_version_script=no
fi
if test "$have_ld_version_script" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5
$as_echo_n "checking if LD -Wl,--version-script works... " >&6; }
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
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
have_ld_version_script=yes
else
have_ld_version_script=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
rm -f conftest.map
LDFLAGS="$save_LDFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script" >&5
$as_echo "$have_ld_version_script" >&6; }
fi
if test "$have_ld_version_script" = "yes"; then
HAVE_LD_VERSION_SCRIPT_TRUE=
HAVE_LD_VERSION_SCRIPT_FALSE='#'
else
HAVE_LD_VERSION_SCRIPT_TRUE='#'
HAVE_LD_VERSION_SCRIPT_FALSE=
fi
case `pwd` in
@ -6065,7 +6130,6 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
if test -n "$ac_tool_prefix"; then
for ac_prog in ar
do
@ -19919,6 +19983,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -22485,6 +22553,7 @@ echo " Documentation directory: ${LIBTIFF_DOCDIR}"
echo " C compiler: ${CC} ${CFLAGS}"
echo " C++ compiler: ${CXX} ${CXXFLAGS}"
echo " Enable runtime linker paths: ${HAVE_RPATH}"
echo " Enable linker symbol versioning: ${have_ld_version_script}"
echo " Support Microsoft Document Imaging: ${HAVE_MDI}"
echo " Use win32 IO: ${win32_io_ok}"
echo ""

View File

@ -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()

View File

@ -34,7 +34,9 @@ EXTRA_DIST = Makefile.vc \
tif_config.wince.h \
tiffconf.vc.h \
tiffconf.wince.h \
libtiff.def
libtiff.def \
libtiff.map \
libtiffxx.map
libtiffinclude_HEADERS = \
tiff.h \
@ -117,6 +119,9 @@ libtiff_la_LDFLAGS = \
if HAVE_RPATH
libtiff_la_LDFLAGS += $(LIBDIR)
endif
if HAVE_LD_VERSION_SCRIPT
libtiff_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiff.map
endif
libtiff_la_LIBADD = $(LIBPORT)
libtiffxx_la_LDFLAGS = \
@ -125,6 +130,9 @@ libtiffxx_la_LDFLAGS = \
if HAVE_RPATH
libtiffxx_la_LDFLAGS += $(LIBDIR)
endif
if HAVE_LD_VERSION_SCRIPT
libtiffxx_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiffxx.map
endif
libtiffxx_la_LIBADD = $(LIBTIFF) $(LIBPORT)
libtiffxx_la_DEPENDENCIES = libtiff.la

View File

@ -68,7 +68,9 @@ host_triplet = @host@
@WIN32_IO_FALSE@am__append_5 = tif_unix.c
@HAVE_CXX_TRUE@am__append_6 = libtiffxx.la
@HAVE_RPATH_TRUE@am__append_7 = $(LIBDIR)
@HAVE_RPATH_TRUE@am__append_8 = $(LIBDIR)
@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_8 = -Wl,--version-script=$(srcdir)/libtiff.map
@HAVE_RPATH_TRUE@am__append_9 = $(LIBDIR)
@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_10 = -Wl,--version-script=$(srcdir)/libtiffxx.map
noinst_PROGRAMS = mkg3states$(EXEEXT)
subdir = libtiff
DIST_COMMON = $(am__libtiffinclude_HEADERS_DIST) $(noinst_HEADERS) \
@ -360,7 +362,7 @@ LIBTIFF = $(top_builddir)/libtiff/libtiff.la
libtiffincludedir = $(includedir)
EXTRA_DIST = Makefile.vc SConstruct tif_config.h-vms tif_config.vc.h \
tif_config.wince.h tiffconf.vc.h tiffconf.wince.h libtiff.def \
$(am__append_2) $(am__append_4)
libtiff.map libtiffxx.map $(am__append_2) $(am__append_4)
libtiffinclude_HEADERS = tiff.h tiffio.h tiffvers.h $(am__append_1)
noinst_HEADERS = \
t4.h \
@ -387,10 +389,10 @@ libtiffxx_la_SOURCES = \
lib_LTLIBRARIES = libtiff.la $(am__append_6)
libtiff_la_LDFLAGS = -no-undefined -version-info \
$(LIBTIFF_VERSION_INFO) $(am__append_7)
$(LIBTIFF_VERSION_INFO) $(am__append_7) $(am__append_8)
libtiff_la_LIBADD = $(LIBPORT)
libtiffxx_la_LDFLAGS = -no-undefined -version-info \
$(LIBTIFF_VERSION_INFO) $(am__append_8)
$(LIBTIFF_VERSION_INFO) $(am__append_9) $(am__append_10)
libtiffxx_la_LIBADD = $(LIBTIFF) $(LIBPORT)
libtiffxx_la_DEPENDENCIES = libtiff.la
mkg3states_SOURCES = mkg3states.c tif_fax3.h

4
libtiff/libtiff.map Normal file
View File

@ -0,0 +1,4 @@
LIBTIFF_4.0 {
global:
*;
};

4
libtiff/libtiffxx.map Normal file
View File

@ -0,0 +1,4 @@
LIBTIFFXX_4.0 {
global:
*;
};

View File

@ -787,10 +787,10 @@ check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@list='$(TEST_LOGS)'; \
list=`for f in $$list; do \
test .log = $$f || echo $$f; \
done | tr '\012\015' ' '`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
{ echo "TEST_LOGS = \\"; \
for f in $$list; do test .log = $$f || echo "$$f \\"; done; \
} | sed '$$s/\\$$//' \
| $(MAKE) -f Makefile -f - $(AM_MAKEFLAGS) $(TEST_SUITE_LOG)
.log.html:
@list='$(RST2HTML) $$RST2HTML rst2html rst2html.py'; \