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