~ubuntu-branches/ubuntu/trusty/wget/trusty-updates

« back to all changes in this revision

Viewing changes to m4/lib-prefix.m4

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2009-12-12 08:15:59 UTC
  • mfrom: (2.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091212081559-mvccl4kzdqb138y3
Tags: 1.12-1.1ubuntu1
* Merge from debian testing, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
* Keep build dependencies in main:
  - debian/control: remove info2man build-dep
  - debian/patches/00list: disable wget-infopod_generated_manpage.dpatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# lib-prefix.m4 serial 4 (gettext-0.14.2)
2
 
dnl Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
 
1
# lib-prefix.m4 serial 5 (gettext-0.15)
 
2
dnl Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Free Software
3
3
dnl Foundation, Inc.
4
4
dnl This file is free software; the Free Software Foundation
5
5
dnl gives unlimited permission to copy and/or distribute it,
25
25
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
26
26
  AC_REQUIRE([AC_PROG_CC])
27
27
  AC_REQUIRE([AC_CANONICAL_HOST])
 
28
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
28
29
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
29
30
  dnl By default, look in $includedir and $libdir.
30
31
  use_additional=yes
46
47
        ])
47
48
      else
48
49
        additional_includedir="$withval/include"
49
 
        additional_libdir="$withval/lib"
 
50
        additional_libdir="$withval/$acl_libdirstem"
50
51
      fi
51
52
    fi
52
53
])
88
89
    dnl   2. if it's already present in $LDFLAGS,
89
90
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
90
91
    dnl   4. if it doesn't exist as a directory.
91
 
    if test "X$additional_libdir" != "X/usr/lib"; then
 
92
    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
92
93
      haveit=
93
94
      for x in $LDFLAGS; do
94
95
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
98
99
        fi
99
100
      done
100
101
      if test -z "$haveit"; then
101
 
        if test "X$additional_libdir" = "X/usr/local/lib"; then
 
102
        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
102
103
          if test -n "$GCC"; then
103
104
            case $host_os in
104
105
              linux*) haveit=yes;;
152
153
  exec_prefix="$acl_save_exec_prefix"
153
154
  prefix="$acl_save_prefix"
154
155
])
 
156
 
 
157
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
 
158
dnl the basename of the libdir, either "lib" or "lib64".
 
159
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 
160
[
 
161
  dnl There is no formal standard regarding lib and lib64. The current
 
162
  dnl practice is that on a system supporting 32-bit and 64-bit instruction
 
163
  dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
 
164
  dnl libraries go under $prefix/lib. We determine the compiler's default
 
165
  dnl mode by looking at the compiler's library search path. If at least
 
166
  dnl of its elements ends in /lib64 or points to a directory whose absolute
 
167
  dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
 
168
  dnl default, namely "lib".
 
169
  acl_libdirstem=lib
 
170
  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
 
171
  if test -n "$searchpath"; then
 
172
    acl_save_IFS="${IFS=        }"; IFS=":"
 
173
    for searchdir in $searchpath; do
 
174
      if test -d "$searchdir"; then
 
175
        case "$searchdir" in
 
176
          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
 
177
          *) searchdir=`cd "$searchdir" && pwd`
 
178
             case "$searchdir" in
 
179
               */lib64 ) acl_libdirstem=lib64 ;;
 
180
             esac ;;
 
181
        esac
 
182
      fi
 
183
    done
 
184
    IFS="$acl_save_IFS"
 
185
  fi
 
186
])