source: trunk/third/gettext/m4/libtool.m4 @ 16931

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