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