]> granicus.if.org Git - re2c/commitdiff
Adjusted build system to correctly build DLLs for windows.
authorUlya Trofimovich <skvadrik@gmail.com>
Sun, 27 Jan 2019 10:06:22 +0000 (10:06 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Sun, 27 Jan 2019 10:06:22 +0000 (10:06 +0000)
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.

re2c/Makefile.libre2c_posix.am
re2c/__build_mingw.sh
re2c/configure.ac

index b02ba3514b1e24dda3d4df9f3183b88816b2e182..005c110b6c4549e333835bafea0021fdb0e6b760 100644 (file)
@@ -3,7 +3,7 @@
 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 \
index 3fc951ba924f856c9b0c89f50e697f611c6e19f3..13c3c8ae9512fc8c0bf439da904f62c59f3cfdc1 100755 (executable)
@@ -5,9 +5,9 @@ rm -rf $builddir
 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 ..
index 582d952e8eccf1224795c9d5027a486529ac9a8d..8c444ed976f1271a26aad01ace48f1224228d0ac 100644 (file)
@@ -3,7 +3,7 @@ AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip])
 AM_SILENT_RULES([yes])
 
 
-LT_INIT([dlopen])
+LT_INIT([dlopen win32-dll])
 AC_CONFIG_MACRO_DIRS([m4])