~ubuntu-branches/ubuntu/edgy/curl/edgy

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-06-29 15:04:24 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060629150424-pn00qumt9sml8p4m
Tags: 7.15.4-1ubuntu1
Synchronize to Debian. Only change left: Removal of stunnel and
libdb4.2-dev build dependencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#***************************************************************************
 
2
#                                  _   _ ____  _
 
3
#  Project                     ___| | | |  _ \| |
 
4
#                             / __| | | | |_) | |
 
5
#                            | (__| |_| |  _ <| |___
 
6
#                             \___|\___/|_| \_\_____|
 
7
#
 
8
# Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
 
9
#
 
10
# This software is licensed as described in the file COPYING, which
 
11
# you should have received as part of this distribution. The terms
 
12
# are also available at http://curl.haxx.se/docs/copyright.html.
 
13
#
 
14
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
 
15
# copies of the Software, and permit persons to whom the Software is
 
16
# furnished to do so, under the terms of the COPYING file.
 
17
#
 
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 
19
# KIND, either express or implied.
 
20
#
 
21
# $Id: acinclude.m4,v 1.86 2006-04-19 11:11:10 bagder Exp $
 
22
###########################################################################
 
23
 
 
24
dnl CURL_CHECK_HEADER_WINDOWS
 
25
dnl -------------------------------------------------
 
26
dnl Check for compilable and valid windows.h header 
 
27
 
 
28
AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
 
29
  AC_CACHE_CHECK([for windows.h], [ac_cv_header_windows_h], [
 
30
    AC_COMPILE_IFELSE([
 
31
      AC_LANG_PROGRAM([
 
32
#undef inline
 
33
#ifndef WIN32_LEAN_AND_MEAN
 
34
#define WIN32_LEAN_AND_MEAN
 
35
#endif
 
36
#include <windows.h>
 
37
      ],[
 
38
        int dummy=2*WINVER;
 
39
      ])
 
40
    ],[
 
41
      ac_cv_header_windows_h="yes"
 
42
    ],[
 
43
      ac_cv_header_windows_h="no"
 
44
    ])
 
45
  ])
 
46
  if test "x$ac_cv_header_windows_h" = "xyes"; then
 
47
    AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
 
48
      [Define to 1 if you have the windows.h header file.])
 
49
    AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
 
50
      [Define to avoid automatic inclusion of winsock.h])
 
51
  fi
 
52
])
 
53
 
 
54
 
 
55
dnl CURL_CHECK_HEADER_WINSOCK
 
56
dnl -------------------------------------------------
 
57
dnl Check for compilable and valid winsock.h header 
 
58
 
 
59
AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
 
60
  AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
 
61
  AC_CACHE_CHECK([for winsock.h], [ac_cv_header_winsock_h], [
 
62
    AC_COMPILE_IFELSE([
 
63
      AC_LANG_PROGRAM([
 
64
#undef inline
 
65
#ifndef WIN32_LEAN_AND_MEAN
 
66
#define WIN32_LEAN_AND_MEAN
 
67
#endif
 
68
#include <windows.h>
 
69
#include <winsock.h>
 
70
      ],[
 
71
        int dummy=WSACleanup();
 
72
      ])
 
73
    ],[
 
74
      ac_cv_header_winsock_h="yes"
 
75
    ],[
 
76
      ac_cv_header_winsock_h="no"
 
77
    ])
 
78
  ])
 
79
  if test "x$ac_cv_header_winsock_h" = "xyes"; then
 
80
    AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
 
81
      [Define to 1 if you have the winsock.h header file.])
 
82
  fi
 
83
])
 
84
 
 
85
 
 
86
dnl CURL_CHECK_HEADER_WINSOCK2
 
87
dnl -------------------------------------------------
 
88
dnl Check for compilable and valid winsock2.h header 
 
89
 
 
90
AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
 
91
  AC_REQUIRE([CURL_CHECK_HEADER_WINDOWS])dnl
 
92
  AC_CACHE_CHECK([for winsock2.h], [ac_cv_header_winsock2_h], [
 
93
    AC_COMPILE_IFELSE([
 
94
      AC_LANG_PROGRAM([
 
95
#undef inline
 
96
#ifndef WIN32_LEAN_AND_MEAN
 
97
#define WIN32_LEAN_AND_MEAN
 
98
#endif
 
99
#include <windows.h>
 
100
#include <winsock2.h>
 
101
      ],[
 
102
        int dummy=2*IPPROTO_ESP;
 
103
      ])
 
104
    ],[
 
105
      ac_cv_header_winsock2_h="yes"
 
106
    ],[
 
107
      ac_cv_header_winsock2_h="no"
 
108
    ])
 
109
  ])
 
110
  if test "x$ac_cv_header_winsock2_h" = "xyes"; then
 
111
    AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
 
112
      [Define to 1 if you have the winsock2.h header file.])
 
113
  fi
 
114
])
 
115
 
 
116
 
 
117
dnl CURL_CHECK_HEADER_WS2TCPIP
 
118
dnl -------------------------------------------------
 
119
dnl Check for compilable and valid ws2tcpip.h header
 
120
 
 
121
AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
 
122
  AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
 
123
  AC_CACHE_CHECK([for ws2tcpip.h], [ac_cv_header_ws2tcpip_h], [
 
124
    AC_COMPILE_IFELSE([
 
125
      AC_LANG_PROGRAM([
 
126
#undef inline
 
127
#ifndef WIN32_LEAN_AND_MEAN
 
128
#define WIN32_LEAN_AND_MEAN
 
129
#endif
 
130
#include <windows.h>
 
131
#include <winsock2.h>
 
132
#include <ws2tcpip.h>
 
133
      ],[
 
134
        int dummy=2*IP_PKTINFO;
 
135
      ])
 
136
    ],[
 
137
      ac_cv_header_ws2tcpip_h="yes"
 
138
    ],[
 
139
      ac_cv_header_ws2tcpip_h="no"
 
140
    ])
 
141
  ])
 
142
  if test "x$ac_cv_header_ws2tcpip_h" = "xyes"; then
 
143
    AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1,
 
144
      [Define to 1 if you have the ws2tcpip.h header file.])
 
145
  fi
 
146
])
 
147
 
 
148
 
 
149
dnl CURL_CHECK_TYPE_SOCKLEN_T
 
150
dnl -------------------------------------------------
 
151
dnl Check for existing socklen_t type, and provide
 
152
dnl an equivalent type if socklen_t not available
 
153
 
 
154
AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
 
155
  AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
 
156
  AC_CHECK_TYPE([socklen_t], ,[
 
157
    AC_CACHE_CHECK([for socklen_t equivalent], 
 
158
      [curl_cv_socklen_t_equiv], [
 
159
      curl_cv_socklen_t_equiv="unknown"
 
160
      for arg2 in "struct sockaddr" void; do
 
161
        for t in int size_t unsigned long "unsigned long"; do
 
162
          AC_COMPILE_IFELSE([
 
163
            AC_LANG_PROGRAM([
 
164
#undef inline
 
165
#ifdef HAVE_WINDOWS_H
 
166
#ifndef WIN32_LEAN_AND_MEAN
 
167
#define WIN32_LEAN_AND_MEAN
 
168
#endif
 
169
#include <windows.h>
 
170
#ifdef HAVE_WINSOCK2_H
 
171
#include <winsock2.h>
 
172
#else
 
173
#ifdef HAVE_WINSOCK_H
 
174
#include <winsock.h>
 
175
#endif
 
176
#endif
 
177
#else
 
178
#ifdef HAVE_SYS_TYPES_H
 
179
#include <sys/types.h>
 
180
#endif
 
181
#ifdef HAVE_SYS_SOCKET_H
 
182
#include <sys/socket.h>
 
183
#endif
 
184
#endif
 
185
              int getpeername (int, $arg2 *, $t *);
 
186
            ],[
 
187
              $t len=0;
 
188
              getpeername(0,0,&len);
 
189
            ])
 
190
          ],[
 
191
             curl_cv_socklen_t_equiv="$t"
 
192
             break 2
 
193
          ])
 
194
        done
 
195
      done
 
196
    ])
 
197
    if test "$curl_cv_socklen_t_equiv" = "unknown"; then
 
198
      AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
 
199
    else
 
200
      AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
 
201
        [type to use in place of socklen_t if not defined])
 
202
    fi
 
203
  ],[
 
204
#undef inline
 
205
#ifdef HAVE_WINDOWS_H
 
206
#ifndef WIN32_LEAN_AND_MEAN
 
207
#define WIN32_LEAN_AND_MEAN
 
208
#endif
 
209
#include <windows.h>
 
210
#ifdef HAVE_WINSOCK2_H
 
211
#include <winsock2.h>
 
212
#ifdef HAVE_WS2TCPIP_H
 
213
#include <ws2tcpip.h>
 
214
#endif
 
215
#endif
 
216
#else
 
217
#ifdef HAVE_SYS_TYPES_H
 
218
#include <sys/types.h>
 
219
#endif
 
220
#ifdef HAVE_SYS_SOCKET_H
 
221
#include <sys/socket.h>
 
222
#endif
 
223
#endif
 
224
  ])
 
225
])
 
226
 
 
227
 
 
228
dnl CURL_CHECK_FUNC_GETNAMEINFO
 
229
dnl -------------------------------------------------
 
230
dnl Test if the getnameinfo function is available, 
 
231
dnl and check the types of five of its arguments.
 
232
dnl If the function succeeds HAVE_GETNAMEINFO will be
 
233
dnl defined, defining the types of the arguments in
 
234
dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2,
 
235
dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7.
 
236
dnl This function is experimental and its results shall
 
237
dnl not be trusted while this notice is in place ------
 
238
 
 
239
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
 
240
  AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
 
241
  AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl
 
242
  AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h)
 
243
  #
 
244
  AC_MSG_CHECKING([for getnameinfo])
 
245
  AC_LINK_IFELSE([
 
246
      AC_LANG_FUNC_LINK_TRY([getnameinfo])
 
247
    ],[
 
248
      AC_MSG_RESULT([yes])
 
249
      curl_cv_getnameinfo="yes"
 
250
    ],[
 
251
      AC_MSG_RESULT([no])
 
252
      curl_cv_getnameinfo="no"
 
253
  ])
 
254
  #
 
255
  if test "$curl_cv_getnameinfo" != "yes"; then
 
256
    AC_MSG_CHECKING([deeper for getnameinfo])
 
257
    AC_TRY_LINK([
 
258
      ],[
 
259
        getnameinfo();
 
260
      ],[
 
261
        AC_MSG_RESULT([yes])
 
262
        curl_cv_getnameinfo="yes"
 
263
      ],[
 
264
        AC_MSG_RESULT([but still no])
 
265
        curl_cv_getnameinfo="no"
 
266
    ])
 
267
  fi
 
268
  #
 
269
  if test "$curl_cv_getnameinfo" != "yes"; then
 
270
    AC_MSG_CHECKING([deeper and deeper for getnameinfo])
 
271
    AC_TRY_LINK([
 
272
#undef inline
 
273
#ifdef HAVE_WINDOWS_H
 
274
#ifndef WIN32_LEAN_AND_MEAN
 
275
#define WIN32_LEAN_AND_MEAN
 
276
#endif
 
277
#include <windows.h>
 
278
#ifdef HAVE_WINSOCK2_H
 
279
#include <winsock2.h>
 
280
#ifdef HAVE_WS2TCPIP_H
 
281
#include <ws2tcpip.h>
 
282
#endif
 
283
#endif
 
284
#else
 
285
#ifdef HAVE_SYS_TYPES_H
 
286
#include <sys/types.h>
 
287
#endif
 
288
#ifdef HAVE_SYS_SOCKET_H
 
289
#include <sys/socket.h>
 
290
#endif
 
291
#ifdef HAVE_NETDB_H
 
292
#include <netdb.h>
 
293
#endif
 
294
#endif
 
295
      ],[
 
296
        getnameinfo(0, 0, 0, 0, 0, 0, 0);
 
297
      ],[ 
 
298
        AC_MSG_RESULT([yes])
 
299
        curl_cv_getnameinfo="yes"
 
300
      ],[
 
301
        AC_MSG_RESULT([but still no])
 
302
        curl_cv_getnameinfo="no"
 
303
    ])
 
304
  fi
 
305
  #
 
306
  if test "$curl_cv_getnameinfo" = "yes"; then
 
307
    AC_CACHE_CHECK([types of arguments for getnameinfo],
 
308
      [curl_cv_func_getnameinfo_args], [
 
309
      curl_cv_func_getnameinfo_args="unknown"
 
310
      for gni_arg1 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
 
311
        for gni_arg2 in 'socklen_t' 'size_t' 'int'; do
 
312
          for gni_arg46 in 'size_t' 'int' 'socklen_t' 'unsigned int' 'DWORD'; do
 
313
            for gni_arg7 in 'int' 'unsigned int'; do
 
314
              AC_COMPILE_IFELSE([
 
315
                AC_LANG_PROGRAM([
 
316
#undef inline 
 
317
#ifdef HAVE_WINDOWS_H
 
318
#ifndef WIN32_LEAN_AND_MEAN
 
319
#define WIN32_LEAN_AND_MEAN
 
320
#endif
 
321
#if (!defined(_WIN32_WINNT)) || (_WIN32_WINNT < 0x0501)
 
322
#undef _WIN32_WINNT
 
323
#define _WIN32_WINNT 0x0501
 
324
#endif
 
325
#include <windows.h>
 
326
#ifdef HAVE_WINSOCK2_H
 
327
#include <winsock2.h> 
 
328
#ifdef HAVE_WS2TCPIP_H
 
329
#include <ws2tcpip.h>
 
330
#endif
 
331
#endif
 
332
#define GNICALLCONV WSAAPI
 
333
#else
 
334
#ifdef HAVE_SYS_TYPES_H
 
335
#include <sys/types.h>
 
336
#endif
 
337
#ifdef HAVE_SYS_SOCKET_H
 
338
#include <sys/socket.h>
 
339
#endif
 
340
#ifdef HAVE_NETDB_H
 
341
#include <netdb.h>
 
342
#endif
 
343
#define GNICALLCONV
 
344
#endif
 
345
                  extern int GNICALLCONV getnameinfo($gni_arg1, $gni_arg2,
 
346
                                         char *, $gni_arg46,
 
347
                                         char *, $gni_arg46,
 
348
                                         $gni_arg7);
 
349
                ],[
 
350
                  $gni_arg2 salen=0;
 
351
                  $gni_arg46 hostlen=0;
 
352
                  $gni_arg46 servlen=0;
 
353
                  $gni_arg7 flags=0;
 
354
                  int res = getnameinfo(0, salen, 0, hostlen, 0, servlen, flags);
 
355
                ])
 
356
              ],[
 
357
                 curl_cv_func_getnameinfo_args="$gni_arg1,$gni_arg2,$gni_arg46,$gni_arg7"
 
358
                 break 4
 
359
              ])
 
360
            done
 
361
          done
 
362
        done
 
363
      done
 
364
    ]) # AC_CACHE_CHECK
 
365
    if test "$curl_cv_func_getnameinfo_args" = "unknown"; then
 
366
      AC_MSG_WARN([Cannot find proper types to use for getnameinfo args])
 
367
      AC_MSG_WARN([HAVE_GETNAMEINFO will not be defined])
 
368
    else
 
369
      gni_prev_IFS=$IFS; IFS=','
 
370
      set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'`
 
371
      IFS=$gni_prev_IFS
 
372
      shift
 
373
      AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $[1],
 
374
        [Define to the type of arg 1 for getnameinfo.])
 
375
      AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2],
 
376
        [Define to the type of arg 2 for getnameinfo.])
 
377
      AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3],
 
378
        [Define to the type of args 4 and 6 for getnameinfo.])
 
379
      AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4],
 
380
        [Define to the type of arg 7 for getnameinfo.])
 
381
      AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1,
 
382
        [Define to 1 if you have the getnameinfo function.])
 
383
      ac_cv_func_getnameinfo="yes"
 
384
    fi
 
385
  fi
 
386
]) # AC_DEFUN
 
387
 
 
388
 
 
389
dnl CURL_CHECK_NONBLOCKING_SOCKET
 
390
dnl -------------------------------------------------
1
391
dnl Check for how to set a socket to non-blocking state. There seems to exist
2
392
dnl four known different ways, with the one used almost everywhere being POSIX
3
393
dnl and XPG3, while the other different ways for different systems (old BSD,
59
449
dnl the code was bad, try a different program now, test 3
60
450
 
61
451
  AC_TRY_COMPILE([
62
 
/* headers for ioctlsocket test (cygwin?) */
 
452
/* headers for ioctlsocket test (Windows) */
 
453
#undef inline
 
454
#ifdef HAVE_WINDOWS_H
 
455
#ifndef WIN32_LEAN_AND_MEAN
 
456
#define WIN32_LEAN_AND_MEAN
 
457
#endif
63
458
#include <windows.h>
 
459
#ifdef HAVE_WINSOCK2_H
 
460
#include <winsock2.h>
 
461
#else
 
462
#ifdef HAVE_WINSOCK_H
 
463
#include <winsock.h>
 
464
#endif
 
465
#endif
 
466
#endif
64
467
],[
65
468
/* ioctlsocket source code */
66
 
 int socket;
67
 
 unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
 
469
 SOCKET sd;
 
470
 unsigned long flags = 0;
 
471
 sd = socket(0, 0, 0);
 
472
 ioctlsocket(sd, FIONBIO, &flags);
68
473
],[
69
474
dnl ioctlsocket test was good
70
475
nonblock="ioctlsocket"
122
527
  fi
123
528
])
124
529
 
 
530
 
 
531
dnl TYPE_SOCKADDR_STORAGE
 
532
dnl -------------------------------------------------
125
533
dnl Check for struct sockaddr_storage. Most IPv6-enabled hosts have it, but
126
534
dnl AIX 4.3 is one known exception.
127
535
AC_DEFUN([TYPE_SOCKADDR_STORAGE],
130
538
        AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
131
539
                  [if struct sockaddr_storage is defined]), ,
132
540
   [
 
541
#undef inline
 
542
#ifdef HAVE_WINDOWS_H
 
543
#ifndef WIN32_LEAN_AND_MEAN
 
544
#define WIN32_LEAN_AND_MEAN
 
545
#endif
 
546
#include <windows.h>
 
547
#ifdef HAVE_WINSOCK2_H
 
548
#include <winsock2.h>
 
549
#endif
 
550
#else
133
551
#ifdef HAVE_SYS_TYPES_H
134
552
#include <sys/types.h>
135
553
#endif
142
560
#ifdef HAVE_ARPA_INET_H
143
561
#include <arpa/inet.h>
144
562
#endif
145
 
#ifdef HAVE_WINSOCK2_H
146
 
#include <winsock2.h>
147
563
#endif
148
564
   ])
149
 
 
150
 
])
151
 
 
152
 
dnl Check for socklen_t: historically on BSD it is an int, and in
153
 
dnl POSIX 1g it is a type of its own, but some platforms use different
154
 
dnl types for the argument to getsockopt, getpeername, etc.  So we
155
 
dnl have to test to find something that will work.
156
 
AC_DEFUN([TYPE_SOCKLEN_T],
157
 
[
158
 
   AC_CHECK_TYPE([socklen_t], ,[
159
 
      AC_MSG_CHECKING([for socklen_t equivalent])
160
 
      AC_CACHE_VAL([curl_cv_socklen_t_equiv],
161
 
      [
162
 
         # Systems have either "struct sockaddr *" or
163
 
         # "void *" as the second argument to getpeername
164
 
         curl_cv_socklen_t_equiv=
165
 
         for arg2 in "struct sockaddr" void; do
166
 
            for t in int size_t unsigned long "unsigned long"; do
167
 
               AC_TRY_COMPILE([
168
 
                  #ifdef HAVE_SYS_TYPES_H
169
 
                  #include <sys/types.h>
170
 
                  #endif
171
 
                  #ifdef HAVE_SYS_SOCKET_H
172
 
                  #include <sys/socket.h>
173
 
                  #endif
174
 
 
175
 
                  int getpeername (int, $arg2 *, $t *);
176
 
               ],[
177
 
                  $t len;
178
 
                  getpeername(0,0,&len);
179
 
               ],[
180
 
                  curl_cv_socklen_t_equiv="$t"
181
 
                  break
182
 
               ])
183
 
            done
184
 
         done
185
 
 
186
 
         if test "x$curl_cv_socklen_t_equiv" = x; then
187
 
            AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
188
 
         fi
189
 
      ])
190
 
      AC_MSG_RESULT($curl_cv_socklen_t_equiv)
191
 
      AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
192
 
                        [type to use in place of socklen_t if not defined])],
193
 
      [#include <sys/types.h>
194
 
#include <sys/socket.h>])
195
 
])
196
 
 
 
565
])
 
566
 
 
567
 
 
568
dnl TYPE_IN_ADDR_T
 
569
dnl -------------------------------------------------
197
570
dnl Check for in_addr_t: it is used to receive the return code of inet_addr()
198
571
dnl and a few other things.
199
572
AC_DEFUN([TYPE_IN_ADDR_T],
205
578
         curl_cv_in_addr_t_equiv=
206
579
         for t in "unsigned long" int size_t unsigned long; do
207
580
            AC_TRY_COMPILE([
208
 
               #ifdef HAVE_SYS_TYPES_H
209
 
               #include <sys/types.h>
210
 
               #endif
211
 
               #ifdef HAVE_SYS_SOCKET_H
212
 
               #include <sys/socket.h>
213
 
               #endif
214
 
               #ifdef HAVE_ARPA_INET_H
215
 
               #include <arpa/inet.h>
216
 
               #endif
 
581
#undef inline
 
582
#ifdef HAVE_WINDOWS_H
 
583
#ifndef WIN32_LEAN_AND_MEAN
 
584
#define WIN32_LEAN_AND_MEAN
 
585
#endif
 
586
#include <windows.h>
 
587
#ifdef HAVE_WINSOCK2_H
 
588
#include <winsock2.h>
 
589
#else
 
590
#ifdef HAVE_WINSOCK_H
 
591
#include <winsock.h>
 
592
#endif
 
593
#endif
 
594
#else
 
595
#ifdef HAVE_SYS_TYPES_H
 
596
#include <sys/types.h>
 
597
#endif
 
598
#ifdef HAVE_SYS_SOCKET_H
 
599
#include <sys/socket.h>
 
600
#endif
 
601
#ifdef HAVE_NETINET_IN_H
 
602
#include <netinet/in.h>
 
603
#endif
 
604
#ifdef HAVE_ARPA_INET_H
 
605
#include <arpa/inet.h>
 
606
#endif
 
607
#endif
217
608
            ],[
218
609
               $t data = inet_addr ("1.2.3.4");
219
610
            ],[
229
620
      AC_MSG_RESULT($curl_cv_in_addr_t_equiv)
230
621
      AC_DEFINE_UNQUOTED(in_addr_t, $curl_cv_in_addr_t_equiv,
231
622
                        [type to use in place of in_addr_t if not defined])],
232
 
      [#include <sys/types.h>
 
623
      [
 
624
#undef inline
 
625
#ifdef HAVE_WINDOWS_H
 
626
#ifndef WIN32_LEAN_AND_MEAN
 
627
#define WIN32_LEAN_AND_MEAN
 
628
#endif
 
629
#include <windows.h>
 
630
#ifdef HAVE_WINSOCK2_H
 
631
#include <winsock2.h>
 
632
#else
 
633
#ifdef HAVE_WINSOCK_H
 
634
#include <winsock.h>
 
635
#endif
 
636
#endif
 
637
#else
 
638
#ifdef HAVE_SYS_TYPES_H
 
639
#include <sys/types.h>
 
640
#endif
 
641
#ifdef HAVE_SYS_SOCKET_H
233
642
#include <sys/socket.h>
234
 
#include <arpa/inet.h>])
235
 
])
 
643
#endif
 
644
#ifdef HAVE_NETINET_IN_H
 
645
#include <netinet/in.h>
 
646
#endif
 
647
#ifdef HAVE_ARPA_INET_H
 
648
#include <arpa/inet.h>
 
649
#endif
 
650
#endif
 
651
  ]) dnl AC_CHECK_TYPE
 
652
]) dnl AC_DEFUN
236
653
 
237
654
dnl ************************************************************
238
655
dnl check for "localhost", if it doesn't exist, we can't do the
687
1104
fi
688
1105
])
689
1106
 
 
1107
 
 
1108
dnl **********************************************************************
 
1109
dnl CURL_DETECT_ICC ([ACTION-IF-YES])
 
1110
dnl
 
1111
dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES
 
1112
dnl sets the $ICC variable to "yes" or "no"
 
1113
dnl **********************************************************************
 
1114
AC_DEFUN([CURL_DETECT_ICC],
 
1115
[
 
1116
    ICC="no"
 
1117
    AC_MSG_CHECKING([for icc in use])
 
1118
    if test "$GCC" = "yes"; then
 
1119
       dnl check if this is icc acting as gcc in disguise
 
1120
       AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
 
1121
         dnl action if the text is found, this it has not been replaced by the
 
1122
         dnl cpp
 
1123
         ICC="no",
 
1124
         dnl the text was not found, it was replaced by the cpp
 
1125
         ICC="yes"
 
1126
         AC_MSG_RESULT([yes])
 
1127
         [$1]
 
1128
       )
 
1129
    fi
 
1130
    if test "$ICC" = "no"; then
 
1131
        # this is not ICC
 
1132
        AC_MSG_RESULT([no])
 
1133
    fi
 
1134
])
 
1135
 
690
1136
dnl We create a function for detecting which compiler we use and then set as
691
1137
dnl pendantic compiler options as possible for that particular compiler. The
692
1138
dnl options are only used for debug-builds.
693
1139
 
694
1140
AC_DEFUN([CURL_CC_DEBUG_OPTS],
695
1141
[
 
1142
    if test "z$ICC" = "z"; then
 
1143
      CURL_DETECT_ICC
 
1144
    fi
 
1145
 
696
1146
    if test "$GCC" = "yes"; then
697
1147
 
698
1148
       dnl figure out gcc version!
703
1153
       gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
704
1154
       AC_MSG_RESULT($gccver)
705
1155
 
706
 
       AC_MSG_CHECKING([if this is icc in disguise])
707
 
       AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
708
 
         dnl action if the text is found, this it has not been replaced by the
709
 
         dnl cpp
710
 
         ICC="no"
711
 
         AC_MSG_RESULT([no]),
712
 
         dnl the text was not found, it was replaced by the cpp
713
 
         ICC="yes"
714
 
         AC_MSG_RESULT([yes])
715
 
       )
716
 
 
717
1156
       if test "$ICC" = "yes"; then
718
1157
         dnl this is icc, not gcc.
719
1158
 
884
1323
  AC_MSG_RESULT($DLFOUNDFILE)
885
1324
fi
886
1325
])
 
1326
 
 
1327
# This is only a temporary fix. This macro is here to replace the broken one
 
1328
# delivered by the automake project (including the 1.9.6 release). As soon as
 
1329
# they ship a working version we SHOULD remove this work-around.
 
1330
 
 
1331
AC_DEFUN([AM_MISSING_HAS_RUN],
 
1332
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
1333
test x"${MISSING+set}" = xset || MISSING="\${SHELL} \"$am_aux_dir/missing\""
 
1334
# Use eval to expand $SHELL
 
1335
if eval "$MISSING --run true"; then
 
1336
  am_missing_run="$MISSING --run "
 
1337
else
 
1338
  am_missing_run=
 
1339
  AC_MSG_WARN([`missing' script is too old or missing])
 
1340
fi
 
1341
])