libftdi: (tomj) updated ft2232 bitbang mode example
[libftdi] / aclocal.m4
CommitLineData
5fdb1cb1 1dnl aclocal.m4 generated automatically by aclocal 1.4-p5
a3da1d95 2
5fdb1cb1
TJ
3dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
a3da1d95 7
5fdb1cb1
TJ
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
a3da1d95 12
08cb09bf
TJ
13# lib-prefix.m4 serial 5 (gettext-0.15)
14dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
15dnl This file is free software; the Free Software Foundation
16dnl gives unlimited permission to copy and/or distribute it,
17dnl with or without modifications, as long as this notice is preserved.
18
19dnl From Bruno Haible.
20
21dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
22dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
23dnl require excessive bracketing.
24ifdef([AC_HELP_STRING],
25[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
26[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
27
28dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
29dnl to access previously installed libraries. The basic assumption is that
30dnl a user will want packages to use other packages he previously installed
31dnl with the same --prefix option.
32dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
33dnl libraries, but is otherwise very convenient.
34AC_DEFUN([AC_LIB_PREFIX],
35[
36 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
37 AC_REQUIRE([AC_PROG_CC])
38 AC_REQUIRE([AC_CANONICAL_HOST])
39 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
40 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
41 dnl By default, look in $includedir and $libdir.
42 use_additional=yes
43 AC_LIB_WITH_FINAL_PREFIX([
44 eval additional_includedir=\"$includedir\"
45 eval additional_libdir=\"$libdir\"
46 ])
47 AC_LIB_ARG_WITH([lib-prefix],
48[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
49 --without-lib-prefix don't search for libraries in includedir and libdir],
50[
51 if test "X$withval" = "Xno"; then
52 use_additional=no
53 else
54 if test "X$withval" = "X"; then
55 AC_LIB_WITH_FINAL_PREFIX([
56 eval additional_includedir=\"$includedir\"
57 eval additional_libdir=\"$libdir\"
58 ])
59 else
60 additional_includedir="$withval/include"
61 additional_libdir="$withval/$acl_libdirstem"
62 fi
63 fi
64])
65 if test $use_additional = yes; then
66 dnl Potentially add $additional_includedir to $CPPFLAGS.
67 dnl But don't add it
68 dnl 1. if it's the standard /usr/include,
69 dnl 2. if it's already present in $CPPFLAGS,
70 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
71 dnl 4. if it doesn't exist as a directory.
72 if test "X$additional_includedir" != "X/usr/include"; then
73 haveit=
74 for x in $CPPFLAGS; do
75 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
76 if test "X$x" = "X-I$additional_includedir"; then
77 haveit=yes
78 break
79 fi
80 done
81 if test -z "$haveit"; then
82 if test "X$additional_includedir" = "X/usr/local/include"; then
83 if test -n "$GCC"; then
84 case $host_os in
85 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
86 esac
87 fi
88 fi
89 if test -z "$haveit"; then
90 if test -d "$additional_includedir"; then
91 dnl Really add $additional_includedir to $CPPFLAGS.
92 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
93 fi
94 fi
95 fi
96 fi
97 dnl Potentially add $additional_libdir to $LDFLAGS.
98 dnl But don't add it
99 dnl 1. if it's the standard /usr/lib,
100 dnl 2. if it's already present in $LDFLAGS,
101 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
102 dnl 4. if it doesn't exist as a directory.
103 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
104 haveit=
105 for x in $LDFLAGS; do
106 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
107 if test "X$x" = "X-L$additional_libdir"; then
108 haveit=yes
109 break
110 fi
111 done
112 if test -z "$haveit"; then
113 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
114 if test -n "$GCC"; then
115 case $host_os in
116 linux*) haveit=yes;;
117 esac
118 fi
119 fi
120 if test -z "$haveit"; then
121 if test -d "$additional_libdir"; then
122 dnl Really add $additional_libdir to $LDFLAGS.
123 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
124 fi
125 fi
126 fi
127 fi
128 fi
129])
130
131dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
132dnl acl_final_exec_prefix, containing the values to which $prefix and
133dnl $exec_prefix will expand at the end of the configure script.
134AC_DEFUN([AC_LIB_PREPARE_PREFIX],
135[
136 dnl Unfortunately, prefix and exec_prefix get only finally determined
137 dnl at the end of configure.
138 if test "X$prefix" = "XNONE"; then
139 acl_final_prefix="$ac_default_prefix"
140 else
141 acl_final_prefix="$prefix"
142 fi
143 if test "X$exec_prefix" = "XNONE"; then
144 acl_final_exec_prefix='${prefix}'
145 else
146 acl_final_exec_prefix="$exec_prefix"
147 fi
148 acl_save_prefix="$prefix"
149 prefix="$acl_final_prefix"
150 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
151 prefix="$acl_save_prefix"
152])
153
154dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
155dnl variables prefix and exec_prefix bound to the values they will have
156dnl at the end of the configure script.
157AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
158[
159 acl_save_prefix="$prefix"
160 prefix="$acl_final_prefix"
161 acl_save_exec_prefix="$exec_prefix"
162 exec_prefix="$acl_final_exec_prefix"
163 $1
164 exec_prefix="$acl_save_exec_prefix"
165 prefix="$acl_save_prefix"
166])
167
168dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
169dnl the basename of the libdir, either "lib" or "lib64".
170AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
171[
172 dnl There is no formal standard regarding lib and lib64. The current
173 dnl practice is that on a system supporting 32-bit and 64-bit instruction
174 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
175 dnl libraries go under $prefix/lib. We determine the compiler's default
176 dnl mode by looking at the compiler's library search path. If at least
177 dnl of its elements ends in /lib64 or points to a directory whose absolute
178 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
179 dnl default, namely "lib".
180 acl_libdirstem=lib
181 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
182 if test -n "$searchpath"; then
183 acl_save_IFS="${IFS= }"; IFS=":"
184 for searchdir in $searchpath; do
185 if test -d "$searchdir"; then
186 case "$searchdir" in
187 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
188 *) searchdir=`cd "$searchdir" && pwd`
189 case "$searchdir" in
190 */lib64 ) acl_libdirstem=lib64 ;;
191 esac ;;
192 esac
193 fi
194 done
195 IFS="$acl_save_IFS"
196 fi
197])
198
199# lib-link.m4 serial 8 (gettext-0.15)
200dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
201dnl This file is free software; the Free Software Foundation
202dnl gives unlimited permission to copy and/or distribute it,
203dnl with or without modifications, as long as this notice is preserved.
204
205dnl From Bruno Haible.
206
207AC_PREREQ(2.50)
208
209dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
210dnl the libraries corresponding to explicit and implicit dependencies.
211dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
212dnl augments the CPPFLAGS variable.
213AC_DEFUN([AC_LIB_LINKFLAGS],
214[
215 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
216 AC_REQUIRE([AC_LIB_RPATH])
217 define([Name],[translit([$1],[./-], [___])])
218 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
219 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
220 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
221 AC_LIB_LINKFLAGS_BODY([$1], [$2])
222 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
223 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
224 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
225 ])
226 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
227 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
228 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
229 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
230 AC_SUBST([LIB]NAME)
231 AC_SUBST([LTLIB]NAME)
232 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
233 dnl results of this search when this library appears as a dependency.
234 HAVE_LIB[]NAME=yes
235 undefine([Name])
236 undefine([NAME])
237])
238
239dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
240dnl searches for libname and the libraries corresponding to explicit and
241dnl implicit dependencies, together with the specified include files and
242dnl the ability to compile and link the specified testcode. If found, it
243dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
244dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
245dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
246dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
247AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
248[
249 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
250 AC_REQUIRE([AC_LIB_RPATH])
251 define([Name],[translit([$1],[./-], [___])])
252 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
253 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
254
255 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
256 dnl accordingly.
257 AC_LIB_LINKFLAGS_BODY([$1], [$2])
258
259 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
260 dnl because if the user has installed lib[]Name and not disabled its use
261 dnl via --without-lib[]Name-prefix, he wants to use it.
262 ac_save_CPPFLAGS="$CPPFLAGS"
263 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
264
265 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
266 ac_save_LIBS="$LIBS"
267 LIBS="$LIBS $LIB[]NAME"
268 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
269 LIBS="$ac_save_LIBS"
270 ])
271 if test "$ac_cv_lib[]Name" = yes; then
272 HAVE_LIB[]NAME=yes
273 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
274 AC_MSG_CHECKING([how to link with lib[]$1])
275 AC_MSG_RESULT([$LIB[]NAME])
276 else
277 HAVE_LIB[]NAME=no
278 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
279 dnl $INC[]NAME either.
280 CPPFLAGS="$ac_save_CPPFLAGS"
281 LIB[]NAME=
282 LTLIB[]NAME=
283 fi
284 AC_SUBST([HAVE_LIB]NAME)
285 AC_SUBST([LIB]NAME)
286 AC_SUBST([LTLIB]NAME)
287 undefine([Name])
288 undefine([NAME])
289])
290
291dnl Determine the platform dependent parameters needed to use rpath:
292dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
293dnl hardcode_direct, hardcode_minus_L.
294AC_DEFUN([AC_LIB_RPATH],
295[
296 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
297 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
298 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
299 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
300 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
301 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
302 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
303 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
304 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
305 . ./conftest.sh
306 rm -f ./conftest.sh
307 acl_cv_rpath=done
308 ])
309 wl="$acl_cv_wl"
310 libext="$acl_cv_libext"
311 shlibext="$acl_cv_shlibext"
312 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
313 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
314 hardcode_direct="$acl_cv_hardcode_direct"
315 hardcode_minus_L="$acl_cv_hardcode_minus_L"
316 dnl Determine whether the user wants rpath handling at all.
317 AC_ARG_ENABLE(rpath,
318 [ --disable-rpath do not hardcode runtime library paths],
319 :, enable_rpath=yes)
320])
321
322dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
323dnl the libraries corresponding to explicit and implicit dependencies.
324dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
325AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
326[
327 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
328 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
329 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
330 dnl By default, look in $includedir and $libdir.
331 use_additional=yes
332 AC_LIB_WITH_FINAL_PREFIX([
333 eval additional_includedir=\"$includedir\"
334 eval additional_libdir=\"$libdir\"
335 ])
336 AC_LIB_ARG_WITH([lib$1-prefix],
337[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
338 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
339[
340 if test "X$withval" = "Xno"; then
341 use_additional=no
342 else
343 if test "X$withval" = "X"; then
344 AC_LIB_WITH_FINAL_PREFIX([
345 eval additional_includedir=\"$includedir\"
346 eval additional_libdir=\"$libdir\"
347 ])
348 else
349 additional_includedir="$withval/include"
350 additional_libdir="$withval/$acl_libdirstem"
351 fi
352 fi
353])
354 dnl Search the library and its dependencies in $additional_libdir and
355 dnl $LDFLAGS. Using breadth-first-seach.
356 LIB[]NAME=
357 LTLIB[]NAME=
358 INC[]NAME=
359 rpathdirs=
360 ltrpathdirs=
361 names_already_handled=
362 names_next_round='$1 $2'
363 while test -n "$names_next_round"; do
364 names_this_round="$names_next_round"
365 names_next_round=
366 for name in $names_this_round; do
367 already_handled=
368 for n in $names_already_handled; do
369 if test "$n" = "$name"; then
370 already_handled=yes
371 break
372 fi
373 done
374 if test -z "$already_handled"; then
375 names_already_handled="$names_already_handled $name"
376 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
377 dnl or AC_LIB_HAVE_LINKFLAGS call.
378 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
379 eval value=\"\$HAVE_LIB$uppername\"
380 if test -n "$value"; then
381 if test "$value" = yes; then
382 eval value=\"\$LIB$uppername\"
383 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
384 eval value=\"\$LTLIB$uppername\"
385 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
386 else
387 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
388 dnl that this library doesn't exist. So just drop it.
389 :
390 fi
391 else
392 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
393 dnl and the already constructed $LIBNAME/$LTLIBNAME.
394 found_dir=
395 found_la=
396 found_so=
397 found_a=
398 if test $use_additional = yes; then
399 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
400 found_dir="$additional_libdir"
401 found_so="$additional_libdir/lib$name.$shlibext"
402 if test -f "$additional_libdir/lib$name.la"; then
403 found_la="$additional_libdir/lib$name.la"
404 fi
405 else
406 if test -f "$additional_libdir/lib$name.$libext"; then
407 found_dir="$additional_libdir"
408 found_a="$additional_libdir/lib$name.$libext"
409 if test -f "$additional_libdir/lib$name.la"; then
410 found_la="$additional_libdir/lib$name.la"
411 fi
412 fi
413 fi
414 fi
415 if test "X$found_dir" = "X"; then
416 for x in $LDFLAGS $LTLIB[]NAME; do
417 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
418 case "$x" in
419 -L*)
420 dir=`echo "X$x" | sed -e 's/^X-L//'`
421 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
422 found_dir="$dir"
423 found_so="$dir/lib$name.$shlibext"
424 if test -f "$dir/lib$name.la"; then
425 found_la="$dir/lib$name.la"
426 fi
427 else
428 if test -f "$dir/lib$name.$libext"; then
429 found_dir="$dir"
430 found_a="$dir/lib$name.$libext"
431 if test -f "$dir/lib$name.la"; then
432 found_la="$dir/lib$name.la"
433 fi
434 fi
435 fi
436 ;;
437 esac
438 if test "X$found_dir" != "X"; then
439 break
440 fi
441 done
442 fi
443 if test "X$found_dir" != "X"; then
444 dnl Found the library.
445 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
446 if test "X$found_so" != "X"; then
447 dnl Linking with a shared library. We attempt to hardcode its
448 dnl directory into the executable's runpath, unless it's the
449 dnl standard /usr/lib.
450 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
451 dnl No hardcoding is needed.
452 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
453 else
454 dnl Use an explicit option to hardcode DIR into the resulting
455 dnl binary.
456 dnl Potentially add DIR to ltrpathdirs.
457 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
458 haveit=
459 for x in $ltrpathdirs; do
460 if test "X$x" = "X$found_dir"; then
461 haveit=yes
462 break
463 fi
464 done
465 if test -z "$haveit"; then
466 ltrpathdirs="$ltrpathdirs $found_dir"
467 fi
468 dnl The hardcoding into $LIBNAME is system dependent.
469 if test "$hardcode_direct" = yes; then
470 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
471 dnl resulting binary.
472 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
473 else
474 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
475 dnl Use an explicit option to hardcode DIR into the resulting
476 dnl binary.
477 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
478 dnl Potentially add DIR to rpathdirs.
479 dnl The rpathdirs will be appended to $LIBNAME at the end.
480 haveit=
481 for x in $rpathdirs; do
482 if test "X$x" = "X$found_dir"; then
483 haveit=yes
484 break
485 fi
486 done
487 if test -z "$haveit"; then
488 rpathdirs="$rpathdirs $found_dir"
489 fi
490 else
491 dnl Rely on "-L$found_dir".
492 dnl But don't add it if it's already contained in the LDFLAGS
493 dnl or the already constructed $LIBNAME
494 haveit=
495 for x in $LDFLAGS $LIB[]NAME; do
496 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
497 if test "X$x" = "X-L$found_dir"; then
498 haveit=yes
499 break
500 fi
501 done
502 if test -z "$haveit"; then
503 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
504 fi
505 if test "$hardcode_minus_L" != no; then
506 dnl FIXME: Not sure whether we should use
507 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
508 dnl here.
509 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
510 else
511 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
512 dnl here, because this doesn't fit in flags passed to the
513 dnl compiler. So give up. No hardcoding. This affects only
514 dnl very old systems.
515 dnl FIXME: Not sure whether we should use
516 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
517 dnl here.
518 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
519 fi
520 fi
521 fi
522 fi
523 else
524 if test "X$found_a" != "X"; then
525 dnl Linking with a static library.
526 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
527 else
528 dnl We shouldn't come here, but anyway it's good to have a
529 dnl fallback.
530 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
531 fi
532 fi
533 dnl Assume the include files are nearby.
534 additional_includedir=
535 case "$found_dir" in
536 */$acl_libdirstem | */$acl_libdirstem/)
537 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
538 additional_includedir="$basedir/include"
539 ;;
540 esac
541 if test "X$additional_includedir" != "X"; then
542 dnl Potentially add $additional_includedir to $INCNAME.
543 dnl But don't add it
544 dnl 1. if it's the standard /usr/include,
545 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
546 dnl 3. if it's already present in $CPPFLAGS or the already
547 dnl constructed $INCNAME,
548 dnl 4. if it doesn't exist as a directory.
549 if test "X$additional_includedir" != "X/usr/include"; then
550 haveit=
551 if test "X$additional_includedir" = "X/usr/local/include"; then
552 if test -n "$GCC"; then
553 case $host_os in
554 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
555 esac
556 fi
557 fi
558 if test -z "$haveit"; then
559 for x in $CPPFLAGS $INC[]NAME; do
560 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
561 if test "X$x" = "X-I$additional_includedir"; then
562 haveit=yes
563 break
564 fi
565 done
566 if test -z "$haveit"; then
567 if test -d "$additional_includedir"; then
568 dnl Really add $additional_includedir to $INCNAME.
569 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
570 fi
571 fi
572 fi
573 fi
574 fi
575 dnl Look for dependencies.
576 if test -n "$found_la"; then
577 dnl Read the .la file. It defines the variables
578 dnl dlname, library_names, old_library, dependency_libs, current,
579 dnl age, revision, installed, dlopen, dlpreopen, libdir.
580 save_libdir="$libdir"
581 case "$found_la" in
582 */* | *\\*) . "$found_la" ;;
583 *) . "./$found_la" ;;
584 esac
585 libdir="$save_libdir"
586 dnl We use only dependency_libs.
587 for dep in $dependency_libs; do
588 case "$dep" in
589 -L*)
590 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
591 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
592 dnl But don't add it
593 dnl 1. if it's the standard /usr/lib,
594 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
595 dnl 3. if it's already present in $LDFLAGS or the already
596 dnl constructed $LIBNAME,
597 dnl 4. if it doesn't exist as a directory.
598 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
599 haveit=
600 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
601 if test -n "$GCC"; then
602 case $host_os in
603 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
604 esac
605 fi
606 fi
607 if test -z "$haveit"; then
608 haveit=
609 for x in $LDFLAGS $LIB[]NAME; do
610 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
611 if test "X$x" = "X-L$additional_libdir"; then
612 haveit=yes
613 break
614 fi
615 done
616 if test -z "$haveit"; then
617 if test -d "$additional_libdir"; then
618 dnl Really add $additional_libdir to $LIBNAME.
619 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
620 fi
621 fi
622 haveit=
623 for x in $LDFLAGS $LTLIB[]NAME; do
624 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
625 if test "X$x" = "X-L$additional_libdir"; then
626 haveit=yes
627 break
628 fi
629 done
630 if test -z "$haveit"; then
631 if test -d "$additional_libdir"; then
632 dnl Really add $additional_libdir to $LTLIBNAME.
633 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
634 fi
635 fi
636 fi
637 fi
638 ;;
639 -R*)
640 dir=`echo "X$dep" | sed -e 's/^X-R//'`
641 if test "$enable_rpath" != no; then
642 dnl Potentially add DIR to rpathdirs.
643 dnl The rpathdirs will be appended to $LIBNAME at the end.
644 haveit=
645 for x in $rpathdirs; do
646 if test "X$x" = "X$dir"; then
647 haveit=yes
648 break
649 fi
650 done
651 if test -z "$haveit"; then
652 rpathdirs="$rpathdirs $dir"
653 fi
654 dnl Potentially add DIR to ltrpathdirs.
655 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
656 haveit=
657 for x in $ltrpathdirs; do
658 if test "X$x" = "X$dir"; then
659 haveit=yes
660 break
661 fi
662 done
663 if test -z "$haveit"; then
664 ltrpathdirs="$ltrpathdirs $dir"
665 fi
666 fi
667 ;;
668 -l*)
669 dnl Handle this in the next round.
670 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
671 ;;
672 *.la)
673 dnl Handle this in the next round. Throw away the .la's
674 dnl directory; it is already contained in a preceding -L
675 dnl option.
676 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
677 ;;
678 *)
679 dnl Most likely an immediate library name.
680 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
681 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
682 ;;
683 esac
684 done
685 fi
686 else
687 dnl Didn't find the library; assume it is in the system directories
688 dnl known to the linker and runtime loader. (All the system
689 dnl directories known to the linker should also be known to the
690 dnl runtime loader, otherwise the system is severely misconfigured.)
691 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
692 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
693 fi
694 fi
695 fi
696 done
697 done
698 if test "X$rpathdirs" != "X"; then
699 if test -n "$hardcode_libdir_separator"; then
700 dnl Weird platform: only the last -rpath option counts, the user must
701 dnl pass all path elements in one option. We can arrange that for a
702 dnl single library, but not when more than one $LIBNAMEs are used.
703 alldirs=
704 for found_dir in $rpathdirs; do
705 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
706 done
707 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
708 acl_save_libdir="$libdir"
709 libdir="$alldirs"
710 eval flag=\"$hardcode_libdir_flag_spec\"
711 libdir="$acl_save_libdir"
712 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
713 else
714 dnl The -rpath options are cumulative.
715 for found_dir in $rpathdirs; do
716 acl_save_libdir="$libdir"
717 libdir="$found_dir"
718 eval flag=\"$hardcode_libdir_flag_spec\"
719 libdir="$acl_save_libdir"
720 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
721 done
722 fi
723 fi
724 if test "X$ltrpathdirs" != "X"; then
725 dnl When using libtool, the option that works for both libraries and
726 dnl executables is -R. The -R options are cumulative.
727 for found_dir in $ltrpathdirs; do
728 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
729 done
730 fi
731])
732
733dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
734dnl unless already present in VAR.
735dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
736dnl contains two or three consecutive elements that belong together.
737AC_DEFUN([AC_LIB_APPENDTOVAR],
738[
739 for element in [$2]; do
740 haveit=
741 for x in $[$1]; do
742 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
743 if test "X$x" = "X$element"; then
744 haveit=yes
745 break
746 fi
747 done
748 if test -z "$haveit"; then
749 [$1]="${[$1]}${[$1]:+ }$element"
750 fi
751 done
752])
753
754dnl For those cases where a variable contains several -L and -l options
755dnl referring to unknown libraries and directories, this macro determines the
756dnl necessary additional linker options for the runtime path.
757dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
758dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
759dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
760dnl otherwise linking without libtool is assumed.
761AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
762[
763 AC_REQUIRE([AC_LIB_RPATH])
764 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
765 $1=
766 if test "$enable_rpath" != no; then
767 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
768 dnl Use an explicit option to hardcode directories into the resulting
769 dnl binary.
770 rpathdirs=
771 next=
772 for opt in $2; do
773 if test -n "$next"; then
774 dir="$next"
775 dnl No need to hardcode the standard /usr/lib.
776 if test "X$dir" != "X/usr/$acl_libdirstem"; then
777 rpathdirs="$rpathdirs $dir"
778 fi
779 next=
780 else
781 case $opt in
782 -L) next=yes ;;
783 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
784 dnl No need to hardcode the standard /usr/lib.
785 if test "X$dir" != "X/usr/$acl_libdirstem"; then
786 rpathdirs="$rpathdirs $dir"
787 fi
788 next= ;;
789 *) next= ;;
790 esac
791 fi
792 done
793 if test "X$rpathdirs" != "X"; then
794 if test -n ""$3""; then
795 dnl libtool is used for linking. Use -R options.
796 for dir in $rpathdirs; do
797 $1="${$1}${$1:+ }-R$dir"
798 done
799 else
800 dnl The linker is used for linking directly.
801 if test -n "$hardcode_libdir_separator"; then
802 dnl Weird platform: only the last -rpath option counts, the user
803 dnl must pass all path elements in one option.
804 alldirs=
805 for dir in $rpathdirs; do
806 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
807 done
808 acl_save_libdir="$libdir"
809 libdir="$alldirs"
810 eval flag=\"$hardcode_libdir_flag_spec\"
811 libdir="$acl_save_libdir"
812 $1="$flag"
813 else
814 dnl The -rpath options are cumulative.
815 for dir in $rpathdirs; do
816 acl_save_libdir="$libdir"
817 libdir="$dir"
818 eval flag=\"$hardcode_libdir_flag_spec\"
819 libdir="$acl_save_libdir"
820 $1="${$1}${$1:+ }$flag"
821 done
822 fi
823 fi
824 fi
825 fi
826 fi
827 AC_SUBST([$1])
828])
829
830# lib-ld.m4 serial 3 (gettext-0.13)
831dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
832dnl This file is free software; the Free Software Foundation
833dnl gives unlimited permission to copy and/or distribute it,
834dnl with or without modifications, as long as this notice is preserved.
835
836dnl Subroutines of libtool.m4,
837dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
838dnl with libtool.m4.
839
840dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
841AC_DEFUN([AC_LIB_PROG_LD_GNU],
842[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
843[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
844case `$LD -v 2>&1 </dev/null` in
845*GNU* | *'with BFD'*)
846 acl_cv_prog_gnu_ld=yes ;;
847*)
848 acl_cv_prog_gnu_ld=no ;;
849esac])
850with_gnu_ld=$acl_cv_prog_gnu_ld
851])
852
853dnl From libtool-1.4. Sets the variable LD.
854AC_DEFUN([AC_LIB_PROG_LD],
855[AC_ARG_WITH(gnu-ld,
856[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
857test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
858AC_REQUIRE([AC_PROG_CC])dnl
859AC_REQUIRE([AC_CANONICAL_HOST])dnl
860# Prepare PATH_SEPARATOR.
861# The user is always right.
862if test "${PATH_SEPARATOR+set}" != set; then
863 echo "#! /bin/sh" >conf$$.sh
864 echo "exit 0" >>conf$$.sh
865 chmod +x conf$$.sh
866 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
867 PATH_SEPARATOR=';'
868 else
869 PATH_SEPARATOR=:
870 fi
871 rm -f conf$$.sh
872fi
873ac_prog=ld
874if test "$GCC" = yes; then
875 # Check if gcc -print-prog-name=ld gives a path.
876 AC_MSG_CHECKING([for ld used by GCC])
877 case $host in
878 *-*-mingw*)
879 # gcc leaves a trailing carriage return which upsets mingw
880 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
881 *)
882 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
883 esac
884 case $ac_prog in
885 # Accept absolute paths.
886 [[\\/]* | [A-Za-z]:[\\/]*)]
887 [re_direlt='/[^/][^/]*/\.\./']
888 # Canonicalize the path of ld
889 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
890 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
891 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
892 done
893 test -z "$LD" && LD="$ac_prog"
894 ;;
895 "")
896 # If it fails, then pretend we aren't using GCC.
897 ac_prog=ld
898 ;;
899 *)
900 # If it is relative, then search for the first ld in PATH.
901 with_gnu_ld=unknown
902 ;;
903 esac
904elif test "$with_gnu_ld" = yes; then
905 AC_MSG_CHECKING([for GNU ld])
906else
907 AC_MSG_CHECKING([for non-GNU ld])
908fi
909AC_CACHE_VAL(acl_cv_path_LD,
910[if test -z "$LD"; then
911 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
912 for ac_dir in $PATH; do
913 test -z "$ac_dir" && ac_dir=.
914 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
915 acl_cv_path_LD="$ac_dir/$ac_prog"
916 # Check to see if the program is GNU ld. I'd rather use --version,
917 # but apparently some GNU ld's only accept -v.
918 # Break only if it was the GNU/non-GNU ld that we prefer.
919 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
920 *GNU* | *'with BFD'*)
921 test "$with_gnu_ld" != no && break ;;
922 *)
923 test "$with_gnu_ld" != yes && break ;;
924 esac
925 fi
926 done
927 IFS="$ac_save_ifs"
928else
929 acl_cv_path_LD="$LD" # Let the user override the test with a path.
930fi])
931LD="$acl_cv_path_LD"
932if test -n "$LD"; then
933 AC_MSG_RESULT($LD)
934else
935 AC_MSG_RESULT(no)
936fi
937test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
938AC_LIB_PROG_LD_GNU
939])
940
9b254687 941# Like AC_CONFIG_HEADER, but automatically create stamp file.
a3da1d95 942
9b254687
GE
943AC_DEFUN([AM_CONFIG_HEADER],
944[AC_PREREQ([2.12])
945AC_CONFIG_HEADER([$1])
946dnl When config.status generates a header, we must update the stamp-h file.
947dnl This file resides in the same directory as the config header
948dnl that is generated. We must strip everything past the first ":",
949dnl and everything past the last "/".
950AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
951ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
952<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
953<<am_indx=1
954for am_file in <<$1>>; do
955 case " <<$>>CONFIG_HEADERS " in
956 *" <<$>>am_file "*<<)>>
957 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
958 ;;
959 esac
960 am_indx=`expr "<<$>>am_indx" + 1`
961done<<>>dnl>>)
962changequote([,]))])
a3da1d95 963
9b254687
GE
964# Do all the work for Automake. This macro actually does too much --
965# some checks are only needed if your package does certain things.
966# But this isn't really a big deal.
a3da1d95 967
9b254687 968# serial 1
a3da1d95 969
9b254687
GE
970dnl Usage:
971dnl AM_INIT_AUTOMAKE(package,version, [no-define])
a3da1d95 972
9b254687
GE
973AC_DEFUN([AM_INIT_AUTOMAKE],
974[AC_REQUIRE([AC_PROG_INSTALL])
975PACKAGE=[$1]
976AC_SUBST(PACKAGE)
977VERSION=[$2]
978AC_SUBST(VERSION)
979dnl test to see if srcdir already configured
980if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
981 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
a3da1d95 982fi
9b254687
GE
983ifelse([$3],,
984AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
985AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
986AC_REQUIRE([AM_SANITY_CHECK])
987AC_REQUIRE([AC_ARG_PROGRAM])
988dnl FIXME This is truly gross.
989missing_dir=`cd $ac_aux_dir && pwd`
990AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
991AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
992AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
993AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
994AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
995AC_REQUIRE([AC_PROG_MAKE_SET])])
a3da1d95 996
9b254687
GE
997#
998# Check to make sure that the build environment is sane.
999#
a3da1d95 1000
9b254687
GE
1001AC_DEFUN([AM_SANITY_CHECK],
1002[AC_MSG_CHECKING([whether build environment is sane])
1003# Just in case
1004sleep 1
1005echo timestamp > conftestfile
1006# Do `set' in a subshell so we don't clobber the current shell's
1007# arguments. Must try -L first in case configure is actually a
1008# symlink; some systems play weird games with the mod time of symlinks
1009# (eg FreeBSD returns the mod time of the symlink's containing
1010# directory).
1011if (
1012 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
1013 if test "[$]*" = "X"; then
1014 # -L didn't work.
1015 set X `ls -t $srcdir/configure conftestfile`
a3da1d95 1016 fi
9b254687
GE
1017 if test "[$]*" != "X $srcdir/configure conftestfile" \
1018 && test "[$]*" != "X conftestfile $srcdir/configure"; then
a3da1d95 1019
9b254687
GE
1020 # If neither matched, then we have a broken ls. This can happen
1021 # if, for instance, CONFIG_SHELL is bash and it inherits a
1022 # broken ls alias from the environment. This has actually
1023 # happened. Such a system could not be considered "sane".
1024 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1025alias in your environment])
a3da1d95
GE
1026 fi
1027
9b254687 1028 test "[$]2" = conftestfile
a3da1d95 1029 )
9b254687
GE
1030then
1031 # Ok.
1032 :
a3da1d95 1033else
9b254687
GE
1034 AC_MSG_ERROR([newly created file is older than distributed files!
1035Check your system clock])
a3da1d95
GE
1036fi
1037rm -f conftest*
9b254687 1038AC_MSG_RESULT(yes)])
a3da1d95 1039
9b254687
GE
1040dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
1041dnl The program must properly implement --version.
1042AC_DEFUN([AM_MISSING_PROG],
1043[AC_MSG_CHECKING(for working $2)
1044# Run test in a subshell; some versions of sh will print an error if
1045# an executable is not found, even if stderr is redirected.
1046# Redirect stdin to placate older versions of autoconf. Sigh.
1047if ($2 --version) < /dev/null > /dev/null 2>&1; then
1048 $1=$2
1049 AC_MSG_RESULT(found)
a3da1d95 1050else
9b254687
GE
1051 $1="$3/missing $2"
1052 AC_MSG_RESULT(missing)
a3da1d95 1053fi
9b254687 1054AC_SUBST($1)])
a3da1d95 1055
9b254687 1056# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
a3da1d95 1057
9b254687 1058# serial 46 AC_PROG_LIBTOOL
a3da1d95 1059
9b254687
GE
1060AC_DEFUN([AC_PROG_LIBTOOL],
1061[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
a3da1d95 1062
9b254687
GE
1063# This can be used to rebuild libtool when needed
1064LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
a3da1d95 1065
9b254687
GE
1066# Always use our own libtool.
1067LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1068AC_SUBST(LIBTOOL)dnl
a3da1d95 1069
9b254687
GE
1070# Prevent multiple expansion
1071define([AC_PROG_LIBTOOL], [])
a3da1d95
GE
1072])
1073
9b254687
GE
1074AC_DEFUN([AC_LIBTOOL_SETUP],
1075[AC_PREREQ(2.13)dnl
1076AC_REQUIRE([AC_ENABLE_SHARED])dnl
1077AC_REQUIRE([AC_ENABLE_STATIC])dnl
1078AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1079AC_REQUIRE([AC_CANONICAL_HOST])dnl
1080AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1081AC_REQUIRE([AC_PROG_CC])dnl
1082AC_REQUIRE([AC_PROG_LD])dnl
1083AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1084AC_REQUIRE([AC_PROG_NM])dnl
1085AC_REQUIRE([AC_PROG_LN_S])dnl
1086AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1087AC_REQUIRE([AC_OBJEXT])dnl
1088AC_REQUIRE([AC_EXEEXT])dnl
a3da1d95 1089dnl
a3da1d95 1090
9b254687
GE
1091_LT_AC_PROG_ECHO_BACKSLASH
1092# Only perform the check for file, if the check method requires it
1093case $deplibs_check_method in
1094file_magic*)
1095 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1096 AC_PATH_MAGIC
a3da1d95 1097 fi
9b254687
GE
1098 ;;
1099esac
a3da1d95 1100
9b254687
GE
1101AC_CHECK_TOOL(RANLIB, ranlib, :)
1102AC_CHECK_TOOL(STRIP, strip, :)
a3da1d95 1103
9b254687
GE
1104ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1105ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1106enable_win32_dll=yes, enable_win32_dll=no)
a3da1d95 1107
9b254687
GE
1108AC_ARG_ENABLE(libtool-lock,
1109 [ --disable-libtool-lock avoid locking (might break parallel builds)])
1110test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
a3da1d95 1111
9b254687
GE
1112# Some flags need to be propagated to the compiler or linker for good
1113# libtool support.
1114case $host in
1115*-*-irix6*)
1116 # Find out which ABI we are using.
1117 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1118 if AC_TRY_EVAL(ac_compile); then
1119 case `/usr/bin/file conftest.$ac_objext` in
1120 *32-bit*)
1121 LD="${LD-ld} -32"
1122 ;;
1123 *N32*)
1124 LD="${LD-ld} -n32"
1125 ;;
1126 *64-bit*)
1127 LD="${LD-ld} -64"
1128 ;;
a3da1d95 1129 esac
a3da1d95 1130 fi
9b254687
GE
1131 rm -rf conftest*
1132 ;;
a3da1d95 1133
9b254687
GE
1134*-*-sco3.2v5*)
1135 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1136 SAVE_CFLAGS="$CFLAGS"
1137 CFLAGS="$CFLAGS -belf"
1138 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1139 [AC_LANG_SAVE
1140 AC_LANG_C
1141 AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1142 AC_LANG_RESTORE])
1143 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1144 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1145 CFLAGS="$SAVE_CFLAGS"
a3da1d95 1146 fi
9b254687 1147 ;;
a3da1d95 1148
9b254687
GE
1149ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1150[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1151 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1152 AC_CHECK_TOOL(AS, as, false)
1153 AC_CHECK_TOOL(OBJDUMP, objdump, false)
a3da1d95 1154
9b254687
GE
1155 # recent cygwin and mingw systems supply a stub DllMain which the user
1156 # can override, but on older systems we have to supply one
1157 AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1158 [AC_TRY_LINK([],
1159 [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1160 DllMain (0, 0, 0);],
1161 [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
a3da1d95 1162
9b254687
GE
1163 case $host/$CC in
1164 *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1165 # old mingw systems require "-dll" to link a DLL, while more recent ones
1166 # require "-mdll"
1167 SAVE_CFLAGS="$CFLAGS"
1168 CFLAGS="$CFLAGS -mdll"
1169 AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1170 [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1171 CFLAGS="$SAVE_CFLAGS" ;;
1172 *-*-cygwin* | *-*-pw32*)
1173 # cygwin systems need to pass --dll to the linker, and not link
1174 # crt.o which will require a WinMain@16 definition.
1175 lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
a3da1d95 1176 esac
a3da1d95 1177 ;;
a3da1d95 1178 ])
9b254687 1179esac
a3da1d95 1180
9b254687 1181_LT_AC_LTCONFIG_HACK
a3da1d95 1182
a3da1d95
GE
1183])
1184
9b254687
GE
1185# AC_LIBTOOL_HEADER_ASSERT
1186# ------------------------
1187AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
1188[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
1189 [lt_cv_func_assert_works],
1190 [case $host in
1191 *-*-solaris*)
1192 if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
1193 case `$CC --version 2>/dev/null` in
1194 [[12]].*) lt_cv_func_assert_works=no ;;
1195 *) lt_cv_func_assert_works=yes ;;
1196 esac
a3da1d95 1197 fi
9b254687
GE
1198 ;;
1199 esac])
a3da1d95 1200
9b254687
GE
1201if test "x$lt_cv_func_assert_works" = xyes; then
1202 AC_CHECK_HEADERS(assert.h)
a3da1d95 1203fi
9b254687 1204])# AC_LIBTOOL_HEADER_ASSERT
a3da1d95 1205
9b254687
GE
1206# _LT_AC_CHECK_DLFCN
1207# --------------------
1208AC_DEFUN([_LT_AC_CHECK_DLFCN],
1209[AC_CHECK_HEADERS(dlfcn.h)
1210])# _LT_AC_CHECK_DLFCN
a3da1d95 1211
9b254687
GE
1212# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1213# ---------------------------------
1214AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
1215[AC_REQUIRE([AC_CANONICAL_HOST])
1216AC_REQUIRE([AC_PROG_NM])
1217AC_REQUIRE([AC_OBJEXT])
1218# Check for command to grab the raw symbol name followed by C symbol from nm.
1219AC_MSG_CHECKING([command to parse $NM output])
1220AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
a3da1d95 1221
9b254687
GE
1222# These are sane defaults that work on at least a few old systems.
1223# [They come from Ultrix. What could be older than Ultrix?!! ;)]
a3da1d95 1224
9b254687
GE
1225# Character class describing NM global symbol codes.
1226symcode='[[BCDEGRST]]'
a3da1d95 1227
9b254687
GE
1228# Regexp to match symbols that can be accessed directly from C.
1229sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
a3da1d95 1230
9b254687
GE
1231# Transform the above into a raw symbol and a C symbol.
1232symxfrm='\1 \2\3 \3'
a3da1d95 1233
9b254687
GE
1234# Transform an extracted symbol line into a proper C declaration
1235lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
a3da1d95 1236
9b254687
GE
1237# Transform an extracted symbol line into symbol name and symbol address
1238lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
a3da1d95 1239
9b254687
GE
1240# Define system-specific variables.
1241case $host_os in
1242aix*)
1243 symcode='[[BCDT]]'
1244 ;;
1245cygwin* | mingw* | pw32*)
1246 symcode='[[ABCDGISTW]]'
1247 ;;
1248hpux*) # Its linker distinguishes data from code symbols
1249 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
1250 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
1251 ;;
1252irix*)
1253 symcode='[[BCDEGRST]]'
1254 ;;
1255solaris* | sysv5*)
1256 symcode='[[BDT]]'
1257 ;;
1258sysv4)
1259 symcode='[[DFNSTU]]'
1260 ;;
1261esac
a3da1d95 1262
9b254687
GE
1263# Handle CRLF in mingw tool chain
1264opt_cr=
1265case $host_os in
1266mingw*)
1267 opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1268 ;;
1269esac
a3da1d95 1270
9b254687
GE
1271# If we're using GNU nm, then use its standard symbol codes.
1272if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1273 symcode='[[ABCDGISTW]]'
a3da1d95
GE
1274fi
1275
9b254687
GE
1276# Try without a prefix undercore, then with it.
1277for ac_symprfx in "" "_"; do
a3da1d95 1278
9b254687
GE
1279 # Write the raw and C identifiers.
1280lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
a3da1d95 1281
9b254687
GE
1282 # Check to see that the pipe works correctly.
1283 pipe_works=no
1284 rm -f conftest*
1285 cat > conftest.$ac_ext <<EOF
1286#ifdef __cplusplus
1287extern "C" {
1288#endif
1289char nm_test_var;
1290void nm_test_func(){}
1291#ifdef __cplusplus
a3da1d95 1292}
a3da1d95 1293#endif
9b254687
GE
1294int main(){nm_test_var='a';nm_test_func();return(0);}
1295EOF
a3da1d95 1296
9b254687
GE
1297 if AC_TRY_EVAL(ac_compile); then
1298 # Now try to grab the symbols.
1299 nlist=conftest.nm
1300 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
1301 # Try sorting and uniquifying the output.
1302 if sort "$nlist" | uniq > "$nlist"T; then
1303 mv -f "$nlist"T "$nlist"
a3da1d95 1304 else
9b254687 1305 rm -f "$nlist"T
a3da1d95 1306 fi
a3da1d95 1307
9b254687
GE
1308 # Make sure that we snagged all the symbols we need.
1309 if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1310 if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1311 cat <<EOF > conftest.$ac_ext
1312#ifdef __cplusplus
1313extern "C" {
a3da1d95 1314#endif
a3da1d95 1315
9b254687
GE
1316EOF
1317 # Now generate the symbol file.
1318 eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
a3da1d95 1319
9b254687
GE
1320 cat <<EOF >> conftest.$ac_ext
1321#if defined (__STDC__) && __STDC__
1322# define lt_ptr void *
1323#else
1324# define lt_ptr char *
1325# define const
1326#endif
a3da1d95 1327
9b254687
GE
1328/* The mapping between symbol names and symbols. */
1329const struct {
1330 const char *name;
1331 lt_ptr address;
a3da1d95 1332}
9b254687
GE
1333lt_preloaded_symbols[[]] =
1334{
1335EOF
1336 sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
1337 cat <<\EOF >> conftest.$ac_ext
1338 {0, (lt_ptr) 0}
1339};
a3da1d95 1340
9b254687 1341#ifdef __cplusplus
a3da1d95 1342}
a3da1d95 1343#endif
a3da1d95 1344EOF
9b254687
GE
1345 # Now try linking the two files.
1346 mv conftest.$ac_objext conftstm.$ac_objext
1347 save_LIBS="$LIBS"
1348 save_CFLAGS="$CFLAGS"
1349 LIBS="conftstm.$ac_objext"
1350 CFLAGS="$CFLAGS$no_builtin_flag"
1351 if AC_TRY_EVAL(ac_link) && test -s conftest; then
1352 pipe_works=yes
a3da1d95 1353 fi
9b254687
GE
1354 LIBS="$save_LIBS"
1355 CFLAGS="$save_CFLAGS"
1356 else
1357 echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
1358 fi
a3da1d95 1359 else
9b254687 1360 echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
a3da1d95 1361 fi
a3da1d95 1362 else
9b254687 1363 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
a3da1d95 1364 fi
a3da1d95 1365 else
9b254687
GE
1366 echo "$progname: failed program was:" >&AC_FD_CC
1367 cat conftest.$ac_ext >&5
a3da1d95 1368 fi
9b254687 1369 rm -f conftest* conftst*
a3da1d95 1370
9b254687
GE
1371 # Do not use the global_symbol_pipe unless it works.
1372 if test "$pipe_works" = yes; then
1373 break
a3da1d95 1374 else
9b254687 1375 lt_cv_sys_global_symbol_pipe=
a3da1d95 1376 fi
9b254687 1377done
a3da1d95 1378])
9b254687
GE
1379global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
1380if test -z "$lt_cv_sys_global_symbol_pipe"; then
1381 global_symbol_to_cdecl=
1382 global_symbol_to_c_name_address=
a3da1d95 1383else
9b254687
GE
1384 global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
1385 global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
a3da1d95 1386fi
9b254687
GE
1387if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
1388then
1389 AC_MSG_RESULT(failed)
a3da1d95 1390else
9b254687 1391 AC_MSG_RESULT(ok)
a3da1d95 1392fi
9b254687 1393]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
a3da1d95 1394
9b254687
GE
1395# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1396# ---------------------------------
1397AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
1398[# Find the correct PATH separator. Usually this is `:', but
1399# DJGPP uses `;' like DOS.
1400if test "X${PATH_SEPARATOR+set}" != Xset; then
1401 UNAME=${UNAME-`uname 2>/dev/null`}
1402 case X$UNAME in
1403 *-DOS) lt_cv_sys_path_separator=';' ;;
1404 *) lt_cv_sys_path_separator=':' ;;
a3da1d95 1405 esac
9b254687 1406 PATH_SEPARATOR=$lt_cv_sys_path_separator
a3da1d95 1407fi
9b254687 1408])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
a3da1d95
GE
1409
1410# _LT_AC_PROG_ECHO_BACKSLASH
1411# --------------------------
1412# Add some code to the start of the generated configure script which
1413# will find an echo command which doesn't interpret backslashes.
1414AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
9b254687
GE
1415[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1416 [AC_DIVERT_PUSH(NOTICE)])
1417_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
a3da1d95
GE
1418
1419# Check that we are running under the correct shell.
1420SHELL=${CONFIG_SHELL-/bin/sh}
1421
1422case X$ECHO in
1423X*--fallback-echo)
1424 # Remove one level of quotation (which was required for Make).
1425 ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1426 ;;
1427esac
1428
1429echo=${ECHO-echo}
1430if test "X[$]1" = X--no-reexec; then
1431 # Discard the --no-reexec flag, and continue.
1432 shift
1433elif test "X[$]1" = X--fallback-echo; then
1434 # Avoid inline document here, it may be left over
1435 :
1436elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
1437 # Yippee, $echo works!
1438 :
1439else
1440 # Restart under the correct shell.
1441 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1442fi
1443
1444if test "X[$]1" = X--fallback-echo; then
1445 # used as fallback echo
1446 shift
1447 cat <<EOF
9b254687 1448$*
a3da1d95
GE
1449EOF
1450 exit 0
1451fi
1452
1453# The HP-UX ksh and POSIX shell print the target directory to stdout
1454# if CDPATH is set.
1455if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
1456
1457if test -z "$ECHO"; then
1458if test "X${echo_test_string+set}" != Xset; then
1459# find a string as large as possible, as long as the shell can cope with it
1460 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1461 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1462 if (echo_test_string="`eval $cmd`") 2>/dev/null &&
1463 echo_test_string="`eval $cmd`" &&
1464 (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
1465 then
1466 break
1467 fi
1468 done
1469fi
1470
1471if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1472 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1473 test "X$echo_testing_string" = "X$echo_test_string"; then
1474 :
1475else
1476 # The Solaris, AIX, and Digital Unix default echo programs unquote
1477 # backslashes. This makes it impossible to quote backslashes using
1478 # echo "$something" | sed 's/\\/\\\\/g'
1479 #
1480 # So, first we look for a working echo in the user's PATH.
1481
9b254687 1482 IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
a3da1d95 1483 for dir in $PATH /usr/ucb; do
a3da1d95
GE
1484 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1485 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1486 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1487 test "X$echo_testing_string" = "X$echo_test_string"; then
1488 echo="$dir/echo"
1489 break
1490 fi
1491 done
9b254687 1492 IFS="$save_ifs"
a3da1d95
GE
1493
1494 if test "X$echo" = Xecho; then
1495 # We didn't find a better echo, so look for alternatives.
1496 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
1497 echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
1498 test "X$echo_testing_string" = "X$echo_test_string"; then
1499 # This shell has a builtin print -r that does the trick.
1500 echo='print -r'
1501 elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
1502 test "X$CONFIG_SHELL" != X/bin/ksh; then
1503 # If we have ksh, try running configure again with it.
1504 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1505 export ORIGINAL_CONFIG_SHELL
1506 CONFIG_SHELL=/bin/ksh
1507 export CONFIG_SHELL
1508 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1509 else
1510 # Try using printf.
1511 echo='printf %s\n'
1512 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1513 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1514 test "X$echo_testing_string" = "X$echo_test_string"; then
1515 # Cool, printf works
1516 :
1517 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1518 test "X$echo_testing_string" = 'X\t' &&
1519 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1520 test "X$echo_testing_string" = "X$echo_test_string"; then
1521 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1522 export CONFIG_SHELL
1523 SHELL="$CONFIG_SHELL"
1524 export SHELL
1525 echo="$CONFIG_SHELL [$]0 --fallback-echo"
1526 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1527 test "X$echo_testing_string" = 'X\t' &&
1528 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1529 test "X$echo_testing_string" = "X$echo_test_string"; then
1530 echo="$CONFIG_SHELL [$]0 --fallback-echo"
1531 else
1532 # maybe with a smaller string...
1533 prev=:
1534
1535 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1536 if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
1537 then
1538 break
1539 fi
1540 prev="$cmd"
1541 done
1542
1543 if test "$prev" != 'sed 50q "[$]0"'; then
1544 echo_test_string=`eval $prev`
1545 export echo_test_string
1546 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1547 else
1548 # Oops. We lost completely, so just stick with echo.
1549 echo=echo
1550 fi
1551 fi
1552 fi
1553 fi
1554fi
1555fi
1556
1557# Copy echo and quote the copy suitably for passing to libtool from
1558# the Makefile, instead of quoting the original, which is used later.
1559ECHO=$echo
1560if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1561 ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1562fi
1563
1564AC_SUBST(ECHO)
1565AC_DIVERT_POP
1566])# _LT_AC_PROG_ECHO_BACKSLASH
1567
a3da1d95
GE
1568# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1569# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1570# ------------------------------------------------------------------
1571AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
9b254687 1572[if test "$cross_compiling" = yes; then :
a3da1d95
GE
1573 [$4]
1574else
9b254687 1575 AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
a3da1d95
GE
1576 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1577 lt_status=$lt_dlunknown
1578 cat > conftest.$ac_ext <<EOF
1579[#line __oline__ "configure"
1580#include "confdefs.h"
1581
1582#if HAVE_DLFCN_H
1583#include <dlfcn.h>
1584#endif
1585
1586#include <stdio.h>
1587
1588#ifdef RTLD_GLOBAL
1589# define LT_DLGLOBAL RTLD_GLOBAL
1590#else
1591# ifdef DL_GLOBAL
1592# define LT_DLGLOBAL DL_GLOBAL
1593# else
1594# define LT_DLGLOBAL 0
1595# endif
1596#endif
1597
1598/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1599 find out it does not work in some platform. */
1600#ifndef LT_DLLAZY_OR_NOW
1601# ifdef RTLD_LAZY
1602# define LT_DLLAZY_OR_NOW RTLD_LAZY
1603# else
1604# ifdef DL_LAZY
1605# define LT_DLLAZY_OR_NOW DL_LAZY
1606# else
1607# ifdef RTLD_NOW
1608# define LT_DLLAZY_OR_NOW RTLD_NOW
1609# else
1610# ifdef DL_NOW
1611# define LT_DLLAZY_OR_NOW DL_NOW
1612# else
1613# define LT_DLLAZY_OR_NOW 0
1614# endif
1615# endif
1616# endif
1617# endif
1618#endif
1619
1620#ifdef __cplusplus
1621extern "C" void exit (int);
1622#endif
1623
1624void fnord() { int i=42;}
1625int main ()
1626{
1627 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1628 int status = $lt_dlunknown;
1629
1630 if (self)
1631 {
1632 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1633 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1634 /* dlclose (self); */
1635 }
1636
1637 exit (status);
1638}]
1639EOF
1640 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1641 (./conftest; exit; ) 2>/dev/null
1642 lt_status=$?
1643 case x$lt_status in
1644 x$lt_dlno_uscore) $1 ;;
1645 x$lt_dlneed_uscore) $2 ;;
1646 x$lt_unknown|x*) $3 ;;
1647 esac
1648 else :
1649 # compilation failed
1650 $3
1651 fi
1652fi
1653rm -fr conftest*
1654])# _LT_AC_TRY_DLOPEN_SELF
1655
a3da1d95
GE
1656# AC_LIBTOOL_DLOPEN_SELF
1657# -------------------
1658AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
9b254687 1659[if test "x$enable_dlopen" != xyes; then
a3da1d95
GE
1660 enable_dlopen=unknown
1661 enable_dlopen_self=unknown
1662 enable_dlopen_self_static=unknown
1663else
1664 lt_cv_dlopen=no
1665 lt_cv_dlopen_libs=
1666
1667 case $host_os in
1668 beos*)
1669 lt_cv_dlopen="load_add_on"
1670 lt_cv_dlopen_libs=
1671 lt_cv_dlopen_self=yes
1672 ;;
1673
1674 cygwin* | mingw* | pw32*)
1675 lt_cv_dlopen="LoadLibrary"
1676 lt_cv_dlopen_libs=
1677 ;;
1678
1679 *)
1680 AC_CHECK_FUNC([shl_load],
9b254687 1681 [lt_cv_dlopen="shl_load"],
a3da1d95 1682 [AC_CHECK_LIB([dld], [shl_load],
9b254687 1683 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
a3da1d95
GE
1684 [AC_CHECK_FUNC([dlopen],
1685 [lt_cv_dlopen="dlopen"],
1686 [AC_CHECK_LIB([dl], [dlopen],
9b254687 1687 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
a3da1d95 1688 [AC_CHECK_LIB([svld], [dlopen],
9b254687 1689 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
a3da1d95 1690 [AC_CHECK_LIB([dld], [dld_link],
9b254687 1691 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
a3da1d95
GE
1692 ])
1693 ])
1694 ])
1695 ])
1696 ])
1697 ;;
1698 esac
1699
1700 if test "x$lt_cv_dlopen" != xno; then
1701 enable_dlopen=yes
1702 else
1703 enable_dlopen=no
1704 fi
1705
1706 case $lt_cv_dlopen in
1707 dlopen)
1708 save_CPPFLAGS="$CPPFLAGS"
9b254687 1709 AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
a3da1d95
GE
1710 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1711
1712 save_LDFLAGS="$LDFLAGS"
1713 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1714
1715 save_LIBS="$LIBS"
1716 LIBS="$lt_cv_dlopen_libs $LIBS"
1717
1718 AC_CACHE_CHECK([whether a program can dlopen itself],
1719 lt_cv_dlopen_self, [dnl
1720 _LT_AC_TRY_DLOPEN_SELF(
1721 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1722 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1723 ])
1724
1725 if test "x$lt_cv_dlopen_self" = xyes; then
1726 LDFLAGS="$LDFLAGS $link_static_flag"
1727 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1728 lt_cv_dlopen_self_static, [dnl
1729 _LT_AC_TRY_DLOPEN_SELF(
1730 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1731 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1732 ])
1733 fi
1734
1735 CPPFLAGS="$save_CPPFLAGS"
1736 LDFLAGS="$save_LDFLAGS"
1737 LIBS="$save_LIBS"
1738 ;;
1739 esac
1740
1741 case $lt_cv_dlopen_self in
1742 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1743 *) enable_dlopen_self=unknown ;;
1744 esac
1745
1746 case $lt_cv_dlopen_self_static in
1747 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1748 *) enable_dlopen_self_static=unknown ;;
1749 esac
1750fi
1751])# AC_LIBTOOL_DLOPEN_SELF
1752
9b254687
GE
1753AC_DEFUN([_LT_AC_LTCONFIG_HACK],
1754[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
1755# Sed substitution that helps us do robust quoting. It backslashifies
1756# metacharacters that are still active within double-quoted strings.
1757Xsed='sed -e s/^X//'
1758sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
a3da1d95 1759
9b254687
GE
1760# Same as above, but do not quote variable references.
1761double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
1762
1763# Sed substitution to delay expansion of an escaped shell variable in a
1764# double_quote_subst'ed string.
1765delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1766
1767# Constants:
1768rm="rm -f"
1769
1770# Global variables:
1771default_ofile=libtool
1772can_build_shared=yes
1773
1774# All known linkers require a `.a' archive for static linking (except M$VC,
1775# which needs '.lib').
1776libext=a
1777ltmain="$ac_aux_dir/ltmain.sh"
1778ofile="$default_ofile"
1779with_gnu_ld="$lt_cv_prog_gnu_ld"
1780need_locks="$enable_libtool_lock"
1781
1782old_CC="$CC"
1783old_CFLAGS="$CFLAGS"
1784
1785# Set sane defaults for various variables
1786test -z "$AR" && AR=ar
1787test -z "$AR_FLAGS" && AR_FLAGS=cru
1788test -z "$AS" && AS=as
1789test -z "$CC" && CC=cc
1790test -z "$DLLTOOL" && DLLTOOL=dlltool
1791test -z "$LD" && LD=ld
1792test -z "$LN_S" && LN_S="ln -s"
1793test -z "$MAGIC_CMD" && MAGIC_CMD=file
1794test -z "$NM" && NM=nm
1795test -z "$OBJDUMP" && OBJDUMP=objdump
1796test -z "$RANLIB" && RANLIB=:
1797test -z "$STRIP" && STRIP=:
1798test -z "$ac_objext" && ac_objext=o
1799
1800if test x"$host" != x"$build"; then
1801 ac_tool_prefix=${host_alias}-
1802else
1803 ac_tool_prefix=
1804fi
1805
1806# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1807case $host_os in
1808linux-gnu*) ;;
1809linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1810esac
1811
1812case $host_os in
1813aix3*)
1814 # AIX sometimes has problems with the GCC collect2 program. For some
1815 # reason, if we set the COLLECT_NAMES environment variable, the problems
1816 # vanish in a puff of smoke.
1817 if test "X${COLLECT_NAMES+set}" != Xset; then
1818 COLLECT_NAMES=
1819 export COLLECT_NAMES
1820 fi
1821 ;;
1822esac
1823
1824# Determine commands to create old-style static archives.
1825old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1826old_postinstall_cmds='chmod 644 $oldlib'
1827old_postuninstall_cmds=
1828
1829if test -n "$RANLIB"; then
1830 case $host_os in
1831 openbsd*)
1832 old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1833 ;;
1834 *)
1835 old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1836 ;;
1837 esac
1838 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1839fi
1840
1841# Allow CC to be a program name with arguments.
1842set dummy $CC
1843compiler="[$]2"
1844
1845AC_MSG_CHECKING([for objdir])
1846rm -f .libs 2>/dev/null
1847mkdir .libs 2>/dev/null
1848if test -d .libs; then
1849 objdir=.libs
1850else
1851 # MS-DOS does not allow filenames that begin with a dot.
1852 objdir=_libs
1853fi
1854rmdir .libs 2>/dev/null
1855AC_MSG_RESULT($objdir)
1856
1857
1858AC_ARG_WITH(pic,
1859[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
1860pic_mode="$withval", pic_mode=default)
1861test -z "$pic_mode" && pic_mode=default
1862
1863# We assume here that the value for lt_cv_prog_cc_pic will not be cached
1864# in isolation, and that seeing it set (from the cache) indicates that
1865# the associated values are set (in the cache) correctly too.
1866AC_MSG_CHECKING([for $compiler option to produce PIC])
1867AC_CACHE_VAL(lt_cv_prog_cc_pic,
1868[ lt_cv_prog_cc_pic=
1869 lt_cv_prog_cc_shlib=
1870 lt_cv_prog_cc_wl=
1871 lt_cv_prog_cc_static=
1872 lt_cv_prog_cc_no_builtin=
1873 lt_cv_prog_cc_can_build_shared=$can_build_shared
1874
1875 if test "$GCC" = yes; then
1876 lt_cv_prog_cc_wl='-Wl,'
1877 lt_cv_prog_cc_static='-static'
1878
1879 case $host_os in
1880 aix*)
1881 # Below there is a dirty hack to force normal static linking with -ldl
1882 # The problem is because libdl dynamically linked with both libc and
1883 # libC (AIX C++ library), which obviously doesn't included in libraries
1884 # list by gcc. This cause undefined symbols with -static flags.
1885 # This hack allows C programs to be linked with "-static -ldl", but
1886 # not sure about C++ programs.
1887 lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1888 ;;
1889 amigaos*)
1890 # FIXME: we need at least 68020 code to build shared libraries, but
1891 # adding the `-m68020' flag to GCC prevents building anything better,
1892 # like `-m68040'.
1893 lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1894 ;;
1895 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
1896 # PIC is the default for these OSes.
1897 ;;
1898 darwin* | rhapsody*)
1899 # PIC is the default on this platform
1900 # Common symbols not allowed in MH_DYLIB files
1901 lt_cv_prog_cc_pic='-fno-common'
1902 ;;
1903 cygwin* | mingw* | pw32* | os2*)
1904 # This hack is so that the source file can tell whether it is being
1905 # built for inclusion in a dll (and should export symbols for example).
1906 lt_cv_prog_cc_pic='-DDLL_EXPORT'
1907 ;;
1908 sysv4*MP*)
1909 if test -d /usr/nec; then
1910 lt_cv_prog_cc_pic=-Kconform_pic
1911 fi
1912 ;;
1913 *)
1914 lt_cv_prog_cc_pic='-fPIC'
1915 ;;
1916 esac
1917 else
1918 # PORTME Check for PIC flags for the system compiler.
1919 case $host_os in
1920 aix3* | aix4* | aix5*)
1921 lt_cv_prog_cc_wl='-Wl,'
1922 # All AIX code is PIC.
1923 if test "$host_cpu" = ia64; then
1924 # AIX 5 now supports IA64 processor
1925 lt_cv_prog_cc_static='-Bstatic'
1926 else
1927 lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1928 fi
1929 ;;
1930
1931 hpux9* | hpux10* | hpux11*)
1932 # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1933 lt_cv_prog_cc_wl='-Wl,'
1934 lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1935 lt_cv_prog_cc_pic='+Z'
1936 ;;
1937
1938 irix5* | irix6*)
1939 lt_cv_prog_cc_wl='-Wl,'
1940 lt_cv_prog_cc_static='-non_shared'
1941 # PIC (with -KPIC) is the default.
1942 ;;
1943
1944 cygwin* | mingw* | pw32* | os2*)
1945 # This hack is so that the source file can tell whether it is being
1946 # built for inclusion in a dll (and should export symbols for example).
1947 lt_cv_prog_cc_pic='-DDLL_EXPORT'
1948 ;;
1949
1950 newsos6)
1951 lt_cv_prog_cc_pic='-KPIC'
1952 lt_cv_prog_cc_static='-Bstatic'
1953 ;;
1954
1955 osf3* | osf4* | osf5*)
1956 # All OSF/1 code is PIC.
1957 lt_cv_prog_cc_wl='-Wl,'
1958 lt_cv_prog_cc_static='-non_shared'
1959 ;;
1960
1961 sco3.2v5*)
1962 lt_cv_prog_cc_pic='-Kpic'
1963 lt_cv_prog_cc_static='-dn'
1964 lt_cv_prog_cc_shlib='-belf'
1965 ;;
1966
1967 solaris*)
1968 lt_cv_prog_cc_pic='-KPIC'
1969 lt_cv_prog_cc_static='-Bstatic'
1970 lt_cv_prog_cc_wl='-Wl,'
1971 ;;
1972
1973 sunos4*)
1974 lt_cv_prog_cc_pic='-PIC'
1975 lt_cv_prog_cc_static='-Bstatic'
1976 lt_cv_prog_cc_wl='-Qoption ld '
1977 ;;
1978
1979 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1980 lt_cv_prog_cc_pic='-KPIC'
1981 lt_cv_prog_cc_static='-Bstatic'
1982 if test "x$host_vendor" = xsni; then
1983 lt_cv_prog_cc_wl='-LD'
1984 else
1985 lt_cv_prog_cc_wl='-Wl,'
1986 fi
1987 ;;
1988
1989 uts4*)
1990 lt_cv_prog_cc_pic='-pic'
1991 lt_cv_prog_cc_static='-Bstatic'
1992 ;;
1993
1994 sysv4*MP*)
1995 if test -d /usr/nec ;then
1996 lt_cv_prog_cc_pic='-Kconform_pic'
1997 lt_cv_prog_cc_static='-Bstatic'
1998 fi
1999 ;;
2000
2001 *)
2002 lt_cv_prog_cc_can_build_shared=no
2003 ;;
2004 esac
2005 fi
a3da1d95 2006])
9b254687
GE
2007if test -z "$lt_cv_prog_cc_pic"; then
2008 AC_MSG_RESULT([none])
2009else
2010 AC_MSG_RESULT([$lt_cv_prog_cc_pic])
a3da1d95 2011
9b254687
GE
2012 # Check to make sure the pic_flag actually works.
2013 AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
2014 AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
2015 save_CFLAGS="$CFLAGS"
2016 CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
2017 AC_TRY_COMPILE([], [], [dnl
2018 case $host_os in
2019 hpux9* | hpux10* | hpux11*)
2020 # On HP-UX, both CC and GCC only warn that PIC is supported... then
2021 # they create non-PIC objects. So, if there were any warnings, we
2022 # assume that PIC is not supported.
2023 if test -s conftest.err; then
2024 lt_cv_prog_cc_pic_works=no
2025 else
2026 lt_cv_prog_cc_pic_works=yes
2027 fi
2028 ;;
2029 *)
2030 lt_cv_prog_cc_pic_works=yes
2031 ;;
2032 esac
2033 ], [dnl
2034 lt_cv_prog_cc_pic_works=no
2035 ])
2036 CFLAGS="$save_CFLAGS"
2037 ])
a3da1d95 2038
9b254687
GE
2039 if test "X$lt_cv_prog_cc_pic_works" = Xno; then
2040 lt_cv_prog_cc_pic=
2041 lt_cv_prog_cc_can_build_shared=no
2042 else
2043 lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
2044 fi
2045
2046 AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
2047fi
2048
2049# Check for any special shared library compilation flags.
2050if test -n "$lt_cv_prog_cc_shlib"; then
2051 AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
2052 if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
2053 else
2054 AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
2055 lt_cv_prog_cc_can_build_shared=no
2056 fi
2057fi
2058
2059AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
2060AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
2061 lt_cv_prog_cc_static_works=no
2062 save_LDFLAGS="$LDFLAGS"
2063 LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
2064 AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
2065 LDFLAGS="$save_LDFLAGS"
2066])
2067
2068# Belt *and* braces to stop my trousers falling down:
2069test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
2070AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
2071
2072pic_flag="$lt_cv_prog_cc_pic"
2073special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
2074wl="$lt_cv_prog_cc_wl"
2075link_static_flag="$lt_cv_prog_cc_static"
2076no_builtin_flag="$lt_cv_prog_cc_no_builtin"
2077can_build_shared="$lt_cv_prog_cc_can_build_shared"
2078
2079
2080# Check to see if options -o and -c are simultaneously supported by compiler
2081AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
2082AC_CACHE_VAL([lt_cv_compiler_c_o], [
2083$rm -r conftest 2>/dev/null
2084mkdir conftest
2085cd conftest
2086echo "int some_variable = 0;" > conftest.$ac_ext
2087mkdir out
2088# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
2089# that will create temporary files in the current directory regardless of
2090# the output directory. Thus, making CWD read-only will cause this test
2091# to fail, enabling locking or at least warning the user not to do parallel
2092# builds.
2093chmod -w .
2094save_CFLAGS="$CFLAGS"
2095CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
2096compiler_c_o=no
2097if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
2098 # The compiler can only warn and ignore the option if not recognized
2099 # So say no if there are warnings
2100 if test -s out/conftest.err; then
2101 lt_cv_compiler_c_o=no
2102 else
2103 lt_cv_compiler_c_o=yes
2104 fi
2105else
2106 # Append any errors to the config.log.
2107 cat out/conftest.err 1>&AC_FD_CC
2108 lt_cv_compiler_c_o=no
2109fi
2110CFLAGS="$save_CFLAGS"
2111chmod u+w .
2112$rm conftest* out/*
2113rmdir out
2114cd ..
2115rmdir conftest
2116$rm -r conftest 2>/dev/null
2117])
2118compiler_c_o=$lt_cv_compiler_c_o
2119AC_MSG_RESULT([$compiler_c_o])
2120
2121if test x"$compiler_c_o" = x"yes"; then
2122 # Check to see if we can write to a .lo
2123 AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
2124 AC_CACHE_VAL([lt_cv_compiler_o_lo], [
2125 lt_cv_compiler_o_lo=no
2126 save_CFLAGS="$CFLAGS"
2127 CFLAGS="$CFLAGS -c -o conftest.lo"
2128 save_objext="$ac_objext"
2129 ac_objext=lo
2130 AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2131 # The compiler can only warn and ignore the option if not recognized
2132 # So say no if there are warnings
2133 if test -s conftest.err; then
2134 lt_cv_compiler_o_lo=no
2135 else
2136 lt_cv_compiler_o_lo=yes
2137 fi
2138 ])
2139 ac_objext="$save_objext"
2140 CFLAGS="$save_CFLAGS"
2141 ])
2142 compiler_o_lo=$lt_cv_compiler_o_lo
2143 AC_MSG_RESULT([$compiler_o_lo])
2144else
2145 compiler_o_lo=no
2146fi
a3da1d95 2147
9b254687 2148# Check to see if we can do hard links to lock some files if needed
a3da1d95 2149hard_links="nottested"
9b254687 2150if test "$compiler_c_o" = no && test "$need_locks" != no; then
a3da1d95
GE
2151 # do not overwrite the value of need_locks provided by the user
2152 AC_MSG_CHECKING([if we can lock with hard links])
2153 hard_links=yes
2154 $rm conftest*
2155 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2156 touch conftest.a
2157 ln conftest.a conftest.b 2>&5 || hard_links=no
2158 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2159 AC_MSG_RESULT([$hard_links])
2160 if test "$hard_links" = no; then
9b254687 2161 AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
a3da1d95
GE
2162 need_locks=warn
2163 fi
2164else
2165 need_locks=no
2166fi
a3da1d95 2167
9b254687
GE
2168if test "$GCC" = yes; then
2169 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
2170 AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
2171 echo "int some_variable = 0;" > conftest.$ac_ext
2172 save_CFLAGS="$CFLAGS"
2173 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
2174 compiler_rtti_exceptions=no
2175 AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2176 # The compiler can only warn and ignore the option if not recognized
2177 # So say no if there are warnings
2178 if test -s conftest.err; then
2179 compiler_rtti_exceptions=no
2180 else
2181 compiler_rtti_exceptions=yes
2182 fi
2183 ])
2184 CFLAGS="$save_CFLAGS"
2185 AC_MSG_RESULT([$compiler_rtti_exceptions])
a3da1d95 2186
9b254687
GE
2187 if test "$compiler_rtti_exceptions" = "yes"; then
2188 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
2189 else
2190 no_builtin_flag=' -fno-builtin'
2191 fi
a3da1d95 2192fi
a3da1d95 2193
9b254687
GE
2194# See if the linker supports building shared libraries.
2195AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
2196
2197allow_undefined_flag=
2198no_undefined_flag=
2199need_lib_prefix=unknown
2200need_version=unknown
2201# when you set need_version to no, make sure it does not cause -set_version
2202# flags to be left without arguments
2203archive_cmds=
2204archive_expsym_cmds=
2205old_archive_from_new_cmds=
2206old_archive_from_expsyms_cmds=
2207export_dynamic_flag_spec=
2208whole_archive_flag_spec=
2209thread_safe_flag_spec=
2210hardcode_into_libs=no
2211hardcode_libdir_flag_spec=
2212hardcode_libdir_separator=
2213hardcode_direct=no
2214hardcode_minus_L=no
2215hardcode_shlibpath_var=unsupported
2216runpath_var=
2217link_all_deplibs=unknown
2218always_export_symbols=no
2219export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
2220# include_expsyms should be a list of space-separated symbols to be *always*
2221# included in the symbol list
2222include_expsyms=
2223# exclude_expsyms can be an egrep regular expression of symbols to exclude
2224# it will be wrapped by ` (' and `)$', so one must not match beginning or
2225# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
2226# as well as any symbol that contains `d'.
2227exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
2228# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
2229# platforms (ab)use it in PIC code, but their linkers get confused if
2230# the symbol is explicitly referenced. Since portable code cannot
2231# rely on this symbol name, it's probably fine to never include it in
2232# preloaded symbol tables.
2233extract_expsyms_cmds=
2234
2235case $host_os in
2236cygwin* | mingw* | pw32*)
2237 # FIXME: the MSVC++ port hasn't been tested in a loooong time
2238 # When not using gcc, we currently assume that we are using
2239 # Microsoft Visual C++.
2240 if test "$GCC" != yes; then
2241 with_gnu_ld=no
2242 fi
2243 ;;
2244openbsd*)
2245 with_gnu_ld=no
2246 ;;
2247esac
2248
2249ld_shlibs=yes
2250if test "$with_gnu_ld" = yes; then
2251 # If archive_cmds runs LD, not CC, wlarc should be empty
2252 wlarc='${wl}'
2253
2254 # See if GNU ld supports shared libraries.
2255 case $host_os in
2256 aix3* | aix4* | aix5*)
2257 # On AIX, the GNU linker is very broken
2258 # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
2259 ld_shlibs=no
2260 cat <<EOF 1>&2
2261
2262*** Warning: the GNU linker, at least up to release 2.9.1, is reported
2263*** to be unable to reliably create shared libraries on AIX.
2264*** Therefore, libtool is disabling shared libraries support. If you
2265*** really care for shared libraries, you may want to modify your PATH
2266*** so that a non-GNU linker is found, and then restart.
2267
2268EOF
2269 ;;
2270
2271 amigaos*)
2272 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
2273 hardcode_libdir_flag_spec='-L$libdir'
2274 hardcode_minus_L=yes
2275
2276 # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
2277 # that the semantics of dynamic libraries on AmigaOS, at least up
2278 # to version 4, is to share data among multiple programs linked
2279 # with the same dynamic library. Since this doesn't match the
2280 # behavior of shared libraries on other platforms, we can use
2281 # them.
2282 ld_shlibs=no
2283 ;;
2284
2285 beos*)
2286 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2287 allow_undefined_flag=unsupported
2288 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
2289 # support --undefined. This deserves some investigation. FIXME
2290 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2291 else
2292 ld_shlibs=no
2293 fi
2294 ;;
2295
2296 cygwin* | mingw* | pw32*)
2297 # hardcode_libdir_flag_spec is actually meaningless, as there is
2298 # no search path for DLLs.
2299 hardcode_libdir_flag_spec='-L$libdir'
2300 allow_undefined_flag=unsupported
2301 always_export_symbols=yes
2302
2303 extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
2304 sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
2305 test -f $output_objdir/impgen.exe || (cd $output_objdir && \
2306 if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
2307 else $CC -o impgen impgen.c ; fi)~
2308 $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
2309
2310 old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
2311
2312 # cygwin and mingw dlls have different entry points and sets of symbols
2313 # to exclude.
2314 # FIXME: what about values for MSVC?
2315 dll_entry=__cygwin_dll_entry@12
2316 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
2317 case $host_os in
2318 mingw*)
2319 # mingw values
2320 dll_entry=_DllMainCRTStartup@12
2321 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
2322 ;;
2323 esac
2324
2325 # mingw and cygwin differ, and it's simplest to just exclude the union
2326 # of the two symbol sets.
2327 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
2328
2329 # recent cygwin and mingw systems supply a stub DllMain which the user
2330 # can override, but on older systems we have to supply one (in ltdll.c)
2331 if test "x$lt_cv_need_dllmain" = "xyes"; then
2332 ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
2333 ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
2334 test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
2335 else
2336 ltdll_obj=
2337 ltdll_cmds=
2338 fi
2339
2340 # Extract the symbol export list from an `--export-all' def file,
2341 # then regenerate the def file from the symbol export list, so that
2342 # the compiled dll only exports the symbol export list.
2343 # Be careful not to strip the DATA tag left be newer dlltools.
2344 export_symbols_cmds="$ltdll_cmds"'
2345 $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
2346 sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
2347
2348 # If the export-symbols file already is a .def file (1st line
2349 # is EXPORTS), use it as is.
2350 # If DATA tags from a recent dlltool are present, honour them!
2351 archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
2352 cp $export_symbols $output_objdir/$soname-def;
2353 else
2354 echo EXPORTS > $output_objdir/$soname-def;
2355 _lt_hint=1;
2356 cat $export_symbols | while read symbol; do
2357 set dummy \$symbol;
2358 case \[$]# in
2359 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
2360 *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
2361 esac;
2362 _lt_hint=`expr 1 + \$_lt_hint`;
2363 done;
2364 fi~
2365 '"$ltdll_cmds"'
2366 $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
2367 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
2368 $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
2369 $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
2370 $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
2371 ;;
2372
2373 netbsd*)
2374 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2375 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
2376 wlarc=
2377 else
2378 archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2379 archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2380 fi
2381 ;;
2382
2383 solaris* | sysv5*)
2384 if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
2385 ld_shlibs=no
2386 cat <<EOF 1>&2
2387
2388*** Warning: The releases 2.8.* of the GNU linker cannot reliably
2389*** create shared libraries on Solaris systems. Therefore, libtool
2390*** is disabling shared libraries support. We urge you to upgrade GNU
2391*** binutils to release 2.9.1 or newer. Another option is to modify
2392*** your PATH or compiler configuration so that the native linker is
2393*** used, and then restart.
2394
2395EOF
2396 elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2397 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2398 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2399 else
2400 ld_shlibs=no
2401 fi
2402 ;;
2403
2404 sunos4*)
2405 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2406 wlarc=
2407 hardcode_direct=yes
2408 hardcode_shlibpath_var=no
2409 ;;
2410
2411 *)
2412 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2413 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2414 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2415 else
2416 ld_shlibs=no
2417 fi
2418 ;;
2419 esac
2420
2421 if test "$ld_shlibs" = yes; then
2422 runpath_var=LD_RUN_PATH
2423 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
2424 export_dynamic_flag_spec='${wl}--export-dynamic'
2425 case $host_os in
2426 cygwin* | mingw* | pw32*)
2427 # dlltool doesn't understand --whole-archive et. al.
2428 whole_archive_flag_spec=
2429 ;;
2430 *)
2431 # ancient GNU ld didn't support --whole-archive et. al.
2432 if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
2433 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
2434 else
2435 whole_archive_flag_spec=
2436 fi
2437 ;;
2438 esac
2439 fi
2440else
2441 # PORTME fill in a description of your system's linker (not GNU ld)
2442 case $host_os in
2443 aix3*)
2444 allow_undefined_flag=unsupported
2445 always_export_symbols=yes
2446 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
2447 # Note: this linker hardcodes the directories in LIBPATH if there
2448 # are no directories specified by -L.
2449 hardcode_minus_L=yes
2450 if test "$GCC" = yes && test -z "$link_static_flag"; then
2451 # Neither direct hardcoding nor static linking is supported with a
2452 # broken collect2.
2453 hardcode_direct=unsupported
2454 fi
2455 ;;
2456
2457 aix4* | aix5*)
2458 if test "$host_cpu" = ia64; then
2459 # On IA64, the linker does run time linking by default, so we don't
2460 # have to do anything special.
2461 aix_use_runtimelinking=no
2462 exp_sym_flag='-Bexport'
2463 no_entry_flag=""
2464 else
2465 aix_use_runtimelinking=no
2466
2467 # Test if we are trying to use run time linking or normal
2468 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
2469 # need to do runtime linking.
2470 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
2471 for ld_flag in $LDFLAGS; do
2472 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
2473 aix_use_runtimelinking=yes
2474 break
2475 fi
2476 done
2477 esac
2478
2479 exp_sym_flag='-bexport'
2480 no_entry_flag='-bnoentry'
2481 fi
2482
2483 # When large executables or shared objects are built, AIX ld can
2484 # have problems creating the table of contents. If linking a library
2485 # or program results in "error TOC overflow" add -mminimal-toc to
2486 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
2487 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
2488
2489 hardcode_direct=yes
2490 archive_cmds=''
2491 hardcode_libdir_separator=':'
2492 if test "$GCC" = yes; then
2493 case $host_os in aix4.[[012]]|aix4.[[012]].*)
2494 collect2name=`${CC} -print-prog-name=collect2`
2495 if test -f "$collect2name" && \
2496 strings "$collect2name" | grep resolve_lib_name >/dev/null
2497 then
2498 # We have reworked collect2
2499 hardcode_direct=yes
2500 else
2501 # We have old collect2
2502 hardcode_direct=unsupported
2503 # It fails to find uninstalled libraries when the uninstalled
2504 # path is not listed in the libpath. Setting hardcode_minus_L
2505 # to unsupported forces relinking
2506 hardcode_minus_L=yes
2507 hardcode_libdir_flag_spec='-L$libdir'
2508 hardcode_libdir_separator=
2509 fi
2510 esac
2511
2512 shared_flag='-shared'
2513 else
2514 # not using gcc
2515 if test "$host_cpu" = ia64; then
2516 shared_flag='${wl}-G'
2517 else
2518 if test "$aix_use_runtimelinking" = yes; then
2519 shared_flag='${wl}-G'
2520 else
2521 shared_flag='${wl}-bM:SRE'
2522 fi
2523 fi
2524 fi
2525
2526 # It seems that -bexpall can do strange things, so it is better to
2527 # generate a list of symbols to export.
2528 always_export_symbols=yes
2529 if test "$aix_use_runtimelinking" = yes; then
2530 # Warning - without using the other runtime loading flags (-brtl),
2531 # -berok will link without error, but may produce a broken library.
2532 allow_undefined_flag='-berok'
2533 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
2534 archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
2535 else
2536 if test "$host_cpu" = ia64; then
2537 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
2538 allow_undefined_flag="-z nodefs"
2539 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
2540 else
2541 hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
2542 # Warning - without using the other run time loading flags,
2543 # -berok will link without error, but may produce a broken library.
2544 allow_undefined_flag='${wl}-berok'
2545 # This is a bit strange, but is similar to how AIX traditionally builds
2546 # it's shared libraries.
2547 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
2548 fi
2549 fi
2550 ;;
2551
2552 amigaos*)
2553 archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
2554 hardcode_libdir_flag_spec='-L$libdir'
2555 hardcode_minus_L=yes
2556 # see comment about different semantics on the GNU ld section
2557 ld_shlibs=no
2558 ;;
2559
2560 cygwin* | mingw* | pw32*)
2561 # When not using gcc, we currently assume that we are using
2562 # Microsoft Visual C++.
2563 # hardcode_libdir_flag_spec is actually meaningless, as there is
2564 # no search path for DLLs.
2565 hardcode_libdir_flag_spec=' '
2566 allow_undefined_flag=unsupported
2567 # Tell ltmain to make .lib files, not .a files.
2568 libext=lib
2569 # FIXME: Setting linknames here is a bad hack.
2570 archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
2571 # The linker will automatically build a .lib file if we build a DLL.
2572 old_archive_from_new_cmds='true'
2573 # FIXME: Should let the user specify the lib program.
2574 old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
2575 fix_srcfile_path='`cygpath -w "$srcfile"`'
2576 ;;
2577
2578 darwin* | rhapsody*)
2579 case "$host_os" in
2580 rhapsody* | darwin1.[[012]])
2581 allow_undefined_flag='-undefined suppress'
2582 ;;
2583 *) # Darwin 1.3 on
2584 allow_undefined_flag='-flat_namespace -undefined suppress'
2585 ;;
2586 esac
2587 # FIXME: Relying on posixy $() will cause problems for
2588 # cross-compilation, but unfortunately the echo tests do not
2589 # yet detect zsh echo's removal of \ escapes.
2590 archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
2591 # We need to add '_' to the symbols in $export_symbols first
2592 #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
2593 hardcode_direct=yes
2594 hardcode_shlibpath_var=no
2595 whole_archive_flag_spec='-all_load $convenience'
2596 ;;
2597
2598 freebsd1*)
2599 ld_shlibs=no
2600 ;;
2601
2602 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
2603 # support. Future versions do this automatically, but an explicit c++rt0.o
2604 # does not break anything, and helps significantly (at the cost of a little
2605 # extra space).
2606 freebsd2.2*)
2607 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
2608 hardcode_libdir_flag_spec='-R$libdir'
2609 hardcode_direct=yes
2610 hardcode_shlibpath_var=no
2611 ;;
2612
2613 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
2614 freebsd2*)
2615 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2616 hardcode_direct=yes
2617 hardcode_minus_L=yes
2618 hardcode_shlibpath_var=no
2619 ;;
2620
2621 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
2622 freebsd*)
2623 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
2624 hardcode_libdir_flag_spec='-R$libdir'
2625 hardcode_direct=yes
2626 hardcode_shlibpath_var=no
2627 ;;
2628
2629 hpux9* | hpux10* | hpux11*)
2630 case $host_os in
2631 hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
2632 *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
2633 esac
2634 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
2635 hardcode_libdir_separator=:
2636 hardcode_direct=yes
2637 hardcode_minus_L=yes # Not in the search PATH, but as the default
2638 # location of the library.
2639 export_dynamic_flag_spec='${wl}-E'
2640 ;;
2641
2642 irix5* | irix6*)
2643 if test "$GCC" = yes; then
2644 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2645 else
2646 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2647 fi
2648 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2649 hardcode_libdir_separator=:
2650 link_all_deplibs=yes
2651 ;;
2652
2653 netbsd*)
2654 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2655 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
2656 else
2657 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
2658 fi
2659 hardcode_libdir_flag_spec='-R$libdir'
2660 hardcode_direct=yes
2661 hardcode_shlibpath_var=no
2662 ;;
2663
2664 newsos6)
2665 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2666 hardcode_direct=yes
2667 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2668 hardcode_libdir_separator=:
2669 hardcode_shlibpath_var=no
2670 ;;
2671
2672 openbsd*)
2673 hardcode_direct=yes
2674 hardcode_shlibpath_var=no
2675 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2676 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2677 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2678 export_dynamic_flag_spec='${wl}-E'
2679 else
2680 case "$host_os" in
2681 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
2682 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2683 hardcode_libdir_flag_spec='-R$libdir'
2684 ;;
2685 *)
2686 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2687 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2688 ;;
2689 esac
2690 fi
2691 ;;
2692
2693 os2*)
2694 hardcode_libdir_flag_spec='-L$libdir'
2695 hardcode_minus_L=yes
2696 allow_undefined_flag=unsupported
2697 archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
2698 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
2699 ;;
2700
2701 osf3*)
2702 if test "$GCC" = yes; then
2703 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2704 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2705 else
2706 allow_undefined_flag=' -expect_unresolved \*'
2707 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2708 fi
2709 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2710 hardcode_libdir_separator=:
2711 ;;
2712
2713 osf4* | osf5*) # as osf3* with the addition of -msym flag
2714 if test "$GCC" = yes; then
2715 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2716 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
2717 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2718 else
2719 allow_undefined_flag=' -expect_unresolved \*'
2720 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
2721 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
2722 $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
2723
2724 #Both c and cxx compiler support -rpath directly
2725 hardcode_libdir_flag_spec='-rpath $libdir'
2726 fi
2727 hardcode_libdir_separator=:
2728 ;;
2729
2730 sco3.2v5*)
2731 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2732 hardcode_shlibpath_var=no
2733 runpath_var=LD_RUN_PATH
2734 hardcode_runpath_var=yes
2735 export_dynamic_flag_spec='${wl}-Bexport'
2736 ;;
2737
2738 solaris*)
2739 # gcc --version < 3.0 without binutils cannot create self contained
2740 # shared libraries reliably, requiring libgcc.a to resolve some of
2741 # the object symbols generated in some cases. Libraries that use
2742 # assert need libgcc.a to resolve __eprintf, for example. Linking
2743 # a copy of libgcc.a into every shared library to guarantee resolving
2744 # such symbols causes other problems: According to Tim Van Holder
2745 # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
2746 # (to the application) exception stack for one thing.
2747 no_undefined_flag=' -z defs'
2748 if test "$GCC" = yes; then
2749 case `$CC --version 2>/dev/null` in
2750 [[12]].*)
2751 cat <<EOF 1>&2
2752
2753*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
2754*** create self contained shared libraries on Solaris systems, without
2755*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
2756*** -no-undefined support, which will at least allow you to build shared
2757*** libraries. However, you may find that when you link such libraries
2758*** into an application without using GCC, you have to manually add
2759*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
2760*** upgrade to a newer version of GCC. Another option is to rebuild your
2761*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
2762
2763EOF
2764 no_undefined_flag=
2765 ;;
2766 esac
2767 fi
2768 # $CC -shared without GNU ld will not create a library from C++
2769 # object files and a static libstdc++, better avoid it by now
2770 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2771 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2772 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2773 hardcode_libdir_flag_spec='-R$libdir'
2774 hardcode_shlibpath_var=no
2775 case $host_os in
2776 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
2777 *) # Supported since Solaris 2.6 (maybe 2.5.1?)
2778 whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
2779 esac
2780 link_all_deplibs=yes
2781 ;;
2782
2783 sunos4*)
2784 if test "x$host_vendor" = xsequent; then
2785 # Use $CC to link under sequent, because it throws in some extra .o
2786 # files that make .init and .fini sections work.
2787 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
2788 else
2789 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
2790 fi
2791 hardcode_libdir_flag_spec='-L$libdir'
2792 hardcode_direct=yes
2793 hardcode_minus_L=yes
2794 hardcode_shlibpath_var=no
2795 ;;
2796
2797 sysv4)
2798 if test "x$host_vendor" = xsno; then
2799 archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
2800 hardcode_direct=yes # is this really true???
2801 else
2802 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2803 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2804 fi
2805 runpath_var='LD_RUN_PATH'
2806 hardcode_shlibpath_var=no
2807 ;;
2808
2809 sysv4.3*)
2810 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2811 hardcode_shlibpath_var=no
2812 export_dynamic_flag_spec='-Bexport'
2813 ;;
2814
2815 sysv5*)
2816 no_undefined_flag=' -z text'
2817 # $CC -shared without GNU ld will not create a library from C++
2818 # object files and a static libstdc++, better avoid it by now
2819 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2820 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2821 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2822 hardcode_libdir_flag_spec=
2823 hardcode_shlibpath_var=no
2824 runpath_var='LD_RUN_PATH'
2825 ;;
2826
2827 uts4*)
2828 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2829 hardcode_libdir_flag_spec='-L$libdir'
2830 hardcode_shlibpath_var=no
2831 ;;
2832
2833 dgux*)
2834 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2835 hardcode_libdir_flag_spec='-L$libdir'
2836 hardcode_shlibpath_var=no
2837 ;;
2838
2839 sysv4*MP*)
2840 if test -d /usr/nec; then
2841 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2842 hardcode_shlibpath_var=no
2843 runpath_var=LD_RUN_PATH
2844 hardcode_runpath_var=yes
2845 ld_shlibs=yes
2846 fi
2847 ;;
2848
2849 sysv4.2uw2*)
2850 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2851 hardcode_direct=yes
2852 hardcode_minus_L=no
2853 hardcode_shlibpath_var=no
2854 hardcode_runpath_var=yes
2855 runpath_var=LD_RUN_PATH
2856 ;;
2857
2858 sysv5uw7* | unixware7*)
2859 no_undefined_flag='${wl}-z ${wl}text'
2860 if test "$GCC" = yes; then
2861 archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2862 else
2863 archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2864 fi
2865 runpath_var='LD_RUN_PATH'
2866 hardcode_shlibpath_var=no
2867 ;;
2868
2869 *)
2870 ld_shlibs=no
2871 ;;
2872 esac
2873fi
2874AC_MSG_RESULT([$ld_shlibs])
2875test "$ld_shlibs" = no && can_build_shared=no
a3da1d95 2876
a3da1d95 2877# Check hardcoding attributes.
9b254687
GE
2878AC_MSG_CHECKING([how to hardcode library paths into programs])
2879hardcode_action=
2880if test -n "$hardcode_libdir_flag_spec" || \
2881 test -n "$runpath_var"; then
a3da1d95
GE
2882
2883 # We can hardcode non-existant directories.
9b254687 2884 if test "$hardcode_direct" != no &&
a3da1d95
GE
2885 # If the only mechanism to avoid hardcoding is shlibpath_var, we
2886 # have to relink, otherwise we might link with an installed library
2887 # when we should be linking with a yet-to-be-installed one
9b254687
GE
2888 ## test "$hardcode_shlibpath_var" != no &&
2889 test "$hardcode_minus_L" != no; then
a3da1d95 2890 # Linking always hardcodes the temporary library directory.
9b254687 2891 hardcode_action=relink
a3da1d95
GE
2892 else
2893 # We can link without hardcoding, and we can hardcode nonexisting dirs.
9b254687 2894 hardcode_action=immediate
a3da1d95
GE
2895 fi
2896else
2897 # We cannot hardcode anything, or else we can only hardcode existing
2898 # directories.
9b254687 2899 hardcode_action=unsupported
a3da1d95 2900fi
9b254687 2901AC_MSG_RESULT([$hardcode_action])
a3da1d95 2902
9b254687 2903striplib=
a3da1d95
GE
2904old_striplib=
2905AC_MSG_CHECKING([whether stripping libraries is possible])
2906if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2907 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2908 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2909 AC_MSG_RESULT([yes])
2910else
2911 AC_MSG_RESULT([no])
2912fi
a3da1d95 2913
9b254687
GE
2914reload_cmds='$LD$reload_flag -o $output$reload_objs'
2915test -z "$deplibs_check_method" && deplibs_check_method=unknown
a3da1d95 2916
a3da1d95 2917# PORTME Fill in your ld.so characteristics
9b254687 2918AC_MSG_CHECKING([dynamic linker characteristics])
a3da1d95
GE
2919library_names_spec=
2920libname_spec='lib$name'
2921soname_spec=
2922postinstall_cmds=
2923postuninstall_cmds=
2924finish_cmds=
2925finish_eval=
2926shlibpath_var=
2927shlibpath_overrides_runpath=unknown
2928version_type=none
2929dynamic_linker="$host_os ld.so"
2930sys_lib_dlsearch_path_spec="/lib /usr/lib"
2931sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
a3da1d95
GE
2932
2933case $host_os in
2934aix3*)
2935 version_type=linux
2936 library_names_spec='${libname}${release}.so$versuffix $libname.a'
2937 shlibpath_var=LIBPATH
2938
9b254687 2939 # AIX has no versioning support, so we append a major version to the name.
a3da1d95
GE
2940 soname_spec='${libname}${release}.so$major'
2941 ;;
2942
2943aix4* | aix5*)
2944 version_type=linux
2945 if test "$host_cpu" = ia64; then
2946 # AIX 5 supports IA64
2947 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2948 shlibpath_var=LD_LIBRARY_PATH
2949 else
2950 # With GCC up to 2.95.x, collect2 would create an import file
2951 # for dependence libraries. The import file would start with
2952 # the line `#! .'. This would cause the generated library to
2953 # depend on `.', always an invalid library. This was fixed in
2954 # development snapshots of GCC prior to 3.0.
2955 case $host_os in
2956 aix4 | aix4.[[01]] | aix4.[[01]].*)
9b254687
GE
2957 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2958 echo ' yes '
2959 echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2960 :
2961 else
2962 can_build_shared=no
2963 fi
2964 ;;
a3da1d95 2965 esac
9b254687
GE
2966 # AIX (on Power*) has no versioning support, so currently we can
2967 # not hardcode correct soname into executable. Probably we can
2968 # add versioning support to collect2, so additional links can
2969 # be useful in future.
a3da1d95
GE
2970 if test "$aix_use_runtimelinking" = yes; then
2971 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2972 # instead of lib<name>.a to let people know that these are not
2973 # typical AIX shared libraries.
2974 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2975 else
2976 # We preserve .a as extension for shared libraries through AIX4.2
2977 # and later when we are not doing run time linking.
2978 library_names_spec='${libname}${release}.a $libname.a'
2979 soname_spec='${libname}${release}.so$major'
2980 fi
2981 shlibpath_var=LIBPATH
2982 fi
2983 ;;
2984
2985amigaos*)
2986 library_names_spec='$libname.ixlibrary $libname.a'
2987 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2988 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
2989 ;;
2990
2991beos*)
2992 library_names_spec='${libname}.so'
2993 dynamic_linker="$host_os ld.so"
2994 shlibpath_var=LIBRARY_PATH
2995 ;;
2996
2997bsdi4*)
2998 version_type=linux
2999 need_version=no
3000 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3001 soname_spec='${libname}${release}.so$major'
3002 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3003 shlibpath_var=LD_LIBRARY_PATH
3004 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3005 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
9b254687 3006 export_dynamic_flag_spec=-rdynamic
a3da1d95
GE
3007 # the default ld.so.conf also contains /usr/contrib/lib and
3008 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3009 # libtool to hard-code these into programs
3010 ;;
3011
3012cygwin* | mingw* | pw32*)
3013 version_type=windows
3014 need_version=no
3015 need_lib_prefix=no
3016 case $GCC,$host_os in
3017 yes,cygwin*)
3018 library_names_spec='$libname.dll.a'
a3da1d95
GE
3019 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
3020 postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
3021 dldir=$destdir/`dirname \$dlpath`~
3022 test -d \$dldir || mkdir -p \$dldir~
3023 $install_prog .libs/$dlname \$dldir/$dlname'
3024 postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
3025 dlpath=$dir/\$dldll~
3026 $rm \$dlpath'
3027 ;;
3028 yes,mingw*)
3029 library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
9b254687 3030 sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
a3da1d95
GE
3031 ;;
3032 yes,pw32*)
3033 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
3034 ;;
3035 *)
3036 library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
3037 ;;
3038 esac
3039 dynamic_linker='Win32 ld.exe'
3040 # FIXME: first we should search . and the directory the executable is in
3041 shlibpath_var=PATH
3042 ;;
3043
3044darwin* | rhapsody*)
3045 dynamic_linker="$host_os dyld"
3046 version_type=darwin
3047 need_lib_prefix=no
3048 need_version=no
3049 # FIXME: Relying on posixy $() will cause problems for
3050 # cross-compilation, but unfortunately the echo tests do not
3051 # yet detect zsh echo's removal of \ escapes.
3052 library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
3053 soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
3054 shlibpath_overrides_runpath=yes
3055 shlibpath_var=DYLD_LIBRARY_PATH
3056 ;;
3057
a3da1d95
GE
3058freebsd1*)
3059 dynamic_linker=no
3060 ;;
3061
3062freebsd*)
3063 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
3064 version_type=freebsd-$objformat
3065 case $version_type in
3066 freebsd-elf*)
3067 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3068 need_version=no
3069 need_lib_prefix=no
3070 ;;
3071 freebsd-*)
3072 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
3073 need_version=yes
3074 ;;
3075 esac
3076 shlibpath_var=LD_LIBRARY_PATH
3077 case $host_os in
3078 freebsd2*)
3079 shlibpath_overrides_runpath=yes
3080 ;;
9b254687 3081 *)
a3da1d95
GE
3082 shlibpath_overrides_runpath=no
3083 hardcode_into_libs=yes
3084 ;;
3085 esac
3086 ;;
3087
3088gnu*)
3089 version_type=linux
3090 need_lib_prefix=no
3091 need_version=no
3092 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
3093 soname_spec='${libname}${release}.so$major'
3094 shlibpath_var=LD_LIBRARY_PATH
3095 hardcode_into_libs=yes
3096 ;;
3097
3098hpux9* | hpux10* | hpux11*)
3099 # Give a soname corresponding to the major version so that dld.sl refuses to
3100 # link against other versions.
9b254687 3101 dynamic_linker="$host_os dld.sl"
a3da1d95
GE
3102 version_type=sunos
3103 need_lib_prefix=no
3104 need_version=no
9b254687
GE
3105 shlibpath_var=SHLIB_PATH
3106 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3107 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
3108 soname_spec='${libname}${release}.sl$major'
a3da1d95
GE
3109 # HP-UX runs *really* slowly unless shared libraries are mode 555.
3110 postinstall_cmds='chmod 555 $lib'
3111 ;;
3112
9b254687
GE
3113irix5* | irix6*)
3114 version_type=irix
a3da1d95
GE
3115 need_lib_prefix=no
3116 need_version=no
3117 soname_spec='${libname}${release}.so$major'
3118 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
3119 case $host_os in
9b254687 3120 irix5*)
a3da1d95
GE
3121 libsuff= shlibsuff=
3122 ;;
3123 *)
3124 case $LD in # libtool.m4 will add one of these switches to LD
3125 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
3126 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
3127 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
3128 *) libsuff= shlibsuff= libmagic=never-match;;
3129 esac
3130 ;;
3131 esac
3132 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3133 shlibpath_overrides_runpath=no
3134 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3135 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3136 ;;
3137
3138# No shared lib support for Linux oldld, aout, or coff.
9b254687 3139linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
a3da1d95
GE
3140 dynamic_linker=no
3141 ;;
3142
3143# This must be Linux ELF.
9b254687 3144linux-gnu*)
a3da1d95
GE
3145 version_type=linux
3146 need_lib_prefix=no
3147 need_version=no
3148 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3149 soname_spec='${libname}${release}.so$major'
3150 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
a3da1d95
GE
3151 shlibpath_var=LD_LIBRARY_PATH
3152 shlibpath_overrides_runpath=no
a3da1d95
GE
3153 # This implies no fast_install, which is unacceptable.
3154 # Some rework will be needed to allow for fast_install
3155 # before this can be enabled.
3156 hardcode_into_libs=yes
3157
3158 # We used to test for /lib/ld.so.1 and disable shared libraries on
3159 # powerpc, because MkLinux only supported shared libraries with the
3160 # GNU dynamic linker. Since this was broken with cross compilers,
3161 # most powerpc-linux boxes support dynamic linking these days and
3162 # people can always --disable-shared, the test was removed, and we
3163 # assume the GNU/Linux dynamic linker is in use.
3164 dynamic_linker='GNU/Linux ld.so'
3165 ;;
3166
3167netbsd*)
3168 version_type=sunos
3169 need_lib_prefix=no
3170 need_version=no
3171 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3172 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3173 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3174 dynamic_linker='NetBSD (a.out) ld.so'
3175 else
3176 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
3177 soname_spec='${libname}${release}.so$major'
3178 dynamic_linker='NetBSD ld.elf_so'
3179 fi
3180 shlibpath_var=LD_LIBRARY_PATH
3181 shlibpath_overrides_runpath=yes
3182 hardcode_into_libs=yes
3183 ;;
3184
3185newsos6)
3186 version_type=linux
3187 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3188 shlibpath_var=LD_LIBRARY_PATH
3189 shlibpath_overrides_runpath=yes
3190 ;;
3191
a3da1d95
GE
3192openbsd*)
3193 version_type=sunos
3194 need_lib_prefix=no
3195 need_version=no
a3da1d95 3196 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
9b254687
GE
3197 case "$host_os" in
3198 openbsd2.[[89]] | openbsd2.[[89]].*)
3199 shlibpath_overrides_runpath=no
3200 ;;
3201 *)
3202 shlibpath_overrides_runpath=yes
3203 ;;
3204 esac
a3da1d95
GE
3205 else
3206 shlibpath_overrides_runpath=yes
3207 fi
9b254687
GE
3208 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3209 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3210 shlibpath_var=LD_LIBRARY_PATH
a3da1d95
GE
3211 ;;
3212
3213os2*)
3214 libname_spec='$name'
3215 need_lib_prefix=no
3216 library_names_spec='$libname.dll $libname.a'
3217 dynamic_linker='OS/2 ld.exe'
3218 shlibpath_var=LIBPATH
3219 ;;
3220
3221osf3* | osf4* | osf5*)
3222 version_type=osf
a3da1d95
GE
3223 need_version=no
3224 soname_spec='${libname}${release}.so'
3225 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3226 shlibpath_var=LD_LIBRARY_PATH
3227 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3228 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3229 ;;
3230
3231sco3.2v5*)
3232 version_type=osf
3233 soname_spec='${libname}${release}.so$major'
3234 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3235 shlibpath_var=LD_LIBRARY_PATH
3236 ;;
3237
3238solaris*)
3239 version_type=linux
3240 need_lib_prefix=no
3241 need_version=no
3242 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3243 soname_spec='${libname}${release}.so$major'
3244 shlibpath_var=LD_LIBRARY_PATH
3245 shlibpath_overrides_runpath=yes
3246 hardcode_into_libs=yes
3247 # ldd complains unless libraries are executable
3248 postinstall_cmds='chmod +x $lib'
3249 ;;
3250
3251sunos4*)
3252 version_type=sunos
3253 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3254 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3255 shlibpath_var=LD_LIBRARY_PATH
3256 shlibpath_overrides_runpath=yes
3257 if test "$with_gnu_ld" = yes; then
3258 need_lib_prefix=no
3259 fi
3260 need_version=yes
3261 ;;
3262
3263sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3264 version_type=linux
3265 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3266 soname_spec='${libname}${release}.so$major'
3267 shlibpath_var=LD_LIBRARY_PATH
3268 case $host_vendor in
3269 sni)
3270 shlibpath_overrides_runpath=no
3271 ;;
3272 motorola)
3273 need_lib_prefix=no
3274 need_version=no
3275 shlibpath_overrides_runpath=no
3276 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3277 ;;
3278 esac
3279 ;;
3280
a3da1d95
GE
3281uts4*)
3282 version_type=linux
3283 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3284 soname_spec='${libname}${release}.so$major'
3285 shlibpath_var=LD_LIBRARY_PATH
3286 ;;
3287
9b254687
GE
3288dgux*)
3289 version_type=linux
3290 need_lib_prefix=no
3291 need_version=no
3292 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3293 soname_spec='${libname}${release}.so$major'
3294 shlibpath_var=LD_LIBRARY_PATH
a3da1d95
GE
3295 ;;
3296
9b254687
GE
3297sysv4*MP*)
3298 if test -d /usr/nec ;then
3299 version_type=linux
3300 library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
3301 soname_spec='$libname.so.$major'
3302 shlibpath_var=LD_LIBRARY_PATH
a3da1d95
GE
3303 fi
3304 ;;
3305
a3da1d95 3306*)
9b254687 3307 dynamic_linker=no
a3da1d95
GE
3308 ;;
3309esac
9b254687
GE
3310AC_MSG_RESULT([$dynamic_linker])
3311test "$dynamic_linker" = no && can_build_shared=no
a3da1d95 3312
9b254687 3313# Report the final consequences.
a3da1d95
GE
3314AC_MSG_CHECKING([if libtool supports shared libraries])
3315AC_MSG_RESULT([$can_build_shared])
3316
3317AC_MSG_CHECKING([whether to build shared libraries])
3318test "$can_build_shared" = "no" && enable_shared=no
3319
3320# On AIX, shared libraries and static libraries use the same namespace, and
3321# are all built from PIC.
3322case "$host_os" in
3323aix3*)
3324 test "$enable_shared" = yes && enable_static=no
3325 if test -n "$RANLIB"; then
3326 archive_cmds="$archive_cmds~\$RANLIB \$lib"
3327 postinstall_cmds='$RANLIB $lib'
3328 fi
3329 ;;
3330
3331aix4*)
3332 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3333 test "$enable_shared" = yes && enable_static=no
3334 fi
3335 ;;
3336esac
3337AC_MSG_RESULT([$enable_shared])
3338
3339AC_MSG_CHECKING([whether to build static libraries])
3340# Make sure either enable_shared or enable_static is yes.
3341test "$enable_shared" = yes || enable_static=yes
3342AC_MSG_RESULT([$enable_static])
3343
9b254687
GE
3344if test "$hardcode_action" = relink; then
3345 # Fast installation is not supported
3346 enable_fast_install=no
3347elif test "$shlibpath_overrides_runpath" = yes ||
3348 test "$enable_shared" = no; then
3349 # Fast installation is not necessary
3350 enable_fast_install=needless
a3da1d95
GE
3351fi
3352
9b254687
GE
3353variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3354if test "$GCC" = yes; then
3355 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
a3da1d95
GE
3356fi
3357
9b254687 3358AC_LIBTOOL_DLOPEN_SELF
a3da1d95 3359
9b254687
GE
3360if test "$enable_shared" = yes && test "$GCC" = yes; then
3361 case $archive_cmds in
3362 *'~'*)
3363 # FIXME: we may have to deal with multi-command sequences.
a3da1d95 3364 ;;
9b254687
GE
3365 '$CC '*)
3366 # Test whether the compiler implicitly links with -lc since on some
3367 # systems, -lgcc has to come before -lc. If gcc already passes -lc
3368 # to ld, don't add -lc before -lgcc.
3369 AC_MSG_CHECKING([whether -lc should be explicitly linked in])
3370 AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
3371 [$rm conftest*
3372 echo 'static int dummy;' > conftest.$ac_ext
3373
3374 if AC_TRY_EVAL(ac_compile); then
3375 soname=conftest
3376 lib=conftest
3377 libobjs=conftest.$ac_objext
3378 deplibs=
3379 wl=$lt_cv_prog_cc_wl
3380 compiler_flags=-v
3381 linker_flags=-v
3382 verstring=
3383 output_objdir=.
3384 libname=conftest
3385 save_allow_undefined_flag=$allow_undefined_flag
3386 allow_undefined_flag=
3387 if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
3388 then
3389 lt_cv_archive_cmds_need_lc=no
a3da1d95 3390 else
9b254687 3391 lt_cv_archive_cmds_need_lc=yes
a3da1d95 3392 fi
9b254687 3393 allow_undefined_flag=$save_allow_undefined_flag
a3da1d95 3394 else
9b254687
GE
3395 cat conftest.err 1>&5
3396 fi])
3397 AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
a3da1d95 3398 ;;
9b254687 3399 esac
a3da1d95 3400fi
9b254687 3401need_lc=${lt_cv_archive_cmds_need_lc-yes}
a3da1d95 3402
9b254687 3403# The second clause should only fire when bootstrapping the
a3da1d95
GE
3404# libtool distribution, otherwise you forgot to ship ltmain.sh
3405# with your package, and you will get complaints that there are
3406# no rules to generate ltmain.sh.
3407if test -f "$ltmain"; then
9b254687
GE
3408 :
3409else
3410 # If there is no Makefile yet, we rely on a make rule to execute
3411 # `config.status --recheck' to rerun these tests and create the
3412 # libtool script then.
3413 test -f Makefile && make "$ltmain"
3414fi
3415
3416if test -f "$ltmain"; then
3417 trap "$rm \"${ofile}T\"; exit 1" 1 2 15
3418 $rm -f "${ofile}T"
3419
3420 echo creating $ofile
3421
a3da1d95
GE
3422 # Now quote all the things that may contain metacharacters while being
3423 # careful not to overquote the AC_SUBSTed values. We take copies of the
3424 # variables and quote the copies for generation of the libtool script.
9b254687
GE
3425 for var in echo old_CC old_CFLAGS \
3426 AR AR_FLAGS CC LD LN_S NM SHELL \
3427 reload_flag reload_cmds wl \
3428 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
3429 thread_safe_flag_spec whole_archive_flag_spec libname_spec \
3430 library_names_spec soname_spec \
3431 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
3432 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
3433 postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
3434 old_striplib striplib file_magic_cmd export_symbols_cmds \
3435 deplibs_check_method allow_undefined_flag no_undefined_flag \
3436 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
3437 global_symbol_to_c_name_address \
3438 hardcode_libdir_flag_spec hardcode_libdir_separator \
a3da1d95 3439 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
9b254687 3440 compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
a3da1d95
GE
3441
3442 case $var in
9b254687 3443 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
a3da1d95 3444 old_postinstall_cmds | old_postuninstall_cmds | \
9b254687
GE
3445 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
3446 extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
3447 postinstall_cmds | postuninstall_cmds | \
3448 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
a3da1d95
GE
3449 # Double-quote double-evaled strings.
3450 eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
3451 ;;
3452 *)
3453 eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
3454 ;;
3455 esac
3456 done
3457
9b254687
GE
3458 cat <<__EOF__ > "${ofile}T"
3459#! $SHELL
a3da1d95 3460
9b254687 3461# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
a3da1d95
GE
3462# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
3463# NOTE: Changes made to this file will be lost: look at ltmain.sh.
3464#
9b254687 3465# Copyright (C) 1996-2000 Free Software Foundation, Inc.
a3da1d95
GE
3466# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3467#
3468# This program is free software; you can redistribute it and/or modify
3469# it under the terms of the GNU General Public License as published by
3470# the Free Software Foundation; either version 2 of the License, or
3471# (at your option) any later version.
3472#
3473# This program is distributed in the hope that it will be useful, but
3474# WITHOUT ANY WARRANTY; without even the implied warranty of
3475# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3476# General Public License for more details.
3477#
3478# You should have received a copy of the GNU General Public License
3479# along with this program; if not, write to the Free Software
3480# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3481#
3482# As a special exception to the GNU General Public License, if you
3483# distribute this file as part of a program that contains a
3484# configuration script generated by Autoconf, you may include it under
3485# the same distribution terms that you use for the rest of that program.
3486
3487# Sed that helps us avoid accidentally triggering echo(1) options like -n.
3488Xsed="sed -e s/^X//"
3489
3490# The HP-UX ksh and POSIX shell print the target directory to stdout
3491# if CDPATH is set.
3492if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
3493
9b254687 3494# ### BEGIN LIBTOOL CONFIG
a3da1d95
GE
3495
3496# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3497
3498# Shell to use when invoking shell scripts.
3499SHELL=$lt_SHELL
3500
3501# Whether or not to build shared libraries.
3502build_libtool_libs=$enable_shared
3503
3504# Whether or not to build static libraries.
3505build_old_libs=$enable_static
3506
3507# Whether or not to add -lc for building shared libraries.
9b254687 3508build_libtool_need_lc=$need_lc
a3da1d95
GE
3509
3510# Whether or not to optimize for fast installation.
3511fast_install=$enable_fast_install
3512
3513# The host system.
3514host_alias=$host_alias
3515host=$host
3516
3517# An echo program that does not interpret backslashes.
3518echo=$lt_echo
3519
3520# The archiver.
3521AR=$lt_AR
3522AR_FLAGS=$lt_AR_FLAGS
3523
9b254687
GE
3524# The default C compiler.
3525CC=$lt_CC
a3da1d95
GE
3526
3527# Is the compiler the GNU C compiler?
9b254687 3528with_gcc=$GCC
a3da1d95
GE
3529
3530# The linker used to build libraries.
9b254687 3531LD=$lt_LD
a3da1d95
GE
3532
3533# Whether we need hard or soft links.
3534LN_S=$lt_LN_S
3535
3536# A BSD-compatible nm program.
3537NM=$lt_NM
3538
a3da1d95
GE
3539# A symbol stripping program
3540STRIP=$STRIP
3541
3542# Used to examine libraries when file_magic_cmd begins "file"
3543MAGIC_CMD=$MAGIC_CMD
3544
3545# Used on cygwin: DLL creation program.
3546DLLTOOL="$DLLTOOL"
3547
3548# Used on cygwin: object dumper.
3549OBJDUMP="$OBJDUMP"
3550
3551# Used on cygwin: assembler.
3552AS="$AS"
3553
3554# The name of the directory that contains temporary libtool files.
3555objdir=$objdir
3556
3557# How to create reloadable object files.
3558reload_flag=$lt_reload_flag
3559reload_cmds=$lt_reload_cmds
3560
3561# How to pass a linker flag through the compiler.
9b254687 3562wl=$lt_wl
a3da1d95
GE
3563
3564# Object file suffix (normally "o").
3565objext="$ac_objext"
3566
3567# Old archive suffix (normally "a").
3568libext="$libext"
3569
3570# Executable file suffix (normally "").
3571exeext="$exeext"
3572
3573# Additional compiler flags for building library objects.
9b254687 3574pic_flag=$lt_pic_flag
a3da1d95
GE
3575pic_mode=$pic_mode
3576
a3da1d95 3577# Does compiler simultaneously support -c and -o options?
9b254687
GE
3578compiler_c_o=$lt_compiler_c_o
3579
3580# Can we write directly to a .lo ?
3581compiler_o_lo=$lt_compiler_o_lo
a3da1d95
GE
3582
3583# Must we lock files when doing compilation ?
3584need_locks=$lt_need_locks
3585
3586# Do we need the lib prefix for modules?
3587need_lib_prefix=$need_lib_prefix
3588
3589# Do we need a version for libraries?
3590need_version=$need_version
3591
3592# Whether dlopen is supported.
3593dlopen_support=$enable_dlopen
3594
3595# Whether dlopen of programs is supported.
3596dlopen_self=$enable_dlopen_self
3597
3598# Whether dlopen of statically linked programs is supported.
3599dlopen_self_static=$enable_dlopen_self_static
3600
3601# Compiler flag to prevent dynamic linking.
9b254687 3602link_static_flag=$lt_link_static_flag
a3da1d95
GE
3603
3604# Compiler flag to turn off builtin functions.
9b254687 3605no_builtin_flag=$lt_no_builtin_flag
a3da1d95
GE
3606
3607# Compiler flag to allow reflexive dlopens.
9b254687 3608export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
a3da1d95
GE
3609
3610# Compiler flag to generate shared objects directly from archives.
9b254687 3611whole_archive_flag_spec=$lt_whole_archive_flag_spec
a3da1d95
GE
3612
3613# Compiler flag to generate thread-safe objects.
9b254687 3614thread_safe_flag_spec=$lt_thread_safe_flag_spec
a3da1d95
GE
3615
3616# Library versioning type.
3617version_type=$version_type
3618
3619# Format of library name prefix.
3620libname_spec=$lt_libname_spec
3621
3622# List of archive names. First name is the real one, the rest are links.
3623# The last name is the one that the linker finds with -lNAME.
3624library_names_spec=$lt_library_names_spec
3625
3626# The coded name of the library, if different from the real name.
3627soname_spec=$lt_soname_spec
3628
3629# Commands used to build and install an old-style archive.
3630RANLIB=$lt_RANLIB
9b254687 3631old_archive_cmds=$lt_old_archive_cmds
a3da1d95
GE
3632old_postinstall_cmds=$lt_old_postinstall_cmds
3633old_postuninstall_cmds=$lt_old_postuninstall_cmds
3634
3635# Create an old-style archive from a shared archive.
9b254687 3636old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
a3da1d95
GE
3637
3638# Create a temporary old-style archive to link instead of a shared archive.
9b254687 3639old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
a3da1d95
GE
3640
3641# Commands used to build and install a shared archive.
9b254687
GE
3642archive_cmds=$lt_archive_cmds
3643archive_expsym_cmds=$lt_archive_expsym_cmds
a3da1d95
GE
3644postinstall_cmds=$lt_postinstall_cmds
3645postuninstall_cmds=$lt_postuninstall_cmds
3646
3647# Commands to strip libraries.
3648old_striplib=$lt_old_striplib
3649striplib=$lt_striplib
3650
a3da1d95
GE
3651# Method to check whether dependent libraries are shared objects.
3652deplibs_check_method=$lt_deplibs_check_method
3653
3654# Command to use when deplibs_check_method == file_magic.
3655file_magic_cmd=$lt_file_magic_cmd
3656
3657# Flag that allows shared libraries with undefined symbols to be built.
9b254687 3658allow_undefined_flag=$lt_allow_undefined_flag
a3da1d95
GE
3659
3660# Flag that forces no undefined symbols.
9b254687 3661no_undefined_flag=$lt_no_undefined_flag
a3da1d95
GE
3662
3663# Commands used to finish a libtool library installation in a directory.
3664finish_cmds=$lt_finish_cmds
3665
3666# Same as above, but a single script fragment to be evaled but not shown.
3667finish_eval=$lt_finish_eval
3668
3669# Take the output of nm and produce a listing of raw symbols and C names.
9b254687 3670global_symbol_pipe=$lt_global_symbol_pipe
a3da1d95
GE
3671
3672# Transform the output of nm in a proper C declaration
9b254687 3673global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
a3da1d95
GE
3674
3675# Transform the output of nm in a C name address pair
9b254687 3676global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
a3da1d95
GE
3677
3678# This is the shared library runtime path variable.
3679runpath_var=$runpath_var
3680
3681# This is the shared library path variable.
3682shlibpath_var=$shlibpath_var
3683
3684# Is shlibpath searched before the hard-coded library search path?
3685shlibpath_overrides_runpath=$shlibpath_overrides_runpath
3686
3687# How to hardcode a shared library path into an executable.
9b254687 3688hardcode_action=$hardcode_action
a3da1d95
GE
3689
3690# Whether we should hardcode library paths into libraries.
3691hardcode_into_libs=$hardcode_into_libs
3692
3693# Flag to hardcode \$libdir into a binary during linking.
3694# This must work even if \$libdir does not exist.
9b254687 3695hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
a3da1d95
GE
3696
3697# Whether we need a single -rpath flag with a separated argument.
9b254687 3698hardcode_libdir_separator=$lt_hardcode_libdir_separator
a3da1d95
GE
3699
3700# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
3701# resulting binary.
9b254687 3702hardcode_direct=$hardcode_direct
a3da1d95
GE
3703
3704# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
3705# resulting binary.
9b254687 3706hardcode_minus_L=$hardcode_minus_L
a3da1d95
GE
3707
3708# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
3709# the resulting binary.
9b254687 3710hardcode_shlibpath_var=$hardcode_shlibpath_var
a3da1d95
GE
3711
3712# Variables whose values should be saved in libtool wrapper scripts and
3713# restored at relink time.
3714variables_saved_for_relink="$variables_saved_for_relink"
3715
3716# Whether libtool must link a program against all its dependency libraries.
9b254687 3717link_all_deplibs=$link_all_deplibs
a3da1d95
GE
3718
3719# Compile-time system search path for libraries
3720sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
3721
3722# Run-time system search path for libraries
3723sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
3724
3725# Fix the shell variable \$srcfile for the compiler.
9b254687 3726fix_srcfile_path="$fix_srcfile_path"
a3da1d95
GE
3727
3728# Set to yes if exported symbols are required.
9b254687 3729always_export_symbols=$always_export_symbols
a3da1d95
GE
3730
3731# The commands to list exported symbols.
9b254687 3732export_symbols_cmds=$lt_export_symbols_cmds
a3da1d95
GE
3733
3734# The commands to extract the exported symbol list from a shared archive.
3735extract_expsyms_cmds=$lt_extract_expsyms_cmds
3736
3737# Symbols that should not be listed in the preloaded symbols.
9b254687 3738exclude_expsyms=$lt_exclude_expsyms
a3da1d95
GE
3739
3740# Symbols that must always be exported.
9b254687 3741include_expsyms=$lt_include_expsyms
a3da1d95 3742
9b254687 3743# ### END LIBTOOL CONFIG
a3da1d95
GE
3744
3745__EOF__
3746
a3da1d95
GE
3747 case $host_os in
3748 aix3*)
9b254687 3749 cat <<\EOF >> "${ofile}T"
a3da1d95
GE
3750
3751# AIX sometimes has problems with the GCC collect2 program. For some
3752# reason, if we set the COLLECT_NAMES environment variable, the problems
3753# vanish in a puff of smoke.
3754if test "X${COLLECT_NAMES+set}" != Xset; then
3755 COLLECT_NAMES=
3756 export COLLECT_NAMES
3757fi
3758EOF
3759 ;;
a3da1d95 3760 esac
a3da1d95
GE
3761
3762 case $host_os in
9b254687
GE
3763 cygwin* | mingw* | pw32* | os2*)
3764 cat <<'EOF' >> "${ofile}T"
3765 # This is a source program that is used to create dlls on Windows
3766 # Don't remove nor modify the starting and closing comments
a3da1d95
GE
3767# /* ltdll.c starts here */
3768# #define WIN32_LEAN_AND_MEAN
3769# #include <windows.h>
3770# #undef WIN32_LEAN_AND_MEAN
3771# #include <stdio.h>
3772#
3773# #ifndef __CYGWIN__
3774# # ifdef __CYGWIN32__
3775# # define __CYGWIN__ __CYGWIN32__
3776# # endif
3777# #endif
3778#
3779# #ifdef __cplusplus
3780# extern "C" {
3781# #endif
3782# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3783# #ifdef __cplusplus
3784# }
3785# #endif
3786#
3787# #ifdef __CYGWIN__
3788# #include <cygwin/cygwin_dll.h>
3789# DECLARE_CYGWIN_DLL( DllMain );
3790# #endif
3791# HINSTANCE __hDllInstance_base;
3792#
3793# BOOL APIENTRY
3794# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3795# {
3796# __hDllInstance_base = hInst;
3797# return TRUE;
3798# }
3799# /* ltdll.c ends here */
9b254687
GE
3800 # This is a source program that is used to create import libraries
3801 # on Windows for dlls which lack them. Don't remove nor modify the
3802 # starting and closing comments
a3da1d95 3803# /* impgen.c starts here */
9b254687 3804# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
a3da1d95
GE
3805#
3806# This file is part of GNU libtool.
3807#
3808# This program is free software; you can redistribute it and/or modify
3809# it under the terms of the GNU General Public License as published by
3810# the Free Software Foundation; either version 2 of the License, or
3811# (at your option) any later version.
3812#
3813# This program is distributed in the hope that it will be useful,
3814# but WITHOUT ANY WARRANTY; without even the implied warranty of
3815# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3816# GNU General Public License for more details.
3817#
3818# You should have received a copy of the GNU General Public License
3819# along with this program; if not, write to the Free Software
3820# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3821# */
3822#
3823# #include <stdio.h> /* for printf() */
3824# #include <unistd.h> /* for open(), lseek(), read() */
3825# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
3826# #include <string.h> /* for strdup() */
3827#
3828# /* O_BINARY isn't required (or even defined sometimes) under Unix */
3829# #ifndef O_BINARY
3830# #define O_BINARY 0
3831# #endif
3832#
3833# static unsigned int
3834# pe_get16 (fd, offset)
3835# int fd;
3836# int offset;
3837# {
3838# unsigned char b[2];
3839# lseek (fd, offset, SEEK_SET);
3840# read (fd, b, 2);
3841# return b[0] + (b[1]<<8);
3842# }
3843#
3844# static unsigned int
3845# pe_get32 (fd, offset)
3846# int fd;
3847# int offset;
3848# {
3849# unsigned char b[4];
3850# lseek (fd, offset, SEEK_SET);
3851# read (fd, b, 4);
3852# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3853# }
3854#
3855# static unsigned int
3856# pe_as32 (ptr)
3857# void *ptr;
3858# {
3859# unsigned char *b = ptr;
3860# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3861# }
3862#
3863# int
3864# main (argc, argv)
3865# int argc;
3866# char *argv[];
3867# {
3868# int dll;
3869# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3870# unsigned long export_rva, export_size, nsections, secptr, expptr;
3871# unsigned long name_rvas, nexp;
3872# unsigned char *expdata, *erva;
3873# char *filename, *dll_name;
3874#
3875# filename = argv[1];
3876#
3877# dll = open(filename, O_RDONLY|O_BINARY);
3878# if (dll < 1)
3879# return 1;
3880#
3881# dll_name = filename;
3882#
3883# for (i=0; filename[i]; i++)
3884# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
3885# dll_name = filename + i +1;
3886#
3887# pe_header_offset = pe_get32 (dll, 0x3c);
3888# opthdr_ofs = pe_header_offset + 4 + 20;
3889# num_entries = pe_get32 (dll, opthdr_ofs + 92);
3890#
3891# if (num_entries < 1) /* no exports */
3892# return 1;
3893#
3894# export_rva = pe_get32 (dll, opthdr_ofs + 96);
3895# export_size = pe_get32 (dll, opthdr_ofs + 100);
3896# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3897# secptr = (pe_header_offset + 4 + 20 +
3898# pe_get16 (dll, pe_header_offset + 4 + 16));
3899#
3900# expptr = 0;
3901# for (i = 0; i < nsections; i++)
3902# {
3903# char sname[8];
3904# unsigned long secptr1 = secptr + 40 * i;
3905# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3906# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3907# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3908# lseek(dll, secptr1, SEEK_SET);
3909# read(dll, sname, 8);
3910# if (vaddr <= export_rva && vaddr+vsize > export_rva)
3911# {
3912# expptr = fptr + (export_rva - vaddr);
3913# if (export_rva + export_size > vaddr + vsize)
3914# export_size = vsize - (export_rva - vaddr);
3915# break;
3916# }
3917# }
3918#
3919# expdata = (unsigned char*)malloc(export_size);
3920# lseek (dll, expptr, SEEK_SET);
3921# read (dll, expdata, export_size);
3922# erva = expdata - export_rva;
3923#
3924# nexp = pe_as32 (expdata+24);
3925# name_rvas = pe_as32 (expdata+32);
3926#
3927# printf ("EXPORTS\n");
3928# for (i = 0; i<nexp; i++)
3929# {
3930# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3931# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3932# }
3933#
3934# return 0;
3935# }
3936# /* impgen.c ends here */
a3da1d95 3937
9b254687
GE
3938EOF
3939 ;;
3940 esac
a3da1d95 3941
9b254687
GE
3942 # We use sed instead of cat because bash on DJGPP gets confused if
3943 # if finds mixed CR/LF and LF-only lines. Since sed operates in
3944 # text mode, it properly converts lines to CR/LF. This bash problem
3945 # is reportedly fixed, but why not run on old versions too?
3946 sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
a3da1d95 3947
9b254687
GE
3948 mv -f "${ofile}T" "$ofile" || \
3949 (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3950 chmod +x "$ofile"
3951fi
a3da1d95 3952
9b254687 3953])# _LT_AC_LTCONFIG_HACK
a3da1d95 3954
9b254687
GE
3955# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3956AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
a3da1d95 3957
9b254687
GE
3958# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3959AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
a3da1d95 3960
9b254687
GE
3961# AC_ENABLE_SHARED - implement the --enable-shared flag
3962# Usage: AC_ENABLE_SHARED[(DEFAULT)]
3963# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
3964# `yes'.
3965AC_DEFUN([AC_ENABLE_SHARED],
3966[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3967AC_ARG_ENABLE(shared,
3968changequote(<<, >>)dnl
3969<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3970changequote([, ])dnl
3971[p=${PACKAGE-default}
3972case $enableval in
3973yes) enable_shared=yes ;;
3974no) enable_shared=no ;;
3975*)
3976 enable_shared=no
3977 # Look at the argument we got. We use all the common list separators.
3978 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3979 for pkg in $enableval; do
3980 if test "X$pkg" = "X$p"; then
3981 enable_shared=yes
3982 fi
a3da1d95 3983 done
9b254687
GE
3984 IFS="$ac_save_ifs"
3985 ;;
3986esac],
3987enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3988])
a3da1d95 3989
9b254687
GE
3990# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3991AC_DEFUN([AC_DISABLE_SHARED],
3992[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3993AC_ENABLE_SHARED(no)])
a3da1d95 3994
9b254687
GE
3995# AC_ENABLE_STATIC - implement the --enable-static flag
3996# Usage: AC_ENABLE_STATIC[(DEFAULT)]
3997# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
3998# `yes'.
3999AC_DEFUN([AC_ENABLE_STATIC],
4000[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
4001AC_ARG_ENABLE(static,
4002changequote(<<, >>)dnl
4003<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
4004changequote([, ])dnl
4005[p=${PACKAGE-default}
4006case $enableval in
4007yes) enable_static=yes ;;
4008no) enable_static=no ;;
4009*)
4010 enable_static=no
4011 # Look at the argument we got. We use all the common list separators.
4012 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4013 for pkg in $enableval; do
4014 if test "X$pkg" = "X$p"; then
4015 enable_static=yes
a3da1d95 4016 fi
a3da1d95 4017 done
9b254687
GE
4018 IFS="$ac_save_ifs"
4019 ;;
4020esac],
4021enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
a3da1d95 4022])
9b254687
GE
4023
4024# AC_DISABLE_STATIC - set the default static flag to --disable-static
4025AC_DEFUN([AC_DISABLE_STATIC],
4026[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4027AC_ENABLE_STATIC(no)])
4028
4029
4030# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
4031# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
4032# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
4033# `yes'.
4034AC_DEFUN([AC_ENABLE_FAST_INSTALL],
4035[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
4036AC_ARG_ENABLE(fast-install,
4037changequote(<<, >>)dnl
4038<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
4039changequote([, ])dnl
4040[p=${PACKAGE-default}
4041case $enableval in
4042yes) enable_fast_install=yes ;;
4043no) enable_fast_install=no ;;
4044*)
4045 enable_fast_install=no
4046 # Look at the argument we got. We use all the common list separators.
4047 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4048 for pkg in $enableval; do
4049 if test "X$pkg" = "X$p"; then
4050 enable_fast_install=yes
4051 fi
4052 done
4053 IFS="$ac_save_ifs"
4054 ;;
4055esac],
4056enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
a3da1d95
GE
4057])
4058
9b254687
GE
4059# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
4060AC_DEFUN([AC_DISABLE_FAST_INSTALL],
4061[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4062AC_ENABLE_FAST_INSTALL(no)])
a3da1d95 4063
9b254687
GE
4064# AC_LIBTOOL_PICMODE - implement the --with-pic flag
4065# Usage: AC_LIBTOOL_PICMODE[(MODE)]
4066# Where MODE is either `yes' or `no'. If omitted, it defaults to
4067# `both'.
4068AC_DEFUN([AC_LIBTOOL_PICMODE],
4069[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4070pic_mode=ifelse($#,1,$1,default)])
a3da1d95
GE
4071
4072
9b254687
GE
4073# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
4074AC_DEFUN([AC_PATH_TOOL_PREFIX],
4075[AC_MSG_CHECKING([for $1])
4076AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4077[case $MAGIC_CMD in
4078 /*)
4079 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4080 ;;
4081 ?:/*)
4082 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4083 ;;
4084 *)
4085 ac_save_MAGIC_CMD="$MAGIC_CMD"
4086 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
4087dnl $ac_dummy forces splitting on constant user-supplied paths.
4088dnl POSIX.2 word splitting is done only on the output of word expansions,
4089dnl not every word. This closes a longstanding sh security hole.
4090 ac_dummy="ifelse([$2], , $PATH, [$2])"
4091 for ac_dir in $ac_dummy; do
4092 test -z "$ac_dir" && ac_dir=.
4093 if test -f $ac_dir/$1; then
4094 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4095 if test -n "$file_magic_test_file"; then
4096 case $deplibs_check_method in
4097 "file_magic "*)
4098 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4099 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4100 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4101 egrep "$file_magic_regex" > /dev/null; then
4102 :
4103 else
4104 cat <<EOF 1>&2
4105
4106*** Warning: the command libtool uses to detect shared libraries,
4107*** $file_magic_cmd, produces output that libtool cannot recognize.
4108*** The result is that libtool may fail to recognize shared libraries
4109*** as such. This will affect the creation of libtool libraries that
4110*** depend on shared libraries, but programs linked with such libtool
4111*** libraries will work regardless of this problem. Nevertheless, you
4112*** may want to report the problem to your system manager and/or to
4113*** bug-libtool@gnu.org
4114
4115EOF
4116 fi ;;
4117 esac
4118 fi
4119 break
4120 fi
4121 done
4122 IFS="$ac_save_ifs"
4123 MAGIC_CMD="$ac_save_MAGIC_CMD"
4124 ;;
4125esac])
4126MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4127if test -n "$MAGIC_CMD"; then
4128 AC_MSG_RESULT($MAGIC_CMD)
4129else
4130 AC_MSG_RESULT(no)
5fdb1cb1 4131fi
9b254687 4132])
a3da1d95 4133
a3da1d95 4134
9b254687
GE
4135# AC_PATH_MAGIC - find a file program which can recognise a shared library
4136AC_DEFUN([AC_PATH_MAGIC],
4137[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
4138AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
4139if test -z "$lt_cv_path_MAGIC_CMD"; then
4140 if test -n "$ac_tool_prefix"; then
4141 AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
4142 else
4143 MAGIC_CMD=:
4144 fi
4145fi
4146])
a3da1d95 4147
a3da1d95 4148
9b254687
GE
4149# AC_PROG_LD - find the path to the GNU or non-GNU linker
4150AC_DEFUN([AC_PROG_LD],
4151[AC_ARG_WITH(gnu-ld,
4152[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
4153test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4154AC_REQUIRE([AC_PROG_CC])dnl
4155AC_REQUIRE([AC_CANONICAL_HOST])dnl
4156AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4157AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4158ac_prog=ld
4159if test "$GCC" = yes; then
4160 # Check if gcc -print-prog-name=ld gives a path.
4161 AC_MSG_CHECKING([for ld used by GCC])
4162 case $host in
4163 *-*-mingw*)
4164 # gcc leaves a trailing carriage return which upsets mingw
4165 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4166 *)
4167 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4168 esac
4169 case $ac_prog in
4170 # Accept absolute paths.
4171 [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
4172 re_direlt='/[[^/]][[^/]]*/\.\./'
4173 # Canonicalize the path of ld
4174 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4175 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4176 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4177 done
4178 test -z "$LD" && LD="$ac_prog"
4179 ;;
4180 "")
4181 # If it fails, then pretend we aren't using GCC.
4182 ac_prog=ld
4183 ;;
4184 *)
4185 # If it is relative, then search for the first ld in PATH.
4186 with_gnu_ld=unknown
4187 ;;
4188 esac
4189elif test "$with_gnu_ld" = yes; then
4190 AC_MSG_CHECKING([for GNU ld])
a3da1d95 4191else
9b254687 4192 AC_MSG_CHECKING([for non-GNU ld])
a3da1d95 4193fi
9b254687
GE
4194AC_CACHE_VAL(lt_cv_path_LD,
4195[if test -z "$LD"; then
4196 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4197 for ac_dir in $PATH; do
4198 test -z "$ac_dir" && ac_dir=.
4199 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4200 lt_cv_path_LD="$ac_dir/$ac_prog"
4201 # Check to see if the program is GNU ld. I'd rather use --version,
4202 # but apparently some GNU ld's only accept -v.
4203 # Break only if it was the GNU/non-GNU ld that we prefer.
4204 if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4205 test "$with_gnu_ld" != no && break
4206 else
4207 test "$with_gnu_ld" != yes && break
4208 fi
4209 fi
4210 done
4211 IFS="$ac_save_ifs"
a3da1d95 4212else
9b254687
GE
4213 lt_cv_path_LD="$LD" # Let the user override the test with a path.
4214fi])
4215LD="$lt_cv_path_LD"
4216if test -n "$LD"; then
4217 AC_MSG_RESULT($LD)
4218else
4219 AC_MSG_RESULT(no)
a3da1d95 4220fi
9b254687
GE
4221test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4222AC_PROG_LD_GNU
4223])
a3da1d95 4224
9b254687
GE
4225# AC_PROG_LD_GNU -
4226AC_DEFUN([AC_PROG_LD_GNU],
4227[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4228[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4229if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4230 lt_cv_prog_gnu_ld=yes
4231else
4232 lt_cv_prog_gnu_ld=no
4233fi])
4234with_gnu_ld=$lt_cv_prog_gnu_ld
4235])
a3da1d95 4236
9b254687
GE
4237# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
4238# -- PORTME Some linkers may need a different reload flag.
4239AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
4240[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
4241[lt_cv_ld_reload_flag='-r'])
4242reload_flag=$lt_cv_ld_reload_flag
4243test -n "$reload_flag" && reload_flag=" $reload_flag"
4244])
4245
4246# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
4247# -- PORTME fill in with the dynamic library characteristics
4248AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
4249[AC_CACHE_CHECK([how to recognise dependant libraries],
4250lt_cv_deplibs_check_method,
4251[lt_cv_file_magic_cmd='$MAGIC_CMD'
4252lt_cv_file_magic_test_file=
4253lt_cv_deplibs_check_method='unknown'
4254# Need to set the preceding variable on all platforms that support
4255# interlibrary dependencies.
4256# 'none' -- dependencies not supported.
4257# `unknown' -- same as none, but documents that we really don't know.
4258# 'pass_all' -- all dependencies passed with no checks.
4259# 'test_compile' -- check by making test program.
4260# 'file_magic [[regex]]' -- check by looking for files in library path
4261# which responds to the $file_magic_cmd with a given egrep regex.
4262# If you have `file' or equivalent on your system and you're not sure
4263# whether `pass_all' will *always* work, you probably want this one.
4264
4265case $host_os in
4266aix4* | aix5*)
4267 lt_cv_deplibs_check_method=pass_all
4268 ;;
4269
4270beos*)
4271 lt_cv_deplibs_check_method=pass_all
4272 ;;
4273
4274bsdi4*)
4275 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4276 lt_cv_file_magic_cmd='/usr/bin/file -L'
4277 lt_cv_file_magic_test_file=/shlib/libc.so
4278 ;;
4279
4280cygwin* | mingw* | pw32*)
4281 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4282 lt_cv_file_magic_cmd='$OBJDUMP -f'
4283 ;;
4284
4285darwin* | rhapsody*)
4286 lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
4287 lt_cv_file_magic_cmd='/usr/bin/file -L'
4288 case "$host_os" in
4289 rhapsody* | darwin1.[[012]])
4290 lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
4291 ;;
4292 *) # Darwin 1.3 on
4293 lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
4294 ;;
4295 esac
4296 ;;
4297
4298freebsd*)
4299 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4300 case $host_cpu in
4301 i*86 )
4302 # Not sure whether the presence of OpenBSD here was a mistake.
4303 # Let's accept both of them until this is cleared up.
4304 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
4305 lt_cv_file_magic_cmd=/usr/bin/file
4306 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4307 ;;
4308 esac
4309 else
4310 lt_cv_deplibs_check_method=pass_all
4311 fi
4312 ;;
4313
4314gnu*)
4315 lt_cv_deplibs_check_method=pass_all
4316 ;;
4317
4318hpux10.20*|hpux11*)
4319 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
4320 lt_cv_file_magic_cmd=/usr/bin/file
4321 lt_cv_file_magic_test_file=/usr/lib/libc.sl
4322 ;;
4323
4324irix5* | irix6*)
4325 case $host_os in
4326 irix5*)
4327 # this will be overridden with pass_all, but let us keep it just in case
4328 lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
4329 ;;
4330 *)
4331 case $LD in
4332 *-32|*"-32 ") libmagic=32-bit;;
4333 *-n32|*"-n32 ") libmagic=N32;;
4334 *-64|*"-64 ") libmagic=64-bit;;
4335 *) libmagic=never-match;;
4336 esac
4337 # this will be overridden with pass_all, but let us keep it just in case
4338 lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
4339 ;;
4340 esac
4341 lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
4342 lt_cv_deplibs_check_method=pass_all
4343 ;;
4344
4345# This must be Linux ELF.
4346linux-gnu*)
4347 case $host_cpu in
4348 alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
4349 lt_cv_deplibs_check_method=pass_all ;;
4350 *)
4351 # glibc up to 2.1.1 does not perform some relocations on ARM
4352 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
4353 esac
4354 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
4355 ;;
4356
4357netbsd*)
4358 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4359 lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
4360 else
4361 lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
4362 fi
4363 ;;
4364
4365newos6*)
4366 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4367 lt_cv_file_magic_cmd=/usr/bin/file
4368 lt_cv_file_magic_test_file=/usr/lib/libnls.so
4369 ;;
4370
4371openbsd*)
4372 lt_cv_file_magic_cmd=/usr/bin/file
4373 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4374 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4375 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
4376 else
4377 lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
4378 fi
4379 ;;
4380
4381osf3* | osf4* | osf5*)
4382 # this will be overridden with pass_all, but let us keep it just in case
4383 lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
4384 lt_cv_file_magic_test_file=/shlib/libc.so
4385 lt_cv_deplibs_check_method=pass_all
4386 ;;
4387
4388sco3.2v5*)
4389 lt_cv_deplibs_check_method=pass_all
4390 ;;
4391
4392solaris*)
4393 lt_cv_deplibs_check_method=pass_all
4394 lt_cv_file_magic_test_file=/lib/libc.so
4395 ;;
4396
4397sysv5uw[[78]]* | sysv4*uw2*)
4398 lt_cv_deplibs_check_method=pass_all
4399 ;;
4400
4401sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4402 case $host_vendor in
4403 motorola)
4404 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
4405 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4406 ;;
4407 ncr)
4408 lt_cv_deplibs_check_method=pass_all
4409 ;;
4410 sequent)
4411 lt_cv_file_magic_cmd='/bin/file'
4412 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4413 ;;
4414 sni)
4415 lt_cv_file_magic_cmd='/bin/file'
4416 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4417 lt_cv_file_magic_test_file=/lib/libc.so
4418 ;;
4419 esac
4420 ;;
4421esac
4422])
4423file_magic_cmd=$lt_cv_file_magic_cmd
4424deplibs_check_method=$lt_cv_deplibs_check_method
4425])
a3da1d95 4426
5fdb1cb1 4427
9b254687
GE
4428# AC_PROG_NM - find the path to a BSD-compatible name lister
4429AC_DEFUN([AC_PROG_NM],
4430[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4431AC_MSG_CHECKING([for BSD-compatible nm])
4432AC_CACHE_VAL(lt_cv_path_NM,
4433[if test -n "$NM"; then
4434 # Let the user override the test.
4435 lt_cv_path_NM="$NM"
a3da1d95 4436else
9b254687
GE
4437 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4438 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
4439 test -z "$ac_dir" && ac_dir=.
4440 tmp_nm=$ac_dir/${ac_tool_prefix}nm
4441 if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
4442 # Check to see if the nm accepts a BSD-compat flag.
4443 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4444 # nm: unknown option "B" ignored
4445 # Tru64's nm complains that /dev/null is an invalid object file
4446 if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
4447 lt_cv_path_NM="$tmp_nm -B"
4448 break
4449 elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
4450 lt_cv_path_NM="$tmp_nm -p"
4451 break
4452 else
4453 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4454 continue # so that we can try to find one that supports BSD flags
4455 fi
4456 fi
4457 done
4458 IFS="$ac_save_ifs"
4459 test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
a3da1d95 4460fi])
9b254687
GE
4461NM="$lt_cv_path_NM"
4462AC_MSG_RESULT([$NM])
4463])
a3da1d95 4464
9b254687
GE
4465# AC_CHECK_LIBM - check for math library
4466AC_DEFUN([AC_CHECK_LIBM],
4467[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4468LIBM=
4469case $host in
4470*-*-beos* | *-*-cygwin* | *-*-pw32*)
4471 # These system don't have libm
4472 ;;
4473*-ncr-sysv4.3*)
4474 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4475 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
4476 ;;
4477*)
4478 AC_CHECK_LIB(m, main, LIBM="-lm")
4479 ;;
4480esac
4481])
a3da1d95 4482
9b254687
GE
4483# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
4484# the libltdl convenience library and INCLTDL to the include flags for
4485# the libltdl header and adds --enable-ltdl-convenience to the
4486# configure arguments. Note that LIBLTDL and INCLTDL are not
4487# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
4488# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
4489# with '${top_builddir}/' and INCLTDL will be prefixed with
4490# '${top_srcdir}/' (note the single quotes!). If your package is not
4491# flat and you're not using automake, define top_builddir and
4492# top_srcdir appropriately in the Makefiles.
4493AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
4494[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4495 case $enable_ltdl_convenience in
4496 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
4497 "") enable_ltdl_convenience=yes
4498 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
a3da1d95 4499 esac
9b254687
GE
4500 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
4501 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4502])
4503
4504# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
4505# the libltdl installable library and INCLTDL to the include flags for
4506# the libltdl header and adds --enable-ltdl-install to the configure
4507# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
4508# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
4509# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
4510# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
4511# with '${top_srcdir}/' (note the single quotes!). If your package is
4512# not flat and you're not using automake, define top_builddir and
4513# top_srcdir appropriately in the Makefiles.
4514# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
4515AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
4516[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4517 AC_CHECK_LIB(ltdl, main,
4518 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
4519 [if test x"$enable_ltdl_install" = xno; then
4520 AC_MSG_WARN([libltdl not installed, but installation disabled])
4521 else
4522 enable_ltdl_install=yes
4523 fi
4524 ])
4525 if test x"$enable_ltdl_install" = x"yes"; then
4526 ac_configure_args="$ac_configure_args --enable-ltdl-install"
4527 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
4528 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4529 else
4530 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
4531 LIBLTDL="-lltdl"
4532 INCLTDL=
4533 fi
4534])
4535
4536# old names
4537AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
4538AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
4539AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
4540AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
4541AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
4542AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
4543AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
4544
4545# This is just to silence aclocal about the macro not being used
4546ifelse([AC_DISABLE_FAST_INSTALL])
a3da1d95 4547
1941414d
TJ
4548# Define a conditional.
4549
4550AC_DEFUN([AM_CONDITIONAL],
4551[AC_SUBST($1_TRUE)
4552AC_SUBST($1_FALSE)
4553if $2; then
4554 $1_TRUE=
4555 $1_FALSE='#'
4556else
4557 $1_TRUE='#'
4558 $1_FALSE=
4559fi])
4560