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

« back to all changes in this revision

Viewing changes to m4/lstat.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
# serial 23
 
2
 
 
3
# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
 
4
#
 
5
# This file is free software; the Free Software Foundation
 
6
# gives unlimited permission to copy and/or distribute it,
 
7
# with or without modifications, as long as this notice is preserved.
 
8
 
 
9
dnl From Jim Meyering.
 
10
 
 
11
AC_DEFUN([gl_FUNC_LSTAT],
 
12
[
 
13
  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
 
14
  dnl If lstat does not exist, the replacement <sys/stat.h> does
 
15
  dnl "#define lstat stat", and lstat.c is a no-op.
 
16
  AC_CHECK_FUNCS_ONCE([lstat])
 
17
  if test $ac_cv_func_lstat = yes; then
 
18
    AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
 
19
    if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then
 
20
      REPLACE_LSTAT=1
 
21
    fi
 
22
  else
 
23
    HAVE_LSTAT=0
 
24
  fi
 
25
])
 
26
 
 
27
# Prerequisites of lib/lstat.c.
 
28
AC_DEFUN([gl_PREREQ_LSTAT],
 
29
[
 
30
  AC_REQUIRE([AC_C_INLINE])
 
31
  :
 
32
])
 
33
 
 
34
AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
 
35
[
 
36
  dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
 
37
  dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
 
38
  AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
 
39
    [gl_cv_func_lstat_dereferences_slashed_symlink],
 
40
    [rm -f conftest.sym conftest.file
 
41
     echo >conftest.file
 
42
     if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
 
43
       AC_RUN_IFELSE(
 
44
         [AC_LANG_PROGRAM(
 
45
            [AC_INCLUDES_DEFAULT],
 
46
            [[struct stat sbuf;
 
47
              /* Linux will dereference the symlink and fail, as required by
 
48
                 POSIX.  That is better in the sense that it means we will not
 
49
                 have to compile and use the lstat wrapper.  */
 
50
              return lstat ("conftest.sym/", &sbuf) == 0;
 
51
            ]])],
 
52
         [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
 
53
         [gl_cv_func_lstat_dereferences_slashed_symlink=no],
 
54
         [# When cross-compiling, be pessimistic so we will end up using the
 
55
          # replacement version of lstat that checks for trailing slashes and
 
56
          # calls lstat a second time when necessary.
 
57
          gl_cv_func_lstat_dereferences_slashed_symlink=no
 
58
         ])
 
59
     else
 
60
       # If the 'ln -s' command failed, then we probably don't even
 
61
       # have an lstat function.
 
62
       gl_cv_func_lstat_dereferences_slashed_symlink=no
 
63
     fi
 
64
     rm -f conftest.sym conftest.file
 
65
    ])
 
66
  test $gl_cv_func_lstat_dereferences_slashed_symlink = yes &&
 
67
    AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
 
68
      [Define to 1 if `lstat' dereferences a symlink specified
 
69
       with a trailing slash.])
 
70
])