# visibility flag not supported for Windows builds
# also increase default stack size for Windows binaries
+windows_build=no
case $host_os in
(*mingw*) FLAG_VISIBILITY_HIDDEN=
cvc4_LDFLAGS=-Wl,--stack,134217728
pcvc4_LDFLAGS=-Wl,--stack,134217728
+ windows_build=yes
esac
+AM_CONDITIONAL([CVC4_WINDOWS_BUILD], [test "$windows_build" = "yes"])
+
AC_SUBST(FLAG_VISIBILITY_HIDDEN)
AC_SUBST(cvc4_LDFLAGS)
AC_SUBST(pcvc4_LDFLAGS)
lib_LTLIBRARIES = libcvc4.la
-libcvc4_la_LDFLAGS = -no-undefined -version-info $(LIBCVC4_VERSION)
+libcvc4_la_LDFLAGS = \
+ -no-undefined \
+ -version-info $(LIBCVC4_VERSION)
# This "tricks" automake into linking us as a C++ library (rather than
# as a C library, which messes up exception handling support)
javalib_LTLIBRARIES += java/libcvc4jni.la
javadata_DATA += CVC4.jar
java_libcvc4jni_la_LDFLAGS = \
+ -no-undefined \
-module \
-shrext $(CVC4_JAVA_MODULE_EXT) \
-version-info $(LIBCVC4BINDINGS_VERSION)
javalib_LTLIBRARIES += libcvc4compatjni.la
javadata_DATA += CVC4compat.jar
libcvc4compatjni_la_LDFLAGS = \
+ -no-undefined \
-module \
-shrext $(CVC4_JAVA_MODULE_EXT) \
-version-info $(LIBCVC4BINDINGS_VERSION)
lib_LTLIBRARIES = libcvc4compat.la
libcvc4compat_la_LDFLAGS = \
+ -no-undefined \
-version-info $(LIBCVC4COMPAT_VERSION)
libcvc4compat_la_LIBADD = \
lib_LTLIBRARIES = libcvc4parser.la
-libcvc4parser_la_LDFLAGS = $(ANTLR_LDFLAGS) \
+libcvc4parser_la_LDFLAGS = \
+ $(ANTLR_LDFLAGS) \
+ -no-undefined \
-version-info $(LIBCVC4PARSER_VERSION)
+if CVC4_WINDOWS_BUILD
+# -Wl,--export-all-symbols makes sure that all symbols are exported when
+# building a DLL. This option is on by default but gets disabled for the parser
+# library because the generated lexer/parser files define some functions as
+# __declspec(dllexport), which leads to lots of unresolved symbols when linking
+# against libcvc4parser.
+libcvc4parser_la_LDFLAGS += -Wl,--export-all-symbols
+endif
+
libcvc4parser_la_LIBADD = \
@builddir@/smt1/libparsersmt1.la \
@builddir@/smt2/libparsersmt2.la \