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