~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to m4/include_next.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# include_next.m4 serial 14
2
 
dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
 
1
# include_next.m4 serial 20
 
2
dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
24
24
dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
25
25
dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
26
26
dnl of plain '__STDC__'.
 
27
dnl
 
28
dnl PRAGMA_COLUMNS can be used in files that override system header files, so
 
29
dnl as to avoid compilation errors on HP NonStop systems when the gnulib file
 
30
dnl is included by a system header file that does a "#pragma COLUMNS 80" (which
 
31
dnl has the effect of truncating the lines of that file and all files that it
 
32
dnl includes to 80 columns) and the gnulib file has lines longer than 80
 
33
dnl columns.
27
34
 
28
35
AC_DEFUN([gl_INCLUDE_NEXT],
29
36
[
68
75
EOF
69
76
     gl_save_CPPFLAGS="$CPPFLAGS"
70
77
     CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
71
 
     AC_COMPILE_IFELSE([#include <conftest.h>],
 
78
dnl We intentionally avoid using AC_LANG_SOURCE here.
 
79
     AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
72
80
       [gl_cv_have_include_next=yes],
73
81
       [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
74
 
        AC_COMPILE_IFELSE([#include <conftest.h>],
 
82
        AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
75
83
          [gl_cv_have_include_next=buggy],
76
84
          [gl_cv_have_include_next=no])
77
85
       ])
97
105
  AC_SUBST([INCLUDE_NEXT])
98
106
  AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
99
107
  AC_SUBST([PRAGMA_SYSTEM_HEADER])
 
108
  AC_CACHE_CHECK([whether system header files limit the line length],
 
109
    [gl_cv_pragma_columns],
 
110
    [dnl HP NonStop systems, which define __TANDEM, have this misfeature.
 
111
     AC_EGREP_CPP([choke me],
 
112
       [
 
113
#ifdef __TANDEM
 
114
choke me
 
115
#endif
 
116
       ],
 
117
       [gl_cv_pragma_columns=yes],
 
118
       [gl_cv_pragma_columns=no])
 
119
    ])
 
120
  if test $gl_cv_pragma_columns = yes; then
 
121
    PRAGMA_COLUMNS="#pragma COLUMNS 10000"
 
122
  else
 
123
    PRAGMA_COLUMNS=
 
124
  fi
 
125
  AC_SUBST([PRAGMA_COLUMNS])
100
126
])
101
127
 
102
128
# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
109
135
# be
110
136
# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
111
137
# That way, a header file with the following line:
112
 
#       #@INCLUDE_NEXT@ @NEXT_FOO_H@
 
138
#       #@INCLUDE_NEXT@ @NEXT_FOO_H@
113
139
# or
114
 
#       #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
 
140
#       #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
115
141
# behaves (after sed substitution) as if it contained
116
 
#       #include_next <foo.h>
 
142
#       #include_next <foo.h>
117
143
# even if the compiler does not support include_next.
118
144
# The three "///" are to pacify Sun C 5.8, which otherwise would say
119
145
# "warning: #include of /usr/include/... may be non-portable".
121
147
# Note: This macro assumes that the header file is not empty after
122
148
# preprocessing, i.e. it does not only define preprocessor macros but also
123
149
# provides some type/enum definitions or function/variable declarations.
 
150
#
 
151
# This macro also checks whether each header exists, by invoking
 
152
# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
124
153
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
125
154
[
 
155
  gl_NEXT_HEADERS_INTERNAL([$1], [check])
 
156
])
 
157
 
 
158
# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
 
159
# ------------------------------------
 
160
# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
 
161
# This is suitable for headers like <stddef.h> that are standardized by C89
 
162
# and therefore can be assumed to exist.
 
163
AC_DEFUN([gl_NEXT_HEADERS],
 
164
[
 
165
  gl_NEXT_HEADERS_INTERNAL([$1], [assume])
 
166
])
 
167
 
 
168
# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
 
169
AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
 
170
[
126
171
  AC_REQUIRE([gl_INCLUDE_NEXT])
127
172
  AC_REQUIRE([AC_CANONICAL_HOST])
128
 
  AC_CHECK_HEADERS_ONCE([$1])
129
 
 
 
173
 
 
174
  m4_if([$2], [check],
 
175
    [AC_CHECK_HEADERS_ONCE([$1])
 
176
    ])
 
177
 
 
178
dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
 
179
dnl until we can assume autoconf 2.64 or newer.
130
180
  m4_foreach_w([gl_HEADER_NAME], [$1],
131
181
    [AS_VAR_PUSHDEF([gl_next_header],
132
 
                    [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
 
182
                    [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
133
183
     if test $gl_cv_have_include_next = yes; then
134
 
       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
 
184
       AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
135
185
     else
136
186
       AC_CACHE_CHECK(
137
 
         [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
138
 
         m4_defn([gl_next_header]),
139
 
         [AS_VAR_PUSHDEF([gl_header_exists],
140
 
                         [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
141
 
          if test AS_VAR_GET(gl_header_exists) = yes; then
142
 
            AC_LANG_CONFTEST(
143
 
              [AC_LANG_SOURCE(
144
 
                 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
145
 
               )])
146
 
            dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
147
 
            dnl that contain only a #include of other header files and no
148
 
            dnl non-comment tokens of their own. This leads to a failure to
149
 
            dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
150
 
            dnl and others. The workaround is to force preservation of comments
151
 
            dnl through option -C. This ensures all necessary #line directives
152
 
            dnl are present. GCC supports option -C as well.
153
 
            case "$host_os" in
154
 
              aix*) gl_absname_cpp="$ac_cpp -C" ;;
155
 
              *)    gl_absname_cpp="$ac_cpp" ;;
156
 
            esac
157
 
            dnl eval is necessary to expand gl_absname_cpp.
158
 
            dnl Ultrix and Pyramid sh refuse to redirect output of eval,
159
 
            dnl so use subshell.
160
 
            AS_VAR_SET([gl_next_header],
161
 
              ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
162
 
               sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
163
 
                 s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
164
 
                 s#^/[^/]#//&#
165
 
                 p
166
 
                 q
167
 
               }'`'"'])
168
 
          else
169
 
            AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
170
 
          fi
171
 
          AS_VAR_POPDEF([gl_header_exists])])
 
187
         [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
 
188
         m4_defn([gl_next_header]),
 
189
         [m4_if([$2], [check],
 
190
            [AS_VAR_PUSHDEF([gl_header_exists],
 
191
                            [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
 
192
             if test AS_VAR_GET(gl_header_exists) = yes; then
 
193
             AS_VAR_POPDEF([gl_header_exists])
 
194
            ])
 
195
               AC_LANG_CONFTEST(
 
196
                 [AC_LANG_SOURCE(
 
197
                    [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
 
198
                  )])
 
199
               dnl AIX "xlc -E" and "cc -E" omit #line directives for header
 
200
               dnl files that contain only a #include of other header files and
 
201
               dnl no non-comment tokens of their own. This leads to a failure
 
202
               dnl to detect the absolute name of <dirent.h>, <signal.h>,
 
203
               dnl <poll.h> and others. The workaround is to force preservation
 
204
               dnl of comments through option -C. This ensures all necessary
 
205
               dnl #line directives are present. GCC supports option -C as well.
 
206
               case "$host_os" in
 
207
                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
 
208
                 *)    gl_absname_cpp="$ac_cpp" ;;
 
209
               esac
 
210
               dnl eval is necessary to expand gl_absname_cpp.
 
211
               dnl Ultrix and Pyramid sh refuse to redirect output of eval,
 
212
               dnl so use subshell.
 
213
               AS_VAR_SET(gl_next_header,
 
214
                 ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
 
215
                  sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
 
216
                    s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
 
217
                    s#^/[^/]#//&#
 
218
                    p
 
219
                    q
 
220
                  }'`'"'])
 
221
          m4_if([$2], [check],
 
222
            [else
 
223
               AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
 
224
             fi
 
225
            ])
 
226
         ])
172
227
     fi
173
228
     AC_SUBST(
174
229
       AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
175
 
       [AS_VAR_GET([gl_next_header])])
 
230
       [AS_VAR_GET(gl_next_header)])
176
231
     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
177
232
       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
178
233
       gl_next_as_first_directive='<'gl_HEADER_NAME'>'
179
234
     else
180
235
       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
181
 
       gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
 
236
       gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
182
237
     fi
183
238
     AC_SUBST(
184
239
       AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
185
240
       [$gl_next_as_first_directive])
186
241
     AS_VAR_POPDEF([gl_next_header])])
187
242
])
 
243
 
 
244
# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
 
245
# this fallback is safe for all earlier autoconf versions.
 
246
m4_define_default([AC_LANG_DEFINES_PROVIDED])