~ubuntu-branches/ubuntu/quantal/gnutls26/quantal

« back to all changes in this revision

Viewing changes to gl/m4/lib-link.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# lib-link.m4 serial 19 (gettext-0.18)
2
 
dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
 
1
# lib-link.m4 serial 23 (gettext-0.18.2)
 
2
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
18
18
[
19
19
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
20
20
  AC_REQUIRE([AC_LIB_RPATH])
21
 
  pushdef([Name],[translit([$1],[./-], [___])])
22
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
23
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
21
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
 
22
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
23
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
24
24
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
25
25
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
26
26
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
58
58
[
59
59
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
60
60
  AC_REQUIRE([AC_LIB_RPATH])
61
 
  pushdef([Name],[translit([$1],[./-], [___])])
62
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
63
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
61
  pushdef([Name],[m4_translit([$1],[./+-], [____])])
 
62
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
63
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
64
64
 
65
65
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
66
66
  dnl accordingly.
74
74
 
75
75
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
76
76
    ac_save_LIBS="$LIBS"
77
 
    LIBS="$LIBS $LIB[]NAME"
 
77
    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
 
78
    dnl because these -l options might require -L options that are present in
 
79
    dnl LIBS. -l options benefit only from the -L options listed before it.
 
80
    dnl Otherwise, add it to the front of LIBS, because it may be a static
 
81
    dnl library that depends on another static library that is present in LIBS.
 
82
    dnl Static libraries benefit only from the static libraries listed after
 
83
    dnl it.
 
84
    case " $LIB[]NAME" in
 
85
      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
 
86
      *)       LIBS="$LIB[]NAME $LIBS" ;;
 
87
    esac
78
88
    AC_TRY_LINK([$3], [$4],
79
89
      [ac_cv_lib[]Name=yes],
80
90
      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
82
92
  ])
83
93
  if test "$ac_cv_lib[]Name" = yes; then
84
94
    HAVE_LIB[]NAME=yes
85
 
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib[]$1 library.])
 
95
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
86
96
    AC_MSG_CHECKING([how to link with lib[]$1])
87
97
    AC_MSG_RESULT([$LIB[]NAME])
88
98
  else
147
157
dnl macro call that searches for libname.
148
158
AC_DEFUN([AC_LIB_FROMPACKAGE],
149
159
[
150
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
151
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
160
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
161
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
152
162
  define([acl_frompackage_]NAME, [$2])
153
163
  popdef([NAME])
154
164
  pushdef([PACK],[$2])
155
 
  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
156
 
                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
165
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
 
166
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
157
167
  define([acl_libsinpackage_]PACKUP,
158
168
    m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
159
169
  popdef([PACKUP])
168
178
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
169
179
[
170
180
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
171
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
172
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
181
  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
 
182
                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
173
183
  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
174
 
  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
175
 
                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
184
  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
 
185
                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
176
186
  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
177
187
  dnl Autoconf >= 2.61 supports dots in --with options.
178
 
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
 
188
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
179
189
  dnl By default, look in $includedir and $libdir.
180
190
  use_additional=yes
181
191
  AC_LIB_WITH_FINAL_PREFIX([
210
220
  LTLIB[]NAME=
211
221
  INC[]NAME=
212
222
  LIB[]NAME[]_PREFIX=
 
223
  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
 
224
  dnl computed. So it has to be reset here.
 
225
  HAVE_LIB[]NAME=
213
226
  rpathdirs=
214
227
  ltrpathdirs=
215
228
  names_already_handled=
229
242
        names_already_handled="$names_already_handled $name"
230
243
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
231
244
        dnl or AC_LIB_HAVE_LINKFLAGS call.
232
 
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
 
245
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
233
246
        eval value=\"\$HAVE_LIB$uppername\"
234
247
        if test -n "$value"; then
235
248
          if test "$value" = yes; then