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