~ubuntu-branches/ubuntu/lucid/curl/lucid-201010031940

« back to all changes in this revision

Viewing changes to m4/curl-reentrant.m4

  • Committer: Kees Cook
  • Date: 2009-12-12 04:16:02 UTC
  • mfrom: (3.3.3 squeeze)
  • Revision ID: kees@outflux.net-20091212041602-o707x164tp1f8efj
Merged with Debian testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#                            | (__| |_| |  _ <| |___
6
6
#                             \___|\___/|_| \_\_____|
7
7
#
8
 
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
#
10
10
# This software is licensed as described in the file COPYING, which
11
11
# you should have received as part of this distribution. The terms
18
18
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
# KIND, either express or implied.
20
20
#
21
 
# $Id: curl-reentrant.m4,v 1.3 2008-10-14 18:44:27 yangtse Exp $
 
21
# $Id: curl-reentrant.m4,v 1.6 2009-09-29 16:34:04 yangtse Exp $
22
22
#***************************************************************************
23
23
 
24
24
# File version for 'aclocal' use. Keep it a single number.
25
 
# serial 3
 
25
# serial 6
26
26
 
27
27
dnl Note 1
28
28
dnl ------
31
31
dnl configure process much before header file availability is known.
32
32
 
33
33
 
 
34
dnl CURL_CHECK_NEED_REENTRANT_ERRNO
 
35
dnl -------------------------------------------------
 
36
dnl Checks if the preprocessor _REENTRANT definition
 
37
dnl makes errno available as a preprocessor macro.
 
38
 
 
39
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_ERRNO], [
 
40
  AC_COMPILE_IFELSE([
 
41
    AC_LANG_PROGRAM([[
 
42
#include <errno.h>
 
43
    ]],[[
 
44
      if(0 != errno)
 
45
        return 1;
 
46
    ]])
 
47
  ],[
 
48
    tmp_errno="yes"
 
49
  ],[
 
50
    tmp_errno="no"
 
51
  ])
 
52
  if test "$tmp_errno" = "yes"; then
 
53
    AC_COMPILE_IFELSE([
 
54
      AC_LANG_PROGRAM([[
 
55
#include <errno.h>
 
56
      ]],[[
 
57
#ifdef errno
 
58
        int dummy=1;
 
59
#else
 
60
        force compilation error
 
61
#endif
 
62
      ]])
 
63
    ],[
 
64
      tmp_errno="errno_macro_defined"
 
65
    ],[
 
66
      AC_COMPILE_IFELSE([
 
67
        AC_LANG_PROGRAM([[
 
68
#define _REENTRANT
 
69
#include <errno.h>
 
70
        ]],[[
 
71
#ifdef errno
 
72
          int dummy=1;
 
73
#else
 
74
          force compilation error
 
75
#endif
 
76
        ]])
 
77
      ],[
 
78
        tmp_errno="errno_macro_needs_reentrant"
 
79
        tmp_need_reentrant="yes"
 
80
      ])
 
81
    ])
 
82
  fi
 
83
])
 
84
 
 
85
 
34
86
dnl CURL_CHECK_NEED_REENTRANT_GMTIME_R
35
87
dnl -------------------------------------------------
36
88
dnl Checks if the preprocessor _REENTRANT definition
444
496
    AC_MSG_CHECKING([if _REENTRANT is actually needed])
445
497
    CURL_CHECK_NEED_REENTRANT_SYSTEM
446
498
    if test "$tmp_need_reentrant" = "no"; then
 
499
      CURL_CHECK_NEED_REENTRANT_ERRNO
 
500
    fi
 
501
    if test "$tmp_need_reentrant" = "no"; then
447
502
      CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R
448
503
    fi
449
504
    if test "$tmp_need_reentrant" = "yes"; then