fixed linux-atm
[openwrt/svn-archive/archive.git] / package / linux-atm / patches / 700-libtoolize.patch
1 --- linux-atm-2.4.1.orig/aclocal.m4 2007-10-20 20:43:45.000000000 +0200
2 +++ linux-atm-2.4.1/aclocal.m4 2007-10-20 20:45:30.000000000 +0200
3 @@ -1,993 +1,6 @@
4 -dnl aclocal.m4 generated automatically by aclocal 1.4-p6
5 -
6 -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
7 -dnl This file is free software; the Free Software Foundation
8 -dnl gives unlimited permission to copy and/or distribute it,
9 -dnl with or without modifications, as long as this notice is preserved.
10 -
11 -dnl This program is distributed in the hope that it will be useful,
12 -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13 -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 -dnl PARTICULAR PURPOSE.
15 -
16 -# lib-prefix.m4 serial 4 (gettext-0.14.2)
17 -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
18 -dnl This file is free software; the Free Software Foundation
19 -dnl gives unlimited permission to copy and/or distribute it,
20 -dnl with or without modifications, as long as this notice is preserved.
21 -
22 -dnl From Bruno Haible.
23 -
24 -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
25 -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
26 -dnl require excessive bracketing.
27 -ifdef([AC_HELP_STRING],
28 -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
29 -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
30 -
31 -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
32 -dnl to access previously installed libraries. The basic assumption is that
33 -dnl a user will want packages to use other packages he previously installed
34 -dnl with the same --prefix option.
35 -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
36 -dnl libraries, but is otherwise very convenient.
37 -AC_DEFUN([AC_LIB_PREFIX],
38 -[
39 - AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
40 - AC_REQUIRE([AC_PROG_CC])
41 - AC_REQUIRE([AC_CANONICAL_HOST])
42 - AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
43 - dnl By default, look in $includedir and $libdir.
44 - use_additional=yes
45 - AC_LIB_WITH_FINAL_PREFIX([
46 - eval additional_includedir=\"$includedir\"
47 - eval additional_libdir=\"$libdir\"
48 - ])
49 - AC_LIB_ARG_WITH([lib-prefix],
50 -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
51 - --without-lib-prefix don't search for libraries in includedir and libdir],
52 -[
53 - if test "X$withval" = "Xno"; then
54 - use_additional=no
55 - else
56 - if test "X$withval" = "X"; then
57 - AC_LIB_WITH_FINAL_PREFIX([
58 - eval additional_includedir=\"$includedir\"
59 - eval additional_libdir=\"$libdir\"
60 - ])
61 - else
62 - additional_includedir="$withval/include"
63 - additional_libdir="$withval/lib"
64 - fi
65 - fi
66 -])
67 - if test $use_additional = yes; then
68 - dnl Potentially add $additional_includedir to $CPPFLAGS.
69 - dnl But don't add it
70 - dnl 1. if it's the standard /usr/include,
71 - dnl 2. if it's already present in $CPPFLAGS,
72 - dnl 3. if it's /usr/local/include and we are using GCC on Linux,
73 - dnl 4. if it doesn't exist as a directory.
74 - if test "X$additional_includedir" != "X/usr/include"; then
75 - haveit=
76 - for x in $CPPFLAGS; do
77 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
78 - if test "X$x" = "X-I$additional_includedir"; then
79 - haveit=yes
80 - break
81 - fi
82 - done
83 - if test -z "$haveit"; then
84 - if test "X$additional_includedir" = "X/usr/local/include"; then
85 - if test -n "$GCC"; then
86 - case $host_os in
87 - linux* | gnu* | k*bsd*-gnu) haveit=yes;;
88 - esac
89 - fi
90 - fi
91 - if test -z "$haveit"; then
92 - if test -d "$additional_includedir"; then
93 - dnl Really add $additional_includedir to $CPPFLAGS.
94 - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
95 - fi
96 - fi
97 - fi
98 - fi
99 - dnl Potentially add $additional_libdir to $LDFLAGS.
100 - dnl But don't add it
101 - dnl 1. if it's the standard /usr/lib,
102 - dnl 2. if it's already present in $LDFLAGS,
103 - dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
104 - dnl 4. if it doesn't exist as a directory.
105 - if test "X$additional_libdir" != "X/usr/lib"; then
106 - haveit=
107 - for x in $LDFLAGS; do
108 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
109 - if test "X$x" = "X-L$additional_libdir"; then
110 - haveit=yes
111 - break
112 - fi
113 - done
114 - if test -z "$haveit"; then
115 - if test "X$additional_libdir" = "X/usr/local/lib"; then
116 - if test -n "$GCC"; then
117 - case $host_os in
118 - linux*) haveit=yes;;
119 - esac
120 - fi
121 - fi
122 - if test -z "$haveit"; then
123 - if test -d "$additional_libdir"; then
124 - dnl Really add $additional_libdir to $LDFLAGS.
125 - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
126 - fi
127 - fi
128 - fi
129 - fi
130 - fi
131 -])
132 -
133 -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
134 -dnl acl_final_exec_prefix, containing the values to which $prefix and
135 -dnl $exec_prefix will expand at the end of the configure script.
136 -AC_DEFUN([AC_LIB_PREPARE_PREFIX],
137 -[
138 - dnl Unfortunately, prefix and exec_prefix get only finally determined
139 - dnl at the end of configure.
140 - if test "X$prefix" = "XNONE"; then
141 - acl_final_prefix="$ac_default_prefix"
142 - else
143 - acl_final_prefix="$prefix"
144 - fi
145 - if test "X$exec_prefix" = "XNONE"; then
146 - acl_final_exec_prefix='${prefix}'
147 - else
148 - acl_final_exec_prefix="$exec_prefix"
149 - fi
150 - acl_save_prefix="$prefix"
151 - prefix="$acl_final_prefix"
152 - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
153 - prefix="$acl_save_prefix"
154 -])
155 -
156 -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
157 -dnl variables prefix and exec_prefix bound to the values they will have
158 -dnl at the end of the configure script.
159 -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
160 -[
161 - acl_save_prefix="$prefix"
162 - prefix="$acl_final_prefix"
163 - acl_save_exec_prefix="$exec_prefix"
164 - exec_prefix="$acl_final_exec_prefix"
165 - $1
166 - exec_prefix="$acl_save_exec_prefix"
167 - prefix="$acl_save_prefix"
168 -])
169 -
170 -# lib-link.m4 serial 6 (gettext-0.14.3)
171 -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
172 -dnl This file is free software; the Free Software Foundation
173 -dnl gives unlimited permission to copy and/or distribute it,
174 -dnl with or without modifications, as long as this notice is preserved.
175 -
176 -dnl From Bruno Haible.
177 -
178 -AC_PREREQ(2.50)
179 -
180 -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
181 -dnl the libraries corresponding to explicit and implicit dependencies.
182 -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
183 -dnl augments the CPPFLAGS variable.
184 -AC_DEFUN([AC_LIB_LINKFLAGS],
185 -[
186 - AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
187 - AC_REQUIRE([AC_LIB_RPATH])
188 - define([Name],[translit([$1],[./-], [___])])
189 - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
190 - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
191 - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
192 - AC_LIB_LINKFLAGS_BODY([$1], [$2])
193 - ac_cv_lib[]Name[]_libs="$LIB[]NAME"
194 - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
195 - ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
196 - ])
197 - LIB[]NAME="$ac_cv_lib[]Name[]_libs"
198 - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
199 - INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
200 - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
201 - AC_SUBST([LIB]NAME)
202 - AC_SUBST([LTLIB]NAME)
203 - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
204 - dnl results of this search when this library appears as a dependency.
205 - HAVE_LIB[]NAME=yes
206 - undefine([Name])
207 - undefine([NAME])
208 -])
209 -
210 -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
211 -dnl searches for libname and the libraries corresponding to explicit and
212 -dnl implicit dependencies, together with the specified include files and
213 -dnl the ability to compile and link the specified testcode. If found, it
214 -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
215 -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
216 -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
217 -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
218 -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
219 -[
220 - AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
221 - AC_REQUIRE([AC_LIB_RPATH])
222 - define([Name],[translit([$1],[./-], [___])])
223 - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
224 - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
225 -
226 - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
227 - dnl accordingly.
228 - AC_LIB_LINKFLAGS_BODY([$1], [$2])
229 -
230 - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
231 - dnl because if the user has installed lib[]Name and not disabled its use
232 - dnl via --without-lib[]Name-prefix, he wants to use it.
233 - ac_save_CPPFLAGS="$CPPFLAGS"
234 - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
235 -
236 - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
237 - ac_save_LIBS="$LIBS"
238 - LIBS="$LIBS $LIB[]NAME"
239 - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
240 - LIBS="$ac_save_LIBS"
241 - ])
242 - if test "$ac_cv_lib[]Name" = yes; then
243 - HAVE_LIB[]NAME=yes
244 - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
245 - AC_MSG_CHECKING([how to link with lib[]$1])
246 - AC_MSG_RESULT([$LIB[]NAME])
247 - else
248 - HAVE_LIB[]NAME=no
249 - dnl If $LIB[]NAME didn't lead to a usable library, we don't need
250 - dnl $INC[]NAME either.
251 - CPPFLAGS="$ac_save_CPPFLAGS"
252 - LIB[]NAME=
253 - LTLIB[]NAME=
254 - fi
255 - AC_SUBST([HAVE_LIB]NAME)
256 - AC_SUBST([LIB]NAME)
257 - AC_SUBST([LTLIB]NAME)
258 - undefine([Name])
259 - undefine([NAME])
260 -])
261 -
262 -dnl Determine the platform dependent parameters needed to use rpath:
263 -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
264 -dnl hardcode_direct, hardcode_minus_L.
265 -AC_DEFUN([AC_LIB_RPATH],
266 -[
267 - dnl Tell automake >= 1.10 to complain if config.rpath is missing.
268 - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
269 - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
270 - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
271 - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
272 - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
273 - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
274 - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
275 - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
276 - . ./conftest.sh
277 - rm -f ./conftest.sh
278 - acl_cv_rpath=done
279 - ])
280 - wl="$acl_cv_wl"
281 - libext="$acl_cv_libext"
282 - shlibext="$acl_cv_shlibext"
283 - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
284 - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
285 - hardcode_direct="$acl_cv_hardcode_direct"
286 - hardcode_minus_L="$acl_cv_hardcode_minus_L"
287 - dnl Determine whether the user wants rpath handling at all.
288 - AC_ARG_ENABLE(rpath,
289 - [ --disable-rpath do not hardcode runtime library paths],
290 - :, enable_rpath=yes)
291 -])
292 -
293 -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
294 -dnl the libraries corresponding to explicit and implicit dependencies.
295 -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
296 -AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
297 -[
298 - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
299 - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
300 - dnl By default, look in $includedir and $libdir.
301 - use_additional=yes
302 - AC_LIB_WITH_FINAL_PREFIX([
303 - eval additional_includedir=\"$includedir\"
304 - eval additional_libdir=\"$libdir\"
305 - ])
306 - AC_LIB_ARG_WITH([lib$1-prefix],
307 -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
308 - --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
309 -[
310 - if test "X$withval" = "Xno"; then
311 - use_additional=no
312 - else
313 - if test "X$withval" = "X"; then
314 - AC_LIB_WITH_FINAL_PREFIX([
315 - eval additional_includedir=\"$includedir\"
316 - eval additional_libdir=\"$libdir\"
317 - ])
318 - else
319 - additional_includedir="$withval/include"
320 - additional_libdir="$withval/lib"
321 - fi
322 - fi
323 -])
324 - dnl Search the library and its dependencies in $additional_libdir and
325 - dnl $LDFLAGS. Using breadth-first-seach.
326 - LIB[]NAME=
327 - LTLIB[]NAME=
328 - INC[]NAME=
329 - rpathdirs=
330 - ltrpathdirs=
331 - names_already_handled=
332 - names_next_round='$1 $2'
333 - while test -n "$names_next_round"; do
334 - names_this_round="$names_next_round"
335 - names_next_round=
336 - for name in $names_this_round; do
337 - already_handled=
338 - for n in $names_already_handled; do
339 - if test "$n" = "$name"; then
340 - already_handled=yes
341 - break
342 - fi
343 - done
344 - if test -z "$already_handled"; then
345 - names_already_handled="$names_already_handled $name"
346 - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
347 - dnl or AC_LIB_HAVE_LINKFLAGS call.
348 - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
349 - eval value=\"\$HAVE_LIB$uppername\"
350 - if test -n "$value"; then
351 - if test "$value" = yes; then
352 - eval value=\"\$LIB$uppername\"
353 - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
354 - eval value=\"\$LTLIB$uppername\"
355 - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
356 - else
357 - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
358 - dnl that this library doesn't exist. So just drop it.
359 - :
360 - fi
361 - else
362 - dnl Search the library lib$name in $additional_libdir and $LDFLAGS
363 - dnl and the already constructed $LIBNAME/$LTLIBNAME.
364 - found_dir=
365 - found_la=
366 - found_so=
367 - found_a=
368 - if test $use_additional = yes; then
369 - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
370 - found_dir="$additional_libdir"
371 - found_so="$additional_libdir/lib$name.$shlibext"
372 - if test -f "$additional_libdir/lib$name.la"; then
373 - found_la="$additional_libdir/lib$name.la"
374 - fi
375 - else
376 - if test -f "$additional_libdir/lib$name.$libext"; then
377 - found_dir="$additional_libdir"
378 - found_a="$additional_libdir/lib$name.$libext"
379 - if test -f "$additional_libdir/lib$name.la"; then
380 - found_la="$additional_libdir/lib$name.la"
381 - fi
382 - fi
383 - fi
384 - fi
385 - if test "X$found_dir" = "X"; then
386 - for x in $LDFLAGS $LTLIB[]NAME; do
387 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
388 - case "$x" in
389 - -L*)
390 - dir=`echo "X$x" | sed -e 's/^X-L//'`
391 - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
392 - found_dir="$dir"
393 - found_so="$dir/lib$name.$shlibext"
394 - if test -f "$dir/lib$name.la"; then
395 - found_la="$dir/lib$name.la"
396 - fi
397 - else
398 - if test -f "$dir/lib$name.$libext"; then
399 - found_dir="$dir"
400 - found_a="$dir/lib$name.$libext"
401 - if test -f "$dir/lib$name.la"; then
402 - found_la="$dir/lib$name.la"
403 - fi
404 - fi
405 - fi
406 - ;;
407 - esac
408 - if test "X$found_dir" != "X"; then
409 - break
410 - fi
411 - done
412 - fi
413 - if test "X$found_dir" != "X"; then
414 - dnl Found the library.
415 - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
416 - if test "X$found_so" != "X"; then
417 - dnl Linking with a shared library. We attempt to hardcode its
418 - dnl directory into the executable's runpath, unless it's the
419 - dnl standard /usr/lib.
420 - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
421 - dnl No hardcoding is needed.
422 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
423 - else
424 - dnl Use an explicit option to hardcode DIR into the resulting
425 - dnl binary.
426 - dnl Potentially add DIR to ltrpathdirs.
427 - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
428 - haveit=
429 - for x in $ltrpathdirs; do
430 - if test "X$x" = "X$found_dir"; then
431 - haveit=yes
432 - break
433 - fi
434 - done
435 - if test -z "$haveit"; then
436 - ltrpathdirs="$ltrpathdirs $found_dir"
437 - fi
438 - dnl The hardcoding into $LIBNAME is system dependent.
439 - if test "$hardcode_direct" = yes; then
440 - dnl Using DIR/libNAME.so during linking hardcodes DIR into the
441 - dnl resulting binary.
442 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
443 - else
444 - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
445 - dnl Use an explicit option to hardcode DIR into the resulting
446 - dnl binary.
447 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
448 - dnl Potentially add DIR to rpathdirs.
449 - dnl The rpathdirs will be appended to $LIBNAME at the end.
450 - haveit=
451 - for x in $rpathdirs; do
452 - if test "X$x" = "X$found_dir"; then
453 - haveit=yes
454 - break
455 - fi
456 - done
457 - if test -z "$haveit"; then
458 - rpathdirs="$rpathdirs $found_dir"
459 - fi
460 - else
461 - dnl Rely on "-L$found_dir".
462 - dnl But don't add it if it's already contained in the LDFLAGS
463 - dnl or the already constructed $LIBNAME
464 - haveit=
465 - for x in $LDFLAGS $LIB[]NAME; do
466 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
467 - if test "X$x" = "X-L$found_dir"; then
468 - haveit=yes
469 - break
470 - fi
471 - done
472 - if test -z "$haveit"; then
473 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
474 - fi
475 - if test "$hardcode_minus_L" != no; then
476 - dnl FIXME: Not sure whether we should use
477 - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
478 - dnl here.
479 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
480 - else
481 - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
482 - dnl here, because this doesn't fit in flags passed to the
483 - dnl compiler. So give up. No hardcoding. This affects only
484 - dnl very old systems.
485 - dnl FIXME: Not sure whether we should use
486 - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
487 - dnl here.
488 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
489 - fi
490 - fi
491 - fi
492 - fi
493 - else
494 - if test "X$found_a" != "X"; then
495 - dnl Linking with a static library.
496 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
497 - else
498 - dnl We shouldn't come here, but anyway it's good to have a
499 - dnl fallback.
500 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
501 - fi
502 - fi
503 - dnl Assume the include files are nearby.
504 - additional_includedir=
505 - case "$found_dir" in
506 - */lib | */lib/)
507 - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
508 - additional_includedir="$basedir/include"
509 - ;;
510 - esac
511 - if test "X$additional_includedir" != "X"; then
512 - dnl Potentially add $additional_includedir to $INCNAME.
513 - dnl But don't add it
514 - dnl 1. if it's the standard /usr/include,
515 - dnl 2. if it's /usr/local/include and we are using GCC on Linux,
516 - dnl 3. if it's already present in $CPPFLAGS or the already
517 - dnl constructed $INCNAME,
518 - dnl 4. if it doesn't exist as a directory.
519 - if test "X$additional_includedir" != "X/usr/include"; then
520 - haveit=
521 - if test "X$additional_includedir" = "X/usr/local/include"; then
522 - if test -n "$GCC"; then
523 - case $host_os in
524 - linux* | gnu* | k*bsd*-gnu) haveit=yes;;
525 - esac
526 - fi
527 - fi
528 - if test -z "$haveit"; then
529 - for x in $CPPFLAGS $INC[]NAME; do
530 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
531 - if test "X$x" = "X-I$additional_includedir"; then
532 - haveit=yes
533 - break
534 - fi
535 - done
536 - if test -z "$haveit"; then
537 - if test -d "$additional_includedir"; then
538 - dnl Really add $additional_includedir to $INCNAME.
539 - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
540 - fi
541 - fi
542 - fi
543 - fi
544 - fi
545 - dnl Look for dependencies.
546 - if test -n "$found_la"; then
547 - dnl Read the .la file. It defines the variables
548 - dnl dlname, library_names, old_library, dependency_libs, current,
549 - dnl age, revision, installed, dlopen, dlpreopen, libdir.
550 - save_libdir="$libdir"
551 - case "$found_la" in
552 - */* | *\\*) . "$found_la" ;;
553 - *) . "./$found_la" ;;
554 - esac
555 - libdir="$save_libdir"
556 - dnl We use only dependency_libs.
557 - for dep in $dependency_libs; do
558 - case "$dep" in
559 - -L*)
560 - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
561 - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
562 - dnl But don't add it
563 - dnl 1. if it's the standard /usr/lib,
564 - dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
565 - dnl 3. if it's already present in $LDFLAGS or the already
566 - dnl constructed $LIBNAME,
567 - dnl 4. if it doesn't exist as a directory.
568 - if test "X$additional_libdir" != "X/usr/lib"; then
569 - haveit=
570 - if test "X$additional_libdir" = "X/usr/local/lib"; then
571 - if test -n "$GCC"; then
572 - case $host_os in
573 - linux* | gnu* | k*bsd*-gnu) haveit=yes;;
574 - esac
575 - fi
576 - fi
577 - if test -z "$haveit"; then
578 - haveit=
579 - for x in $LDFLAGS $LIB[]NAME; do
580 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
581 - if test "X$x" = "X-L$additional_libdir"; then
582 - haveit=yes
583 - break
584 - fi
585 - done
586 - if test -z "$haveit"; then
587 - if test -d "$additional_libdir"; then
588 - dnl Really add $additional_libdir to $LIBNAME.
589 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
590 - fi
591 - fi
592 - haveit=
593 - for x in $LDFLAGS $LTLIB[]NAME; do
594 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
595 - if test "X$x" = "X-L$additional_libdir"; then
596 - haveit=yes
597 - break
598 - fi
599 - done
600 - if test -z "$haveit"; then
601 - if test -d "$additional_libdir"; then
602 - dnl Really add $additional_libdir to $LTLIBNAME.
603 - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
604 - fi
605 - fi
606 - fi
607 - fi
608 - ;;
609 - -R*)
610 - dir=`echo "X$dep" | sed -e 's/^X-R//'`
611 - if test "$enable_rpath" != no; then
612 - dnl Potentially add DIR to rpathdirs.
613 - dnl The rpathdirs will be appended to $LIBNAME at the end.
614 - haveit=
615 - for x in $rpathdirs; do
616 - if test "X$x" = "X$dir"; then
617 - haveit=yes
618 - break
619 - fi
620 - done
621 - if test -z "$haveit"; then
622 - rpathdirs="$rpathdirs $dir"
623 - fi
624 - dnl Potentially add DIR to ltrpathdirs.
625 - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
626 - haveit=
627 - for x in $ltrpathdirs; do
628 - if test "X$x" = "X$dir"; then
629 - haveit=yes
630 - break
631 - fi
632 - done
633 - if test -z "$haveit"; then
634 - ltrpathdirs="$ltrpathdirs $dir"
635 - fi
636 - fi
637 - ;;
638 - -l*)
639 - dnl Handle this in the next round.
640 - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
641 - ;;
642 - *.la)
643 - dnl Handle this in the next round. Throw away the .la's
644 - dnl directory; it is already contained in a preceding -L
645 - dnl option.
646 - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
647 - ;;
648 - *)
649 - dnl Most likely an immediate library name.
650 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
651 - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
652 - ;;
653 - esac
654 - done
655 - fi
656 - else
657 - dnl Didn't find the library; assume it is in the system directories
658 - dnl known to the linker and runtime loader. (All the system
659 - dnl directories known to the linker should also be known to the
660 - dnl runtime loader, otherwise the system is severely misconfigured.)
661 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
662 - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
663 - fi
664 - fi
665 - fi
666 - done
667 - done
668 - if test "X$rpathdirs" != "X"; then
669 - if test -n "$hardcode_libdir_separator"; then
670 - dnl Weird platform: only the last -rpath option counts, the user must
671 - dnl pass all path elements in one option. We can arrange that for a
672 - dnl single library, but not when more than one $LIBNAMEs are used.
673 - alldirs=
674 - for found_dir in $rpathdirs; do
675 - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
676 - done
677 - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
678 - acl_save_libdir="$libdir"
679 - libdir="$alldirs"
680 - eval flag=\"$hardcode_libdir_flag_spec\"
681 - libdir="$acl_save_libdir"
682 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
683 - else
684 - dnl The -rpath options are cumulative.
685 - for found_dir in $rpathdirs; do
686 - acl_save_libdir="$libdir"
687 - libdir="$found_dir"
688 - eval flag=\"$hardcode_libdir_flag_spec\"
689 - libdir="$acl_save_libdir"
690 - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
691 - done
692 - fi
693 - fi
694 - if test "X$ltrpathdirs" != "X"; then
695 - dnl When using libtool, the option that works for both libraries and
696 - dnl executables is -R. The -R options are cumulative.
697 - for found_dir in $ltrpathdirs; do
698 - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
699 - done
700 - fi
701 -])
702 -
703 -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
704 -dnl unless already present in VAR.
705 -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
706 -dnl contains two or three consecutive elements that belong together.
707 -AC_DEFUN([AC_LIB_APPENDTOVAR],
708 -[
709 - for element in [$2]; do
710 - haveit=
711 - for x in $[$1]; do
712 - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
713 - if test "X$x" = "X$element"; then
714 - haveit=yes
715 - break
716 - fi
717 - done
718 - if test -z "$haveit"; then
719 - [$1]="${[$1]}${[$1]:+ }$element"
720 - fi
721 - done
722 -])
723 -
724 -# lib-ld.m4 serial 3 (gettext-0.13)
725 -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
726 -dnl This file is free software; the Free Software Foundation
727 -dnl gives unlimited permission to copy and/or distribute it,
728 -dnl with or without modifications, as long as this notice is preserved.
729 -
730 -dnl Subroutines of libtool.m4,
731 -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
732 -dnl with libtool.m4.
733 -
734 -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
735 -AC_DEFUN([AC_LIB_PROG_LD_GNU],
736 -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
737 -[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
738 -case `$LD -v 2>&1 </dev/null` in
739 -*GNU* | *'with BFD'*)
740 - acl_cv_prog_gnu_ld=yes ;;
741 -*)
742 - acl_cv_prog_gnu_ld=no ;;
743 -esac])
744 -with_gnu_ld=$acl_cv_prog_gnu_ld
745 -])
746 -
747 -dnl From libtool-1.4. Sets the variable LD.
748 -AC_DEFUN([AC_LIB_PROG_LD],
749 -[AC_ARG_WITH(gnu-ld,
750 -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
751 -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
752 -AC_REQUIRE([AC_PROG_CC])dnl
753 -AC_REQUIRE([AC_CANONICAL_HOST])dnl
754 -# Prepare PATH_SEPARATOR.
755 -# The user is always right.
756 -if test "${PATH_SEPARATOR+set}" != set; then
757 - echo "#! /bin/sh" >conf$$.sh
758 - echo "exit 0" >>conf$$.sh
759 - chmod +x conf$$.sh
760 - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
761 - PATH_SEPARATOR=';'
762 - else
763 - PATH_SEPARATOR=:
764 - fi
765 - rm -f conf$$.sh
766 -fi
767 -ac_prog=ld
768 -if test "$GCC" = yes; then
769 - # Check if gcc -print-prog-name=ld gives a path.
770 - AC_MSG_CHECKING([for ld used by GCC])
771 - case $host in
772 - *-*-mingw*)
773 - # gcc leaves a trailing carriage return which upsets mingw
774 - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
775 - *)
776 - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
777 - esac
778 - case $ac_prog in
779 - # Accept absolute paths.
780 - [[\\/]* | [A-Za-z]:[\\/]*)]
781 - [re_direlt='/[^/][^/]*/\.\./']
782 - # Canonicalize the path of ld
783 - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
784 - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
785 - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
786 - done
787 - test -z "$LD" && LD="$ac_prog"
788 - ;;
789 - "")
790 - # If it fails, then pretend we aren't using GCC.
791 - ac_prog=ld
792 - ;;
793 - *)
794 - # If it is relative, then search for the first ld in PATH.
795 - with_gnu_ld=unknown
796 - ;;
797 - esac
798 -elif test "$with_gnu_ld" = yes; then
799 - AC_MSG_CHECKING([for GNU ld])
800 -else
801 - AC_MSG_CHECKING([for non-GNU ld])
802 -fi
803 -AC_CACHE_VAL(acl_cv_path_LD,
804 -[if test -z "$LD"; then
805 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
806 - for ac_dir in $PATH; do
807 - test -z "$ac_dir" && ac_dir=.
808 - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
809 - acl_cv_path_LD="$ac_dir/$ac_prog"
810 - # Check to see if the program is GNU ld. I'd rather use --version,
811 - # but apparently some GNU ld's only accept -v.
812 - # Break only if it was the GNU/non-GNU ld that we prefer.
813 - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
814 - *GNU* | *'with BFD'*)
815 - test "$with_gnu_ld" != no && break ;;
816 - *)
817 - test "$with_gnu_ld" != yes && break ;;
818 - esac
819 - fi
820 - done
821 - IFS="$ac_save_ifs"
822 -else
823 - acl_cv_path_LD="$LD" # Let the user override the test with a path.
824 -fi])
825 -LD="$acl_cv_path_LD"
826 -if test -n "$LD"; then
827 - AC_MSG_RESULT($LD)
828 -else
829 - AC_MSG_RESULT(no)
830 -fi
831 -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
832 -AC_LIB_PROG_LD_GNU
833 -])
834 -
835 -# Like AC_CONFIG_HEADER, but automatically create stamp file.
836 -
837 -AC_DEFUN([AM_CONFIG_HEADER],
838 -[AC_PREREQ([2.12])
839 -AC_CONFIG_HEADER([$1])
840 -dnl When config.status generates a header, we must update the stamp-h file.
841 -dnl This file resides in the same directory as the config header
842 -dnl that is generated. We must strip everything past the first ":",
843 -dnl and everything past the last "/".
844 -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
845 -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
846 -<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
847 -<<am_indx=1
848 -for am_file in <<$1>>; do
849 - case " <<$>>CONFIG_HEADERS " in
850 - *" <<$>>am_file "*<<)>>
851 - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
852 - ;;
853 - esac
854 - am_indx=`expr "<<$>>am_indx" + 1`
855 -done<<>>dnl>>)
856 -changequote([,]))])
857 -
858 -# Do all the work for Automake. This macro actually does too much --
859 -# some checks are only needed if your package does certain things.
860 -# But this isn't really a big deal.
861 -
862 -# serial 1
863 -
864 -dnl Usage:
865 -dnl AM_INIT_AUTOMAKE(package,version, [no-define])
866 -
867 -AC_DEFUN([AM_INIT_AUTOMAKE],
868 -[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
869 -AC_REQUIRE([AC_PROG_INSTALL])
870 -PACKAGE=[$1]
871 -AC_SUBST(PACKAGE)
872 -VERSION=[$2]
873 -AC_SUBST(VERSION)
874 -dnl test to see if srcdir already configured
875 -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
876 - AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
877 -fi
878 -ifelse([$3],,
879 -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
880 -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
881 -AC_REQUIRE([AM_SANITY_CHECK])
882 -AC_REQUIRE([AC_ARG_PROGRAM])
883 -dnl FIXME This is truly gross.
884 -missing_dir=`cd $ac_aux_dir && pwd`
885 -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
886 -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
887 -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
888 -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
889 -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
890 -AC_REQUIRE([AC_PROG_MAKE_SET])])
891 -
892 -# Copyright 2002 Free Software Foundation, Inc.
893 -
894 -# This program is free software; you can redistribute it and/or modify
895 -# it under the terms of the GNU General Public License as published by
896 -# the Free Software Foundation; either version 2, or (at your option)
897 -# any later version.
898 -
899 -# This program is distributed in the hope that it will be useful,
900 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
901 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
902 -# GNU General Public License for more details.
903 -
904 -# You should have received a copy of the GNU General Public License
905 -# along with this program; if not, write to the Free Software
906 -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
907 -
908 -# AM_AUTOMAKE_VERSION(VERSION)
909 -# ----------------------------
910 -# Automake X.Y traces this macro to ensure aclocal.m4 has been
911 -# generated from the m4 files accompanying Automake X.Y.
912 -AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
913 -
914 -# AM_SET_CURRENT_AUTOMAKE_VERSION
915 -# -------------------------------
916 -# Call AM_AUTOMAKE_VERSION so it can be traced.
917 -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
918 -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
919 - [AM_AUTOMAKE_VERSION([1.4-p6])])
920 -
921 -#
922 -# Check to make sure that the build environment is sane.
923 -#
924 -
925 -AC_DEFUN([AM_SANITY_CHECK],
926 -[AC_MSG_CHECKING([whether build environment is sane])
927 -# Just in case
928 -sleep 1
929 -echo timestamp > conftestfile
930 -# Do `set' in a subshell so we don't clobber the current shell's
931 -# arguments. Must try -L first in case configure is actually a
932 -# symlink; some systems play weird games with the mod time of symlinks
933 -# (eg FreeBSD returns the mod time of the symlink's containing
934 -# directory).
935 -if (
936 - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
937 - if test "[$]*" = "X"; then
938 - # -L didn't work.
939 - set X `ls -t $srcdir/configure conftestfile`
940 - fi
941 - if test "[$]*" != "X $srcdir/configure conftestfile" \
942 - && test "[$]*" != "X conftestfile $srcdir/configure"; then
943 -
944 - # If neither matched, then we have a broken ls. This can happen
945 - # if, for instance, CONFIG_SHELL is bash and it inherits a
946 - # broken ls alias from the environment. This has actually
947 - # happened. Such a system could not be considered "sane".
948 - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
949 -alias in your environment])
950 - fi
951 -
952 - test "[$]2" = conftestfile
953 - )
954 -then
955 - # Ok.
956 - :
957 -else
958 - AC_MSG_ERROR([newly created file is older than distributed files!
959 -Check your system clock])
960 -fi
961 -rm -f conftest*
962 -AC_MSG_RESULT(yes)])
963 -
964 -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
965 -dnl The program must properly implement --version.
966 -AC_DEFUN([AM_MISSING_PROG],
967 -[AC_MSG_CHECKING(for working $2)
968 -# Run test in a subshell; some versions of sh will print an error if
969 -# an executable is not found, even if stderr is redirected.
970 -# Redirect stdin to placate older versions of autoconf. Sigh.
971 -if ($2 --version) < /dev/null > /dev/null 2>&1; then
972 - $1=$2
973 - AC_MSG_RESULT(found)
974 -else
975 - $1="$3/missing $2"
976 - AC_MSG_RESULT(missing)
977 -fi
978 -AC_SUBST($1)])
979 -
980 -
981 -dnl AM_PROG_LEX
982 -dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
983 -AC_DEFUN([AM_PROG_LEX],
984 -[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
985 -AC_CHECK_PROGS(LEX, flex lex, $missing_dir/missing flex)
986 -AC_PROG_LEX
987 -AC_DECL_YYTEXT])
988
989 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
990
991 -# serial 47 AC_PROG_LIBTOOL
992 -# Debian $Rev: 9373 $
993 -
994
995 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
996 # -----------------------------------------------------------