From 3f97a5c5298c2439262383cb91fa7caab5a393f7 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 20 Mar 2016 02:07:06 -0500 Subject: [PATCH] configure: check for MINGW --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 408c0868..2c3b0363 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,25 @@ fi AC_PREFIX_DEFAULT($HOME/ircd) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER(include/setup.h) + +case "$host_os" in +*cygwin*) + AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) + AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) + ;; +*mingw*) + AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) + AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) + AC_CHECK_HEADER(winsock2.h, , [AC_MSG_ERROR([** MinGW and no winsock2.h. I give up.])]) + LIBS="$LIBS -lws2_32 -liphlpapi" + is_mingw="yes" + ;; +*) + ;; +esac + +AM_CONDITIONAL([MINGW], [test "$is_mingw" = "yes"]) + AC_CONFIG_SUBDIRS([librb]) AC_CONFIG_AUX_DIR([libltdl/config])