]> granicus.if.org Git - libevent/commitdiff
cygwin: make it possible to build DLLs
authorNick Mathewson <nickm@torproject.org>
Wed, 1 Jun 2011 17:48:02 +0000 (13:48 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 1 Jun 2011 17:48:02 +0000 (13:48 -0400)
Patch from Brian Koehmstedt

Makefile.am
configure.in

index 2c902426ad12508ec6dfd7d084638888efdb6d18..5538caf22572af3a4e44d5e3fb330f0e0c1dc8e1 100644 (file)
@@ -172,7 +172,7 @@ CORE_SRC = event.c evthread.c buffer.c \
        evmap.c log.c evutil.c evutil_rand.c strlcpy.c $(SYS_SRC)
 EXTRA_SRC = event_tagging.c http.c evdns.c evrpc.c
 
-if BUILD_WIN32
+if BUILD_WITH_NO_UNDEFINED
 NO_UNDEFINED = -no-undefined
 MAYBE_CORE = libevent_core.la
 else
@@ -192,6 +192,7 @@ libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS)
 
 if PTHREADS
 libevent_pthreads_la_SOURCES = evthread_pthread.c
+libevent_pthreads_la_LIBADD = $(MAYBE_CORE)
 libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS)
 endif
 
index cbc0d2189086c3737381b2a511db09ac7afb39a9..8517a0de336e6ade4a3322631f71421422ca54df 100644 (file)
@@ -98,6 +98,19 @@ die horribly
        bwin32=false; AC_MSG_RESULT(no),
 )
 
+dnl - check if the macro __CYGWIN__ is defined on this compiler.
+dnl - (this is how we check for a cygwin version of GCC)
+AC_MSG_CHECKING(for CYGWIN)
+AC_TRY_COMPILE(,
+       [
+#ifndef __CYGWIN__
+die horribly
+#endif
+       ],
+       cygwin=true; AC_MSG_RESULT(yes),
+       cygwin=false; AC_MSG_RESULT(no),
+)
+
 AC_CHECK_HEADERS([zlib.h])
 
 if test "x$ac_cv_header_zlib_h" = "xyes"; then
@@ -231,6 +244,8 @@ if test "x$ac_cv_header_sys_sysctl_h" = "xyes"; then
 fi
 
 AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
+AM_CONDITIONAL(BUILD_CYGWIN, test x$cygwin = xtrue)
+AM_CONDITIONAL(BUILD_WITH_NO_UNDEFINED, test x$bwin32 = xtrue || test x$cygwin = xtrue)
 
 if test x$bwin32 = xtrue; then
    AC_SEARCH_LIBS([getservbyname],[ws2_32])