diff --git a/Makefile.am b/Makefile.am index 2688e746..50f9a6af 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,14 @@ libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \ jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \ jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c -libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h +libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h \ + turbojpeg-mapfile + +if VERSION_SCRIPT + +libturbojpeg_la_LDFLAGS += -Wl,--version-script,$(srcdir)/turbojpeg-mapfile + +endif if WITH_SIMD diff --git a/configure.ac b/configure.ac index 08996134..a315e078 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,17 @@ AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_LN_S +AC_MSG_CHECKING([whether the linker supports version scripts]) +LDVER=`$LD --help < /dev/null 2>/dev/null | grep version-script` +if test "$LDVER"; then + VERSION_SCRIPT=yes + AC_MSG_RESULT(yes) +else + VERSION_SCRIPT=no + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(VERSION_SCRIPT, test "x$VERSION_SCRIPT" = "xyes") + if test "x${GCC}" = "xyes"; then if test "x${SAVED_CFLAGS}" = "x"; then CFLAGS=-O3 diff --git a/turbojpeg-mapfile b/turbojpeg-mapfile new file mode 100755 index 00000000..b2776f2a --- /dev/null +++ b/turbojpeg-mapfile @@ -0,0 +1,13 @@ +{ + global: + tjInitCompress; + tjCompress; + TJBUFSIZE; + tjInitDecompress; + tjDecompressHeader; + tjDecompress; + tjDestroy; + tjGetErrorStr; + local: + *; +};