~ubuntu-branches/ubuntu/maverick/curl/maverick-security

« back to all changes in this revision

Viewing changes to m4/curl-confopts.m4

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-04-29 11:10:29 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090429111029-2j5eiyokfw2bw049
Tags: 7.19.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* drop debian/patches/security_CVE-2009-0037.patch 
  - this patch is part of 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#***************************************************************************
 
2
#                                  _   _ ____  _
 
3
#  Project                     ___| | | |  _ \| |
 
4
#                             / __| | | | |_) | |
 
5
#                            | (__| |_| |  _ <| |___
 
6
#                             \___|\___/|_| \_\_____|
 
7
#
 
8
# Copyright (C) 1998 - 2008, 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: curl-confopts.m4,v 1.4 2008-11-13 18:56:56 yangtse Exp $
 
22
#***************************************************************************
 
23
 
 
24
# File version for 'aclocal' use. Keep it a single number.
 
25
# serial 4
 
26
 
 
27
 
 
28
dnl CURL_CHECK_OPTION_DEBUG
 
29
dnl -------------------------------------------------
 
30
dnl Verify if configure has been invoked with option
 
31
dnl --enable-debug or --disable-debug, and set shell
 
32
dnl variable want_debug value as appropriate.
 
33
 
 
34
AC_DEFUN([CURL_CHECK_OPTION_DEBUG], [
 
35
  AC_BEFORE([$0],[CURL_CHECK_OPTION_WARNINGS])dnl
 
36
  AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl
 
37
  AC_MSG_CHECKING([whether to enable debug build options])
 
38
  OPT_DEBUG_BUILD="default"
 
39
  AC_ARG_ENABLE(debug,
 
40
AC_HELP_STRING([--enable-debug],[Enable debug build options])
 
41
AC_HELP_STRING([--disable-debug],[Disable debug build options]),
 
42
  OPT_DEBUG_BUILD=$enableval)
 
43
  case "$OPT_DEBUG_BUILD" in
 
44
    no)
 
45
      dnl --disable-debug option used
 
46
      want_debug="no"
 
47
      ;;
 
48
    default)
 
49
      dnl configure option not specified
 
50
      want_debug="no"
 
51
      ;;
 
52
    *)
 
53
      dnl --enable-debug option used
 
54
      want_debug="yes"
 
55
      ;;
 
56
  esac
 
57
  AC_MSG_RESULT([$want_debug])
 
58
])
 
59
 
 
60
 
 
61
dnl CURL_CHECK_OPTION_NONBLOCKING
 
62
dnl -------------------------------------------------
 
63
dnl Verify if configure has been invoked with option
 
64
dnl --enable-nonblocking or --disable-nonblocking, and
 
65
dnl set shell variable want_nonblocking as appropriate.
 
66
 
 
67
AC_DEFUN([CURL_CHECK_OPTION_NONBLOCKING], [
 
68
  AC_BEFORE([$0],[CURL_CHECK_NONBLOCKING_SOCKET])dnl
 
69
  AC_MSG_CHECKING([whether to enable non-blocking communications])
 
70
  OPT_NONBLOCKING="default"
 
71
  AC_ARG_ENABLE(nonblocking,
 
72
AC_HELP_STRING([--enable-nonblocking],[Enable non-blocking communications])
 
73
AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking communications]),
 
74
  OPT_NONBLOCKING=$enableval)
 
75
  case "$OPT_NONBLOCKING" in
 
76
    no)
 
77
      dnl --disable-nonblocking option used
 
78
      want_nonblocking="no"
 
79
      ;;
 
80
    default)
 
81
      dnl configure option not specified
 
82
      want_nonblocking="yes"
 
83
      ;;
 
84
    *)
 
85
      dnl --enable-nonblocking option used
 
86
      want_nonblocking="yes"
 
87
      ;;
 
88
  esac
 
89
  AC_MSG_RESULT([$want_nonblocking])
 
90
])
 
91
 
 
92
 
 
93
dnl CURL_CHECK_OPTION_OPTIMIZE
 
94
dnl -------------------------------------------------
 
95
dnl Verify if configure has been invoked with option
 
96
dnl --enable-optimize or --disable-optimize, and set
 
97
dnl shell variable want_optimize value as appropriate.
 
98
 
 
99
AC_DEFUN([CURL_CHECK_OPTION_OPTIMIZE], [
 
100
  AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
 
101
  AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl
 
102
  AC_MSG_CHECKING([whether to enable compiler optimizer])
 
103
  OPT_COMPILER_OPTIMIZE="default"
 
104
  AC_ARG_ENABLE(optimize,
 
105
AC_HELP_STRING([--enable-optimize],[Enable compiler optimizations])
 
106
AC_HELP_STRING([--disable-optimize],[Disable compiler optimizations]),
 
107
  OPT_COMPILER_OPTIMIZE=$enableval)
 
108
  case "$OPT_COMPILER_OPTIMIZE" in
 
109
    no)
 
110
      dnl --disable-optimize option used. We will handle this as
 
111
      dnl a request to disable compiler optimizations if possible.
 
112
      dnl If the compiler is known CFLAGS and CPPFLAGS will be
 
113
      dnl overridden, otherwise this can not be honored.
 
114
      want_optimize="no"
 
115
      AC_MSG_RESULT([no])
 
116
      ;;
 
117
    default)
 
118
      dnl configure's optimize option not specified. Initially we will
 
119
      dnl handle this as a a request contrary to configure's setting
 
120
      dnl for --enable-debug. IOW, initially, for debug-enabled builds
 
121
      dnl this will be handled as a request to disable optimizations if
 
122
      dnl possible, and for debug-disabled builds this will be handled
 
123
      dnl initially as a request to enable optimizations if possible.
 
124
      dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do
 
125
      dnl not have any optimizer flag the request will be honored, in
 
126
      dnl any other case the request can not be honored.
 
127
      dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS
 
128
      dnl will always take precedence over any initial assumption.
 
129
      if test "$want_debug" = "yes"; then
 
130
        want_optimize="assume_no"
 
131
        AC_MSG_RESULT([not specified (assuming no)])
 
132
      else
 
133
        want_optimize="assume_yes"
 
134
        AC_MSG_RESULT([not specified (assuming yes)])
 
135
      fi
 
136
      ;;
 
137
    *)
 
138
      dnl --enable-optimize option used. We will handle this as
 
139
      dnl a request to enable compiler optimizations if possible.
 
140
      dnl If the compiler is known CFLAGS and CPPFLAGS will be
 
141
      dnl overridden, otherwise this can not be honored.
 
142
      want_optimize="yes"
 
143
      AC_MSG_RESULT([yes])
 
144
      ;;
 
145
  esac
 
146
])
 
147
 
 
148
 
 
149
dnl CURL_CHECK_OPTION_WARNINGS
 
150
dnl -------------------------------------------------
 
151
dnl Verify if configure has been invoked with option
 
152
dnl --enable-warnings or --disable-warnings, and set
 
153
dnl shell variable want_warnings as appropriate.
 
154
 
 
155
AC_DEFUN([CURL_CHECK_OPTION_WARNINGS], [
 
156
  AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl
 
157
  AC_BEFORE([$0],[CURL_CHECK_PROG_CC])dnl
 
158
  AC_MSG_CHECKING([whether to enable strict compiler warnings])
 
159
  OPT_COMPILER_WARNINGS="default"
 
160
  AC_ARG_ENABLE(warnings,
 
161
AC_HELP_STRING([--enable-warnings],[Enable strict compiler warnings])
 
162
AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
 
163
  OPT_COMPILER_WARNINGS=$enableval)
 
164
  case "$OPT_COMPILER_WARNINGS" in
 
165
    no)
 
166
      dnl --disable-warnings option used
 
167
      want_warnings="no"
 
168
      ;;
 
169
    default)
 
170
      dnl configure option not specified, so
 
171
      dnl use same setting as --enable-debug
 
172
      want_warnings="$want_debug"
 
173
      ;;
 
174
    *)
 
175
      dnl --enable-warnings option used
 
176
      want_warnings="yes"
 
177
      ;;
 
178
  esac
 
179
  AC_MSG_RESULT([$want_warnings])
 
180
])
 
181
 
 
182
 
 
183
dnl CURL_CHECK_NONBLOCKING_SOCKET
 
184
dnl -------------------------------------------------
 
185
dnl Check for how to set a socket into non-blocking state.
 
186
 
 
187
AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [
 
188
  AC_REQUIRE([CURL_CHECK_OPTION_NONBLOCKING])dnl
 
189
  AC_REQUIRE([CURL_CHECK_FUNC_FCNTL])dnl
 
190
  AC_REQUIRE([CURL_CHECK_FUNC_IOCTL])dnl
 
191
  AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET])dnl
 
192
  AC_REQUIRE([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL])dnl
 
193
  AC_REQUIRE([CURL_CHECK_FUNC_SETSOCKOPT])dnl
 
194
  #
 
195
  tst_method="unknown"
 
196
  if test "$want_nonblocking" = "yes"; then
 
197
    AC_MSG_CHECKING([how to set a socket into non-blocking mode])
 
198
    if test "x$ac_cv_func_fcntl_o_nonblock" = "xyes"; then
 
199
      tst_method="fcntl O_NONBLOCK"
 
200
    elif test "x$ac_cv_func_ioctl_fionbio" = "xyes"; then
 
201
      tst_method="ioctl FIONBIO"
 
202
    elif test "x$ac_cv_func_ioctlsocket_fionbio" = "xyes"; then
 
203
      tst_method="ioctlsocket FIONBIO"
 
204
    elif test "x$ac_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then
 
205
      tst_method="IoctlSocket FIONBIO"
 
206
    elif test "x$ac_cv_func_setsockopt_so_nonblock" = "xyes"; then
 
207
      tst_method="setsockopt SO_NONBLOCK"
 
208
    fi
 
209
    AC_MSG_RESULT([$tst_method])
 
210
    if test "$tst_method" = "unknown"; then
 
211
      AC_MSG_WARN([cannot determine non-blocking socket method.])
 
212
    fi
 
213
  fi
 
214
  if test "$tst_method" = "unknown"; then
 
215
    AC_DEFINE_UNQUOTED(USE_BLOCKING_SOCKETS, 1,
 
216
      [Define to disable non-blocking sockets.])
 
217
    AC_MSG_WARN([non-blocking sockets disabled.])
 
218
  fi
 
219
])
 
220