diff --git a/configure.ac b/configure.ac index 6881931e..30c5f72c 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ AC_SUBST(ISODATE) SODIUM_LIBRARY_VERSION_MAJOR=4 SODIUM_LIBRARY_VERSION_MINOR=0 - +DLL_VERSION=4 SODIUM_LIBRARY_VERSION=4:0:0 # | | | # +------+ | +---+ @@ -31,6 +31,7 @@ SODIUM_LIBRARY_VERSION=4:0:0 AC_SUBST(SODIUM_LIBRARY_VERSION_MAJOR) AC_SUBST(SODIUM_LIBRARY_VERSION_MINOR) AC_SUBST(SODIUM_LIBRARY_VERSION) +AC_SUBST(DLL_VERSION) LX_CFLAGS=${CFLAGS-NONE} AC_PROG_CC_C99 @@ -132,6 +133,7 @@ AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"] LT_INIT AC_SUBST(LIBTOOL_DEPS) +gl_LD_OUTPUT_DEF AC_ARG_VAR([AR], [path to the ar utility]) AC_CHECK_TOOL([AR], [ar], [ar]) diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index 31774b65..2ec09697 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -180,5 +180,12 @@ libsodium_la_CPPFLAGS = \ -I$(srcdir)/include/sodium \ -I$(builddir)/include/sodium +if HAVE_LD_OUTPUT_DEF + libsodium_la_LDFLAGS += -Wl,--output-def,libsodium-$(DLL_VERSION).def + defexecdir = $(bindir) + defexec_DATA = libsodium-$(DLL_VERSION).def + DISTCLEANFILES += $(defexec_DATA) +endif + SUBDIRS = \ include