From bdade00e68f63a3b0af1536625dfdea8f89272fa Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 28 Mar 2013 01:25:42 +0900 Subject: [PATCH] cygwin build fix --- configure.ac | 13 ++++++++++--- src/Makefile.am | 20 ++++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 4d26858f..c983b827 100644 --- a/configure.ac +++ b/configure.ac @@ -205,8 +205,12 @@ AC_CHECK_HEADERS([ \ unistd.h \ ]) -# For ntohl, ntohs in Windows -AC_CHECK_HEADERS([winsock2.h]) +case "${host}" in + *mingw*) + # For ntohl, ntohs in Windows + AC_CHECK_HEADERS([winsock2.h]) + ;; +esac # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T @@ -237,7 +241,10 @@ fi AM_CONDITIONAL([HAVE_EPOLL], [ test "x${have_epoll}" = "xyes" ]) AC_CHECK_FUNCS([kqueue], [have_kqueue=yes]) -AM_CONDITIONAL([HAVE_KQUEUE], [test "x${have_kqueue}" = "xyes"]) +AM_CONDITIONAL([HAVE_KQUEUE], [ test "x${have_kqueue}" = "xyes" ]) + +AM_CONDITIONAL([ENABLE_SPDYD], + [ test "x${have_epoll}" = "xyes" || test "x${have_kqueue}" = "xyes" ]) AC_LANG_PUSH(C++) AC_MSG_CHECKING([whether struct kevent.udata is intptr_t]) diff --git a/src/Makefile.am b/src/Makefile.am index d0aac3e2..1bd7a6eb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,6 +21,10 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +bin_PROGRAMS = +check_PROGRAMS = +TESTS = + if ENABLE_SRC AM_CFLAGS = -Wall @@ -30,9 +34,11 @@ AM_LDFLAGS = @OPENSSL_LIBS@ @XML_LIBS@ @LIBEVENT_OPENSSL_LIBS@ @SRC_LIBS@ LDADD = $(top_builddir)/lib/libspdylay.la -bin_PROGRAMS = spdycat spdyd -check_PROGRAMS = -TESTS = +bin_PROGRAMS += spdycat + +if ENABLE_SPDYD +bin_PROGRAMS += spdyd +endif # ENABLE_SPDYD if HAVE_LIBEVENT_OPENSSL bin_PROGRAMS += shrpx @@ -61,17 +67,19 @@ if HAVE_LIBXML2 HTML_PARSER_OBJECTS += HtmlParser.cc endif # HAVE_LIBXML2 -SPDY_SERVER_OBJECTS = SpdyServer.cc -SPDY_SERVER_HFILES = SpdyServer.h - spdycat_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} spdycat.cc \ ${HTML_PARSER_OBJECTS} ${HTML_PARSER_HFILES} \ http-parser/http_parser.c http-parser/http_parser.h +if ENABLE_SPDYD +SPDY_SERVER_OBJECTS = SpdyServer.cc +SPDY_SERVER_HFILES = SpdyServer.h + spdyd_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \ ${EVENT_OBJECTS} ${EVENT_HFILES} \ ${SPDY_SERVER_OBJECTS} ${SPDY_SERVER_HFILES} \ spdyd.cc +endif # ENABLE_SPDYD if HAVE_LIBEVENT_OPENSSL SHRPX_SRCS = \