Newer
Older
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
Daniel Stenberg
committed
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# $Id$
###########################################################################
dnl CURL_CHECK_HEADER_WINDOWS
dnl -------------------------------------------------
AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [
AC_COMPILE_IFELSE([
#if defined(__CYGWIN__) || defined(__CEGCC__)
HAVE_WINDOWS_H shall not be defined.
#else
#endif
],[
ac_cv_header_windows_h="yes"
],[
ac_cv_header_windows_h="no"
])
])
Yang Tse
committed
case "$ac_cv_header_windows_h" in
yes)
AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
[Define to 1 if you have the windows.h header file.])
AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
[Define to avoid automatic inclusion of winsock.h])
;;
esac
dnl CURL_CHECK_NATIVE_WINDOWS
dnl -------------------------------------------------
dnl Check if building a native Windows target
AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([whether build target is a native Windows one], [ac_cv_native_windows], [
if test "$ac_cv_header_windows_h" = "no"; then
ac_cv_native_windows="no"
else
AC_COMPILE_IFELSE([
#if defined(__MINGW32__) || defined(__MINGW32CE__)
int dummy=1;
#else
Not a native Windows build target.
#endif
],[
ac_cv_native_windows="yes"
],[
ac_cv_native_windows="no"
])
fi
])
case "$ac_cv_native_windows" in
yes)
AC_DEFINE_UNQUOTED(NATIVE_WINDOWS, 1,
[Define to 1 if you are building a native Windows target.])
;;
esac
])
dnl CURL_CHECK_HEADER_WINSOCK
dnl -------------------------------------------------
AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [
AC_COMPILE_IFELSE([
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock.h>
#if defined(__CYGWIN__) || defined(__CEGCC__)
HAVE_WINSOCK_H shall not be defined.
#else
#endif
],[
ac_cv_header_winsock_h="yes"
],[
ac_cv_header_winsock_h="no"
])
])
Yang Tse
committed
case "$ac_cv_header_winsock_h" in
yes)
AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
[Define to 1 if you have the winsock.h header file.])
;;
esac
])
dnl CURL_CHECK_HEADER_WINSOCK2
dnl -------------------------------------------------
AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [
AC_COMPILE_IFELSE([
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
HAVE_WINSOCK2_H shall not be defined.
#else
#endif
],[
ac_cv_header_winsock2_h="yes"
],[
ac_cv_header_winsock2_h="no"
])
])
Yang Tse
committed
case "$ac_cv_header_winsock2_h" in
yes)
AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
[Define to 1 if you have the winsock2.h header file.])
;;
esac
])
dnl CURL_CHECK_HEADER_WS2TCPIP
dnl -------------------------------------------------
AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [
AC_COMPILE_IFELSE([
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#if defined(__CYGWIN__) || defined(__CEGCC__) || defined(__MINGW32CE__)
HAVE_WS2TCPIP_H shall not be defined.
#else
#endif
],[
ac_cv_header_ws2tcpip_h="yes"
],[
ac_cv_header_ws2tcpip_h="no"
])
])
Yang Tse
committed
case "$ac_cv_header_ws2tcpip_h" in
Loading
Loading full blame…