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