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