]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pkgs/ppl/patches/ppl-0.10.2-m4-update.patch
Remove legacy build system.
[people/ms/ipfire-3.x.git] / pkgs / ppl / patches / ppl-0.10.2-m4-update.patch
1 From e3460918400e04cf24fda33ff0cf9d18a95840b8 Mon Sep 17 00:00:00 2001
2 From: Roberto Bagnara <bagnara@cs.unipr.it>
3 Date: Tue, 12 May 2009 15:49:10 +0200
4 Subject: [PATCH] Updated from Gnulib.
5
6 ---
7 m4/lib-ld.m4 | 14 +-
8 m4/lib-link.m4 | 352 +++++++++++++++++++++++++++++++++++++++++++-----------
9 m4/lib-prefix.m4 | 81 ++++++++++++-
10 3 files changed, 363 insertions(+), 84 deletions(-)
11
12 diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
13 index 96c4e2c..e4863f2 100644
14 --- a/m4/lib-ld.m4
15 +++ b/m4/lib-ld.m4
16 @@ -1,5 +1,5 @@
17 -# lib-ld.m4 serial 3 (gettext-0.13)
18 -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
19 +# lib-ld.m4 serial 4 (gettext-0.18)
20 +dnl Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc.
21 dnl This file is free software; the Free Software Foundation
22 dnl gives unlimited permission to copy and/or distribute it,
23 dnl with or without modifications, as long as this notice is preserved.
24 @@ -10,7 +10,7 @@ dnl with libtool.m4.
25
26 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
27 AC_DEFUN([AC_LIB_PROG_LD_GNU],
28 -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
29 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
30 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
31 case `$LD -v 2>&1 </dev/null` in
32 *GNU* | *'with BFD'*)
33 @@ -23,7 +23,7 @@ with_gnu_ld=$acl_cv_prog_gnu_ld
34
35 dnl From libtool-1.4. Sets the variable LD.
36 AC_DEFUN([AC_LIB_PROG_LD],
37 -[AC_ARG_WITH(gnu-ld,
38 +[AC_ARG_WITH([gnu-ld],
39 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
40 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
41 AC_REQUIRE([AC_PROG_CC])dnl
42 @@ -77,7 +77,7 @@ elif test "$with_gnu_ld" = yes; then
43 else
44 AC_MSG_CHECKING([for non-GNU ld])
45 fi
46 -AC_CACHE_VAL(acl_cv_path_LD,
47 +AC_CACHE_VAL([acl_cv_path_LD],
48 [if test -z "$LD"; then
49 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
50 for ac_dir in $PATH; do
51 @@ -101,9 +101,9 @@ else
52 fi])
53 LD="$acl_cv_path_LD"
54 if test -n "$LD"; then
55 - AC_MSG_RESULT($LD)
56 + AC_MSG_RESULT([$LD])
57 else
58 - AC_MSG_RESULT(no)
59 + AC_MSG_RESULT([no])
60 fi
61 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
62 AC_LIB_PROG_LD_GNU
63 diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
64 index ea0b0c4..2144203 100644
65 --- a/m4/lib-link.m4
66 +++ b/m4/lib-link.m4
67 @@ -1,58 +1,66 @@
68 -# lib-link.m4 serial 6 (gettext-0.14.3)
69 -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
70 +# lib-link.m4 serial 19 (gettext-0.18)
71 +dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
72 dnl This file is free software; the Free Software Foundation
73 dnl gives unlimited permission to copy and/or distribute it,
74 dnl with or without modifications, as long as this notice is preserved.
75
76 dnl From Bruno Haible.
77
78 -AC_PREREQ(2.50)
79 +AC_PREREQ([2.54])
80
81 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
82 dnl the libraries corresponding to explicit and implicit dependencies.
83 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
84 dnl augments the CPPFLAGS variable.
85 +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
86 +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
87 AC_DEFUN([AC_LIB_LINKFLAGS],
88 [
89 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
90 AC_REQUIRE([AC_LIB_RPATH])
91 - define([Name],[translit([$1],[./-], [___])])
92 - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
93 - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
94 + pushdef([Name],[translit([$1],[./-], [___])])
95 + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
96 + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
97 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
98 AC_LIB_LINKFLAGS_BODY([$1], [$2])
99 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
100 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
101 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
102 + ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
103 ])
104 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
105 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
106 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
107 + LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
108 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
109 AC_SUBST([LIB]NAME)
110 AC_SUBST([LTLIB]NAME)
111 + AC_SUBST([LIB]NAME[_PREFIX])
112 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
113 dnl results of this search when this library appears as a dependency.
114 HAVE_LIB[]NAME=yes
115 - undefine([Name])
116 - undefine([NAME])
117 + popdef([NAME])
118 + popdef([Name])
119 ])
120
121 -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
122 +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
123 dnl searches for libname and the libraries corresponding to explicit and
124 dnl implicit dependencies, together with the specified include files and
125 -dnl the ability to compile and link the specified testcode. If found, it
126 -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
127 -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
128 +dnl the ability to compile and link the specified testcode. The missing-message
129 +dnl defaults to 'no' and may contain additional hints for the user.
130 +dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
131 +dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
132 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
133 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
134 +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
135 +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
136 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
137 [
138 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
139 AC_REQUIRE([AC_LIB_RPATH])
140 - define([Name],[translit([$1],[./-], [___])])
141 - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
142 - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
143 + pushdef([Name],[translit([$1],[./-], [___])])
144 + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
145 + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
146
147 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
148 dnl accordingly.
149 @@ -67,12 +75,14 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
150 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
151 ac_save_LIBS="$LIBS"
152 LIBS="$LIBS $LIB[]NAME"
153 - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
154 + AC_TRY_LINK([$3], [$4],
155 + [ac_cv_lib[]Name=yes],
156 + [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
157 LIBS="$ac_save_LIBS"
158 ])
159 if test "$ac_cv_lib[]Name" = yes; then
160 HAVE_LIB[]NAME=yes
161 - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
162 + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib[]$1 library.])
163 AC_MSG_CHECKING([how to link with lib[]$1])
164 AC_MSG_RESULT([$LIB[]NAME])
165 else
166 @@ -82,17 +92,23 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
167 CPPFLAGS="$ac_save_CPPFLAGS"
168 LIB[]NAME=
169 LTLIB[]NAME=
170 + LIB[]NAME[]_PREFIX=
171 fi
172 AC_SUBST([HAVE_LIB]NAME)
173 AC_SUBST([LIB]NAME)
174 AC_SUBST([LTLIB]NAME)
175 - undefine([Name])
176 - undefine([NAME])
177 + AC_SUBST([LIB]NAME[_PREFIX])
178 + popdef([NAME])
179 + popdef([Name])
180 ])
181
182 dnl Determine the platform dependent parameters needed to use rpath:
183 -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
184 -dnl hardcode_direct, hardcode_minus_L.
185 +dnl acl_libext,
186 +dnl acl_shlibext,
187 +dnl acl_hardcode_libdir_flag_spec,
188 +dnl acl_hardcode_libdir_separator,
189 +dnl acl_hardcode_direct,
190 +dnl acl_hardcode_minus_L.
191 AC_DEFUN([AC_LIB_RPATH],
192 [
193 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
194 @@ -101,7 +117,7 @@ AC_DEFUN([AC_LIB_RPATH],
195 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
196 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
197 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
198 - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
199 + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
200 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
201 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
202 . ./conftest.sh
203 @@ -109,34 +125,66 @@ AC_DEFUN([AC_LIB_RPATH],
204 acl_cv_rpath=done
205 ])
206 wl="$acl_cv_wl"
207 - libext="$acl_cv_libext"
208 - shlibext="$acl_cv_shlibext"
209 - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
210 - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
211 - hardcode_direct="$acl_cv_hardcode_direct"
212 - hardcode_minus_L="$acl_cv_hardcode_minus_L"
213 + acl_libext="$acl_cv_libext"
214 + acl_shlibext="$acl_cv_shlibext"
215 + acl_libname_spec="$acl_cv_libname_spec"
216 + acl_library_names_spec="$acl_cv_library_names_spec"
217 + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
218 + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
219 + acl_hardcode_direct="$acl_cv_hardcode_direct"
220 + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
221 dnl Determine whether the user wants rpath handling at all.
222 - AC_ARG_ENABLE(rpath,
223 + AC_ARG_ENABLE([rpath],
224 [ --disable-rpath do not hardcode runtime library paths],
225 :, enable_rpath=yes)
226 ])
227
228 +dnl AC_LIB_FROMPACKAGE(name, package)
229 +dnl declares that libname comes from the given package. The configure file
230 +dnl will then not have a --with-libname-prefix option but a
231 +dnl --with-package-prefix option. Several libraries can come from the same
232 +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
233 +dnl macro call that searches for libname.
234 +AC_DEFUN([AC_LIB_FROMPACKAGE],
235 +[
236 + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
237 + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
238 + define([acl_frompackage_]NAME, [$2])
239 + popdef([NAME])
240 + pushdef([PACK],[$2])
241 + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
242 + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
243 + define([acl_libsinpackage_]PACKUP,
244 + m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
245 + popdef([PACKUP])
246 + popdef([PACK])
247 +])
248 +
249 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
250 dnl the libraries corresponding to explicit and implicit dependencies.
251 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
252 +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
253 +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
254 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
255 [
256 - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
257 - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
258 + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
259 + pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
260 + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
261 + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
262 + pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
263 + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
264 + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
265 + dnl Autoconf >= 2.61 supports dots in --with options.
266 + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
267 dnl By default, look in $includedir and $libdir.
268 use_additional=yes
269 AC_LIB_WITH_FINAL_PREFIX([
270 eval additional_includedir=\"$includedir\"
271 eval additional_libdir=\"$libdir\"
272 ])
273 - AC_LIB_ARG_WITH([lib$1-prefix],
274 -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
275 - --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
276 + AC_ARG_WITH(P_A_C_K[-prefix],
277 +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
278 + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
279 [
280 if test "X$withval" = "Xno"; then
281 use_additional=no
282 @@ -148,7 +196,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
283 ])
284 else
285 additional_includedir="$withval/include"
286 - additional_libdir="$withval/lib"
287 + additional_libdir="$withval/$acl_libdirstem"
288 + if test "$acl_libdirstem2" != "$acl_libdirstem" \
289 + && ! test -d "$withval/$acl_libdirstem"; then
290 + additional_libdir="$withval/$acl_libdirstem2"
291 + fi
292 fi
293 fi
294 ])
295 @@ -157,6 +209,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
296 LIB[]NAME=
297 LTLIB[]NAME=
298 INC[]NAME=
299 + LIB[]NAME[]_PREFIX=
300 rpathdirs=
301 ltrpathdirs=
302 names_already_handled=
303 @@ -196,22 +249,55 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
304 found_la=
305 found_so=
306 found_a=
307 + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
308 + if test -n "$acl_shlibext"; then
309 + shrext=".$acl_shlibext" # typically: shrext=.so
310 + else
311 + shrext=
312 + fi
313 if test $use_additional = yes; then
314 - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
315 - found_dir="$additional_libdir"
316 - found_so="$additional_libdir/lib$name.$shlibext"
317 - if test -f "$additional_libdir/lib$name.la"; then
318 - found_la="$additional_libdir/lib$name.la"
319 - fi
320 - else
321 - if test -f "$additional_libdir/lib$name.$libext"; then
322 - found_dir="$additional_libdir"
323 - found_a="$additional_libdir/lib$name.$libext"
324 - if test -f "$additional_libdir/lib$name.la"; then
325 - found_la="$additional_libdir/lib$name.la"
326 + dir="$additional_libdir"
327 + dnl The same code as in the loop below:
328 + dnl First look for a shared library.
329 + if test -n "$acl_shlibext"; then
330 + if test -f "$dir/$libname$shrext"; then
331 + found_dir="$dir"
332 + found_so="$dir/$libname$shrext"
333 + else
334 + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
335 + ver=`(cd "$dir" && \
336 + for f in "$libname$shrext".*; do echo "$f"; done \
337 + | sed -e "s,^$libname$shrext\\\\.,," \
338 + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
339 + | sed 1q ) 2>/dev/null`
340 + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
341 + found_dir="$dir"
342 + found_so="$dir/$libname$shrext.$ver"
343 + fi
344 + else
345 + eval library_names=\"$acl_library_names_spec\"
346 + for f in $library_names; do
347 + if test -f "$dir/$f"; then
348 + found_dir="$dir"
349 + found_so="$dir/$f"
350 + break
351 + fi
352 + done
353 fi
354 fi
355 fi
356 + dnl Then look for a static library.
357 + if test "X$found_dir" = "X"; then
358 + if test -f "$dir/$libname.$acl_libext"; then
359 + found_dir="$dir"
360 + found_a="$dir/$libname.$acl_libext"
361 + fi
362 + fi
363 + if test "X$found_dir" != "X"; then
364 + if test -f "$dir/$libname.la"; then
365 + found_la="$dir/$libname.la"
366 + fi
367 + fi
368 fi
369 if test "X$found_dir" = "X"; then
370 for x in $LDFLAGS $LTLIB[]NAME; do
371 @@ -219,21 +305,46 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
372 case "$x" in
373 -L*)
374 dir=`echo "X$x" | sed -e 's/^X-L//'`
375 - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
376 - found_dir="$dir"
377 - found_so="$dir/lib$name.$shlibext"
378 - if test -f "$dir/lib$name.la"; then
379 - found_la="$dir/lib$name.la"
380 - fi
381 - else
382 - if test -f "$dir/lib$name.$libext"; then
383 + dnl First look for a shared library.
384 + if test -n "$acl_shlibext"; then
385 + if test -f "$dir/$libname$shrext"; then
386 found_dir="$dir"
387 - found_a="$dir/lib$name.$libext"
388 - if test -f "$dir/lib$name.la"; then
389 - found_la="$dir/lib$name.la"
390 + found_so="$dir/$libname$shrext"
391 + else
392 + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
393 + ver=`(cd "$dir" && \
394 + for f in "$libname$shrext".*; do echo "$f"; done \
395 + | sed -e "s,^$libname$shrext\\\\.,," \
396 + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
397 + | sed 1q ) 2>/dev/null`
398 + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
399 + found_dir="$dir"
400 + found_so="$dir/$libname$shrext.$ver"
401 + fi
402 + else
403 + eval library_names=\"$acl_library_names_spec\"
404 + for f in $library_names; do
405 + if test -f "$dir/$f"; then
406 + found_dir="$dir"
407 + found_so="$dir/$f"
408 + break
409 + fi
410 + done
411 fi
412 fi
413 fi
414 + dnl Then look for a static library.
415 + if test "X$found_dir" = "X"; then
416 + if test -f "$dir/$libname.$acl_libext"; then
417 + found_dir="$dir"
418 + found_a="$dir/$libname.$acl_libext"
419 + fi
420 + fi
421 + if test "X$found_dir" != "X"; then
422 + if test -f "$dir/$libname.la"; then
423 + found_la="$dir/$libname.la"
424 + fi
425 + fi
426 ;;
427 esac
428 if test "X$found_dir" != "X"; then
429 @@ -248,7 +359,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
430 dnl Linking with a shared library. We attempt to hardcode its
431 dnl directory into the executable's runpath, unless it's the
432 dnl standard /usr/lib.
433 - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
434 + if test "$enable_rpath" = no \
435 + || test "X$found_dir" = "X/usr/$acl_libdirstem" \
436 + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
437 dnl No hardcoding is needed.
438 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
439 else
440 @@ -267,12 +380,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
441 ltrpathdirs="$ltrpathdirs $found_dir"
442 fi
443 dnl The hardcoding into $LIBNAME is system dependent.
444 - if test "$hardcode_direct" = yes; then
445 + if test "$acl_hardcode_direct" = yes; then
446 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
447 dnl resulting binary.
448 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
449 else
450 - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
451 + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
452 dnl Use an explicit option to hardcode DIR into the resulting
453 dnl binary.
454 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
455 @@ -303,13 +416,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
456 if test -z "$haveit"; then
457 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
458 fi
459 - if test "$hardcode_minus_L" != no; then
460 + if test "$acl_hardcode_minus_L" != no; then
461 dnl FIXME: Not sure whether we should use
462 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
463 dnl here.
464 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
465 else
466 - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
467 + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
468 dnl here, because this doesn't fit in flags passed to the
469 dnl compiler. So give up. No hardcoding. This affects only
470 dnl very old systems.
471 @@ -334,8 +447,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
472 dnl Assume the include files are nearby.
473 additional_includedir=
474 case "$found_dir" in
475 - */lib | */lib/)
476 - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
477 + */$acl_libdirstem | */$acl_libdirstem/)
478 + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
479 + if test "$name" = '$1'; then
480 + LIB[]NAME[]_PREFIX="$basedir"
481 + fi
482 + additional_includedir="$basedir/include"
483 + ;;
484 + */$acl_libdirstem2 | */$acl_libdirstem2/)
485 + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
486 + if test "$name" = '$1'; then
487 + LIB[]NAME[]_PREFIX="$basedir"
488 + fi
489 additional_includedir="$basedir/include"
490 ;;
491 esac
492 @@ -396,9 +519,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
493 dnl 3. if it's already present in $LDFLAGS or the already
494 dnl constructed $LIBNAME,
495 dnl 4. if it doesn't exist as a directory.
496 - if test "X$additional_libdir" != "X/usr/lib"; then
497 + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
498 + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
499 haveit=
500 - if test "X$additional_libdir" = "X/usr/local/lib"; then
501 + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
502 + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
503 if test -n "$GCC"; then
504 case $host_os in
505 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
506 @@ -497,18 +622,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
507 done
508 done
509 if test "X$rpathdirs" != "X"; then
510 - if test -n "$hardcode_libdir_separator"; then
511 + if test -n "$acl_hardcode_libdir_separator"; then
512 dnl Weird platform: only the last -rpath option counts, the user must
513 dnl pass all path elements in one option. We can arrange that for a
514 dnl single library, but not when more than one $LIBNAMEs are used.
515 alldirs=
516 for found_dir in $rpathdirs; do
517 - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
518 + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
519 done
520 - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
521 + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
522 acl_save_libdir="$libdir"
523 libdir="$alldirs"
524 - eval flag=\"$hardcode_libdir_flag_spec\"
525 + eval flag=\"$acl_hardcode_libdir_flag_spec\"
526 libdir="$acl_save_libdir"
527 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
528 else
529 @@ -516,7 +641,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
530 for found_dir in $rpathdirs; do
531 acl_save_libdir="$libdir"
532 libdir="$found_dir"
533 - eval flag=\"$hardcode_libdir_flag_spec\"
534 + eval flag=\"$acl_hardcode_libdir_flag_spec\"
535 libdir="$acl_save_libdir"
536 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
537 done
538 @@ -529,6 +654,11 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
539 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
540 done
541 fi
542 + popdef([P_A_C_K])
543 + popdef([PACKLIBS])
544 + popdef([PACKUP])
545 + popdef([PACK])
546 + popdef([NAME])
547 ])
548
549 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
550 @@ -551,3 +681,81 @@ AC_DEFUN([AC_LIB_APPENDTOVAR],
551 fi
552 done
553 ])
554 +
555 +dnl For those cases where a variable contains several -L and -l options
556 +dnl referring to unknown libraries and directories, this macro determines the
557 +dnl necessary additional linker options for the runtime path.
558 +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
559 +dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
560 +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
561 +dnl otherwise linking without libtool is assumed.
562 +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
563 +[
564 + AC_REQUIRE([AC_LIB_RPATH])
565 + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
566 + $1=
567 + if test "$enable_rpath" != no; then
568 + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
569 + dnl Use an explicit option to hardcode directories into the resulting
570 + dnl binary.
571 + rpathdirs=
572 + next=
573 + for opt in $2; do
574 + if test -n "$next"; then
575 + dir="$next"
576 + dnl No need to hardcode the standard /usr/lib.
577 + if test "X$dir" != "X/usr/$acl_libdirstem" \
578 + && test "X$dir" != "X/usr/$acl_libdirstem2"; then
579 + rpathdirs="$rpathdirs $dir"
580 + fi
581 + next=
582 + else
583 + case $opt in
584 + -L) next=yes ;;
585 + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
586 + dnl No need to hardcode the standard /usr/lib.
587 + if test "X$dir" != "X/usr/$acl_libdirstem" \
588 + && test "X$dir" != "X/usr/$acl_libdirstem2"; then
589 + rpathdirs="$rpathdirs $dir"
590 + fi
591 + next= ;;
592 + *) next= ;;
593 + esac
594 + fi
595 + done
596 + if test "X$rpathdirs" != "X"; then
597 + if test -n ""$3""; then
598 + dnl libtool is used for linking. Use -R options.
599 + for dir in $rpathdirs; do
600 + $1="${$1}${$1:+ }-R$dir"
601 + done
602 + else
603 + dnl The linker is used for linking directly.
604 + if test -n "$acl_hardcode_libdir_separator"; then
605 + dnl Weird platform: only the last -rpath option counts, the user
606 + dnl must pass all path elements in one option.
607 + alldirs=
608 + for dir in $rpathdirs; do
609 + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
610 + done
611 + acl_save_libdir="$libdir"
612 + libdir="$alldirs"
613 + eval flag=\"$acl_hardcode_libdir_flag_spec\"
614 + libdir="$acl_save_libdir"
615 + $1="$flag"
616 + else
617 + dnl The -rpath options are cumulative.
618 + for dir in $rpathdirs; do
619 + acl_save_libdir="$libdir"
620 + libdir="$dir"
621 + eval flag=\"$acl_hardcode_libdir_flag_spec\"
622 + libdir="$acl_save_libdir"
623 + $1="${$1}${$1:+ }$flag"
624 + done
625 + fi
626 + fi
627 + fi
628 + fi
629 + fi
630 + AC_SUBST([$1])
631 +])
632 diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
633 index 0d895ca..4b7ee33 100644
634 --- a/m4/lib-prefix.m4
635 +++ b/m4/lib-prefix.m4
636 @@ -1,5 +1,5 @@
637 -# lib-prefix.m4 serial 4 (gettext-0.14.2)
638 -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
639 +# lib-prefix.m4 serial 7 (gettext-0.18)
640 +dnl Copyright (C) 2001-2005, 2008-2009 Free Software Foundation, Inc.
641 dnl This file is free software; the Free Software Foundation
642 dnl gives unlimited permission to copy and/or distribute it,
643 dnl with or without modifications, as long as this notice is preserved.
644 @@ -24,6 +24,7 @@ AC_DEFUN([AC_LIB_PREFIX],
645 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
646 AC_REQUIRE([AC_PROG_CC])
647 AC_REQUIRE([AC_CANONICAL_HOST])
648 + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
649 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
650 dnl By default, look in $includedir and $libdir.
651 use_additional=yes
652 @@ -45,7 +46,7 @@ AC_DEFUN([AC_LIB_PREFIX],
653 ])
654 else
655 additional_includedir="$withval/include"
656 - additional_libdir="$withval/lib"
657 + additional_libdir="$withval/$acl_libdirstem"
658 fi
659 fi
660 ])
661 @@ -87,7 +88,7 @@ AC_DEFUN([AC_LIB_PREFIX],
662 dnl 2. if it's already present in $LDFLAGS,
663 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
664 dnl 4. if it doesn't exist as a directory.
665 - if test "X$additional_libdir" != "X/usr/lib"; then
666 + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
667 haveit=
668 for x in $LDFLAGS; do
669 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
670 @@ -97,7 +98,7 @@ AC_DEFUN([AC_LIB_PREFIX],
671 fi
672 done
673 if test -z "$haveit"; then
674 - if test "X$additional_libdir" = "X/usr/local/lib"; then
675 + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
676 if test -n "$GCC"; then
677 case $host_os in
678 linux*) haveit=yes;;
679 @@ -151,3 +152,73 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
680 exec_prefix="$acl_save_exec_prefix"
681 prefix="$acl_save_prefix"
682 ])
683 +
684 +dnl AC_LIB_PREPARE_MULTILIB creates
685 +dnl - a variable acl_libdirstem, containing the basename of the libdir, either
686 +dnl "lib" or "lib64" or "lib/64",
687 +dnl - a variable acl_libdirstem2, as a secondary possible value for
688 +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
689 +dnl "lib/amd64".
690 +AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
691 +[
692 + dnl There is no formal standard regarding lib and lib64.
693 + dnl On glibc systems, the current practice is that on a system supporting
694 + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
695 + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
696 + dnl the compiler's default mode by looking at the compiler's library search
697 + dnl path. If at least one of its elements ends in /lib64 or points to a
698 + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
699 + dnl Otherwise we use the default, namely "lib".
700 + dnl On Solaris systems, the current practice is that on a system supporting
701 + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
702 + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
703 + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
704 + AC_REQUIRE([AC_CANONICAL_HOST])
705 + acl_libdirstem=lib
706 + acl_libdirstem2=
707 + case "$host_os" in
708 + solaris*)
709 + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
710 + dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
711 + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
712 + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
713 + dnl symlink is missing, so we set acl_libdirstem2 too.
714 + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
715 + [AC_EGREP_CPP([sixtyfour bits], [
716 +#ifdef _LP64
717 +sixtyfour bits
718 +#endif
719 + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
720 + ])
721 + if test $gl_cv_solaris_64bit = yes; then
722 + acl_libdirstem=lib/64
723 + case "$host_cpu" in
724 + sparc*) acl_libdirstem2=lib/sparcv9 ;;
725 + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
726 + esac
727 + fi
728 + ;;
729 + *)
730 + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
731 + if test -n "$searchpath"; then
732 + acl_save_IFS="${IFS= }"; IFS=":"
733 + for searchdir in $searchpath; do
734 + if test -d "$searchdir"; then
735 + case "$searchdir" in
736 + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
737 + */../ | */.. )
738 + # Better ignore directories of this form. They are misleading.
739 + ;;
740 + *) searchdir=`cd "$searchdir" && pwd`
741 + case "$searchdir" in
742 + */lib64 ) acl_libdirstem=lib64 ;;
743 + esac ;;
744 + esac
745 + fi
746 + done
747 + IFS="$acl_save_IFS"
748 + fi
749 + ;;
750 + esac
751 + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
752 +])
753 --
754 1.6.0.6
755