From 6d3afb32dedfe5aeefbfe7e1567019cc96e71cd5 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 4 Feb 2013 17:16:46 -0800 Subject: [PATCH] Build the library as a module on Windows --- configure.ac | 2 ++ src/libsodium/Makefile.am | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a17f8ebf..2c700e21 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,7 @@ AX_CHECK_COMPILE_FLAG([-fno-strict-overflow], [CFLAGS="$CFLAGS -fno-strict-overf case $host_os in cygwin* | mingw* | pw32* | cegcc*) + LIBTOOL_EXTRA_FLAGS=-module AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [LDFLAGS="$LDFLAGS -Wl,--dynamicbase"]) AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [LDFLAGS="$LDFLAGS -Wl,--nxcompat"]) AX_CHECK_COMPILE_FLAG([-fstack-protector-all], [ @@ -207,6 +208,7 @@ AC_ARG_WITH(safecode, AC_SUBST([MAINT]) AC_SUBST([SODIUM_PATH]) +AC_SUBST([LIBTOOL_EXTRA_FLAGS]) dnl Libtool. diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index a9121dc3..0d97029f 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -84,7 +84,8 @@ libsodium_la_LDFLAGS = \ $(AM_LDFLAGS) \ -export-dynamic \ -version-info $(SODIUM_LIBRARY_VERSION) \ - -no-undefined + -no-undefined \ + $(LIBTOOL_EXTRA_FLAGS) libsodium_la_CPPFLAGS = \ $(LTDLINCL) \