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

« back to all changes in this revision

Viewing changes to m4/getdelim.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
 
# getdelim.m4 serial 5
 
1
# getdelim.m4 serial 9
2
2
 
3
 
dnl Copyright (C) 2005, 2006, 2007 Free Software dnl Foundation, Inc.
 
3
dnl Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
4
4
dnl
5
5
dnl This file is free software; the Free Software Foundation
6
6
dnl gives unlimited permission to copy and/or distribute it,
15
15
  dnl Persuade glibc <stdio.h> to declare getdelim().
16
16
  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
17
17
 
18
 
  AC_REPLACE_FUNCS([getdelim])
19
18
  AC_CHECK_DECLS_ONCE([getdelim])
20
19
 
21
 
  if test $ac_cv_func_getdelim = no; then
22
 
    gl_PREREQ_GETDELIM
 
20
  AC_CHECK_FUNCS_ONCE([getdelim])
 
21
  if test $ac_cv_func_getdelim = yes; then
 
22
    HAVE_GETDELIM=1
 
23
    dnl Found it in some library.  Verify that it works.
 
24
    AC_CACHE_CHECK([for working getdelim function], [gl_cv_func_working_getdelim],
 
25
    [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
 
26
    AC_RUN_IFELSE([AC_LANG_SOURCE([[
 
27
#    include <stdio.h>
 
28
#    include <stdlib.h>
 
29
#    include <string.h>
 
30
    int main ()
 
31
    {
 
32
      FILE *in = fopen ("./conftest.data", "r");
 
33
      if (!in)
 
34
        return 1;
 
35
      {
 
36
        /* Test result for a NULL buffer and a zero size.
 
37
           Based on a test program from Karl Heuer.  */
 
38
        char *line = NULL;
 
39
        size_t siz = 0;
 
40
        int len = getdelim (&line, &siz, '\n', in);
 
41
        if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
 
42
          return 2;
 
43
      }
 
44
      {
 
45
        /* Test result for a NULL buffer and a non-zero size.
 
46
           This crashes on FreeBSD 8.0.  */
 
47
        char *line = NULL;
 
48
        size_t siz = (size_t)(~0) / 4;
 
49
        if (getdelim (&line, &siz, '\n', in) == -1)
 
50
          return 3;
 
51
      }
 
52
      return 0;
 
53
    }
 
54
    ]])], [gl_cv_func_working_getdelim=yes] dnl The library version works.
 
55
    , [gl_cv_func_working_getdelim=no] dnl The library version does NOT work.
 
56
    , dnl We're cross compiling. Assume it works on glibc2 systems.
 
57
      [AC_EGREP_CPP([Lucky GNU user],
 
58
         [
 
59
#include <features.h>
 
60
#ifdef __GNU_LIBRARY__
 
61
 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
 
62
  Lucky GNU user
 
63
 #endif
 
64
#endif
 
65
         ],
 
66
         [gl_cv_func_working_getdelim=yes],
 
67
         [gl_cv_func_working_getdelim=no])]
 
68
    )])
 
69
    if test $gl_cv_func_working_getdelim = no; then
 
70
      REPLACE_GETDELIM=1
 
71
    fi
 
72
  else
 
73
    HAVE_GETDELIM=0
23
74
  fi
24
75
 
25
76
  if test $ac_cv_have_decl_getdelim = no; then