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