Build static binary on Windows
authorSteve McIntyre <steve@einval.com>
Thu, 7 Nov 2019 18:09:17 +0000 (18:09 +0000)
committerSteve McIntyre <steve@einval.com>
Thu, 7 Nov 2019 18:09:17 +0000 (18:09 +0000)
Makes things much easier to distribute

configure.ac

index f387aaf..0012814 100644 (file)
@@ -209,6 +209,11 @@ else
     jigdo_pkg_config_prefix="--define-variable=prefix=$jigdo_pkg_config_prefix"
 fi
 
+if test "$is_windows" = yes; then
+    CXXFLAGS="$CXXFLAGS -static"
+    LDFLAGS="$LDFLAGS -static"
+fi
+
 dnl dnl cppunit
 dnl CPPUNITCFLAGS='# `cppunit-config --cflags`'
 dnl CPPUNITLIBS='# `cppunit-config --libs`'
@@ -272,7 +277,6 @@ AC_CHECK_LIB(bz2, BZ2_bzCompressInit, have_bzlib="-lbz2", have_bzlib="no")
 if test "$is_windows" = yes; then
     dnl For some reason, can't check for BZ2_bzCompressInit without #include <bzlib.h>
     AC_CHECK_LIB(bz2, main, have_bzlib="-lbz2", )
-    AC_CHECK_LIB(bz2.dll, main, have_bzlib="-lbz2.dll", )
 fi
 AC_CHECK_HEADER(bzlib.h, have_bzlib_h="yes", have_bzlib_h="no")
 if test "$have_bzlib" = "no" -o "$have_bzlib_h" = "no"; then