From 7d61535076aa1ca484f453594b29e2ca052c2505 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 16 Feb 2013 18:30:45 +0100 Subject: Fix building with mingw and make sure linking generates proper DLL files --- axiom/configure.ac | 14 ++++++++++++++ axiom/src/om/Makefile.am | 2 +- axiom/src/parser/guththila/Makefile.am | 2 +- axiom/src/parser/libxml2/Makefile.am | 2 +- axiom/src/xpath/Makefile.am | 2 +- configure.ac | 14 ++++++++++++++ guththila/configure.ac | 13 +++++++++++++ guththila/src/Makefile.am | 4 ++-- neethi/configure.ac | 15 +++++++++++++++ neethi/src/Makefile.am | 2 +- src/core/engine/Makefile.am | 2 +- src/core/transport/amqp/receiver/Makefile.am | 2 +- .../transport/amqp/receiver/qpid_receiver/Makefile.am | 2 +- .../receiver/qpid_receiver/request_processor/Makefile.am | 2 +- src/core/transport/amqp/sender/Makefile.am | 2 +- src/core/transport/amqp/sender/qpid_sender/Makefile.am | 2 +- src/core/transport/amqp/util/Makefile.am | 2 +- src/core/transport/http/common/Makefile.am | 2 +- src/core/transport/http/receiver/Makefile.am | 2 +- src/core/transport/http/sender/Makefile.am | 2 +- src/core/transport/http/sender/ntlm/default/Makefile.am | 2 ++ src/core/transport/http/sender/ntlm/heimdal/Makefile.am | 2 +- src/core/transport/http/sender/ntlm/libntlm/Makefile.am | 2 +- src/core/transport/http/server/apache2/Makefile.am | 2 +- src/core/transport/tcp/receiver/Makefile.am | 2 +- src/core/transport/tcp/sender/Makefile.am | 2 +- src/modules/mod_addr/Makefile.am | 2 +- src/modules/mod_log/Makefile.am | 2 +- util/configure.ac | 14 ++++++++++++++ util/src/Makefile.am | 5 +++-- util/src/minizip/Makefile.am | 2 +- 31 files changed, 100 insertions(+), 27 deletions(-) diff --git a/axiom/configure.ac b/axiom/configure.ac index d3cdd1f..9cee511 100644 --- a/axiom/configure.ac +++ b/axiom/configure.ac @@ -89,6 +89,20 @@ AC_CHECK_HEADERS([linux/if.h],[],[], #endif ]) +dnl Check for cygwin and mingw builds to allow building DLLs +WIN32_EXTRA_LIBADD= +WIN32_EXTRA_LDFLAGS= +case "$host" in + *-*-cygwin*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; + *-*-mingw*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; +esac +AC_SUBST(WIN32_EXTRA_LIBADD) +AC_SUBST(WIN32_EXTRA_LDFLAGS) + dnl This is a check to see if we are running MacOS X dnl It may be better to do a Darwin check AC_CHECK_HEADER([sys/appleapiopts.h], diff --git a/axiom/src/om/Makefile.am b/axiom/src/om/Makefile.am index 1740883..06ba246 100644 --- a/axiom/src/om/Makefile.am +++ b/axiom/src/om/Makefile.am @@ -37,7 +37,7 @@ libaxis2_axiom_la_LIBADD = $(top_builddir)/src/soap/libaxis2_soap.la \ ../parser/${WRAPPER_DIR}/libaxis2_parser.la \ ../../../util/src/libaxutil.la -libaxis2_axiom_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_axiom_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/parser \ diff --git a/axiom/src/parser/guththila/Makefile.am b/axiom/src/parser/guththila/Makefile.am index 51a6667..9682e75 100644 --- a/axiom/src/parser/guththila/Makefile.am +++ b/axiom/src/parser/guththila/Makefile.am @@ -20,7 +20,7 @@ libaxis2_parser_la_LIBADD = ../../../../guththila/src/libguththila.la \ libaxis2_parser_la_SOURCES = ../xml_reader.c ../xml_writer.c guththila_xml_writer_wrapper.c \ guththila_xml_reader_wrapper.c -libaxis2_parser_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_parser_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I ../../../../util/include \ diff --git a/axiom/src/parser/libxml2/Makefile.am b/axiom/src/parser/libxml2/Makefile.am index 8e67318..53f5ac7 100644 --- a/axiom/src/parser/libxml2/Makefile.am +++ b/axiom/src/parser/libxml2/Makefile.am @@ -21,7 +21,7 @@ libaxis2_parser_la_SOURCES = ../xml_reader.c ../xml_writer.c \ libaxis2_parser_la_LIBADD = @LIBXML2_LIBS@ \ ../../../../util/src/libaxutil.la -libaxis2_parser_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_parser_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ diff --git a/axiom/src/xpath/Makefile.am b/axiom/src/xpath/Makefile.am index 0fd3152..2fd9dcb 100644 --- a/axiom/src/xpath/Makefile.am +++ b/axiom/src/xpath/Makefile.am @@ -21,7 +21,7 @@ libaxis2_xpath_la_SOURCES = xpath.c \ xpath_internals_parser.c \ xpath_streaming.c -libaxis2_xpath_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_xpath_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) libaxis2_xpath_la_LIBADD = $(top_builddir)/../util/src/libaxutil.la \ $(top_builddir)/src/om/libaxis2_axiom.la diff --git a/configure.ac b/configure.ac index 0d0a308..7c0b8a8 100644 --- a/configure.ac +++ b/configure.ac @@ -106,6 +106,20 @@ AC_CHECK_HEADERS([linux/if.h],[],[], AC_CHECK_HEADERS([net/if_types.h]) AC_CHECK_HEADERS([net/if_dl.h]) +dnl Check for cygwin and mingw builds to allow building DLLs +WIN32_EXTRA_LIBADD= +WIN32_EXTRA_LDFLAGS= +case "$host" in + *-*-cygwin*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; + *-*-mingw*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; +esac +AC_SUBST(WIN32_EXTRA_LIBADD) +AC_SUBST(WIN32_EXTRA_LDFLAGS) + dnl This is a check to see if we are running MacOS X dnl It may be better to do a Darwin check AC_CHECK_HEADERS([sys/appleapiopts.h]) diff --git a/guththila/configure.ac b/guththila/configure.ac index 38934f1..34e4bee 100644 --- a/guththila/configure.ac +++ b/guththila/configure.ac @@ -67,6 +67,19 @@ if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -ansi -ggdb3 -Wall -Wno-implicit-function-declaration " fi +dnl Check for cygwin and mingw builds to allow building DLLs +WIN32_EXTRA_LIBADD= +WIN32_EXTRA_LDFLAGS= +case "$host" in + *-*-cygwin*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; + *-*-mingw*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; +esac +AC_SUBST(WIN32_EXTRA_LIBADD) +AC_SUBST(WIN32_EXTRA_LDFLAGS) dnl Checks for header files. AC_HEADER_STDC diff --git a/guththila/src/Makefile.am b/guththila/src/Makefile.am index 5df4bce..67f0b41 100644 --- a/guththila/src/Makefile.am +++ b/guththila/src/Makefile.am @@ -14,8 +14,6 @@ # limitations under the License. lib_LTLIBRARIES = libguththila.la -libguththila_la_LDFLAGS = -version-info $(VERSION_NO) - libguththila_la_SOURCES = guththila_buffer.c \ guththila_namespace.c \ guththila_token.c \ @@ -27,6 +25,8 @@ libguththila_la_SOURCES = guththila_buffer.c \ libguththila_la_LIBADD = ../../util/src/libaxutil.la +libguththila_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) + INCLUDES = -I$(top_builddir)/include \ -I ../../util/include diff --git a/neethi/configure.ac b/neethi/configure.ac index 688f53d..fc4cb82 100644 --- a/neethi/configure.ac +++ b/neethi/configure.ac @@ -113,6 +113,21 @@ dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdio.h stdlib.h string.h]) AC_CHECK_HEADERS([sys/socket.h]) + +dnl Check for cygwin and mingw builds to allow building DLLs +WIN32_EXTRA_LIBADD= +WIN32_EXTRA_LDFLAGS= +case "$host" in + *-*-cygwin*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; + *-*-mingw*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; +esac +AC_SUBST(WIN32_EXTRA_LIBADD) +AC_SUBST(WIN32_EXTRA_LDFLAGS) + dnl This is a check to see if we are running MacOS X dnl It may be better to do a Darwin check AC_CHECK_HEADER([sys/appleapiopts.h], diff --git a/neethi/src/Makefile.am b/neethi/src/Makefile.am index bb45bc6..4bd6128 100644 --- a/neethi/src/Makefile.am +++ b/neethi/src/Makefile.am @@ -47,7 +47,7 @@ libneethi_la_LIBADD = ../../axiom/src/om/libaxis2_axiom.la \ # $(top_builddir)/axiom/src/om/libaxis2_axiom.la -libneethi_la_LDFLAGS = -version-info $(VERSION_NO) +libneethi_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I ../../util/include \ diff --git a/src/core/engine/Makefile.am b/src/core/engine/Makefile.am index 4244820..feb709c 100644 --- a/src/core/engine/Makefile.am +++ b/src/core/engine/Makefile.am @@ -29,7 +29,7 @@ libaxis2_engine_la_SOURCES= ../transport/transport_receiver.c handler.c \ $(top_builddir)/src/core/transport/http/common/http_header.c \ $(top_builddir)/src/core/transport/http/common/http_accept_record.c -libaxis2_engine_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_engine_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) libaxis2_engine_la_LIBADD=$(top_builddir)/src/core/description/libaxis2_description.la \ $(top_builddir)/src/core/receivers/libaxis2_receivers.la \ diff --git a/src/core/transport/amqp/receiver/Makefile.am b/src/core/transport/amqp/receiver/Makefile.am index 0e2f0f8..882807b 100644 --- a/src/core/transport/amqp/receiver/Makefile.am +++ b/src/core/transport/amqp/receiver/Makefile.am @@ -22,7 +22,7 @@ libaxis2_amqp_receiver_la_LIBADD = $(top_builddir)/util/src/libaxutil.la \ $(top_builddir)/src/core/transport/amqp/util/libaxis2_amqp_util.la \ $(top_builddir)/src/core/transport/amqp/receiver/qpid_receiver/libaxis2_qpid_receiver.la -libaxis2_amqp_receiver_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_amqp_receiver_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport/amqp/util \ diff --git a/src/core/transport/amqp/receiver/qpid_receiver/Makefile.am b/src/core/transport/amqp/receiver/qpid_receiver/Makefile.am index faf0c34..2535545 100644 --- a/src/core/transport/amqp/receiver/qpid_receiver/Makefile.am +++ b/src/core/transport/amqp/receiver/qpid_receiver/Makefile.am @@ -25,7 +25,7 @@ libaxis2_qpid_receiver_la_LIBADD = $(top_builddir)/util/src/libaxutil.la \ $(top_builddir)/src/core/transport/amqp/util/libaxis2_amqp_util.la \ $(top_builddir)/src/core/transport/amqp/receiver/qpid_receiver/request_processor/libaxis2_amqp_request_processor.la -libaxis2_qpid_receiver_la_LDFLAGS = g++ -version-info $(VERSION_NO) +libaxis2_qpid_receiver_la_LDFLAGS = g++ -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport/amqp/receiver/qpid_receiver \ diff --git a/src/core/transport/amqp/receiver/qpid_receiver/request_processor/Makefile.am b/src/core/transport/amqp/receiver/qpid_receiver/request_processor/Makefile.am index 991e7a5..daa2a15 100644 --- a/src/core/transport/amqp/receiver/qpid_receiver/request_processor/Makefile.am +++ b/src/core/transport/amqp/receiver/qpid_receiver/request_processor/Makefile.am @@ -19,7 +19,7 @@ libaxis2_amqp_request_processor_la_SOURCES = axis2_amqp_request_processor.c libaxis2_amqp_request_processor_la_LIBADD = $(top_builddir)/util/src/libaxutil.la \ $(top_builddir)/src/core/transport/amqp/util/libaxis2_amqp_util.la -libaxis2_amqp_request_processor_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_amqp_request_processor_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport/amqp/receiver/qpid_receiver/request_processor \ diff --git a/src/core/transport/amqp/sender/Makefile.am b/src/core/transport/amqp/sender/Makefile.am index 9b662ed..68cfc9a 100644 --- a/src/core/transport/amqp/sender/Makefile.am +++ b/src/core/transport/amqp/sender/Makefile.am @@ -22,7 +22,7 @@ libaxis2_amqp_sender_la_LIBADD = $(top_builddir)/util/src/libaxutil.la \ $(top_builddir)/src/core/transport/amqp/util/libaxis2_amqp_util.la \ $(top_builddir)/src/core/transport/amqp/sender/qpid_sender/libaxis2_qpid_sender.la -libaxis2_amqp_sender_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_amqp_sender_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport/amqp/util \ diff --git a/src/core/transport/amqp/sender/qpid_sender/Makefile.am b/src/core/transport/amqp/sender/qpid_sender/Makefile.am index 5f3d34c..c064041 100644 --- a/src/core/transport/amqp/sender/qpid_sender/Makefile.am +++ b/src/core/transport/amqp/sender/qpid_sender/Makefile.am @@ -21,7 +21,7 @@ libaxis2_qpid_sender_la_LIBADD = $(top_builddir)/util/src/libaxutil.la \ $(top_builddir)/src/core/transport/amqp/util/libaxis2_amqp_util.la \ $(QPID_HOME)/lib/libqpidclient.la -libaxis2_qpid_sender_la_LDFLAGS = g++ -version-info $(VERSION_NO) +libaxis2_qpid_sender_la_LDFLAGS = g++ -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport/amqp/sender/qpid_sender \ diff --git a/src/core/transport/amqp/util/Makefile.am b/src/core/transport/amqp/util/Makefile.am index 0ecda7e..61cbe6c 100644 --- a/src/core/transport/amqp/util/Makefile.am +++ b/src/core/transport/amqp/util/Makefile.am @@ -18,7 +18,7 @@ libaxis2_amqp_util_la_SOURCES = axis2_amqp_util.c libaxis2_amqp_util_la_LIBADD = $(top_builddir)/util/src/libaxutil.la -libaxis2_amqp_util_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_amqp_util_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport/amqp/util \ diff --git a/src/core/transport/http/common/Makefile.am b/src/core/transport/http/common/Makefile.am index 84b6548..5c1db0d 100644 --- a/src/core/transport/http/common/Makefile.am +++ b/src/core/transport/http/common/Makefile.am @@ -29,7 +29,7 @@ libaxis2_http_common_la_LIBADD= $(top_builddir)/util/src/libaxutil.la\ $(top_builddir)/src/core/transport/http/util/libaxis2_http_util.la\ $(top_builddir)/src/core/engine/libaxis2_engine.la -libaxis2_http_common_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_http_common_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport\ diff --git a/src/core/transport/http/receiver/Makefile.am b/src/core/transport/http/receiver/Makefile.am index 8e838e1..cf9bf22 100644 --- a/src/core/transport/http/receiver/Makefile.am +++ b/src/core/transport/http/receiver/Makefile.am @@ -22,7 +22,7 @@ libaxis2_http_receiver_la_SOURCES = http_receiver.c\ http_svr_thread.c -libaxis2_http_receiver_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_http_receiver_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport\ diff --git a/src/core/transport/http/sender/Makefile.am b/src/core/transport/http/sender/Makefile.am index dd314d3..0e1d2a4 100644 --- a/src/core/transport/http/sender/Makefile.am +++ b/src/core/transport/http/sender/Makefile.am @@ -55,7 +55,7 @@ libaxis2_http_sender_la_LIBADD = $(top_builddir)/src/core/transport/http/common/ $(SSL_LIBS) -libaxis2_http_sender_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_http_sender_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport\ diff --git a/src/core/transport/http/sender/ntlm/default/Makefile.am b/src/core/transport/http/sender/ntlm/default/Makefile.am index 1457475..a5a6849 100644 --- a/src/core/transport/http/sender/ntlm/default/Makefile.am +++ b/src/core/transport/http/sender/ntlm/default/Makefile.am @@ -20,5 +20,7 @@ libaxis2_ntlm_la_SOURCES = ../ntlm.c \ libaxis2_ntlm_la_LIBADD = $(top_builddir)/util/src/libaxutil.la +libaxis2_ntlm_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) + INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/util/include diff --git a/src/core/transport/http/sender/ntlm/heimdal/Makefile.am b/src/core/transport/http/sender/ntlm/heimdal/Makefile.am index 05c6239..cadaa44 100644 --- a/src/core/transport/http/sender/ntlm/heimdal/Makefile.am +++ b/src/core/transport/http/sender/ntlm/heimdal/Makefile.am @@ -21,7 +21,7 @@ libaxis2_ntlm_la_SOURCES = ../ntlm.c \ libaxis2_ntlm_la_LIBADD = @NTLM_LDFLAGS@ \ $(top_builddir)/util/src/libaxutil.la -#libaxis2_ntlm_la_LDFLAGS = -version-info $(VERSION_NO) +#libaxis2_ntlm_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ diff --git a/src/core/transport/http/sender/ntlm/libntlm/Makefile.am b/src/core/transport/http/sender/ntlm/libntlm/Makefile.am index 823c9c8..e9d142e 100644 --- a/src/core/transport/http/sender/ntlm/libntlm/Makefile.am +++ b/src/core/transport/http/sender/ntlm/libntlm/Makefile.am @@ -21,7 +21,7 @@ libaxis2_ntlm_la_SOURCES = ../ntlm.c \ libaxis2_ntlm_la_LIBADD = @NTLM_LDFLAGS@ \ $(top_builddir)/util/src/libaxutil.la -#libaxis2_ntlm_la_LDFLAGS = -version-info $(VERSION_NO) +#libaxis2_ntlm_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ diff --git a/src/core/transport/http/server/apache2/Makefile.am b/src/core/transport/http/server/apache2/Makefile.am index ada2471..a5f559c 100644 --- a/src/core/transport/http/server/apache2/Makefile.am +++ b/src/core/transport/http/server/apache2/Makefile.am @@ -28,7 +28,7 @@ libmod_axis2_la_LIBADD = $(LDFLAGS) \ $(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la\ $(top_builddir)/axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la -libmod_axis2_la_LDFLAGS = -version-info $(VERSION_NO) +libmod_axis2_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport/http \ diff --git a/src/core/transport/tcp/receiver/Makefile.am b/src/core/transport/tcp/receiver/Makefile.am index f9fb16c..68e5a17 100644 --- a/src/core/transport/tcp/receiver/Makefile.am +++ b/src/core/transport/tcp/receiver/Makefile.am @@ -23,7 +23,7 @@ libaxis2_tcp_receiver_la_SOURCES = tcp_svr_thread.c \ tcp_receiver.c -libaxis2_tcp_receiver_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_tcp_receiver_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport\ diff --git a/src/core/transport/tcp/sender/Makefile.am b/src/core/transport/tcp/sender/Makefile.am index 2875299..17d364d 100644 --- a/src/core/transport/tcp/sender/Makefile.am +++ b/src/core/transport/tcp/sender/Makefile.am @@ -24,7 +24,7 @@ libaxis2_tcp_sender_la_LIBADD = $(top_builddir)/src/core/transport/http/common/l $(SSL_LIBS) -libaxis2_tcp_sender_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_tcp_sender_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/transport\ diff --git a/src/modules/mod_addr/Makefile.am b/src/modules/mod_addr/Makefile.am index 23be098..5aad491 100644 --- a/src/modules/mod_addr/Makefile.am +++ b/src/modules/mod_addr/Makefile.am @@ -24,7 +24,7 @@ libaxis2_mod_addr_la_LIBADD = $(top_builddir)/axiom/src/om/libaxis2_axiom.la \ $(top_builddir)/util/src/libaxutil.la \ $(top_builddir)/src/core/engine/libaxis2_engine.la -libaxis2_mod_addr_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_mod_addr_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/description \ diff --git a/src/modules/mod_log/Makefile.am b/src/modules/mod_log/Makefile.am index 7508282..5689649 100644 --- a/src/modules/mod_log/Makefile.am +++ b/src/modules/mod_log/Makefile.am @@ -25,7 +25,7 @@ libaxis2_mod_log_la_LIBADD = \ $(top_builddir)/axiom/src/om/libaxis2_axiom.la \ $(top_builddir)/src/core/engine/libaxis2_engine.la -libaxis2_mod_log_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_mod_log_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/src/core/description \ diff --git a/util/configure.ac b/util/configure.ac index 65555da..ccb808b 100644 --- a/util/configure.ac +++ b/util/configure.ac @@ -196,6 +196,20 @@ AC_SUBST([PLATFORM]) AC_DEFINE([HOST_OS_MINGW], 1, [define if we are on mingw]) +dnl Check for cygwin and mingw builds to allow building DLLs +WIN32_EXTRA_LIBADD= +WIN32_EXTRA_LDFLAGS= +case "$host" in + *-*-cygwin*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; + *-*-mingw*) + WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version" + ;; +esac +AC_SUBST(WIN32_EXTRA_LIBADD) +AC_SUBST(WIN32_EXTRA_LDFLAGS) + AC_MSG_CHECKING(whether to build guththila xml parser library) AC_ARG_ENABLE(guththila, [ --enable-guththila build guththila xml parser library wrapper. default=no], [ case "${enableval}" in diff --git a/util/src/Makefile.am b/util/src/Makefile.am index fb40027..0cc7fbf 100644 --- a/util/src/Makefile.am +++ b/util/src/Makefile.am @@ -56,9 +56,10 @@ libaxutil_la_SOURCES = hash.c \ libaxutil_la_LIBADD = $(top_builddir)/src/platforms/$(PLATFORM)/libaxis2_$(PLATFORM).la \ -lpthread \ - @ZLIBLIBS@ + @ZLIBLIBS@ \ + $(WIN32_EXTRA_LIBADD) -libaxutil_la_LDFLAGS = -version-info $(VERSION_NO) +libaxutil_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include diff --git a/util/src/minizip/Makefile.am b/util/src/minizip/Makefile.am index f9e239e..9cf9fe1 100644 --- a/util/src/minizip/Makefile.am +++ b/util/src/minizip/Makefile.am @@ -19,7 +19,7 @@ libaxis2_minizip_la_SOURCES = ioapi.c \ archive_extract.c \ crypt.c -libaxis2_minizip_la_LDFLAGS = -version-info $(VERSION_NO) +libaxis2_minizip_la_LDFLAGS = -version-info $(VERSION_NO) $(WIN32_EXTRA_LDFLAGS) INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/platforms -- cgit v1.1-32-gdbae