~ubuntu-branches/ubuntu/saucy/libpwquality/saucy

« back to all changes in this revision

Viewing changes to m4/lib-link.m4

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Iain Lane, Michael Biebl
  • Date: 2013-05-25 08:04:37 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130525080437-whpk2a9hdorhcut2
Tags: 1.2.1-1
[ Iain Lane ]
* Pass python version correctly 

[ Michael Biebl ]
* Upload to unstable.
* New upstream release.
* Use uploaders.mk to substitute @GNOME_TEAM@ in control.in.
* Split off the man page and configuration file from libpwquality1 into a new
  binary package named libpwquality-common and make libpwquality1 depend on
  it.
* With those files split off, mark the packages as multi-arch enabled.
* Bump Standards-Version to 3.9.4. No further changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# lib-link.m4 serial 21 (gettext-0.18)
2
 
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 
1
# lib-link.m4 serial 8 (gettext-0.15)
 
2
dnl Copyright (C) 2001-2006 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.
6
6
 
7
7
dnl From Bruno Haible.
8
8
 
9
 
AC_PREREQ([2.54])
 
9
AC_PREREQ(2.50)
10
10
 
11
11
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
12
12
dnl the libraries corresponding to explicit and implicit dependencies.
13
13
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
14
14
dnl augments the CPPFLAGS variable.
15
 
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
16
 
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
17
15
AC_DEFUN([AC_LIB_LINKFLAGS],
18
16
[
19
17
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
20
18
  AC_REQUIRE([AC_LIB_RPATH])
21
 
  pushdef([Name],[translit([$1],[./-], [___])])
22
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
23
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
19
  define([Name],[translit([$1],[./-], [___])])
 
20
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
21
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
24
22
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
25
23
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
26
24
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
27
25
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
28
26
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
29
 
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
30
27
  ])
31
28
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
32
29
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
33
30
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
34
 
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
35
31
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
36
32
  AC_SUBST([LIB]NAME)
37
33
  AC_SUBST([LTLIB]NAME)
38
 
  AC_SUBST([LIB]NAME[_PREFIX])
39
34
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
40
35
  dnl results of this search when this library appears as a dependency.
41
36
  HAVE_LIB[]NAME=yes
42
 
  popdef([NAME])
43
 
  popdef([Name])
 
37
  undefine([Name])
 
38
  undefine([NAME])
44
39
])
45
40
 
46
 
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
 
41
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
47
42
dnl searches for libname and the libraries corresponding to explicit and
48
43
dnl implicit dependencies, together with the specified include files and
49
 
dnl the ability to compile and link the specified testcode. The missing-message
50
 
dnl defaults to 'no' and may contain additional hints for the user.
51
 
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
52
 
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 
44
dnl the ability to compile and link the specified testcode. If found, it
 
45
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
 
46
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
53
47
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
54
48
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
55
 
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
56
 
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
57
49
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
58
50
[
59
51
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
60
52
  AC_REQUIRE([AC_LIB_RPATH])
61
 
  pushdef([Name],[translit([$1],[./-], [___])])
62
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
63
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
53
  define([Name],[translit([$1],[./-], [___])])
 
54
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
55
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
64
56
 
65
57
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
66
58
  dnl accordingly.
74
66
 
75
67
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
76
68
    ac_save_LIBS="$LIBS"
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
88
 
    AC_TRY_LINK([$3], [$4],
89
 
      [ac_cv_lib[]Name=yes],
90
 
      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
 
69
    LIBS="$LIBS $LIB[]NAME"
 
70
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
91
71
    LIBS="$ac_save_LIBS"
92
72
  ])
93
73
  if test "$ac_cv_lib[]Name" = yes; then
94
74
    HAVE_LIB[]NAME=yes
95
 
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
 
75
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
96
76
    AC_MSG_CHECKING([how to link with lib[]$1])
97
77
    AC_MSG_RESULT([$LIB[]NAME])
98
78
  else
102
82
    CPPFLAGS="$ac_save_CPPFLAGS"
103
83
    LIB[]NAME=
104
84
    LTLIB[]NAME=
105
 
    LIB[]NAME[]_PREFIX=
106
85
  fi
107
86
  AC_SUBST([HAVE_LIB]NAME)
108
87
  AC_SUBST([LIB]NAME)
109
88
  AC_SUBST([LTLIB]NAME)
110
 
  AC_SUBST([LIB]NAME[_PREFIX])
111
 
  popdef([NAME])
112
 
  popdef([Name])
 
89
  undefine([Name])
 
90
  undefine([NAME])
113
91
])
114
92
 
115
93
dnl Determine the platform dependent parameters needed to use rpath:
116
 
dnl   acl_libext,
117
 
dnl   acl_shlibext,
118
 
dnl   acl_hardcode_libdir_flag_spec,
119
 
dnl   acl_hardcode_libdir_separator,
120
 
dnl   acl_hardcode_direct,
121
 
dnl   acl_hardcode_minus_L.
 
94
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
 
95
dnl hardcode_direct, hardcode_minus_L.
122
96
AC_DEFUN([AC_LIB_RPATH],
123
97
[
124
98
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
127
101
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
128
102
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
129
103
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
130
 
  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
 
104
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
131
105
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
132
106
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
133
107
    . ./conftest.sh
135
109
    acl_cv_rpath=done
136
110
  ])
137
111
  wl="$acl_cv_wl"
138
 
  acl_libext="$acl_cv_libext"
139
 
  acl_shlibext="$acl_cv_shlibext"
140
 
  acl_libname_spec="$acl_cv_libname_spec"
141
 
  acl_library_names_spec="$acl_cv_library_names_spec"
142
 
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
143
 
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
144
 
  acl_hardcode_direct="$acl_cv_hardcode_direct"
145
 
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
112
  libext="$acl_cv_libext"
 
113
  shlibext="$acl_cv_shlibext"
 
114
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
115
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
116
  hardcode_direct="$acl_cv_hardcode_direct"
 
117
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
146
118
  dnl Determine whether the user wants rpath handling at all.
147
 
  AC_ARG_ENABLE([rpath],
 
119
  AC_ARG_ENABLE(rpath,
148
120
    [  --disable-rpath         do not hardcode runtime library paths],
149
121
    :, enable_rpath=yes)
150
122
])
151
123
 
152
 
dnl AC_LIB_FROMPACKAGE(name, package)
153
 
dnl declares that libname comes from the given package. The configure file
154
 
dnl will then not have a --with-libname-prefix option but a
155
 
dnl --with-package-prefix option. Several libraries can come from the same
156
 
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
157
 
dnl macro call that searches for libname.
158
 
AC_DEFUN([AC_LIB_FROMPACKAGE],
159
 
[
160
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
161
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
162
 
  define([acl_frompackage_]NAME, [$2])
163
 
  popdef([NAME])
164
 
  pushdef([PACK],[$2])
165
 
  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
166
 
                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
167
 
  define([acl_libsinpackage_]PACKUP,
168
 
    m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
169
 
  popdef([PACKUP])
170
 
  popdef([PACK])
171
 
])
172
 
 
173
124
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
174
125
dnl the libraries corresponding to explicit and implicit dependencies.
175
126
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
176
 
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
177
 
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
178
127
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
179
128
[
180
129
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
181
 
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
182
 
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
183
 
  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
184
 
  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
185
 
                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
186
 
  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
187
 
  dnl Autoconf >= 2.61 supports dots in --with options.
188
 
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
 
130
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
131
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
189
132
  dnl By default, look in $includedir and $libdir.
190
133
  use_additional=yes
191
134
  AC_LIB_WITH_FINAL_PREFIX([
192
135
    eval additional_includedir=\"$includedir\"
193
136
    eval additional_libdir=\"$libdir\"
194
137
  ])
195
 
  AC_ARG_WITH(P_A_C_K[-prefix],
196
 
[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
197
 
  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
 
138
  AC_LIB_ARG_WITH([lib$1-prefix],
 
139
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
 
140
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
198
141
[
199
142
    if test "X$withval" = "Xno"; then
200
143
      use_additional=no
207
150
      else
208
151
        additional_includedir="$withval/include"
209
152
        additional_libdir="$withval/$acl_libdirstem"
210
 
        if test "$acl_libdirstem2" != "$acl_libdirstem" \
211
 
           && ! test -d "$withval/$acl_libdirstem"; then
212
 
          additional_libdir="$withval/$acl_libdirstem2"
213
 
        fi
214
153
      fi
215
154
    fi
216
155
])
219
158
  LIB[]NAME=
220
159
  LTLIB[]NAME=
221
160
  INC[]NAME=
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=
226
161
  rpathdirs=
227
162
  ltrpathdirs=
228
163
  names_already_handled=
262
197
          found_la=
263
198
          found_so=
264
199
          found_a=
265
 
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
266
 
          if test -n "$acl_shlibext"; then
267
 
            shrext=".$acl_shlibext"             # typically: shrext=.so
268
 
          else
269
 
            shrext=
270
 
          fi
271
200
          if test $use_additional = yes; then
272
 
            dir="$additional_libdir"
273
 
            dnl The same code as in the loop below:
274
 
            dnl First look for a shared library.
275
 
            if test -n "$acl_shlibext"; then
276
 
              if test -f "$dir/$libname$shrext"; then
277
 
                found_dir="$dir"
278
 
                found_so="$dir/$libname$shrext"
279
 
              else
280
 
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
281
 
                  ver=`(cd "$dir" && \
282
 
                        for f in "$libname$shrext".*; do echo "$f"; done \
283
 
                        | sed -e "s,^$libname$shrext\\\\.,," \
284
 
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
285
 
                        | sed 1q ) 2>/dev/null`
286
 
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
287
 
                    found_dir="$dir"
288
 
                    found_so="$dir/$libname$shrext.$ver"
289
 
                  fi
290
 
                else
291
 
                  eval library_names=\"$acl_library_names_spec\"
292
 
                  for f in $library_names; do
293
 
                    if test -f "$dir/$f"; then
294
 
                      found_dir="$dir"
295
 
                      found_so="$dir/$f"
296
 
                      break
297
 
                    fi
298
 
                  done
 
201
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
 
202
              found_dir="$additional_libdir"
 
203
              found_so="$additional_libdir/lib$name.$shlibext"
 
204
              if test -f "$additional_libdir/lib$name.la"; then
 
205
                found_la="$additional_libdir/lib$name.la"
 
206
              fi
 
207
            else
 
208
              if test -f "$additional_libdir/lib$name.$libext"; then
 
209
                found_dir="$additional_libdir"
 
210
                found_a="$additional_libdir/lib$name.$libext"
 
211
                if test -f "$additional_libdir/lib$name.la"; then
 
212
                  found_la="$additional_libdir/lib$name.la"
299
213
                fi
300
214
              fi
301
215
            fi
302
 
            dnl Then look for a static library.
303
 
            if test "X$found_dir" = "X"; then
304
 
              if test -f "$dir/$libname.$acl_libext"; then
305
 
                found_dir="$dir"
306
 
                found_a="$dir/$libname.$acl_libext"
307
 
              fi
308
 
            fi
309
 
            if test "X$found_dir" != "X"; then
310
 
              if test -f "$dir/$libname.la"; then
311
 
                found_la="$dir/$libname.la"
312
 
              fi
313
 
            fi
314
216
          fi
315
217
          if test "X$found_dir" = "X"; then
316
218
            for x in $LDFLAGS $LTLIB[]NAME; do
318
220
              case "$x" in
319
221
                -L*)
320
222
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
321
 
                  dnl First look for a shared library.
322
 
                  if test -n "$acl_shlibext"; then
323
 
                    if test -f "$dir/$libname$shrext"; then
 
223
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
 
224
                    found_dir="$dir"
 
225
                    found_so="$dir/lib$name.$shlibext"
 
226
                    if test -f "$dir/lib$name.la"; then
 
227
                      found_la="$dir/lib$name.la"
 
228
                    fi
 
229
                  else
 
230
                    if test -f "$dir/lib$name.$libext"; then
324
231
                      found_dir="$dir"
325
 
                      found_so="$dir/$libname$shrext"
326
 
                    else
327
 
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
328
 
                        ver=`(cd "$dir" && \
329
 
                              for f in "$libname$shrext".*; do echo "$f"; done \
330
 
                              | sed -e "s,^$libname$shrext\\\\.,," \
331
 
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
332
 
                              | sed 1q ) 2>/dev/null`
333
 
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
334
 
                          found_dir="$dir"
335
 
                          found_so="$dir/$libname$shrext.$ver"
336
 
                        fi
337
 
                      else
338
 
                        eval library_names=\"$acl_library_names_spec\"
339
 
                        for f in $library_names; do
340
 
                          if test -f "$dir/$f"; then
341
 
                            found_dir="$dir"
342
 
                            found_so="$dir/$f"
343
 
                            break
344
 
                          fi
345
 
                        done
 
232
                      found_a="$dir/lib$name.$libext"
 
233
                      if test -f "$dir/lib$name.la"; then
 
234
                        found_la="$dir/lib$name.la"
346
235
                      fi
347
236
                    fi
348
237
                  fi
349
 
                  dnl Then look for a static library.
350
 
                  if test "X$found_dir" = "X"; then
351
 
                    if test -f "$dir/$libname.$acl_libext"; then
352
 
                      found_dir="$dir"
353
 
                      found_a="$dir/$libname.$acl_libext"
354
 
                    fi
355
 
                  fi
356
 
                  if test "X$found_dir" != "X"; then
357
 
                    if test -f "$dir/$libname.la"; then
358
 
                      found_la="$dir/$libname.la"
359
 
                    fi
360
 
                  fi
361
238
                  ;;
362
239
              esac
363
240
              if test "X$found_dir" != "X"; then
372
249
              dnl Linking with a shared library. We attempt to hardcode its
373
250
              dnl directory into the executable's runpath, unless it's the
374
251
              dnl standard /usr/lib.
375
 
              if test "$enable_rpath" = no \
376
 
                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
377
 
                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
 
252
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
378
253
                dnl No hardcoding is needed.
379
254
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
380
255
              else
393
268
                  ltrpathdirs="$ltrpathdirs $found_dir"
394
269
                fi
395
270
                dnl The hardcoding into $LIBNAME is system dependent.
396
 
                if test "$acl_hardcode_direct" = yes; then
 
271
                if test "$hardcode_direct" = yes; then
397
272
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
398
273
                  dnl resulting binary.
399
274
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
400
275
                else
401
 
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
276
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
402
277
                    dnl Use an explicit option to hardcode DIR into the resulting
403
278
                    dnl binary.
404
279
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
429
304
                    if test -z "$haveit"; then
430
305
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
431
306
                    fi
432
 
                    if test "$acl_hardcode_minus_L" != no; then
 
307
                    if test "$hardcode_minus_L" != no; then
433
308
                      dnl FIXME: Not sure whether we should use
434
309
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
435
310
                      dnl here.
436
311
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
437
312
                    else
438
 
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
 
313
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
439
314
                      dnl here, because this doesn't fit in flags passed to the
440
315
                      dnl compiler. So give up. No hardcoding. This affects only
441
316
                      dnl very old systems.
462
337
            case "$found_dir" in
463
338
              */$acl_libdirstem | */$acl_libdirstem/)
464
339
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
465
 
                if test "$name" = '$1'; then
466
 
                  LIB[]NAME[]_PREFIX="$basedir"
467
 
                fi
468
 
                additional_includedir="$basedir/include"
469
 
                ;;
470
 
              */$acl_libdirstem2 | */$acl_libdirstem2/)
471
 
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
472
 
                if test "$name" = '$1'; then
473
 
                  LIB[]NAME[]_PREFIX="$basedir"
474
 
                fi
475
340
                additional_includedir="$basedir/include"
476
341
                ;;
477
342
            esac
532
397
                    dnl   3. if it's already present in $LDFLAGS or the already
533
398
                    dnl      constructed $LIBNAME,
534
399
                    dnl   4. if it doesn't exist as a directory.
535
 
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
536
 
                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
 
400
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
537
401
                      haveit=
538
 
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
539
 
                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
 
402
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
540
403
                        if test -n "$GCC"; then
541
404
                          case $host_os in
542
405
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
635
498
    done
636
499
  done
637
500
  if test "X$rpathdirs" != "X"; then
638
 
    if test -n "$acl_hardcode_libdir_separator"; then
 
501
    if test -n "$hardcode_libdir_separator"; then
639
502
      dnl Weird platform: only the last -rpath option counts, the user must
640
503
      dnl pass all path elements in one option. We can arrange that for a
641
504
      dnl single library, but not when more than one $LIBNAMEs are used.
642
505
      alldirs=
643
506
      for found_dir in $rpathdirs; do
644
 
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
 
507
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
645
508
      done
646
 
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
 
509
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
647
510
      acl_save_libdir="$libdir"
648
511
      libdir="$alldirs"
649
 
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
512
      eval flag=\"$hardcode_libdir_flag_spec\"
650
513
      libdir="$acl_save_libdir"
651
514
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
652
515
    else
654
517
      for found_dir in $rpathdirs; do
655
518
        acl_save_libdir="$libdir"
656
519
        libdir="$found_dir"
657
 
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
520
        eval flag=\"$hardcode_libdir_flag_spec\"
658
521
        libdir="$acl_save_libdir"
659
522
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
660
523
      done
667
530
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
668
531
    done
669
532
  fi
670
 
  popdef([P_A_C_K])
671
 
  popdef([PACKLIBS])
672
 
  popdef([PACKUP])
673
 
  popdef([PACK])
674
 
  popdef([NAME])
675
533
])
676
534
 
677
535
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
708
566
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
709
567
  $1=
710
568
  if test "$enable_rpath" != no; then
711
 
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
569
    if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
712
570
      dnl Use an explicit option to hardcode directories into the resulting
713
571
      dnl binary.
714
572
      rpathdirs=
717
575
        if test -n "$next"; then
718
576
          dir="$next"
719
577
          dnl No need to hardcode the standard /usr/lib.
720
 
          if test "X$dir" != "X/usr/$acl_libdirstem" \
721
 
             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
 
578
          if test "X$dir" != "X/usr/$acl_libdirstem"; then
722
579
            rpathdirs="$rpathdirs $dir"
723
580
          fi
724
581
          next=
727
584
            -L) next=yes ;;
728
585
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
729
586
                 dnl No need to hardcode the standard /usr/lib.
730
 
                 if test "X$dir" != "X/usr/$acl_libdirstem" \
731
 
                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
 
587
                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
732
588
                   rpathdirs="$rpathdirs $dir"
733
589
                 fi
734
590
                 next= ;;
744
600
          done
745
601
        else
746
602
          dnl The linker is used for linking directly.
747
 
          if test -n "$acl_hardcode_libdir_separator"; then
 
603
          if test -n "$hardcode_libdir_separator"; then
748
604
            dnl Weird platform: only the last -rpath option counts, the user
749
605
            dnl must pass all path elements in one option.
750
606
            alldirs=
751
607
            for dir in $rpathdirs; do
752
 
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
 
608
              alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
753
609
            done
754
610
            acl_save_libdir="$libdir"
755
611
            libdir="$alldirs"
756
 
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
612
            eval flag=\"$hardcode_libdir_flag_spec\"
757
613
            libdir="$acl_save_libdir"
758
614
            $1="$flag"
759
615
          else
761
617
            for dir in $rpathdirs; do
762
618
              acl_save_libdir="$libdir"
763
619
              libdir="$dir"
764
 
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
620
              eval flag=\"$hardcode_libdir_flag_spec\"
765
621
              libdir="$acl_save_libdir"
766
622
              $1="${$1}${$1:+ }$flag"
767
623
            done