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

« back to all changes in this revision

Viewing changes to m4/alloca.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
 
# alloca.m4 serial 9
2
 
dnl Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
 
1
# alloca.m4 serial 13
 
2
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
 
3
dnl Inc.
3
4
dnl This file is free software; the Free Software Foundation
4
5
dnl gives unlimited permission to copy and/or distribute it,
5
6
dnl with or without modifications, as long as this notice is preserved.
6
7
 
7
8
AC_DEFUN([gl_FUNC_ALLOCA],
8
9
[
9
 
  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
10
 
  AC_REQUIRE([AC_PROG_CPP])
11
 
  AC_REQUIRE([AC_PROG_EGREP])
12
 
 
13
10
  AC_REQUIRE([AC_FUNC_ALLOCA])
14
11
  if test $ac_cv_func_alloca_works = no; then
15
12
    gl_PREREQ_ALLOCA
39
36
    ALLOCA_H=alloca.h
40
37
  fi
41
38
  AC_SUBST([ALLOCA_H])
 
39
  AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
42
40
])
43
41
 
44
42
# Prerequisites of lib/alloca.c.
45
43
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
46
44
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
 
45
 
 
46
# This works around a bug in autoconf <= 2.68.
 
47
# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
 
48
 
 
49
m4_version_prereq([2.69], [] ,[
 
50
 
 
51
# This is taken from the following Autoconf patch:
 
52
# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
 
53
 
 
54
# _AC_LIBOBJ_ALLOCA
 
55
# -----------------
 
56
# Set up the LIBOBJ replacement of `alloca'.  Well, not exactly
 
57
# AC_LIBOBJ since we actually set the output variable `ALLOCA'.
 
58
# Nevertheless, for Automake, AC_LIBSOURCES it.
 
59
m4_define([_AC_LIBOBJ_ALLOCA],
 
60
[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
 
61
# that cause trouble.  Some versions do not even contain alloca or
 
62
# contain a buggy version.  If you still want to use their alloca,
 
63
# use ar to extract alloca.o from them instead of compiling alloca.c.
 
64
AC_LIBSOURCES(alloca.c)
 
65
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
 
66
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using `alloca.c'.])
 
67
 
 
68
AC_CACHE_CHECK(whether `alloca.c' needs Cray hooks, ac_cv_os_cray,
 
69
[AC_EGREP_CPP(webecray,
 
70
[#if defined CRAY && ! defined CRAY2
 
71
webecray
 
72
#else
 
73
wenotbecray
 
74
#endif
 
75
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
 
76
if test $ac_cv_os_cray = yes; then
 
77
  for ac_func in _getb67 GETB67 getb67; do
 
78
    AC_CHECK_FUNC($ac_func,
 
79
                  [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
 
80
                                      [Define to one of `_getb67', `GETB67',
 
81
                                       `getb67' for Cray-2 and Cray-YMP
 
82
                                       systems. This function is required for
 
83
                                       `alloca.c' support on those systems.])
 
84
    break])
 
85
  done
 
86
fi
 
87
 
 
88
AC_CACHE_CHECK([stack direction for C alloca],
 
89
               [ac_cv_c_stack_direction],
 
90
[AC_RUN_IFELSE([AC_LANG_SOURCE(
 
91
[AC_INCLUDES_DEFAULT
 
92
int
 
93
find_stack_direction (int *addr, int depth)
 
94
{
 
95
  int dir, dummy = 0;
 
96
  if (! addr)
 
97
    addr = &dummy;
 
98
  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
 
99
  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
 
100
  return dir + dummy;
 
101
}
 
102
 
 
103
int
 
104
main (int argc, char **argv)
 
105
{
 
106
  return find_stack_direction (0, argc + !argv + 20) < 0;
 
107
}])],
 
108
               [ac_cv_c_stack_direction=1],
 
109
               [ac_cv_c_stack_direction=-1],
 
110
               [ac_cv_c_stack_direction=0])])
 
111
AH_VERBATIM([STACK_DIRECTION],
 
112
[/* If using the C implementation of alloca, define if you know the
 
113
   direction of stack growth for your system; otherwise it will be
 
114
   automatically deduced at runtime.
 
115
        STACK_DIRECTION > 0 => grows toward higher addresses
 
116
        STACK_DIRECTION < 0 => grows toward lower addresses
 
117
        STACK_DIRECTION = 0 => direction of growth unknown */
 
118
@%:@undef STACK_DIRECTION])dnl
 
119
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
 
120
])# _AC_LIBOBJ_ALLOCA
 
121
])