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

« back to all changes in this revision

Viewing changes to m4/getline.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
 
# getline.m4 serial 19
 
1
# getline.m4 serial 25
2
2
 
3
 
dnl Copyright (C) 1998-2003, 2005-2007, 2009 Free Software Foundation, Inc.
 
3
dnl Copyright (C) 1998-2003, 2005-2007, 2009-2011 Free Software Foundation,
 
4
dnl Inc.
4
5
dnl
5
6
dnl This file is free software; the Free Software Foundation
6
7
dnl gives unlimited permission to copy and/or distribute it,
23
24
 
24
25
  gl_getline_needs_run_time_check=no
25
26
  AC_CHECK_FUNC([getline],
26
 
                dnl Found it in some library.  Verify that it works.
27
 
                gl_getline_needs_run_time_check=yes,
28
 
                am_cv_func_working_getline=no)
 
27
                [dnl Found it in some library.  Verify that it works.
 
28
                 gl_getline_needs_run_time_check=yes],
 
29
                [am_cv_func_working_getline=no])
29
30
  if test $gl_getline_needs_run_time_check = yes; then
30
31
    AC_CACHE_CHECK([for working getline function], [am_cv_func_working_getline],
31
 
    [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
32
 
    AC_TRY_RUN([
 
32
    [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
 
33
    AC_RUN_IFELSE([AC_LANG_SOURCE([[
33
34
#    include <stdio.h>
34
35
#    include <stdlib.h>
35
36
#    include <string.h>
36
37
    int main ()
37
 
    { /* Based on a test program from Karl Heuer.  */
38
 
      char *line = NULL;
39
 
      size_t siz = 0;
40
 
      int len;
 
38
    {
41
39
      FILE *in = fopen ("./conftest.data", "r");
42
40
      if (!in)
43
 
        return 1;
44
 
      len = getline (&line, &siz, in);
45
 
      exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
 
41
        return 1;
 
42
      {
 
43
        /* Test result for a NULL buffer and a zero size.
 
44
           Based on a test program from Karl Heuer.  */
 
45
        char *line = NULL;
 
46
        size_t siz = 0;
 
47
        int len = getline (&line, &siz, in);
 
48
        if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
 
49
          return 2;
 
50
      }
 
51
      {
 
52
        /* Test result for a NULL buffer and a non-zero size.
 
53
           This crashes on FreeBSD 8.0.  */
 
54
        char *line = NULL;
 
55
        size_t siz = (size_t)(~0) / 4;
 
56
        if (getline (&line, &siz, in) == -1)
 
57
          return 3;
 
58
      }
 
59
      return 0;
46
60
    }
47
 
    ], am_cv_func_working_getline=yes dnl The library version works.
48
 
    , am_cv_func_working_getline=no dnl The library version does NOT work.
 
61
    ]])], [am_cv_func_working_getline=yes] dnl The library version works.
 
62
    , [am_cv_func_working_getline=no] dnl The library version does NOT work.
49
63
    , dnl We're cross compiling. Assume it works on glibc2 systems.
50
64
      [AC_EGREP_CPP([Lucky GNU user],
51
65
         [
52
66
#include <features.h>
53
67
#ifdef __GNU_LIBRARY__
54
 
 #if (__GLIBC__ >= 2)
 
68
 #if (__GLIBC__ >= 2) && !defined __UCLIBC__
55
69
  Lucky GNU user
56
70
 #endif
57
71
#endif
66
80
  fi
67
81
 
68
82
  if test $am_cv_func_working_getline = no; then
 
83
    dnl Set REPLACE_GETLINE always: Even if we have not found the broken
 
84
    dnl getline function among $LIBS, it may exist in libinet and the
 
85
    dnl executable may be linked with -linet.
69
86
    REPLACE_GETLINE=1
70
 
    AC_LIBOBJ([getline])
71
 
 
72
 
    gl_PREREQ_GETLINE
73
87
  fi
74
88
])
75
89
 
76
90
# Prerequisites of lib/getline.c.
77
91
AC_DEFUN([gl_PREREQ_GETLINE],
78
92
[
79
 
  gl_FUNC_GETDELIM
 
93
  :
80
94
])