Added autoconf macro AX_WINSOCK for identifying winsock libs and headers for

support of command line compiles.  Adds new configure command line option
--with-winsock to enable winsock if necessary where alternative socket libraries
exist.

Modified BOINC_CHECK_CYGWIN to call AX_WINSOCK.

Modified boinc_getsockopt.m4 to get correct type when winsock is used.

Modified AX_CHECK_GLUT to find correct libraries when compiling under
windows from command line.

svn path=/trunk/boinc/; revision=9072
This commit is contained in:
Eric J. Korpela 2005-12-16 03:20:01 +00:00
parent 68c79d4ad7
commit ff9e4b5ea4
4 changed files with 26 additions and 1 deletions

View File

@ -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 <windows.h>
# endif
# include <GL/glut.h>]],

13
m4/ax_winsock.m4 Normal file
View File

@ -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])
])

View File

@ -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}"

View File

@ -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 <windows.h>
"
fi
AC_CHECK_HEADERS([sys/socket.h])
if test "${ac_cv_header_sys_socket_h}" = "yes" ; then
ac_includes_default="${ac_includes_default}