diff --git a/m4/ax_check_glut.m4 b/m4/ax_check_glut.m4 index ed2f8a18fc..f883833084 100644 --- a/m4/ax_check_glut.m4 +++ b/m4/ax_check_glut.m4 @@ -38,7 +38,7 @@ else LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ -# if HAVE_WINDOWS_H && defined(_WIN32) +# if HAVE_WINDOWS_H && (defined(_WIN32) || defined(CYGWIN_USE_WIN32)) # include # endif # include ]], diff --git a/m4/ax_winsock.m4 b/m4/ax_winsock.m4 new file mode 100644 index 0000000000..fbe16215f8 --- /dev/null +++ b/m4/ax_winsock.m4 @@ -0,0 +1,13 @@ +AC_DEFUN([AX_WINSOCK],[ + AC_ARG_WITH([winsock], + AC_HELP_STRING([--with-winsock], + [use windows sockets even if sys/socket.h exists])) + if test "${with_winsock}" = "yes" ; then + AC_DEFINE(USE_WINSOCK,[1],[Define to 1 to use windows sockets]) + ac_cv_header_sys_socket_h="no" + else + ac_cv_header_winsock2_h="no" + ac_cv_header_winsock_h="no" + fi + AC_CHECK_HEADERS([windows.h winsock2.h winsock.h sys/socket.h]) +]) diff --git a/m4/boinc_check_cygwin.m4 b/m4/boinc_check_cygwin.m4 index ff344092d0..2fbc7161f2 100644 --- a/m4/boinc_check_cygwin.m4 +++ b/m4/boinc_check_cygwin.m4 @@ -9,6 +9,12 @@ AC_DEFUN([BOINC_CHECK_CYGWIN],[ esac AC_MSG_RESULT($with_cygwin) if test "${with_cygwin}" = "yes" ; then + save_cflags="${CFLAGS}" + CFLAGS="-I/usr/include/w32api -D_WIN32 -DWIN32 ${CFLAGS}" + fi + AX_WINSOCK + if test "${with_cygwin}" = "yes" ; then + CFLAGS="${save_cflags}" AC_MSG_CHECKING([whether to use X11 or WIN32 GUI]) if test "${with_x+set}" = set; then with_x="${with_x}" diff --git a/m4/boinc_getsockopt.m4 b/m4/boinc_getsockopt.m4 index b51e9c8737..7f5fdfd971 100644 --- a/m4/boinc_getsockopt.m4 +++ b/m4/boinc_getsockopt.m4 @@ -1,6 +1,12 @@ AC_DEFUN([BOINC_GETSOCKOPT_TYPE],[ AC_LANG_PUSH(C) +AC_CHECK_HEADERS([windows.h]) +if test "${ac_cv_header_windows_h}" = "yes" ; then + ac_includes_default="${ac_includes_default} +#include +" +fi AC_CHECK_HEADERS([sys/socket.h]) if test "${ac_cv_header_sys_socket_h}" = "yes" ; then ac_includes_default="${ac_includes_default}