Adjustments:
- configure.ac: pass win32-dll option to LT_INIT
- Makefile_libre2c_posix.am: use -no-undefined in LDFLAGS
- use slibtool: https://github.com/midipix-project/slibtool for windows
builds The problem with libtool is that it doesn't allow to link libstdc++
and libgcc statically, which is necessary to build portable DLLs with
Mingw. Libtool adds -nostdlib option to LDFLAGS and links some predefined
objects that pull in dependency on dynamic libstdc++ and libgcc, even in
the presence of -static-libstdc++ -static-libgcc.
lib_LTLIBRARIES += libre2c_posix.la
libre2c_posix_la_CXXFLAGS = $(AM_CXXFLAGS)
-libre2c_posix_la_LDFLAGS = -module
+libre2c_posix_la_LDFLAGS = -module -no-undefined
libre2c_posix_la_HDR = \
libre2c_posix/lex.h \
mkdir $builddir
cd $builddir
-../configure \
+../configure LDFLAGS="-static-libstdc++ -static-libgcc" \
--enable-debug \
--enable-libs \
--host i686-w64-mingw32 \
- && make -j5
+ && make -j5 LIBTOOL="dlibtool"
cd ..
AM_SILENT_RULES([yes])
-LT_INIT([dlopen])
+LT_INIT([dlopen win32-dll])
AC_CONFIG_MACRO_DIRS([m4])