1# generated automatically by aclocal 1.7.2 -*- 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
14# Do all the work for Automake.                            -*- Autoconf -*-
15
16# This macro actually does too much some checks are only needed if
17# your package does certain things.  But this isn't really a big deal.
18
19# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
20# Free Software Foundation, Inc.
21
22# This program is free software; you can redistribute it and/or modify
23# it under the terms of the GNU General Public License as published by
24# the Free Software Foundation; either version 2, or (at your option)
25# any later version.
26
27# This program is distributed in the hope that it will be useful,
28# but WITHOUT ANY WARRANTY; without even the implied warranty of
29# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30# GNU General Public License for more details.
31
32# You should have received a copy of the GNU General Public License
33# along with this program; if not, write to the Free Software
34# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35# 02111-1307, USA.
36
37# serial 8
38
39# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
40# written in clear, in which case automake, when reading aclocal.m4,
41# will think it sees a *use*, and therefore will trigger all it's
42# C support machinery.  Also note that it means that autoscan, seeing
43# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
44
45
46AC_PREREQ([2.54])
47
48# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
49# the ones we care about.
50m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
51
52# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
53# AM_INIT_AUTOMAKE([OPTIONS])
54# -----------------------------------------------
55# The call with PACKAGE and VERSION arguments is the old style
56# call (pre autoconf-2.50), which is being phased out.  PACKAGE
57# and VERSION should now be passed to AC_INIT and removed from
58# the call to AM_INIT_AUTOMAKE.
59# We support both call styles for the transition.  After
60# the next Automake release, Autoconf can make the AC_INIT
61# arguments mandatory, and then we can depend on a new Autoconf
62# release and drop the old call support.
63AC_DEFUN([AM_INIT_AUTOMAKE],
64[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
65 AC_REQUIRE([AC_PROG_INSTALL])dnl
66# test to see if srcdir already configured
67if test "`cd $srcdir && pwd`" != "`pwd`" &&
68   test -f $srcdir/config.status; then
69  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
70fi
71
72# test whether we have cygpath
73if test -z "$CYGPATH_W"; then
74  if (cygpath --version) >/dev/null 2>/dev/null; then
75    CYGPATH_W='cygpath -w'
76  else
77    CYGPATH_W=echo
78  fi
79fi
80AC_SUBST([CYGPATH_W])
81
82# Define the identity of the package.
83dnl Distinguish between old-style and new-style calls.
84m4_ifval([$2],
85[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
86 AC_SUBST([PACKAGE], [$1])dnl
87 AC_SUBST([VERSION], [$2])],
88[_AM_SET_OPTIONS([$1])dnl
89 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
90 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
91
92_AM_IF_OPTION([no-define],,
93[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
94 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
95
96# Some tools Automake needs.
97AC_REQUIRE([AM_SANITY_CHECK])dnl
98AC_REQUIRE([AC_ARG_PROGRAM])dnl
99AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
100AM_MISSING_PROG(AUTOCONF, autoconf)
101AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
102AM_MISSING_PROG(AUTOHEADER, autoheader)
103AM_MISSING_PROG(MAKEINFO, makeinfo)
104AM_MISSING_PROG(AMTAR, tar)
105AM_PROG_INSTALL_SH
106AM_PROG_INSTALL_STRIP
107# We need awk for the "check" target.  The system "awk" is bad on
108# some platforms.
109AC_REQUIRE([AC_PROG_AWK])dnl
110AC_REQUIRE([AC_PROG_MAKE_SET])dnl
111
112_AM_IF_OPTION([no-dependencies],,
113[AC_PROVIDE_IFELSE([AC_PROG_CC],
114                  [_AM_DEPENDENCIES(CC)],
115                  [define([AC_PROG_CC],
116                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
117AC_PROVIDE_IFELSE([AC_PROG_CXX],
118                  [_AM_DEPENDENCIES(CXX)],
119                  [define([AC_PROG_CXX],
120                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
121])
122])
123
124
125# When config.status generates a header, we must update the stamp-h file.
126# This file resides in the same directory as the config header
127# that is generated.  The stamp files are numbered to have different names.
128
129# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
130# loop where config.status creates the headers, so we can generate
131# our stamp files there.
132AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
133[_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
134echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
135
136# Copyright 2002  Free Software Foundation, Inc.
137
138# This program is free software; you can redistribute it and/or modify
139# it under the terms of the GNU General Public License as published by
140# the Free Software Foundation; either version 2, or (at your option)
141# any later version.
142
143# This program is distributed in the hope that it will be useful,
144# but WITHOUT ANY WARRANTY; without even the implied warranty of
145# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
146# GNU General Public License for more details.
147
148# You should have received a copy of the GNU General Public License
149# along with this program; if not, write to the Free Software
150# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
151
152# AM_AUTOMAKE_VERSION(VERSION)
153# ----------------------------
154# Automake X.Y traces this macro to ensure aclocal.m4 has been
155# generated from the m4 files accompanying Automake X.Y.
156AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
157
158# AM_SET_CURRENT_AUTOMAKE_VERSION
159# -------------------------------
160# Call AM_AUTOMAKE_VERSION so it can be traced.
161# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
162AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
163	 [AM_AUTOMAKE_VERSION([1.7.2])])
164
165# Helper functions for option handling.                    -*- Autoconf -*-
166
167# Copyright 2001, 2002  Free Software Foundation, Inc.
168
169# This program is free software; you can redistribute it and/or modify
170# it under the terms of the GNU General Public License as published by
171# the Free Software Foundation; either version 2, or (at your option)
172# any later version.
173
174# This program is distributed in the hope that it will be useful,
175# but WITHOUT ANY WARRANTY; without even the implied warranty of
176# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
177# GNU General Public License for more details.
178
179# You should have received a copy of the GNU General Public License
180# along with this program; if not, write to the Free Software
181# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
182# 02111-1307, USA.
183
184# serial 2
185
186# _AM_MANGLE_OPTION(NAME)
187# -----------------------
188AC_DEFUN([_AM_MANGLE_OPTION],
189[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
190
191# _AM_SET_OPTION(NAME)
192# ------------------------------
193# Set option NAME.  Presently that only means defining a flag for this option.
194AC_DEFUN([_AM_SET_OPTION],
195[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
196
197# _AM_SET_OPTIONS(OPTIONS)
198# ----------------------------------
199# OPTIONS is a space-separated list of Automake options.
200AC_DEFUN([_AM_SET_OPTIONS],
201[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
202
203# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
204# -------------------------------------------
205# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
206AC_DEFUN([_AM_IF_OPTION],
207[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
208
209#
210# Check to make sure that the build environment is sane.
211#
212
213# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
214
215# This program is free software; you can redistribute it and/or modify
216# it under the terms of the GNU General Public License as published by
217# the Free Software Foundation; either version 2, or (at your option)
218# any later version.
219
220# This program is distributed in the hope that it will be useful,
221# but WITHOUT ANY WARRANTY; without even the implied warranty of
222# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
223# GNU General Public License for more details.
224
225# You should have received a copy of the GNU General Public License
226# along with this program; if not, write to the Free Software
227# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
228# 02111-1307, USA.
229
230# serial 3
231
232# AM_SANITY_CHECK
233# ---------------
234AC_DEFUN([AM_SANITY_CHECK],
235[AC_MSG_CHECKING([whether build environment is sane])
236# Just in case
237sleep 1
238echo timestamp > conftest.file
239# Do `set' in a subshell so we don't clobber the current shell's
240# arguments.  Must try -L first in case configure is actually a
241# symlink; some systems play weird games with the mod time of symlinks
242# (eg FreeBSD returns the mod time of the symlink's containing
243# directory).
244if (
245   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
246   if test "$[*]" = "X"; then
247      # -L didn't work.
248      set X `ls -t $srcdir/configure conftest.file`
249   fi
250   rm -f conftest.file
251   if test "$[*]" != "X $srcdir/configure conftest.file" \
252      && test "$[*]" != "X conftest.file $srcdir/configure"; then
253
254      # If neither matched, then we have a broken ls.  This can happen
255      # if, for instance, CONFIG_SHELL is bash and it inherits a
256      # broken ls alias from the environment.  This has actually
257      # happened.  Such a system could not be considered "sane".
258      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
259alias in your environment])
260   fi
261
262   test "$[2]" = conftest.file
263   )
264then
265   # Ok.
266   :
267else
268   AC_MSG_ERROR([newly created file is older than distributed files!
269Check your system clock])
270fi
271AC_MSG_RESULT(yes)])
272
273#  -*- Autoconf -*-
274
275
276# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
277
278# This program is free software; you can redistribute it and/or modify
279# it under the terms of the GNU General Public License as published by
280# the Free Software Foundation; either version 2, or (at your option)
281# any later version.
282
283# This program is distributed in the hope that it will be useful,
284# but WITHOUT ANY WARRANTY; without even the implied warranty of
285# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
286# GNU General Public License for more details.
287
288# You should have received a copy of the GNU General Public License
289# along with this program; if not, write to the Free Software
290# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
291# 02111-1307, USA.
292
293# serial 3
294
295# AM_MISSING_PROG(NAME, PROGRAM)
296# ------------------------------
297AC_DEFUN([AM_MISSING_PROG],
298[AC_REQUIRE([AM_MISSING_HAS_RUN])
299$1=${$1-"${am_missing_run}$2"}
300AC_SUBST($1)])
301
302
303# AM_MISSING_HAS_RUN
304# ------------------
305# Define MISSING if not defined so far and test if it supports --run.
306# If it does, set am_missing_run to use it, otherwise, to nothing.
307AC_DEFUN([AM_MISSING_HAS_RUN],
308[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
309test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
310# Use eval to expand $SHELL
311if eval "$MISSING --run true"; then
312  am_missing_run="$MISSING --run "
313else
314  am_missing_run=
315  AC_MSG_WARN([`missing' script is too old or missing])
316fi
317])
318
319# AM_AUX_DIR_EXPAND
320
321# Copyright 2001 Free Software Foundation, Inc.
322
323# This program is free software; you can redistribute it and/or modify
324# it under the terms of the GNU General Public License as published by
325# the Free Software Foundation; either version 2, or (at your option)
326# any later version.
327
328# This program is distributed in the hope that it will be useful,
329# but WITHOUT ANY WARRANTY; without even the implied warranty of
330# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
331# GNU General Public License for more details.
332
333# You should have received a copy of the GNU General Public License
334# along with this program; if not, write to the Free Software
335# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
336# 02111-1307, USA.
337
338# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
339# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
340# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
341#
342# Of course, Automake must honor this variable whenever it calls a
343# tool from the auxiliary directory.  The problem is that $srcdir (and
344# therefore $ac_aux_dir as well) can be either absolute or relative,
345# depending on how configure is run.  This is pretty annoying, since
346# it makes $ac_aux_dir quite unusable in subdirectories: in the top
347# source directory, any form will work fine, but in subdirectories a
348# relative path needs to be adjusted first.
349#
350# $ac_aux_dir/missing
351#    fails when called from a subdirectory if $ac_aux_dir is relative
352# $top_srcdir/$ac_aux_dir/missing
353#    fails if $ac_aux_dir is absolute,
354#    fails when called from a subdirectory in a VPATH build with
355#          a relative $ac_aux_dir
356#
357# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
358# are both prefixed by $srcdir.  In an in-source build this is usually
359# harmless because $srcdir is `.', but things will broke when you
360# start a VPATH build or use an absolute $srcdir.
361#
362# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
363# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
364#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
365# and then we would define $MISSING as
366#   MISSING="\${SHELL} $am_aux_dir/missing"
367# This will work as long as MISSING is not called from configure, because
368# unfortunately $(top_srcdir) has no meaning in configure.
369# However there are other variables, like CC, which are often used in
370# configure, and could therefore not use this "fixed" $ac_aux_dir.
371#
372# Another solution, used here, is to always expand $ac_aux_dir to an
373# absolute PATH.  The drawback is that using absolute paths prevent a
374# configured tree to be moved without reconfiguration.
375
376# Rely on autoconf to set up CDPATH properly.
377AC_PREREQ([2.50])
378
379AC_DEFUN([AM_AUX_DIR_EXPAND], [
380# expand $ac_aux_dir to an absolute path
381am_aux_dir=`cd $ac_aux_dir && pwd`
382])
383
384# AM_PROG_INSTALL_SH
385# ------------------
386# Define $install_sh.
387
388# Copyright 2001 Free Software Foundation, Inc.
389
390# This program is free software; you can redistribute it and/or modify
391# it under the terms of the GNU General Public License as published by
392# the Free Software Foundation; either version 2, or (at your option)
393# any later version.
394
395# This program is distributed in the hope that it will be useful,
396# but WITHOUT ANY WARRANTY; without even the implied warranty of
397# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
398# GNU General Public License for more details.
399
400# You should have received a copy of the GNU General Public License
401# along with this program; if not, write to the Free Software
402# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
403# 02111-1307, USA.
404
405AC_DEFUN([AM_PROG_INSTALL_SH],
406[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
407install_sh=${install_sh-"$am_aux_dir/install-sh"}
408AC_SUBST(install_sh)])
409
410# AM_PROG_INSTALL_STRIP
411
412# Copyright 2001 Free Software Foundation, Inc.
413
414# This program is free software; you can redistribute it and/or modify
415# it under the terms of the GNU General Public License as published by
416# the Free Software Foundation; either version 2, or (at your option)
417# any later version.
418
419# This program is distributed in the hope that it will be useful,
420# but WITHOUT ANY WARRANTY; without even the implied warranty of
421# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
422# GNU General Public License for more details.
423
424# You should have received a copy of the GNU General Public License
425# along with this program; if not, write to the Free Software
426# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
427# 02111-1307, USA.
428
429# One issue with vendor `install' (even GNU) is that you can't
430# specify the program used to strip binaries.  This is especially
431# annoying in cross-compiling environments, where the build's strip
432# is unlikely to handle the host's binaries.
433# Fortunately install-sh will honor a STRIPPROG variable, so we
434# always use install-sh in `make install-strip', and initialize
435# STRIPPROG with the value of the STRIP variable (set by the user).
436AC_DEFUN([AM_PROG_INSTALL_STRIP],
437[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
438# Installed binaries are usually stripped using `strip' when the user
439# run `make install-strip'.  However `strip' might not be the right
440# tool to use in cross-compilation environments, therefore Automake
441# will honor the `STRIP' environment variable to overrule this program.
442dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
443if test "$cross_compiling" != no; then
444  AC_CHECK_TOOL([STRIP], [strip], :)
445fi
446INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
447AC_SUBST([INSTALL_STRIP_PROGRAM])])
448
449# serial 4						-*- Autoconf -*-
450
451# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
452
453# This program is free software; you can redistribute it and/or modify
454# it under the terms of the GNU General Public License as published by
455# the Free Software Foundation; either version 2, or (at your option)
456# any later version.
457
458# This program is distributed in the hope that it will be useful,
459# but WITHOUT ANY WARRANTY; without even the implied warranty of
460# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
461# GNU General Public License for more details.
462
463# You should have received a copy of the GNU General Public License
464# along with this program; if not, write to the Free Software
465# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
466# 02111-1307, USA.
467
468
469# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
470# written in clear, in which case automake, when reading aclocal.m4,
471# will think it sees a *use*, and therefore will trigger all it's
472# C support machinery.  Also note that it means that autoscan, seeing
473# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
474
475
476
477# _AM_DEPENDENCIES(NAME)
478# ----------------------
479# See how the compiler implements dependency checking.
480# NAME is "CC", "CXX", "GCJ", or "OBJC".
481# We try a few techniques and use that to set a single cache variable.
482#
483# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
484# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
485# dependency, and given that the user is not expected to run this macro,
486# just rely on AC_PROG_CC.
487AC_DEFUN([_AM_DEPENDENCIES],
488[AC_REQUIRE([AM_SET_DEPDIR])dnl
489AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
490AC_REQUIRE([AM_MAKE_INCLUDE])dnl
491AC_REQUIRE([AM_DEP_TRACK])dnl
492
493ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
494       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
495       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
496       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
497                   [depcc="$$1"   am_compiler_list=])
498
499AC_CACHE_CHECK([dependency style of $depcc],
500               [am_cv_$1_dependencies_compiler_type],
501[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
502  # We make a subdir and do the tests there.  Otherwise we can end up
503  # making bogus files that we don't know about and never remove.  For
504  # instance it was reported that on HP-UX the gcc test will end up
505  # making a dummy file named `D' -- because `-MD' means `put the output
506  # in D'.
507  mkdir conftest.dir
508  # Copy depcomp to subdir because otherwise we won't find it if we're
509  # using a relative directory.
510  cp "$am_depcomp" conftest.dir
511  cd conftest.dir
512
513  am_cv_$1_dependencies_compiler_type=none
514  if test "$am_compiler_list" = ""; then
515     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
516  fi
517  for depmode in $am_compiler_list; do
518    # We need to recreate these files for each test, as the compiler may
519    # overwrite some of them when testing with obscure command lines.
520    # This happens at least with the AIX C compiler.
521    echo '#include "conftest.h"' > conftest.c
522    echo 'int i;' > conftest.h
523    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
524
525    case $depmode in
526    nosideeffect)
527      # after this tag, mechanisms are not by side-effect, so they'll
528      # only be used when explicitly requested
529      if test "x$enable_dependency_tracking" = xyes; then
530	continue
531      else
532	break
533      fi
534      ;;
535    none) break ;;
536    esac
537    # We check with `-c' and `-o' for the sake of the "dashmstdout"
538    # mode.  It turns out that the SunPro C++ compiler does not properly
539    # handle `-M -o', and we need to detect this.
540    if depmode=$depmode \
541       source=conftest.c object=conftest.o \
542       depfile=conftest.Po tmpdepfile=conftest.TPo \
543       $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
544       grep conftest.h conftest.Po > /dev/null 2>&1 &&
545       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
546      am_cv_$1_dependencies_compiler_type=$depmode
547      break
548    fi
549  done
550
551  cd ..
552  rm -rf conftest.dir
553else
554  am_cv_$1_dependencies_compiler_type=none
555fi
556])
557AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
558AM_CONDITIONAL([am__fastdep$1], [
559  test "x$enable_dependency_tracking" != xno \
560  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
561])
562
563
564# AM_SET_DEPDIR
565# -------------
566# Choose a directory name for dependency files.
567# This macro is AC_REQUIREd in _AM_DEPENDENCIES
568AC_DEFUN([AM_SET_DEPDIR],
569[rm -f .deps 2>/dev/null
570mkdir .deps 2>/dev/null
571if test -d .deps; then
572  DEPDIR=.deps
573else
574  # MS-DOS does not allow filenames that begin with a dot.
575  DEPDIR=_deps
576fi
577rmdir .deps 2>/dev/null
578AC_SUBST([DEPDIR])
579])
580
581
582# AM_DEP_TRACK
583# ------------
584AC_DEFUN([AM_DEP_TRACK],
585[AC_ARG_ENABLE(dependency-tracking,
586[  --disable-dependency-tracking Speeds up one-time builds
587  --enable-dependency-tracking  Do not reject slow dependency extractors])
588if test "x$enable_dependency_tracking" != xno; then
589  am_depcomp="$ac_aux_dir/depcomp"
590  AMDEPBACKSLASH='\'
591fi
592AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
593AC_SUBST([AMDEPBACKSLASH])
594])
595
596# Generate code to set up dependency tracking.   -*- Autoconf -*-
597
598# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
599
600# This program is free software; you can redistribute it and/or modify
601# it under the terms of the GNU General Public License as published by
602# the Free Software Foundation; either version 2, or (at your option)
603# any later version.
604
605# This program is distributed in the hope that it will be useful,
606# but WITHOUT ANY WARRANTY; without even the implied warranty of
607# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
608# GNU General Public License for more details.
609
610# You should have received a copy of the GNU General Public License
611# along with this program; if not, write to the Free Software
612# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
613# 02111-1307, USA.
614
615#serial 2
616
617# _AM_OUTPUT_DEPENDENCY_COMMANDS
618# ------------------------------
619AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
620[for mf in $CONFIG_FILES; do
621  # Strip MF so we end up with the name of the file.
622  mf=`echo "$mf" | sed -e 's/:.*$//'`
623  # Check whether this is an Automake generated Makefile or not.
624  # We used to match only the files named `Makefile.in', but
625  # some people rename them; so instead we look at the file content.
626  # Grep'ing the first line is not enough: some people post-process
627  # each Makefile.in and add a new line on top of each file to say so.
628  # So let's grep whole file.
629  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
630    dirpart=`AS_DIRNAME("$mf")`
631  else
632    continue
633  fi
634  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
635  # Extract the definition of DEP_FILES from the Makefile without
636  # running `make'.
637  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
638  test -z "$DEPDIR" && continue
639  # When using ansi2knr, U may be empty or an underscore; expand it
640  U=`sed -n -e '/^U = / s///p' < "$mf"`
641  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
642  # We invoke sed twice because it is the simplest approach to
643  # changing $(DEPDIR) to its actual value in the expansion.
644  for file in `sed -n -e '
645    /^DEP_FILES = .*\\\\$/ {
646      s/^DEP_FILES = //
647      :loop
648	s/\\\\$//
649	p
650	n
651	/\\\\$/ b loop
652      p
653    }
654    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
655       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
656    # Make sure the directory exists.
657    test -f "$dirpart/$file" && continue
658    fdir=`AS_DIRNAME(["$file"])`
659    AS_MKDIR_P([$dirpart/$fdir])
660    # echo "creating $dirpart/$file"
661    echo '# dummy' > "$dirpart/$file"
662  done
663done
664])# _AM_OUTPUT_DEPENDENCY_COMMANDS
665
666
667# AM_OUTPUT_DEPENDENCY_COMMANDS
668# -----------------------------
669# This macro should only be invoked once -- use via AC_REQUIRE.
670#
671# This code is only required when automatic dependency tracking
672# is enabled.  FIXME.  This creates each `.P' file that we will
673# need in order to bootstrap the dependency handling code.
674AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
675[AC_CONFIG_COMMANDS([depfiles],
676     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
677     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
678])
679
680# Check to see how 'make' treats includes.	-*- Autoconf -*-
681
682# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
683
684# This program is free software; you can redistribute it and/or modify
685# it under the terms of the GNU General Public License as published by
686# the Free Software Foundation; either version 2, or (at your option)
687# any later version.
688
689# This program is distributed in the hope that it will be useful,
690# but WITHOUT ANY WARRANTY; without even the implied warranty of
691# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
692# GNU General Public License for more details.
693
694# You should have received a copy of the GNU General Public License
695# along with this program; if not, write to the Free Software
696# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
697# 02111-1307, USA.
698
699# serial 2
700
701# AM_MAKE_INCLUDE()
702# -----------------
703# Check to see how make treats includes.
704AC_DEFUN([AM_MAKE_INCLUDE],
705[am_make=${MAKE-make}
706cat > confinc << 'END'
707doit:
708	@echo done
709END
710# If we don't find an include directive, just comment out the code.
711AC_MSG_CHECKING([for style of include used by $am_make])
712am__include="#"
713am__quote=
714_am_result=none
715# First try GNU make style include.
716echo "include confinc" > confmf
717# We grep out `Entering directory' and `Leaving directory'
718# messages which can occur if `w' ends up in MAKEFLAGS.
719# In particular we don't look at `^make:' because GNU make might
720# be invoked under some other name (usually "gmake"), in which
721# case it prints its new name instead of `make'.
722if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
723   am__include=include
724   am__quote=
725   _am_result=GNU
726fi
727# Now try BSD make style include.
728if test "$am__include" = "#"; then
729   echo '.include "confinc"' > confmf
730   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
731      am__include=.include
732      am__quote="\""
733      _am_result=BSD
734   fi
735fi
736AC_SUBST(am__include)
737AC_SUBST(am__quote)
738AC_MSG_RESULT($_am_result)
739rm -f confinc confmf
740])
741
742# AM_CONDITIONAL                                              -*- Autoconf -*-
743
744# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
745
746# This program is free software; you can redistribute it and/or modify
747# it under the terms of the GNU General Public License as published by
748# the Free Software Foundation; either version 2, or (at your option)
749# any later version.
750
751# This program is distributed in the hope that it will be useful,
752# but WITHOUT ANY WARRANTY; without even the implied warranty of
753# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
754# GNU General Public License for more details.
755
756# You should have received a copy of the GNU General Public License
757# along with this program; if not, write to the Free Software
758# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
759# 02111-1307, USA.
760
761# serial 5
762
763AC_PREREQ(2.52)
764
765# AM_CONDITIONAL(NAME, SHELL-CONDITION)
766# -------------------------------------
767# Define a conditional.
768AC_DEFUN([AM_CONDITIONAL],
769[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
770        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
771AC_SUBST([$1_TRUE])
772AC_SUBST([$1_FALSE])
773if $2; then
774  $1_TRUE=
775  $1_FALSE='#'
776else
777  $1_TRUE='#'
778  $1_FALSE=
779fi
780AC_CONFIG_COMMANDS_PRE(
781[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
782  AC_MSG_ERROR([conditional "$1" was never defined.
783Usually this means the macro was only invoked conditionally.])
784fi])])
785
786# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
787
788# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
789
790# This program is free software; you can redistribute it and/or modify
791# it under the terms of the GNU General Public License as published by
792# the Free Software Foundation; either version 2, or (at your option)
793# any later version.
794
795# This program is distributed in the hope that it will be useful,
796# but WITHOUT ANY WARRANTY; without even the implied warranty of
797# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
798# GNU General Public License for more details.
799
800# You should have received a copy of the GNU General Public License
801# along with this program; if not, write to the Free Software
802# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
803# 02111-1307, USA.
804
805AC_PREREQ([2.52])
806
807# serial 6
808
809# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
810AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
811
812# Add --enable-maintainer-mode option to configure.
813# From Jim Meyering
814
815# Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
816
817# This program is free software; you can redistribute it and/or modify
818# it under the terms of the GNU General Public License as published by
819# the Free Software Foundation; either version 2, or (at your option)
820# any later version.
821
822# This program is distributed in the hope that it will be useful,
823# but WITHOUT ANY WARRANTY; without even the implied warranty of
824# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
825# GNU General Public License for more details.
826
827# You should have received a copy of the GNU General Public License
828# along with this program; if not, write to the Free Software
829# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
830# 02111-1307, USA.
831
832# serial 2
833
834AC_DEFUN([AM_MAINTAINER_MODE],
835[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
836  dnl maintainer-mode is disabled by default
837  AC_ARG_ENABLE(maintainer-mode,
838[  --enable-maintainer-mode enable make rules and dependencies not useful
839                          (and sometimes confusing) to the casual installer],
840      USE_MAINTAINER_MODE=$enableval,
841      USE_MAINTAINER_MODE=no)
842  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
843  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
844  MAINT=$MAINTAINER_MODE_TRUE
845  AC_SUBST(MAINT)dnl
846]
847)
848
849AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
850
851# isc-posix.m4 serial 2 (gettext-0.11.2)
852dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
853dnl This file is free software, distributed under the terms of the GNU
854dnl General Public License.  As a special exception to the GNU General
855dnl Public License, this file may be distributed as part of a program
856dnl that contains a configuration script generated by Autoconf, under
857dnl the same distribution terms as the rest of that program.
858
859# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
860
861# This test replaces the one in autoconf.
862# Currently this macro should have the same name as the autoconf macro
863# because gettext's gettext.m4 (distributed in the automake package)
864# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
865# give these diagnostics:
866#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
867#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
868
869undefine([AC_ISC_POSIX])
870
871AC_DEFUN([AC_ISC_POSIX],
872  [
873    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
874    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
875  ]
876)
877
878
879# Copyright 1996, 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
880
881# This program is free software; you can redistribute it and/or modify
882# it under the terms of the GNU General Public License as published by
883# the Free Software Foundation; either version 2, or (at your option)
884# any later version.
885
886# This program is distributed in the hope that it will be useful,
887# but WITHOUT ANY WARRANTY; without even the implied warranty of
888# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
889# GNU General Public License for more details.
890
891# You should have received a copy of the GNU General Public License
892# along with this program; if not, write to the Free Software
893# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
894# 02111-1307, USA.
895
896# serial 2
897
898# @defmac AC_PROG_CC_STDC
899# @maindex PROG_CC_STDC
900# @ovindex CC
901# If the C compiler in not in ANSI C mode by default, try to add an option
902# to output variable @code{CC} to make it so.  This macro tries various
903# options that select ANSI C on some system or another.  It considers the
904# compiler to be in ANSI C mode if it handles function prototypes correctly.
905#
906# If you use this macro, you should check after calling it whether the C
907# compiler has been set to accept ANSI C; if not, the shell variable
908# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
909# code in ANSI C, you can make an un-ANSIfied copy of it by using the
910# program @code{ansi2knr}, which comes with Ghostscript.
911# @end defmac
912
913AC_DEFUN([AM_PROG_CC_STDC],
914[AC_REQUIRE([AC_PROG_CC])
915AC_BEFORE([$0], [AC_C_INLINE])
916AC_BEFORE([$0], [AC_C_CONST])
917dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
918dnl a magic option to avoid problems with ANSI preprocessor commands
919dnl like #elif.
920dnl FIXME: can't do this because then AC_AIX won't work due to a
921dnl circular dependency.
922dnl AC_BEFORE([$0], [AC_PROG_CPP])
923AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
924AC_CACHE_VAL(am_cv_prog_cc_stdc,
925[am_cv_prog_cc_stdc=no
926ac_save_CC="$CC"
927# Don't try gcc -ansi; that turns off useful extensions and
928# breaks some systems' header files.
929# AIX			-qlanglvl=ansi
930# Ultrix and OSF/1	-std1
931# HP-UX 10.20 and later	-Ae
932# HP-UX older versions	-Aa -D_HPUX_SOURCE
933# SVR4			-Xc -D__EXTENSIONS__
934for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
935do
936  CC="$ac_save_CC $ac_arg"
937  AC_TRY_COMPILE(
938[#include <stdarg.h>
939#include <stdio.h>
940#include <sys/types.h>
941#include <sys/stat.h>
942/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
943struct buf { int x; };
944FILE * (*rcsopen) (struct buf *, struct stat *, int);
945static char *e (p, i)
946     char **p;
947     int i;
948{
949  return p[i];
950}
951static char *f (char * (*g) (char **, int), char **p, ...)
952{
953  char *s;
954  va_list v;
955  va_start (v,p);
956  s = g (p, va_arg (v,int));
957  va_end (v);
958  return s;
959}
960int test (int i, double x);
961struct s1 {int (*f) (int a);};
962struct s2 {int (*f) (double a);};
963int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
964int argc;
965char **argv;
966], [
967return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
968],
969[am_cv_prog_cc_stdc="$ac_arg"; break])
970done
971CC="$ac_save_CC"
972])
973if test -z "$am_cv_prog_cc_stdc"; then
974  AC_MSG_RESULT([none needed])
975else
976  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
977fi
978case "x$am_cv_prog_cc_stdc" in
979  x|xno) ;;
980  *) CC="$CC $am_cv_prog_cc_stdc" ;;
981esac
982])
983
984AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
985
986# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
987
988# serial 46 AC_PROG_LIBTOOL
989
990AC_DEFUN([AC_PROG_LIBTOOL],
991[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
992
993# This can be used to rebuild libtool when needed
994LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
995
996# Always use our own libtool.
997LIBTOOL='$(SHELL) $(top_builddir)/libtool'
998AC_SUBST(LIBTOOL)dnl
999
1000# Prevent multiple expansion
1001define([AC_PROG_LIBTOOL], [])
1002])
1003
1004AC_DEFUN([AC_LIBTOOL_SETUP],
1005[AC_PREREQ(2.13)dnl
1006AC_REQUIRE([AC_ENABLE_SHARED])dnl
1007AC_REQUIRE([AC_ENABLE_STATIC])dnl
1008AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1009AC_REQUIRE([AC_CANONICAL_HOST])dnl
1010AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1011AC_REQUIRE([AC_PROG_CC])dnl
1012AC_REQUIRE([AC_PROG_LD])dnl
1013AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1014AC_REQUIRE([AC_PROG_NM])dnl
1015AC_REQUIRE([LT_AC_PROG_SED])dnl
1016
1017AC_REQUIRE([AC_PROG_LN_S])dnl
1018AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1019AC_REQUIRE([AC_OBJEXT])dnl
1020AC_REQUIRE([AC_EXEEXT])dnl
1021dnl
1022
1023_LT_AC_PROG_ECHO_BACKSLASH
1024# Only perform the check for file, if the check method requires it
1025case $deplibs_check_method in
1026file_magic*)
1027  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1028    AC_PATH_MAGIC
1029  fi
1030  ;;
1031esac
1032
1033AC_CHECK_TOOL(RANLIB, ranlib, :)
1034AC_CHECK_TOOL(STRIP, strip, :)
1035
1036ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1037ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1038enable_win32_dll=yes, enable_win32_dll=no)
1039
1040AC_ARG_ENABLE(libtool-lock,
1041  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
1042test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1043
1044# Some flags need to be propagated to the compiler or linker for good
1045# libtool support.
1046case $host in
1047*-*-irix6*)
1048  # Find out which ABI we are using.
1049  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1050  if AC_TRY_EVAL(ac_compile); then
1051    case `/usr/bin/file conftest.$ac_objext` in
1052    *32-bit*)
1053      LD="${LD-ld} -32"
1054      ;;
1055    *N32*)
1056      LD="${LD-ld} -n32"
1057      ;;
1058    *64-bit*)
1059      LD="${LD-ld} -64"
1060      ;;
1061    esac
1062  fi
1063  rm -rf conftest*
1064  ;;
1065
1066*-*-linux*)
1067  # Test if the compiler is 64bit
1068  echo 'int i;' > conftest.$ac_ext
1069  lt_cv_cc_64bit_output=no
1070  if AC_TRY_EVAL(ac_compile); then
1071    case `/usr/bin/file conftest.$ac_objext` in
1072    *"ELF 64"*)
1073      lt_cv_cc_64bit_output=yes
1074      ;;
1075    esac
1076  fi
1077  rm -rf conftest*
1078  ;;
1079
1080*-*-sco3.2v5*)
1081  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1082  SAVE_CFLAGS="$CFLAGS"
1083  CFLAGS="$CFLAGS -belf"
1084  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1085    [AC_LANG_SAVE
1086     AC_LANG_C
1087     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1088     AC_LANG_RESTORE])
1089  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1090    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1091    CFLAGS="$SAVE_CFLAGS"
1092  fi
1093  ;;
1094
1095ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1096[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1097  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1098  AC_CHECK_TOOL(AS, as, false)
1099  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1100
1101  # recent cygwin and mingw systems supply a stub DllMain which the user
1102  # can override, but on older systems we have to supply one
1103  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1104    [AC_TRY_LINK([],
1105      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1106      DllMain (0, 0, 0);],
1107      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1108
1109  case $host/$CC in
1110  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1111    # old mingw systems require "-dll" to link a DLL, while more recent ones
1112    # require "-mdll"
1113    SAVE_CFLAGS="$CFLAGS"
1114    CFLAGS="$CFLAGS -mdll"
1115    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1116      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1117    CFLAGS="$SAVE_CFLAGS" ;;
1118  *-*-cygwin* | *-*-pw32*)
1119    # cygwin systems need to pass --dll to the linker, and not link
1120    # crt.o which will require a WinMain@16 definition.
1121    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1122  esac
1123  ;;
1124  ])
1125esac
1126
1127_LT_AC_LTCONFIG_HACK
1128
1129])
1130
1131# AC_LIBTOOL_HEADER_ASSERT
1132# ------------------------
1133AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
1134[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
1135    [lt_cv_func_assert_works],
1136    [case $host in
1137    *-*-solaris*)
1138      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
1139        case `$CC --version 2>/dev/null` in
1140        [[12]].*) lt_cv_func_assert_works=no ;;
1141        *)        lt_cv_func_assert_works=yes ;;
1142        esac
1143      fi
1144      ;;
1145    esac])
1146
1147if test "x$lt_cv_func_assert_works" = xyes; then
1148  AC_CHECK_HEADERS(assert.h)
1149fi
1150])# AC_LIBTOOL_HEADER_ASSERT
1151
1152# _LT_AC_CHECK_DLFCN
1153# --------------------
1154AC_DEFUN([_LT_AC_CHECK_DLFCN],
1155[AC_CHECK_HEADERS(dlfcn.h)
1156])# _LT_AC_CHECK_DLFCN
1157
1158# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1159# ---------------------------------
1160AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
1161[AC_REQUIRE([AC_CANONICAL_HOST])
1162AC_REQUIRE([AC_PROG_NM])
1163AC_REQUIRE([AC_OBJEXT])
1164# Check for command to grab the raw symbol name followed by C symbol from nm.
1165AC_MSG_CHECKING([command to parse $NM output])
1166AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
1167
1168# These are sane defaults that work on at least a few old systems.
1169# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
1170
1171# Character class describing NM global symbol codes.
1172symcode='[[BCDEGRST]]'
1173
1174# Regexp to match symbols that can be accessed directly from C.
1175sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
1176
1177# Transform the above into a raw symbol and a C symbol.
1178symxfrm='\1 \2\3 \3'
1179
1180# Transform an extracted symbol line into a proper C declaration
1181lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1182
1183# Transform an extracted symbol line into symbol name and symbol address
1184lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
1185
1186# Define system-specific variables.
1187case $host_os in
1188aix*)
1189  symcode='[[BCDT]]'
1190  ;;
1191cygwin* | mingw* | pw32*)
1192  symcode='[[ABCDGISTW]]'
1193  ;;
1194hpux*) # Its linker distinguishes data from code symbols
1195  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
1196  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'"
1197  ;;
1198irix* | nonstopux*)
1199  symcode='[[BCDEGRST]]'
1200  ;;
1201osf*)
1202  symcode='[[BCDEGQRST]]'
1203  ;;
1204solaris* | sysv5*)
1205  symcode='[[BDT]]'
1206  ;;
1207sysv4)
1208  symcode='[[DFNSTU]]'
1209  ;;
1210esac
1211
1212# Handle CRLF in mingw tool chain
1213opt_cr=
1214case $host_os in
1215mingw*)
1216  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
1217  ;;
1218esac
1219
1220# If we're using GNU nm, then use its standard symbol codes.
1221if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1222  symcode='[[ABCDGISTW]]'
1223fi
1224
1225# Try without a prefix undercore, then with it.
1226for ac_symprfx in "" "_"; do
1227
1228  # Write the raw and C identifiers.
1229lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
1230
1231  # Check to see that the pipe works correctly.
1232  pipe_works=no
1233  rm -f conftest*
1234  cat > conftest.$ac_ext <<EOF
1235#ifdef __cplusplus
1236extern "C" {
1237#endif
1238char nm_test_var;
1239void nm_test_func(){}
1240#ifdef __cplusplus
1241}
1242#endif
1243int main(){nm_test_var='a';nm_test_func();return(0);}
1244EOF
1245
1246  if AC_TRY_EVAL(ac_compile); then
1247    # Now try to grab the symbols.
1248    nlist=conftest.nm
1249    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
1250      # Try sorting and uniquifying the output.
1251      if sort "$nlist" | uniq > "$nlist"T; then
1252	mv -f "$nlist"T "$nlist"
1253      else
1254	rm -f "$nlist"T
1255      fi
1256
1257      # Make sure that we snagged all the symbols we need.
1258      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
1259	if egrep ' nm_test_func$' "$nlist" >/dev/null; then
1260	  cat <<EOF > conftest.$ac_ext
1261#ifdef __cplusplus
1262extern "C" {
1263#endif
1264
1265EOF
1266	  # Now generate the symbol file.
1267	  eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
1268
1269	  cat <<EOF >> conftest.$ac_ext
1270#if defined (__STDC__) && __STDC__
1271# define lt_ptr void *
1272#else
1273# define lt_ptr char *
1274# define const
1275#endif
1276
1277/* The mapping between symbol names and symbols. */
1278const struct {
1279  const char *name;
1280  lt_ptr address;
1281}
1282lt_preloaded_symbols[[]] =
1283{
1284EOF
1285	  sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
1286	  cat <<\EOF >> conftest.$ac_ext
1287  {0, (lt_ptr) 0}
1288};
1289
1290#ifdef __cplusplus
1291}
1292#endif
1293EOF
1294	  # Now try linking the two files.
1295	  mv conftest.$ac_objext conftstm.$ac_objext
1296	  save_LIBS="$LIBS"
1297	  save_CFLAGS="$CFLAGS"
1298	  LIBS="conftstm.$ac_objext"
1299	  CFLAGS="$CFLAGS$no_builtin_flag"
1300	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
1301	    pipe_works=yes
1302	  fi
1303	  LIBS="$save_LIBS"
1304	  CFLAGS="$save_CFLAGS"
1305	else
1306	  echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
1307	fi
1308      else
1309	echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
1310      fi
1311    else
1312      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
1313    fi
1314  else
1315    echo "$progname: failed program was:" >&AC_FD_CC
1316    cat conftest.$ac_ext >&5
1317  fi
1318  rm -f conftest* conftst*
1319
1320  # Do not use the global_symbol_pipe unless it works.
1321  if test "$pipe_works" = yes; then
1322    break
1323  else
1324    lt_cv_sys_global_symbol_pipe=
1325  fi
1326done
1327])
1328global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
1329if test -z "$lt_cv_sys_global_symbol_pipe"; then
1330  global_symbol_to_cdecl=
1331  global_symbol_to_c_name_address=
1332else
1333  global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
1334  global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
1335fi
1336if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
1337then
1338  AC_MSG_RESULT(failed)
1339else
1340  AC_MSG_RESULT(ok)
1341fi
1342]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1343
1344# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1345# ---------------------------------
1346AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
1347[# Find the correct PATH separator.  Usually this is `:', but
1348# DJGPP uses `;' like DOS.
1349if test "X${PATH_SEPARATOR+set}" != Xset; then
1350  UNAME=${UNAME-`uname 2>/dev/null`}
1351  case X$UNAME in
1352    *-DOS) lt_cv_sys_path_separator=';' ;;
1353    *)     lt_cv_sys_path_separator=':' ;;
1354  esac
1355  PATH_SEPARATOR=$lt_cv_sys_path_separator
1356fi
1357])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1358
1359# _LT_AC_PROG_ECHO_BACKSLASH
1360# --------------------------
1361# Add some code to the start of the generated configure script which
1362# will find an echo command which doesn't interpret backslashes.
1363AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
1364[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1365			      [AC_DIVERT_PUSH(NOTICE)])
1366_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
1367
1368# Check that we are running under the correct shell.
1369SHELL=${CONFIG_SHELL-/bin/sh}
1370
1371case X$ECHO in
1372X*--fallback-echo)
1373  # Remove one level of quotation (which was required for Make).
1374  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1375  ;;
1376esac
1377
1378echo=${ECHO-echo}
1379if test "X[$]1" = X--no-reexec; then
1380  # Discard the --no-reexec flag, and continue.
1381  shift
1382elif test "X[$]1" = X--fallback-echo; then
1383  # Avoid inline document here, it may be left over
1384  :
1385elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
1386  # Yippee, $echo works!
1387  :
1388else
1389  # Restart under the correct shell.
1390  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1391fi
1392
1393if test "X[$]1" = X--fallback-echo; then
1394  # used as fallback echo
1395  shift
1396  cat <<EOF
1397$*
1398EOF
1399  exit 0
1400fi
1401
1402# The HP-UX ksh and POSIX shell print the target directory to stdout
1403# if CDPATH is set.
1404if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
1405
1406if test -z "$ECHO"; then
1407if test "X${echo_test_string+set}" != Xset; then
1408# find a string as large as possible, as long as the shell can cope with it
1409  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1410    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1411    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
1412       echo_test_string="`eval $cmd`" &&
1413       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
1414    then
1415      break
1416    fi
1417  done
1418fi
1419
1420if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1421   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1422   test "X$echo_testing_string" = "X$echo_test_string"; then
1423  :
1424else
1425  # The Solaris, AIX, and Digital Unix default echo programs unquote
1426  # backslashes.  This makes it impossible to quote backslashes using
1427  #   echo "$something" | sed 's/\\/\\\\/g'
1428  #
1429  # So, first we look for a working echo in the user's PATH.
1430
1431  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1432  for dir in $PATH /usr/ucb; do
1433    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1434       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1435       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1436       test "X$echo_testing_string" = "X$echo_test_string"; then
1437      echo="$dir/echo"
1438      break
1439    fi
1440  done
1441  IFS="$save_ifs"
1442
1443  if test "X$echo" = Xecho; then
1444    # We didn't find a better echo, so look for alternatives.
1445    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
1446       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
1447       test "X$echo_testing_string" = "X$echo_test_string"; then
1448      # This shell has a builtin print -r that does the trick.
1449      echo='print -r'
1450    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
1451	 test "X$CONFIG_SHELL" != X/bin/ksh; then
1452      # If we have ksh, try running configure again with it.
1453      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1454      export ORIGINAL_CONFIG_SHELL
1455      CONFIG_SHELL=/bin/ksh
1456      export CONFIG_SHELL
1457      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1458    else
1459      # Try using printf.
1460      echo='printf %s\n'
1461      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1462	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1463	 test "X$echo_testing_string" = "X$echo_test_string"; then
1464	# Cool, printf works
1465	:
1466      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1467	   test "X$echo_testing_string" = 'X\t' &&
1468	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1469	   test "X$echo_testing_string" = "X$echo_test_string"; then
1470	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1471	export CONFIG_SHELL
1472	SHELL="$CONFIG_SHELL"
1473	export SHELL
1474	echo="$CONFIG_SHELL [$]0 --fallback-echo"
1475      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1476	   test "X$echo_testing_string" = 'X\t' &&
1477	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1478	   test "X$echo_testing_string" = "X$echo_test_string"; then
1479	echo="$CONFIG_SHELL [$]0 --fallback-echo"
1480      else
1481	# maybe with a smaller string...
1482	prev=:
1483
1484	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1485	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
1486	  then
1487	    break
1488	  fi
1489	  prev="$cmd"
1490	done
1491
1492	if test "$prev" != 'sed 50q "[$]0"'; then
1493	  echo_test_string=`eval $prev`
1494	  export echo_test_string
1495	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1496	else
1497	  # Oops.  We lost completely, so just stick with echo.
1498	  echo=echo
1499	fi
1500      fi
1501    fi
1502  fi
1503fi
1504fi
1505
1506# Copy echo and quote the copy suitably for passing to libtool from
1507# the Makefile, instead of quoting the original, which is used later.
1508ECHO=$echo
1509if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1510   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1511fi
1512
1513AC_SUBST(ECHO)
1514AC_DIVERT_POP
1515])# _LT_AC_PROG_ECHO_BACKSLASH
1516
1517# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1518#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1519# ------------------------------------------------------------------
1520AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
1521[if test "$cross_compiling" = yes; then :
1522  [$4]
1523else
1524  AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1525  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1526  lt_status=$lt_dlunknown
1527  cat > conftest.$ac_ext <<EOF
1528[#line __oline__ "configure"
1529#include "confdefs.h"
1530
1531#if HAVE_DLFCN_H
1532#include <dlfcn.h>
1533#endif
1534
1535#include <stdio.h>
1536
1537#ifdef RTLD_GLOBAL
1538#  define LT_DLGLOBAL		RTLD_GLOBAL
1539#else
1540#  ifdef DL_GLOBAL
1541#    define LT_DLGLOBAL		DL_GLOBAL
1542#  else
1543#    define LT_DLGLOBAL		0
1544#  endif
1545#endif
1546
1547/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1548   find out it does not work in some platform. */
1549#ifndef LT_DLLAZY_OR_NOW
1550#  ifdef RTLD_LAZY
1551#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1552#  else
1553#    ifdef DL_LAZY
1554#      define LT_DLLAZY_OR_NOW		DL_LAZY
1555#    else
1556#      ifdef RTLD_NOW
1557#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1558#      else
1559#        ifdef DL_NOW
1560#          define LT_DLLAZY_OR_NOW	DL_NOW
1561#        else
1562#          define LT_DLLAZY_OR_NOW	0
1563#        endif
1564#      endif
1565#    endif
1566#  endif
1567#endif
1568
1569#ifdef __cplusplus
1570extern "C" void exit (int);
1571#endif
1572
1573void fnord() { int i=42;}
1574int main ()
1575{
1576  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1577  int status = $lt_dlunknown;
1578
1579  if (self)
1580    {
1581      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1582      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1583      /* dlclose (self); */
1584    }
1585
1586    exit (status);
1587}]
1588EOF
1589  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1590    (./conftest; exit; ) 2>/dev/null
1591    lt_status=$?
1592    case x$lt_status in
1593      x$lt_dlno_uscore) $1 ;;
1594      x$lt_dlneed_uscore) $2 ;;
1595      x$lt_unknown|x*) $3 ;;
1596    esac
1597  else :
1598    # compilation failed
1599    $3
1600  fi
1601fi
1602rm -fr conftest*
1603])# _LT_AC_TRY_DLOPEN_SELF
1604
1605# AC_LIBTOOL_DLOPEN_SELF
1606# -------------------
1607AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1608[if test "x$enable_dlopen" != xyes; then
1609  enable_dlopen=unknown
1610  enable_dlopen_self=unknown
1611  enable_dlopen_self_static=unknown
1612else
1613  lt_cv_dlopen=no
1614  lt_cv_dlopen_libs=
1615
1616  case $host_os in
1617  beos*)
1618    lt_cv_dlopen="load_add_on"
1619    lt_cv_dlopen_libs=
1620    lt_cv_dlopen_self=yes
1621    ;;
1622
1623  cygwin* | mingw* | pw32*)
1624    lt_cv_dlopen="LoadLibrary"
1625    lt_cv_dlopen_libs=
1626   ;;
1627
1628  *)
1629    AC_CHECK_FUNC([shl_load],
1630          [lt_cv_dlopen="shl_load"],
1631      [AC_CHECK_LIB([dld], [shl_load],
1632            [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
1633	[AC_CHECK_FUNC([dlopen],
1634	      [lt_cv_dlopen="dlopen"],
1635	  [AC_CHECK_LIB([dl], [dlopen],
1636	        [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1637	    [AC_CHECK_LIB([svld], [dlopen],
1638	          [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1639	      [AC_CHECK_LIB([dld], [dld_link],
1640	            [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
1641	      ])
1642	    ])
1643	  ])
1644	])
1645      ])
1646    ;;
1647  esac
1648
1649  if test "x$lt_cv_dlopen" != xno; then
1650    enable_dlopen=yes
1651  else
1652    enable_dlopen=no
1653  fi
1654
1655  case $lt_cv_dlopen in
1656  dlopen)
1657    save_CPPFLAGS="$CPPFLAGS"
1658    AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1659    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1660
1661    save_LDFLAGS="$LDFLAGS"
1662    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1663
1664    save_LIBS="$LIBS"
1665    LIBS="$lt_cv_dlopen_libs $LIBS"
1666
1667    AC_CACHE_CHECK([whether a program can dlopen itself],
1668	  lt_cv_dlopen_self, [dnl
1669	  _LT_AC_TRY_DLOPEN_SELF(
1670	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1671	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1672    ])
1673
1674    if test "x$lt_cv_dlopen_self" = xyes; then
1675      LDFLAGS="$LDFLAGS $link_static_flag"
1676      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1677    	  lt_cv_dlopen_self_static, [dnl
1678	  _LT_AC_TRY_DLOPEN_SELF(
1679	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1680	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1681      ])
1682    fi
1683
1684    CPPFLAGS="$save_CPPFLAGS"
1685    LDFLAGS="$save_LDFLAGS"
1686    LIBS="$save_LIBS"
1687    ;;
1688  esac
1689
1690  case $lt_cv_dlopen_self in
1691  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1692  *) enable_dlopen_self=unknown ;;
1693  esac
1694
1695  case $lt_cv_dlopen_self_static in
1696  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1697  *) enable_dlopen_self_static=unknown ;;
1698  esac
1699fi
1700])# AC_LIBTOOL_DLOPEN_SELF
1701
1702AC_DEFUN([_LT_AC_LTCONFIG_HACK],
1703[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
1704# Sed substitution that helps us do robust quoting.  It backslashifies
1705# metacharacters that are still active within double-quoted strings.
1706Xsed='sed -e s/^X//'
1707sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
1708
1709# Same as above, but do not quote variable references.
1710double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
1711
1712# Sed substitution to delay expansion of an escaped shell variable in a
1713# double_quote_subst'ed string.
1714delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1715
1716# Constants:
1717rm="rm -f"
1718
1719# Global variables:
1720default_ofile=libtool
1721can_build_shared=yes
1722
1723# All known linkers require a `.a' archive for static linking (except M$VC,
1724# which needs '.lib').
1725libext=a
1726ltmain="$ac_aux_dir/ltmain.sh"
1727ofile="$default_ofile"
1728with_gnu_ld="$lt_cv_prog_gnu_ld"
1729need_locks="$enable_libtool_lock"
1730
1731old_CC="$CC"
1732old_CFLAGS="$CFLAGS"
1733
1734# Set sane defaults for various variables
1735test -z "$AR" && AR=ar
1736test -z "$AR_FLAGS" && AR_FLAGS=cru
1737test -z "$AS" && AS=as
1738test -z "$CC" && CC=cc
1739test -z "$DLLTOOL" && DLLTOOL=dlltool
1740test -z "$LD" && LD=ld
1741test -z "$LN_S" && LN_S="ln -s"
1742test -z "$MAGIC_CMD" && MAGIC_CMD=file
1743test -z "$NM" && NM=nm
1744test -z "$OBJDUMP" && OBJDUMP=objdump
1745test -z "$RANLIB" && RANLIB=:
1746test -z "$STRIP" && STRIP=:
1747test -z "$ac_objext" && ac_objext=o
1748
1749if test x"$host" != x"$build"; then
1750  ac_tool_prefix=${host_alias}-
1751else
1752  ac_tool_prefix=
1753fi
1754
1755# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1756case $host_os in
1757linux-gnu*) ;;
1758linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1759esac
1760
1761case $host_os in
1762aix3*)
1763  # AIX sometimes has problems with the GCC collect2 program.  For some
1764  # reason, if we set the COLLECT_NAMES environment variable, the problems
1765  # vanish in a puff of smoke.
1766  if test "X${COLLECT_NAMES+set}" != Xset; then
1767    COLLECT_NAMES=
1768    export COLLECT_NAMES
1769  fi
1770  ;;
1771esac
1772
1773# Determine commands to create old-style static archives.
1774old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1775old_postinstall_cmds='chmod 644 $oldlib'
1776old_postuninstall_cmds=
1777
1778if test -n "$RANLIB"; then
1779  case $host_os in
1780  openbsd*)
1781    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1782    ;;
1783  *)
1784    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1785    ;;
1786  esac
1787  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1788fi
1789
1790# Allow CC to be a program name with arguments.
1791set dummy $CC
1792compiler="[$]2"
1793
1794AC_MSG_CHECKING([for objdir])
1795rm -f .libs 2>/dev/null
1796mkdir .libs 2>/dev/null
1797if test -d .libs; then
1798  objdir=.libs
1799else
1800  # MS-DOS does not allow filenames that begin with a dot.
1801  objdir=_libs
1802fi
1803rmdir .libs 2>/dev/null
1804AC_MSG_RESULT($objdir)
1805
1806
1807AC_ARG_WITH(pic,
1808[  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1809pic_mode="$withval", pic_mode=default)
1810test -z "$pic_mode" && pic_mode=default
1811
1812# We assume here that the value for lt_cv_prog_cc_pic will not be cached
1813# in isolation, and that seeing it set (from the cache) indicates that
1814# the associated values are set (in the cache) correctly too.
1815AC_MSG_CHECKING([for $compiler option to produce PIC])
1816AC_CACHE_VAL(lt_cv_prog_cc_pic,
1817[ lt_cv_prog_cc_pic=
1818  lt_cv_prog_cc_shlib=
1819  lt_cv_prog_cc_wl=
1820  lt_cv_prog_cc_static=
1821  lt_cv_prog_cc_no_builtin=
1822  lt_cv_prog_cc_can_build_shared=$can_build_shared
1823
1824  if test "$GCC" = yes; then
1825    lt_cv_prog_cc_wl='-Wl,'
1826    lt_cv_prog_cc_static='-static'
1827
1828    case $host_os in
1829    aix*)
1830      # Below there is a dirty hack to force normal static linking with -ldl
1831      # The problem is because libdl dynamically linked with both libc and
1832      # libC (AIX C++ library), which obviously doesn't included in libraries
1833      # list by gcc. This cause undefined symbols with -static flags.
1834      # This hack allows C programs to be linked with "-static -ldl", but
1835      # not sure about C++ programs.
1836      lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1837      ;;
1838    amigaos*)
1839      # FIXME: we need at least 68020 code to build shared libraries, but
1840      # adding the `-m68020' flag to GCC prevents building anything better,
1841      # like `-m68040'.
1842      lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1843      ;;
1844    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
1845      # PIC is the default for these OSes.
1846      ;;
1847    darwin* | rhapsody*)
1848      # PIC is the default on this platform
1849      # Common symbols not allowed in MH_DYLIB files
1850      lt_cv_prog_cc_pic='-fno-common'
1851      ;;
1852    cygwin* | mingw* | pw32* | os2*)
1853      # This hack is so that the source file can tell whether it is being
1854      # built for inclusion in a dll (and should export symbols for example).
1855      lt_cv_prog_cc_pic='-DDLL_EXPORT'
1856      ;;
1857    sysv4*MP*)
1858      if test -d /usr/nec; then
1859	 lt_cv_prog_cc_pic=-Kconform_pic
1860      fi
1861      ;;
1862    *)
1863      lt_cv_prog_cc_pic='-fPIC'
1864      ;;
1865    esac
1866  else
1867    # PORTME Check for PIC flags for the system compiler.
1868    case $host_os in
1869    aix3* | aix4* | aix5*)
1870      lt_cv_prog_cc_wl='-Wl,'
1871      # All AIX code is PIC.
1872      if test "$host_cpu" = ia64; then
1873	# AIX 5 now supports IA64 processor
1874	lt_cv_prog_cc_static='-Bstatic'
1875      else
1876	lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1877      fi
1878      ;;
1879
1880    hpux9* | hpux10* | hpux11*)
1881      # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1882      lt_cv_prog_cc_wl='-Wl,'
1883      lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1884      lt_cv_prog_cc_pic='+Z'
1885      ;;
1886
1887    irix5* | irix6* | nonstopux*)
1888      lt_cv_prog_cc_wl='-Wl,'
1889      lt_cv_prog_cc_static='-non_shared'
1890      # PIC (with -KPIC) is the default.
1891      ;;
1892
1893    cygwin* | mingw* | pw32* | os2*)
1894      # This hack is so that the source file can tell whether it is being
1895      # built for inclusion in a dll (and should export symbols for example).
1896      lt_cv_prog_cc_pic='-DDLL_EXPORT'
1897      ;;
1898
1899    newsos6)
1900      lt_cv_prog_cc_pic='-KPIC'
1901      lt_cv_prog_cc_static='-Bstatic'
1902      ;;
1903
1904    osf3* | osf4* | osf5*)
1905      # All OSF/1 code is PIC.
1906      lt_cv_prog_cc_wl='-Wl,'
1907      lt_cv_prog_cc_static='-non_shared'
1908      ;;
1909
1910    sco3.2v5*)
1911      lt_cv_prog_cc_pic='-Kpic'
1912      lt_cv_prog_cc_static='-dn'
1913      lt_cv_prog_cc_shlib='-belf'
1914      ;;
1915
1916    solaris*)
1917      lt_cv_prog_cc_pic='-KPIC'
1918      lt_cv_prog_cc_static='-Bstatic'
1919      lt_cv_prog_cc_wl='-Wl,'
1920      ;;
1921
1922    sunos4*)
1923      lt_cv_prog_cc_pic='-PIC'
1924      lt_cv_prog_cc_static='-Bstatic'
1925      lt_cv_prog_cc_wl='-Qoption ld '
1926      ;;
1927
1928    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1929      lt_cv_prog_cc_pic='-KPIC'
1930      lt_cv_prog_cc_static='-Bstatic'
1931      lt_cv_prog_cc_wl='-Wl,'
1932      ;;
1933
1934    uts4*)
1935      lt_cv_prog_cc_pic='-pic'
1936      lt_cv_prog_cc_static='-Bstatic'
1937      ;;
1938
1939    sysv4*MP*)
1940      if test -d /usr/nec ;then
1941	lt_cv_prog_cc_pic='-Kconform_pic'
1942	lt_cv_prog_cc_static='-Bstatic'
1943      fi
1944      ;;
1945
1946    *)
1947      lt_cv_prog_cc_can_build_shared=no
1948      ;;
1949    esac
1950  fi
1951])
1952if test -z "$lt_cv_prog_cc_pic"; then
1953  AC_MSG_RESULT([none])
1954else
1955  AC_MSG_RESULT([$lt_cv_prog_cc_pic])
1956
1957  # Check to make sure the pic_flag actually works.
1958  AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
1959  AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
1960    save_CFLAGS="$CFLAGS"
1961    CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
1962    AC_TRY_COMPILE([], [], [dnl
1963      case $host_os in
1964      hpux9* | hpux10* | hpux11*)
1965	# On HP-UX, both CC and GCC only warn that PIC is supported... then
1966	# they create non-PIC objects.  So, if there were any warnings, we
1967	# assume that PIC is not supported.
1968	if test -s conftest.err; then
1969	  lt_cv_prog_cc_pic_works=no
1970	else
1971	  lt_cv_prog_cc_pic_works=yes
1972	fi
1973	;;
1974      *)
1975	lt_cv_prog_cc_pic_works=yes
1976	;;
1977      esac
1978    ], [dnl
1979      lt_cv_prog_cc_pic_works=no
1980    ])
1981    CFLAGS="$save_CFLAGS"
1982  ])
1983
1984  if test "X$lt_cv_prog_cc_pic_works" = Xno; then
1985    lt_cv_prog_cc_pic=
1986    lt_cv_prog_cc_can_build_shared=no
1987  else
1988    lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
1989  fi
1990
1991  AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
1992fi
1993
1994# Check for any special shared library compilation flags.
1995if test -n "$lt_cv_prog_cc_shlib"; then
1996  AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
1997  if echo "$old_CC $old_CFLAGS " | egrep -e "[[ 	]]$lt_cv_prog_cc_shlib[[ 	]]" >/dev/null; then :
1998  else
1999   AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
2000    lt_cv_prog_cc_can_build_shared=no
2001  fi
2002fi
2003
2004AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
2005AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
2006  lt_cv_prog_cc_static_works=no
2007  save_LDFLAGS="$LDFLAGS"
2008  LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
2009  AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
2010  LDFLAGS="$save_LDFLAGS"
2011])
2012
2013# Belt *and* braces to stop my trousers falling down:
2014test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
2015AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
2016
2017pic_flag="$lt_cv_prog_cc_pic"
2018special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
2019wl="$lt_cv_prog_cc_wl"
2020link_static_flag="$lt_cv_prog_cc_static"
2021no_builtin_flag="$lt_cv_prog_cc_no_builtin"
2022can_build_shared="$lt_cv_prog_cc_can_build_shared"
2023
2024
2025# Check to see if options -o and -c are simultaneously supported by compiler
2026AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
2027AC_CACHE_VAL([lt_cv_compiler_c_o], [
2028$rm -r conftest 2>/dev/null
2029mkdir conftest
2030cd conftest
2031echo "int some_variable = 0;" > conftest.$ac_ext
2032mkdir out
2033# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
2034# that will create temporary files in the current directory regardless of
2035# the output directory.  Thus, making CWD read-only will cause this test
2036# to fail, enabling locking or at least warning the user not to do parallel
2037# builds.
2038chmod -w .
2039save_CFLAGS="$CFLAGS"
2040CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
2041compiler_c_o=no
2042if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
2043  # The compiler can only warn and ignore the option if not recognized
2044  # So say no if there are warnings
2045  if test -s out/conftest.err; then
2046    lt_cv_compiler_c_o=no
2047  else
2048    lt_cv_compiler_c_o=yes
2049  fi
2050else
2051  # Append any errors to the config.log.
2052  cat out/conftest.err 1>&AC_FD_CC
2053  lt_cv_compiler_c_o=no
2054fi
2055CFLAGS="$save_CFLAGS"
2056chmod u+w .
2057$rm conftest* out/*
2058rmdir out
2059cd ..
2060rmdir conftest
2061$rm -r conftest 2>/dev/null
2062])
2063compiler_c_o=$lt_cv_compiler_c_o
2064AC_MSG_RESULT([$compiler_c_o])
2065
2066if test x"$compiler_c_o" = x"yes"; then
2067  # Check to see if we can write to a .lo
2068  AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
2069  AC_CACHE_VAL([lt_cv_compiler_o_lo], [
2070  lt_cv_compiler_o_lo=no
2071  save_CFLAGS="$CFLAGS"
2072  CFLAGS="$CFLAGS -c -o conftest.lo"
2073  save_objext="$ac_objext"
2074  ac_objext=lo
2075  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2076    # The compiler can only warn and ignore the option if not recognized
2077    # So say no if there are warnings
2078    if test -s conftest.err; then
2079      lt_cv_compiler_o_lo=no
2080    else
2081      lt_cv_compiler_o_lo=yes
2082    fi
2083  ])
2084  ac_objext="$save_objext"
2085  CFLAGS="$save_CFLAGS"
2086  ])
2087  compiler_o_lo=$lt_cv_compiler_o_lo
2088  AC_MSG_RESULT([$compiler_o_lo])
2089else
2090  compiler_o_lo=no
2091fi
2092
2093# Check to see if we can do hard links to lock some files if needed
2094hard_links="nottested"
2095if test "$compiler_c_o" = no && test "$need_locks" != no; then
2096  # do not overwrite the value of need_locks provided by the user
2097  AC_MSG_CHECKING([if we can lock with hard links])
2098  hard_links=yes
2099  $rm conftest*
2100  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2101  touch conftest.a
2102  ln conftest.a conftest.b 2>&5 || hard_links=no
2103  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2104  AC_MSG_RESULT([$hard_links])
2105  if test "$hard_links" = no; then
2106    AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
2107    need_locks=warn
2108  fi
2109else
2110  need_locks=no
2111fi
2112
2113if test "$GCC" = yes; then
2114  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
2115  AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
2116  echo "int some_variable = 0;" > conftest.$ac_ext
2117  save_CFLAGS="$CFLAGS"
2118  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
2119  compiler_rtti_exceptions=no
2120  AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
2121    # The compiler can only warn and ignore the option if not recognized
2122    # So say no if there are warnings
2123    if test -s conftest.err; then
2124      compiler_rtti_exceptions=no
2125    else
2126      compiler_rtti_exceptions=yes
2127    fi
2128  ])
2129  CFLAGS="$save_CFLAGS"
2130  AC_MSG_RESULT([$compiler_rtti_exceptions])
2131
2132  if test "$compiler_rtti_exceptions" = "yes"; then
2133    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
2134  else
2135    no_builtin_flag=' -fno-builtin'
2136  fi
2137fi
2138
2139# See if the linker supports building shared libraries.
2140AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
2141
2142allow_undefined_flag=
2143no_undefined_flag=
2144need_lib_prefix=unknown
2145need_version=unknown
2146# when you set need_version to no, make sure it does not cause -set_version
2147# flags to be left without arguments
2148archive_cmds=
2149archive_expsym_cmds=
2150old_archive_from_new_cmds=
2151old_archive_from_expsyms_cmds=
2152export_dynamic_flag_spec=
2153whole_archive_flag_spec=
2154thread_safe_flag_spec=
2155hardcode_into_libs=no
2156hardcode_libdir_flag_spec=
2157hardcode_libdir_separator=
2158hardcode_direct=no
2159hardcode_minus_L=no
2160hardcode_shlibpath_var=unsupported
2161runpath_var=
2162link_all_deplibs=unknown
2163always_export_symbols=no
2164export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
2165# include_expsyms should be a list of space-separated symbols to be *always*
2166# included in the symbol list
2167include_expsyms=
2168# exclude_expsyms can be an egrep regular expression of symbols to exclude
2169# it will be wrapped by ` (' and `)$', so one must not match beginning or
2170# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
2171# as well as any symbol that contains `d'.
2172exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
2173# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
2174# platforms (ab)use it in PIC code, but their linkers get confused if
2175# the symbol is explicitly referenced.  Since portable code cannot
2176# rely on this symbol name, it's probably fine to never include it in
2177# preloaded symbol tables.
2178extract_expsyms_cmds=
2179
2180case $host_os in
2181cygwin* | mingw* | pw32*)
2182  # FIXME: the MSVC++ port hasn't been tested in a loooong time
2183  # When not using gcc, we currently assume that we are using
2184  # Microsoft Visual C++.
2185  if test "$GCC" != yes; then
2186    with_gnu_ld=no
2187  fi
2188  ;;
2189openbsd*)
2190  with_gnu_ld=no
2191  ;;
2192esac
2193
2194ld_shlibs=yes
2195if test "$with_gnu_ld" = yes; then
2196  # If archive_cmds runs LD, not CC, wlarc should be empty
2197  wlarc='${wl}'
2198
2199  # See if GNU ld supports shared libraries.
2200  case $host_os in
2201  aix3* | aix4* | aix5*)
2202    # On AIX, the GNU linker is very broken
2203    # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
2204    ld_shlibs=no
2205    cat <<EOF 1>&2
2206
2207*** Warning: the GNU linker, at least up to release 2.9.1, is reported
2208*** to be unable to reliably create shared libraries on AIX.
2209*** Therefore, libtool is disabling shared libraries support.  If you
2210*** really care for shared libraries, you may want to modify your PATH
2211*** so that a non-GNU linker is found, and then restart.
2212
2213EOF
2214    ;;
2215
2216  amigaos*)
2217    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)'
2218    hardcode_libdir_flag_spec='-L$libdir'
2219    hardcode_minus_L=yes
2220
2221    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
2222    # that the semantics of dynamic libraries on AmigaOS, at least up
2223    # to version 4, is to share data among multiple programs linked
2224    # with the same dynamic library.  Since this doesn't match the
2225    # behavior of shared libraries on other platforms, we can use
2226    # them.
2227    ld_shlibs=no
2228    ;;
2229
2230  beos*)
2231    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2232      allow_undefined_flag=unsupported
2233      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
2234      # support --undefined.  This deserves some investigation.  FIXME
2235      archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2236    else
2237      ld_shlibs=no
2238    fi
2239    ;;
2240
2241  cygwin* | mingw* | pw32*)
2242    # hardcode_libdir_flag_spec is actually meaningless, as there is
2243    # no search path for DLLs.
2244    hardcode_libdir_flag_spec='-L$libdir'
2245    allow_undefined_flag=unsupported
2246    always_export_symbols=yes
2247
2248    extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
2249      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
2250      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
2251      if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
2252      else $CC -o impgen impgen.c ; fi)~
2253      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
2254
2255    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
2256
2257    # cygwin and mingw dlls have different entry points and sets of symbols
2258    # to exclude.
2259    # FIXME: what about values for MSVC?
2260    dll_entry=__cygwin_dll_entry@12
2261    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
2262    case $host_os in
2263    mingw*)
2264      # mingw values
2265      dll_entry=_DllMainCRTStartup@12
2266      dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
2267      ;;
2268    esac
2269
2270    # mingw and cygwin differ, and it's simplest to just exclude the union
2271    # of the two symbol sets.
2272    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
2273
2274    # recent cygwin and mingw systems supply a stub DllMain which the user
2275    # can override, but on older systems we have to supply one (in ltdll.c)
2276    if test "x$lt_cv_need_dllmain" = "xyes"; then
2277      ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
2278      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~
2279	test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
2280    else
2281      ltdll_obj=
2282      ltdll_cmds=
2283    fi
2284
2285    # Extract the symbol export list from an `--export-all' def file,
2286    # then regenerate the def file from the symbol export list, so that
2287    # the compiled dll only exports the symbol export list.
2288    # Be careful not to strip the DATA tag left be newer dlltools.
2289    export_symbols_cmds="$ltdll_cmds"'
2290      $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
2291      sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
2292
2293    # If the export-symbols file already is a .def file (1st line
2294    # is EXPORTS), use it as is.
2295    # If DATA tags from a recent dlltool are present, honour them!
2296    archive_expsym_cmds='if test "x`sed 1q $export_symbols`" = xEXPORTS; then
2297	cp $export_symbols $output_objdir/$soname-def;
2298      else
2299	echo EXPORTS > $output_objdir/$soname-def;
2300	_lt_hint=1;
2301	cat $export_symbols | while read symbol; do
2302	 set dummy \$symbol;
2303	 case \[$]# in
2304	   2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
2305	   4) echo "   \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
2306	   *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
2307	 esac;
2308	 _lt_hint=`expr 1 + \$_lt_hint`;
2309	done;
2310      fi~
2311      '"$ltdll_cmds"'
2312      $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~
2313      $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~
2314      $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~
2315      $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~
2316      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
2317    ;;
2318
2319  netbsd*)
2320    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2321      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
2322      wlarc=
2323    else
2324      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2325      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2326    fi
2327    ;;
2328
2329  solaris* | sysv5*)
2330    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
2331      ld_shlibs=no
2332      cat <<EOF 1>&2
2333
2334*** Warning: The releases 2.8.* of the GNU linker cannot reliably
2335*** create shared libraries on Solaris systems.  Therefore, libtool
2336*** is disabling shared libraries support.  We urge you to upgrade GNU
2337*** binutils to release 2.9.1 or newer.  Another option is to modify
2338*** your PATH or compiler configuration so that the native linker is
2339*** used, and then restart.
2340
2341EOF
2342    elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2343      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2344      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2345    else
2346      ld_shlibs=no
2347    fi
2348    ;;
2349
2350  sunos4*)
2351    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2352    wlarc=
2353    hardcode_direct=yes
2354    hardcode_shlibpath_var=no
2355    ;;
2356
2357  *)
2358    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
2359      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
2360      archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2361    else
2362      ld_shlibs=no
2363    fi
2364    ;;
2365  esac
2366
2367  if test "$ld_shlibs" = yes; then
2368    runpath_var=LD_RUN_PATH
2369    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
2370    export_dynamic_flag_spec='${wl}--export-dynamic'
2371    case $host_os in
2372    cygwin* | mingw* | pw32*)
2373      # dlltool doesn't understand --whole-archive et. al.
2374      whole_archive_flag_spec=
2375      ;;
2376    *)
2377      # ancient GNU ld didn't support --whole-archive et. al.
2378      if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
2379	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
2380      else
2381	whole_archive_flag_spec=
2382      fi
2383      ;;
2384    esac
2385  fi
2386else
2387  # PORTME fill in a description of your system's linker (not GNU ld)
2388  case $host_os in
2389  aix3*)
2390    allow_undefined_flag=unsupported
2391    always_export_symbols=yes
2392    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'
2393    # Note: this linker hardcodes the directories in LIBPATH if there
2394    # are no directories specified by -L.
2395    hardcode_minus_L=yes
2396    if test "$GCC" = yes && test -z "$link_static_flag"; then
2397      # Neither direct hardcoding nor static linking is supported with a
2398      # broken collect2.
2399      hardcode_direct=unsupported
2400    fi
2401    ;;
2402
2403  aix4* | aix5*)
2404    if test "$host_cpu" = ia64; then
2405      # On IA64, the linker does run time linking by default, so we don't
2406      # have to do anything special.
2407      aix_use_runtimelinking=no
2408      exp_sym_flag='-Bexport'
2409      no_entry_flag=""
2410    else
2411      aix_use_runtimelinking=no
2412
2413      # Test if we are trying to use run time linking or normal
2414      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
2415      # need to do runtime linking.
2416      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
2417	for ld_flag in $LDFLAGS; do
2418	  case $ld_flag in
2419	  *-brtl*)
2420	    aix_use_runtimelinking=yes
2421	    break
2422	  ;;
2423	  esac
2424	done
2425      esac
2426
2427      exp_sym_flag='-bexport'
2428      no_entry_flag='-bnoentry'
2429    fi
2430
2431    # When large executables or shared objects are built, AIX ld can
2432    # have problems creating the table of contents.  If linking a library
2433    # or program results in "error TOC overflow" add -mminimal-toc to
2434    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
2435    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
2436
2437    hardcode_direct=yes
2438    archive_cmds=''
2439    hardcode_libdir_separator=':'
2440    if test "$GCC" = yes; then
2441      case $host_os in aix4.[[012]]|aix4.[[012]].*)
2442	collect2name=`${CC} -print-prog-name=collect2`
2443	if test -f "$collect2name" && \
2444	  strings "$collect2name" | grep resolve_lib_name >/dev/null
2445	then
2446	  # We have reworked collect2
2447	  hardcode_direct=yes
2448	else
2449	  # We have old collect2
2450	  hardcode_direct=unsupported
2451	  # It fails to find uninstalled libraries when the uninstalled
2452	  # path is not listed in the libpath.  Setting hardcode_minus_L
2453	  # to unsupported forces relinking
2454	  hardcode_minus_L=yes
2455	  hardcode_libdir_flag_spec='-L$libdir'
2456	  hardcode_libdir_separator=
2457	fi
2458      esac
2459
2460      shared_flag='-shared'
2461    else
2462      # not using gcc
2463      if test "$host_cpu" = ia64; then
2464	shared_flag='${wl}-G'
2465      else
2466	if test "$aix_use_runtimelinking" = yes; then
2467	  shared_flag='${wl}-G'
2468	else
2469	  shared_flag='${wl}-bM:SRE'
2470	fi
2471      fi
2472    fi
2473
2474    # It seems that -bexpall can do strange things, so it is better to
2475    # generate a list of symbols to export.
2476    always_export_symbols=yes
2477    if test "$aix_use_runtimelinking" = yes; then
2478      # Warning - without using the other runtime loading flags (-brtl),
2479      # -berok will link without error, but may produce a broken library.
2480      allow_undefined_flag='-berok'
2481      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
2482      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"
2483    else
2484      if test "$host_cpu" = ia64; then
2485	hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
2486	allow_undefined_flag="-z nodefs"
2487	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"
2488      else
2489	hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
2490	# Warning - without using the other run time loading flags,
2491	# -berok will link without error, but may produce a broken library.
2492	allow_undefined_flag='${wl}-berok'
2493	# This is a bit strange, but is similar to how AIX traditionally builds
2494	# it's shared libraries.
2495	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'
2496      fi
2497    fi
2498    ;;
2499
2500  amigaos*)
2501    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)'
2502    hardcode_libdir_flag_spec='-L$libdir'
2503    hardcode_minus_L=yes
2504    # see comment about different semantics on the GNU ld section
2505    ld_shlibs=no
2506    ;;
2507
2508  cygwin* | mingw* | pw32*)
2509    # When not using gcc, we currently assume that we are using
2510    # Microsoft Visual C++.
2511    # hardcode_libdir_flag_spec is actually meaningless, as there is
2512    # no search path for DLLs.
2513    hardcode_libdir_flag_spec=' '
2514    allow_undefined_flag=unsupported
2515    # Tell ltmain to make .lib files, not .a files.
2516    libext=lib
2517    # FIXME: Setting linknames here is a bad hack.
2518    archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
2519    # The linker will automatically build a .lib file if we build a DLL.
2520    old_archive_from_new_cmds='true'
2521    # FIXME: Should let the user specify the lib program.
2522    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
2523    fix_srcfile_path='`cygpath -w "$srcfile"`'
2524    ;;
2525
2526  darwin* | rhapsody*)
2527    case "$host_os" in
2528    rhapsody* | darwin1.[[012]])
2529      allow_undefined_flag='-undefined suppress'
2530      ;;
2531    *) # Darwin 1.3 on
2532      allow_undefined_flag='-flat_namespace -undefined suppress'
2533      ;;
2534    esac
2535    # FIXME: Relying on posixy $() will cause problems for
2536    #        cross-compilation, but unfortunately the echo tests do not
2537    #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
2538    #	     `"' quotes if we put them in here... so don't!
2539    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)'
2540    # We need to add '_' to the symbols in $export_symbols first
2541    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
2542    hardcode_direct=yes
2543    hardcode_shlibpath_var=no
2544    whole_archive_flag_spec='-all_load $convenience'
2545    ;;
2546
2547  freebsd1*)
2548    ld_shlibs=no
2549    ;;
2550
2551  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
2552  # support.  Future versions do this automatically, but an explicit c++rt0.o
2553  # does not break anything, and helps significantly (at the cost of a little
2554  # extra space).
2555  freebsd2.2*)
2556    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
2557    hardcode_libdir_flag_spec='-R$libdir'
2558    hardcode_direct=yes
2559    hardcode_shlibpath_var=no
2560    ;;
2561
2562  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
2563  freebsd2*)
2564    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2565    hardcode_direct=yes
2566    hardcode_minus_L=yes
2567    hardcode_shlibpath_var=no
2568    ;;
2569
2570  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
2571  freebsd*)
2572    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
2573    hardcode_libdir_flag_spec='-R$libdir'
2574    hardcode_direct=yes
2575    hardcode_shlibpath_var=no
2576    ;;
2577
2578  hpux9* | hpux10* | hpux11*)
2579    case $host_os in
2580    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' ;;
2581    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
2582    esac
2583    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
2584    hardcode_libdir_separator=:
2585    hardcode_direct=yes
2586    hardcode_minus_L=yes # Not in the search PATH, but as the default
2587			 # location of the library.
2588    export_dynamic_flag_spec='${wl}-E'
2589    ;;
2590
2591  irix5* | irix6* | nonstopux*)
2592    if test "$GCC" = yes; then
2593      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'
2594      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2595    else
2596      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'
2597      hardcode_libdir_flag_spec='-rpath $libdir'
2598    fi
2599    hardcode_libdir_separator=:
2600    link_all_deplibs=yes
2601    ;;
2602
2603  netbsd*)
2604    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2605      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
2606    else
2607      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
2608    fi
2609    hardcode_libdir_flag_spec='-R$libdir'
2610    hardcode_direct=yes
2611    hardcode_shlibpath_var=no
2612    ;;
2613
2614  newsos6)
2615    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2616    hardcode_direct=yes
2617    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2618    hardcode_libdir_separator=:
2619    hardcode_shlibpath_var=no
2620    ;;
2621
2622  openbsd*)
2623    hardcode_direct=yes
2624    hardcode_shlibpath_var=no
2625    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2626      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
2627      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2628      export_dynamic_flag_spec='${wl}-E'
2629    else
2630      case "$host_os" in
2631      openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
2632	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2633	hardcode_libdir_flag_spec='-R$libdir'
2634        ;;
2635      *)
2636        archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
2637        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2638        ;;
2639      esac
2640    fi
2641    ;;
2642
2643  os2*)
2644    hardcode_libdir_flag_spec='-L$libdir'
2645    hardcode_minus_L=yes
2646    allow_undefined_flag=unsupported
2647    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'
2648    old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
2649    ;;
2650
2651  osf3*)
2652    if test "$GCC" = yes; then
2653      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2654      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'
2655    else
2656      allow_undefined_flag=' -expect_unresolved \*'
2657      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'
2658    fi
2659    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2660    hardcode_libdir_separator=:
2661    ;;
2662
2663  osf4* | osf5*)	# as osf3* with the addition of -msym flag
2664    if test "$GCC" = yes; then
2665      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2666      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'
2667      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2668    else
2669      allow_undefined_flag=' -expect_unresolved \*'
2670      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'
2671      archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
2672      $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'
2673
2674      #Both c and cxx compiler support -rpath directly
2675      hardcode_libdir_flag_spec='-rpath $libdir'
2676    fi
2677    hardcode_libdir_separator=:
2678    ;;
2679
2680  sco3.2v5*)
2681    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2682    hardcode_shlibpath_var=no
2683    runpath_var=LD_RUN_PATH
2684    hardcode_runpath_var=yes
2685    export_dynamic_flag_spec='${wl}-Bexport'
2686    ;;
2687
2688  solaris*)
2689    # gcc --version < 3.0 without binutils cannot create self contained
2690    # shared libraries reliably, requiring libgcc.a to resolve some of
2691    # the object symbols generated in some cases.  Libraries that use
2692    # assert need libgcc.a to resolve __eprintf, for example.  Linking
2693    # a copy of libgcc.a into every shared library to guarantee resolving
2694    # such symbols causes other problems:  According to Tim Van Holder
2695    # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
2696    # (to the application) exception stack for one thing.
2697    no_undefined_flag=' -z defs'
2698    if test "$GCC" = yes; then
2699      case `$CC --version 2>/dev/null` in
2700      [[12]].*)
2701	cat <<EOF 1>&2
2702
2703*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
2704*** create self contained shared libraries on Solaris systems, without
2705*** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
2706*** -no-undefined support, which will at least allow you to build shared
2707*** libraries.  However, you may find that when you link such libraries
2708*** into an application without using GCC, you have to manually add
2709*** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
2710*** upgrade to a newer version of GCC.  Another option is to rebuild your
2711*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
2712
2713EOF
2714        no_undefined_flag=
2715	;;
2716      esac
2717    fi
2718    # $CC -shared without GNU ld will not create a library from C++
2719    # object files and a static libstdc++, better avoid it by now
2720    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2721    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2722		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2723    hardcode_libdir_flag_spec='-R$libdir'
2724    hardcode_shlibpath_var=no
2725    case $host_os in
2726    solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
2727    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
2728      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
2729    esac
2730    link_all_deplibs=yes
2731    ;;
2732
2733  sunos4*)
2734    if test "x$host_vendor" = xsequent; then
2735      # Use $CC to link under sequent, because it throws in some extra .o
2736      # files that make .init and .fini sections work.
2737      archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
2738    else
2739      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
2740    fi
2741    hardcode_libdir_flag_spec='-L$libdir'
2742    hardcode_direct=yes
2743    hardcode_minus_L=yes
2744    hardcode_shlibpath_var=no
2745    ;;
2746
2747  sysv4)
2748    case $host_vendor in
2749      sni)
2750        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2751        hardcode_direct=yes # is this really true???
2752        ;;
2753      siemens)
2754        ## LD is ld it makes a PLAMLIB
2755        ## CC just makes a GrossModule.
2756        archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2757        reload_cmds='$CC -r -o $output$reload_objs'
2758        hardcode_direct=no
2759        ;;
2760      motorola)
2761        archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2762        hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2763        ;;
2764    esac
2765    runpath_var='LD_RUN_PATH'
2766    hardcode_shlibpath_var=no
2767    ;;
2768
2769  sysv4.3*)
2770    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2771    hardcode_shlibpath_var=no
2772    export_dynamic_flag_spec='-Bexport'
2773    ;;
2774
2775  sysv5*)
2776    no_undefined_flag=' -z text'
2777    # $CC -shared without GNU ld will not create a library from C++
2778    # object files and a static libstdc++, better avoid it by now
2779    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2780    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2781		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2782    hardcode_libdir_flag_spec=
2783    hardcode_shlibpath_var=no
2784    runpath_var='LD_RUN_PATH'
2785    ;;
2786
2787  uts4*)
2788    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2789    hardcode_libdir_flag_spec='-L$libdir'
2790    hardcode_shlibpath_var=no
2791    ;;
2792
2793  dgux*)
2794    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2795    hardcode_libdir_flag_spec='-L$libdir'
2796    hardcode_shlibpath_var=no
2797    ;;
2798
2799  sysv4*MP*)
2800    if test -d /usr/nec; then
2801      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2802      hardcode_shlibpath_var=no
2803      runpath_var=LD_RUN_PATH
2804      hardcode_runpath_var=yes
2805      ld_shlibs=yes
2806    fi
2807    ;;
2808
2809  sysv4.2uw2*)
2810    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2811    hardcode_direct=yes
2812    hardcode_minus_L=no
2813    hardcode_shlibpath_var=no
2814    hardcode_runpath_var=yes
2815    runpath_var=LD_RUN_PATH
2816    ;;
2817
2818  sysv5uw7* | unixware7*)
2819    no_undefined_flag='${wl}-z ${wl}text'
2820    if test "$GCC" = yes; then
2821      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2822    else
2823      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2824    fi
2825    runpath_var='LD_RUN_PATH'
2826    hardcode_shlibpath_var=no
2827    ;;
2828
2829  *)
2830    ld_shlibs=no
2831    ;;
2832  esac
2833fi
2834AC_MSG_RESULT([$ld_shlibs])
2835test "$ld_shlibs" = no && can_build_shared=no
2836
2837# Check hardcoding attributes.
2838AC_MSG_CHECKING([how to hardcode library paths into programs])
2839hardcode_action=
2840if test -n "$hardcode_libdir_flag_spec" || \
2841   test -n "$runpath_var"; then
2842
2843  # We can hardcode non-existant directories.
2844  if test "$hardcode_direct" != no &&
2845     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2846     # have to relink, otherwise we might link with an installed library
2847     # when we should be linking with a yet-to-be-installed one
2848     ## test "$hardcode_shlibpath_var" != no &&
2849     test "$hardcode_minus_L" != no; then
2850    # Linking always hardcodes the temporary library directory.
2851    hardcode_action=relink
2852  else
2853    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2854    hardcode_action=immediate
2855  fi
2856else
2857  # We cannot hardcode anything, or else we can only hardcode existing
2858  # directories.
2859  hardcode_action=unsupported
2860fi
2861AC_MSG_RESULT([$hardcode_action])
2862
2863striplib=
2864old_striplib=
2865AC_MSG_CHECKING([whether stripping libraries is possible])
2866if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2867  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2868  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2869  AC_MSG_RESULT([yes])
2870else
2871  AC_MSG_RESULT([no])
2872fi
2873
2874reload_cmds='$LD$reload_flag -o $output$reload_objs'
2875test -z "$deplibs_check_method" && deplibs_check_method=unknown
2876
2877# PORTME Fill in your ld.so characteristics
2878AC_MSG_CHECKING([dynamic linker characteristics])
2879library_names_spec=
2880libname_spec='lib$name'
2881soname_spec=
2882postinstall_cmds=
2883postuninstall_cmds=
2884finish_cmds=
2885finish_eval=
2886shlibpath_var=
2887shlibpath_overrides_runpath=unknown
2888version_type=none
2889dynamic_linker="$host_os ld.so"
2890sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib"
2891sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib /usr/X11R6/lib"
2892
2893case $host_os in
2894aix3*)
2895  version_type=linux
2896  library_names_spec='${libname}${release}.so$versuffix $libname.a'
2897  shlibpath_var=LIBPATH
2898
2899  # AIX has no versioning support, so we append a major version to the name.
2900  soname_spec='${libname}${release}.so$major'
2901  ;;
2902
2903aix4* | aix5*)
2904  version_type=linux
2905  need_lib_prefix=no
2906  need_version=no
2907  hardcode_into_libs=yes
2908  if test "$host_cpu" = ia64; then
2909    # AIX 5 supports IA64
2910    library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2911    shlibpath_var=LD_LIBRARY_PATH
2912  else
2913    # With GCC up to 2.95.x, collect2 would create an import file
2914    # for dependence libraries.  The import file would start with
2915    # the line `#! .'.  This would cause the generated library to
2916    # depend on `.', always an invalid library.  This was fixed in
2917    # development snapshots of GCC prior to 3.0.
2918    case $host_os in
2919      aix4 | aix4.[[01]] | aix4.[[01]].*)
2920	if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2921	     echo ' yes '
2922	     echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2923	  :
2924	else
2925	  can_build_shared=no
2926	fi
2927	;;
2928    esac
2929    # AIX (on Power*) has no versioning support, so currently we can
2930    # not hardcode correct soname into executable. Probably we can
2931    # add versioning support to collect2, so additional links can
2932    # be useful in future.
2933    if test "$aix_use_runtimelinking" = yes; then
2934      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2935      # instead of lib<name>.a to let people know that these are not
2936      # typical AIX shared libraries.
2937      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2938    else
2939      # We preserve .a as extension for shared libraries through AIX4.2
2940      # and later when we are not doing run time linking.
2941      library_names_spec='${libname}${release}.a $libname.a'
2942      soname_spec='${libname}${release}.so$major'
2943    fi
2944    shlibpath_var=LIBPATH
2945  fi
2946  hardcode_into_libs=yes
2947  ;;
2948
2949amigaos*)
2950  library_names_spec='$libname.ixlibrary $libname.a'
2951  # Create ${libname}_ixlibrary.a entries in /sys/libs.
2952  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'
2953  ;;
2954
2955beos*)
2956  library_names_spec='${libname}.so'
2957  dynamic_linker="$host_os ld.so"
2958  shlibpath_var=LIBRARY_PATH
2959  ;;
2960
2961bsdi4*)
2962  version_type=linux
2963  need_version=no
2964  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2965  soname_spec='${libname}${release}.so$major'
2966  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2967  shlibpath_var=LD_LIBRARY_PATH
2968  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2969  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2970  export_dynamic_flag_spec=-rdynamic
2971  # the default ld.so.conf also contains /usr/contrib/lib and
2972  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2973  # libtool to hard-code these into programs
2974  ;;
2975
2976cygwin* | mingw* | pw32*)
2977  version_type=windows
2978  need_version=no
2979  need_lib_prefix=no
2980  case $GCC,$host_os in
2981  yes,cygwin*)
2982    library_names_spec='$libname.dll.a'
2983    soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2984    postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
2985      dldir=$destdir/`dirname \$dlpath`~
2986      test -d \$dldir || mkdir -p \$dldir~
2987      $install_prog .libs/$dlname \$dldir/$dlname'
2988    postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
2989      dlpath=$dir/\$dldll~
2990       $rm \$dlpath'
2991    ;;
2992  yes,mingw*)
2993    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2994    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
2995    ;;
2996  yes,pw32*)
2997    library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
2998    ;;
2999  *)
3000    library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
3001    ;;
3002  esac
3003  dynamic_linker='Win32 ld.exe'
3004  # FIXME: first we should search . and the directory the executable is in
3005  shlibpath_var=PATH
3006  ;;
3007
3008darwin* | rhapsody*)
3009  dynamic_linker="$host_os dyld"
3010  version_type=darwin
3011  need_lib_prefix=no
3012  need_version=no
3013  # FIXME: Relying on posixy $() will cause problems for
3014  #        cross-compilation, but unfortunately the echo tests do not
3015  #        yet detect zsh echo's removal of \ escapes.
3016  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)'
3017  soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
3018  shlibpath_overrides_runpath=yes
3019  shlibpath_var=DYLD_LIBRARY_PATH
3020  ;;
3021
3022freebsd1*)
3023  dynamic_linker=no
3024  ;;
3025
3026freebsd*)
3027  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
3028  version_type=freebsd-$objformat
3029  case $version_type in
3030    freebsd-elf*)
3031      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
3032      need_version=no
3033      need_lib_prefix=no
3034      ;;
3035    freebsd-*)
3036      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
3037      need_version=yes
3038      ;;
3039  esac
3040  shlibpath_var=LD_LIBRARY_PATH
3041  case $host_os in
3042  freebsd2*)
3043    shlibpath_overrides_runpath=yes
3044    ;;
3045  *)
3046    shlibpath_overrides_runpath=no
3047    hardcode_into_libs=yes
3048    ;;
3049  esac
3050  ;;
3051
3052gnu*)
3053  version_type=linux
3054  need_lib_prefix=no
3055  need_version=no
3056  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
3057  soname_spec='${libname}${release}.so$major'
3058  shlibpath_var=LD_LIBRARY_PATH
3059  hardcode_into_libs=yes
3060  ;;
3061
3062hpux9* | hpux10* | hpux11*)
3063  # Give a soname corresponding to the major version so that dld.sl refuses to
3064  # link against other versions.
3065  dynamic_linker="$host_os dld.sl"
3066  version_type=sunos
3067  need_lib_prefix=no
3068  need_version=no
3069  shlibpath_var=SHLIB_PATH
3070  shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3071  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
3072  soname_spec='${libname}${release}.sl$major'
3073  # HP-UX runs *really* slowly unless shared libraries are mode 555.
3074  postinstall_cmds='chmod 555 $lib'
3075  ;;
3076
3077irix5* | irix6* | nonstopux*)
3078  case $host_os in
3079    nonstopux*) version_type=nonstopux ;;
3080    *)          version_type=irix ;;
3081  esac
3082  need_lib_prefix=no
3083  need_version=no
3084  soname_spec='${libname}${release}.so$major'
3085  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
3086  case $host_os in
3087  irix5* | nonstopux*)
3088    libsuff= shlibsuff=
3089    ;;
3090  *)
3091    case $LD in # libtool.m4 will add one of these switches to LD
3092    *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
3093    *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
3094    *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
3095    *) libsuff= shlibsuff= libmagic=never-match;;
3096    esac
3097    ;;
3098  esac
3099  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3100  shlibpath_overrides_runpath=no
3101  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3102  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3103  ;;
3104
3105# No shared lib support for Linux oldld, aout, or coff.
3106linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
3107  dynamic_linker=no
3108  ;;
3109
3110# This must be Linux ELF.
3111linux-gnu*)
3112  version_type=linux
3113  need_lib_prefix=no
3114  need_version=no
3115  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3116  soname_spec='${libname}${release}.so$major'
3117  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3118  shlibpath_var=LD_LIBRARY_PATH
3119  shlibpath_overrides_runpath=no
3120  # This implies no fast_install, which is unacceptable.
3121  # Some rework will be needed to allow for fast_install
3122  # before this can be enabled.
3123  hardcode_into_libs=yes
3124
3125  case $host_cpu:$lt_cv_cc_64bit_output in
3126  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
3127    sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64"
3128    sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64"
3129    ;;
3130  esac
3131
3132  # We used to test for /lib/ld.so.1 and disable shared libraries on
3133  # powerpc, because MkLinux only supported shared libraries with the
3134  # GNU dynamic linker.  Since this was broken with cross compilers,
3135  # most powerpc-linux boxes support dynamic linking these days and
3136  # people can always --disable-shared, the test was removed, and we
3137  # assume the GNU/Linux dynamic linker is in use.
3138  dynamic_linker='GNU/Linux ld.so'
3139  ;;
3140
3141netbsd*)
3142  version_type=sunos
3143  need_lib_prefix=no
3144  need_version=no
3145  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3146    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3147    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3148    dynamic_linker='NetBSD (a.out) ld.so'
3149  else
3150    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
3151    soname_spec='${libname}${release}.so$major'
3152    dynamic_linker='NetBSD ld.elf_so'
3153  fi
3154  shlibpath_var=LD_LIBRARY_PATH
3155  shlibpath_overrides_runpath=yes
3156  hardcode_into_libs=yes
3157  ;;
3158
3159newsos6)
3160  version_type=linux
3161  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3162  shlibpath_var=LD_LIBRARY_PATH
3163  shlibpath_overrides_runpath=yes
3164  ;;
3165
3166openbsd*)
3167  version_type=sunos
3168  need_lib_prefix=no
3169  need_version=no
3170  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3171    case "$host_os" in
3172    openbsd2.[[89]] | openbsd2.[[89]].*)
3173      shlibpath_overrides_runpath=no
3174      ;;
3175    *)
3176      shlibpath_overrides_runpath=yes
3177      ;;
3178    esac
3179  else
3180    shlibpath_overrides_runpath=yes
3181  fi
3182  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3183  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3184  shlibpath_var=LD_LIBRARY_PATH
3185  ;;
3186
3187os2*)
3188  libname_spec='$name'
3189  need_lib_prefix=no
3190  library_names_spec='$libname.dll $libname.a'
3191  dynamic_linker='OS/2 ld.exe'
3192  shlibpath_var=LIBPATH
3193  ;;
3194
3195osf3* | osf4* | osf5*)
3196  version_type=osf
3197  need_version=no
3198  soname_spec='${libname}${release}.so$major'
3199  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3200  shlibpath_var=LD_LIBRARY_PATH
3201  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3202  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3203  hardcode_into_libs=yes
3204  ;;
3205
3206sco3.2v5*)
3207  version_type=osf
3208  soname_spec='${libname}${release}.so$major'
3209  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3210  shlibpath_var=LD_LIBRARY_PATH
3211  ;;
3212
3213solaris*)
3214  version_type=linux
3215  need_lib_prefix=no
3216  need_version=no
3217  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3218  soname_spec='${libname}${release}.so$major'
3219  shlibpath_var=LD_LIBRARY_PATH
3220  shlibpath_overrides_runpath=yes
3221  hardcode_into_libs=yes
3222  # ldd complains unless libraries are executable
3223  postinstall_cmds='chmod +x $lib'
3224  ;;
3225
3226sunos4*)
3227  version_type=sunos
3228  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
3229  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3230  shlibpath_var=LD_LIBRARY_PATH
3231  shlibpath_overrides_runpath=yes
3232  if test "$with_gnu_ld" = yes; then
3233    need_lib_prefix=no
3234  fi
3235  need_version=yes
3236  ;;
3237
3238sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3239  version_type=linux
3240  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3241  soname_spec='${libname}${release}.so$major'
3242  shlibpath_var=LD_LIBRARY_PATH
3243  case $host_vendor in
3244    sni)
3245      shlibpath_overrides_runpath=no
3246      need_lib_prefix=no
3247      export_dynamic_flag_spec='${wl}-Blargedynsym'
3248      runpath_var=LD_RUN_PATH
3249      ;;
3250    siemens)
3251      need_lib_prefix=no
3252      ;;
3253    motorola)
3254      need_lib_prefix=no
3255      need_version=no
3256      shlibpath_overrides_runpath=no
3257      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3258      ;;
3259  esac
3260  ;;
3261
3262uts4*)
3263  version_type=linux
3264  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3265  soname_spec='${libname}${release}.so$major'
3266  shlibpath_var=LD_LIBRARY_PATH
3267  ;;
3268
3269dgux*)
3270  version_type=linux
3271  need_lib_prefix=no
3272  need_version=no
3273  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
3274  soname_spec='${libname}${release}.so$major'
3275  shlibpath_var=LD_LIBRARY_PATH
3276  ;;
3277
3278sysv4*MP*)
3279  if test -d /usr/nec ;then
3280    version_type=linux
3281    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
3282    soname_spec='$libname.so.$major'
3283    shlibpath_var=LD_LIBRARY_PATH
3284  fi
3285  ;;
3286
3287*)
3288  dynamic_linker=no
3289  ;;
3290esac
3291AC_MSG_RESULT([$dynamic_linker])
3292test "$dynamic_linker" = no && can_build_shared=no
3293
3294# Report the final consequences.
3295AC_MSG_CHECKING([if libtool supports shared libraries])
3296AC_MSG_RESULT([$can_build_shared])
3297
3298AC_MSG_CHECKING([whether to build shared libraries])
3299test "$can_build_shared" = "no" && enable_shared=no
3300
3301# On AIX, shared libraries and static libraries use the same namespace, and
3302# are all built from PIC.
3303case "$host_os" in
3304aix3*)
3305  test "$enable_shared" = yes && enable_static=no
3306  if test -n "$RANLIB"; then
3307    archive_cmds="$archive_cmds~\$RANLIB \$lib"
3308    postinstall_cmds='$RANLIB $lib'
3309  fi
3310  ;;
3311
3312aix4*)
3313  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3314    test "$enable_shared" = yes && enable_static=no
3315  fi
3316  ;;
3317esac
3318AC_MSG_RESULT([$enable_shared])
3319
3320AC_MSG_CHECKING([whether to build static libraries])
3321# Make sure either enable_shared or enable_static is yes.
3322test "$enable_shared" = yes || enable_static=yes
3323AC_MSG_RESULT([$enable_static])
3324
3325if test "$hardcode_action" = relink; then
3326  # Fast installation is not supported
3327  enable_fast_install=no
3328elif test "$shlibpath_overrides_runpath" = yes ||
3329     test "$enable_shared" = no; then
3330  # Fast installation is not necessary
3331  enable_fast_install=needless
3332fi
3333
3334variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3335if test "$GCC" = yes; then
3336  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3337fi
3338
3339AC_LIBTOOL_DLOPEN_SELF
3340
3341if test "$enable_shared" = yes && test "$GCC" = yes; then
3342  case $archive_cmds in
3343  *'~'*)
3344    # FIXME: we may have to deal with multi-command sequences.
3345    ;;
3346  '$CC '*)
3347    # Test whether the compiler implicitly links with -lc since on some
3348    # systems, -lgcc has to come before -lc. If gcc already passes -lc
3349    # to ld, don't add -lc before -lgcc.
3350    AC_MSG_CHECKING([whether -lc should be explicitly linked in])
3351    AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
3352    [$rm conftest*
3353    echo 'static int dummy;' > conftest.$ac_ext
3354
3355    if AC_TRY_EVAL(ac_compile); then
3356      soname=conftest
3357      lib=conftest
3358      libobjs=conftest.$ac_objext
3359      deplibs=
3360      wl=$lt_cv_prog_cc_wl
3361      compiler_flags=-v
3362      linker_flags=-v
3363      verstring=
3364      output_objdir=.
3365      libname=conftest
3366      save_allow_undefined_flag=$allow_undefined_flag
3367      allow_undefined_flag=
3368      if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
3369      then
3370	lt_cv_archive_cmds_need_lc=no
3371      else
3372	lt_cv_archive_cmds_need_lc=yes
3373      fi
3374      allow_undefined_flag=$save_allow_undefined_flag
3375    else
3376      cat conftest.err 1>&5
3377    fi])
3378    AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
3379    ;;
3380  esac
3381fi
3382need_lc=${lt_cv_archive_cmds_need_lc-yes}
3383
3384# The second clause should only fire when bootstrapping the
3385# libtool distribution, otherwise you forgot to ship ltmain.sh
3386# with your package, and you will get complaints that there are
3387# no rules to generate ltmain.sh.
3388if test -f "$ltmain"; then
3389  :
3390else
3391  # If there is no Makefile yet, we rely on a make rule to execute
3392  # `config.status --recheck' to rerun these tests and create the
3393  # libtool script then.
3394  test -f Makefile && make "$ltmain"
3395fi
3396
3397if test -f "$ltmain"; then
3398  trap "$rm \"${ofile}T\"; exit 1" 1 2 15
3399  $rm -f "${ofile}T"
3400
3401  echo creating $ofile
3402
3403  # Now quote all the things that may contain metacharacters while being
3404  # careful not to overquote the AC_SUBSTed values.  We take copies of the
3405  # variables and quote the copies for generation of the libtool script.
3406  for var in echo old_CC old_CFLAGS SED \
3407    AR AR_FLAGS CC LD LN_S NM SHELL \
3408    reload_flag reload_cmds wl \
3409    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
3410    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
3411    library_names_spec soname_spec \
3412    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
3413    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
3414    postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
3415    old_striplib striplib file_magic_cmd export_symbols_cmds \
3416    deplibs_check_method allow_undefined_flag no_undefined_flag \
3417    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
3418    global_symbol_to_c_name_address \
3419    hardcode_libdir_flag_spec hardcode_libdir_separator  \
3420    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
3421    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
3422
3423    case $var in
3424    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
3425    old_postinstall_cmds | old_postuninstall_cmds | \
3426    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
3427    extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
3428    postinstall_cmds | postuninstall_cmds | \
3429    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
3430      # Double-quote double-evaled strings.
3431      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
3432      ;;
3433    *)
3434      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
3435      ;;
3436    esac
3437  done
3438
3439  cat <<__EOF__ > "${ofile}T"
3440#! $SHELL
3441
3442# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
3443# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
3444# NOTE: Changes made to this file will be lost: look at ltmain.sh.
3445#
3446# Copyright (C) 1996-2000 Free Software Foundation, Inc.
3447# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
3448#
3449# This program is free software; you can redistribute it and/or modify
3450# it under the terms of the GNU General Public License as published by
3451# the Free Software Foundation; either version 2 of the License, or
3452# (at your option) any later version.
3453#
3454# This program is distributed in the hope that it will be useful, but
3455# WITHOUT ANY WARRANTY; without even the implied warranty of
3456# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3457# General Public License for more details.
3458#
3459# You should have received a copy of the GNU General Public License
3460# along with this program; if not, write to the Free Software
3461# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3462#
3463# As a special exception to the GNU General Public License, if you
3464# distribute this file as part of a program that contains a
3465# configuration script generated by Autoconf, you may include it under
3466# the same distribution terms that you use for the rest of that program.
3467
3468# A sed that does not truncate output.
3469SED=$lt_SED
3470
3471# Sed that helps us avoid accidentally triggering echo(1) options like -n.
3472Xsed="${SED} -e s/^X//"
3473
3474# The HP-UX ksh and POSIX shell print the target directory to stdout
3475# if CDPATH is set.
3476if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
3477
3478# ### BEGIN LIBTOOL CONFIG
3479
3480# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3481
3482# Shell to use when invoking shell scripts.
3483SHELL=$lt_SHELL
3484
3485# Whether or not to build shared libraries.
3486build_libtool_libs=$enable_shared
3487
3488# Whether or not to build static libraries.
3489build_old_libs=$enable_static
3490
3491# Whether or not to add -lc for building shared libraries.
3492build_libtool_need_lc=$need_lc
3493
3494# Whether or not to optimize for fast installation.
3495fast_install=$enable_fast_install
3496
3497# The host system.
3498host_alias=$host_alias
3499host=$host
3500
3501# An echo program that does not interpret backslashes.
3502echo=$lt_echo
3503
3504# The archiver.
3505AR=$lt_AR
3506AR_FLAGS=$lt_AR_FLAGS
3507
3508# The default C compiler.
3509CC=$lt_CC
3510
3511# Is the compiler the GNU C compiler?
3512with_gcc=$GCC
3513
3514# The linker used to build libraries.
3515LD=$lt_LD
3516
3517# Whether we need hard or soft links.
3518LN_S=$lt_LN_S
3519
3520# A BSD-compatible nm program.
3521NM=$lt_NM
3522
3523# A symbol stripping program
3524STRIP=$STRIP
3525
3526# Used to examine libraries when file_magic_cmd begins "file"
3527MAGIC_CMD=$MAGIC_CMD
3528
3529# Used on cygwin: DLL creation program.
3530DLLTOOL="$DLLTOOL"
3531
3532# Used on cygwin: object dumper.
3533OBJDUMP="$OBJDUMP"
3534
3535# Used on cygwin: assembler.
3536AS="$AS"
3537
3538# The name of the directory that contains temporary libtool files.
3539objdir=$objdir
3540
3541# How to create reloadable object files.
3542reload_flag=$lt_reload_flag
3543reload_cmds=$lt_reload_cmds
3544
3545# How to pass a linker flag through the compiler.
3546wl=$lt_wl
3547
3548# Object file suffix (normally "o").
3549objext="$ac_objext"
3550
3551# Old archive suffix (normally "a").
3552libext="$libext"
3553
3554# Executable file suffix (normally "").
3555exeext="$exeext"
3556
3557# Additional compiler flags for building library objects.
3558pic_flag=$lt_pic_flag
3559pic_mode=$pic_mode
3560
3561# Does compiler simultaneously support -c and -o options?
3562compiler_c_o=$lt_compiler_c_o
3563
3564# Can we write directly to a .lo ?
3565compiler_o_lo=$lt_compiler_o_lo
3566
3567# Must we lock files when doing compilation ?
3568need_locks=$lt_need_locks
3569
3570# Do we need the lib prefix for modules?
3571need_lib_prefix=$need_lib_prefix
3572
3573# Do we need a version for libraries?
3574need_version=$need_version
3575
3576# Whether dlopen is supported.
3577dlopen_support=$enable_dlopen
3578
3579# Whether dlopen of programs is supported.
3580dlopen_self=$enable_dlopen_self
3581
3582# Whether dlopen of statically linked programs is supported.
3583dlopen_self_static=$enable_dlopen_self_static
3584
3585# Compiler flag to prevent dynamic linking.
3586link_static_flag=$lt_link_static_flag
3587
3588# Compiler flag to turn off builtin functions.
3589no_builtin_flag=$lt_no_builtin_flag
3590
3591# Compiler flag to allow reflexive dlopens.
3592export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
3593
3594# Compiler flag to generate shared objects directly from archives.
3595whole_archive_flag_spec=$lt_whole_archive_flag_spec
3596
3597# Compiler flag to generate thread-safe objects.
3598thread_safe_flag_spec=$lt_thread_safe_flag_spec
3599
3600# Library versioning type.
3601version_type=$version_type
3602
3603# Format of library name prefix.
3604libname_spec=$lt_libname_spec
3605
3606# List of archive names.  First name is the real one, the rest are links.
3607# The last name is the one that the linker finds with -lNAME.
3608library_names_spec=$lt_library_names_spec
3609
3610# The coded name of the library, if different from the real name.
3611soname_spec=$lt_soname_spec
3612
3613# Commands used to build and install an old-style archive.
3614RANLIB=$lt_RANLIB
3615old_archive_cmds=$lt_old_archive_cmds
3616old_postinstall_cmds=$lt_old_postinstall_cmds
3617old_postuninstall_cmds=$lt_old_postuninstall_cmds
3618
3619# Create an old-style archive from a shared archive.
3620old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
3621
3622# Create a temporary old-style archive to link instead of a shared archive.
3623old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
3624
3625# Commands used to build and install a shared archive.
3626archive_cmds=$lt_archive_cmds
3627archive_expsym_cmds=$lt_archive_expsym_cmds
3628postinstall_cmds=$lt_postinstall_cmds
3629postuninstall_cmds=$lt_postuninstall_cmds
3630
3631# Commands to strip libraries.
3632old_striplib=$lt_old_striplib
3633striplib=$lt_striplib
3634
3635# Method to check whether dependent libraries are shared objects.
3636deplibs_check_method=$lt_deplibs_check_method
3637
3638# Command to use when deplibs_check_method == file_magic.
3639file_magic_cmd=$lt_file_magic_cmd
3640
3641# Flag that allows shared libraries with undefined symbols to be built.
3642allow_undefined_flag=$lt_allow_undefined_flag
3643
3644# Flag that forces no undefined symbols.
3645no_undefined_flag=$lt_no_undefined_flag
3646
3647# Commands used to finish a libtool library installation in a directory.
3648finish_cmds=$lt_finish_cmds
3649
3650# Same as above, but a single script fragment to be evaled but not shown.
3651finish_eval=$lt_finish_eval
3652
3653# Take the output of nm and produce a listing of raw symbols and C names.
3654global_symbol_pipe=$lt_global_symbol_pipe
3655
3656# Transform the output of nm in a proper C declaration
3657global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
3658
3659# Transform the output of nm in a C name address pair
3660global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
3661
3662# This is the shared library runtime path variable.
3663runpath_var=$runpath_var
3664
3665# This is the shared library path variable.
3666shlibpath_var=$shlibpath_var
3667
3668# Is shlibpath searched before the hard-coded library search path?
3669shlibpath_overrides_runpath=$shlibpath_overrides_runpath
3670
3671# How to hardcode a shared library path into an executable.
3672hardcode_action=$hardcode_action
3673
3674# Whether we should hardcode library paths into libraries.
3675hardcode_into_libs=$hardcode_into_libs
3676
3677# Flag to hardcode \$libdir into a binary during linking.
3678# This must work even if \$libdir does not exist.
3679hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
3680
3681# Whether we need a single -rpath flag with a separated argument.
3682hardcode_libdir_separator=$lt_hardcode_libdir_separator
3683
3684# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
3685# resulting binary.
3686hardcode_direct=$hardcode_direct
3687
3688# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
3689# resulting binary.
3690hardcode_minus_L=$hardcode_minus_L
3691
3692# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
3693# the resulting binary.
3694hardcode_shlibpath_var=$hardcode_shlibpath_var
3695
3696# Variables whose values should be saved in libtool wrapper scripts and
3697# restored at relink time.
3698variables_saved_for_relink="$variables_saved_for_relink"
3699
3700# Whether libtool must link a program against all its dependency libraries.
3701link_all_deplibs=$link_all_deplibs
3702
3703# Compile-time system search path for libraries
3704sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
3705
3706# Run-time system search path for libraries
3707sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
3708
3709# Fix the shell variable \$srcfile for the compiler.
3710fix_srcfile_path="$fix_srcfile_path"
3711
3712# Set to yes if exported symbols are required.
3713always_export_symbols=$always_export_symbols
3714
3715# The commands to list exported symbols.
3716export_symbols_cmds=$lt_export_symbols_cmds
3717
3718# The commands to extract the exported symbol list from a shared archive.
3719extract_expsyms_cmds=$lt_extract_expsyms_cmds
3720
3721# Symbols that should not be listed in the preloaded symbols.
3722exclude_expsyms=$lt_exclude_expsyms
3723
3724# Symbols that must always be exported.
3725include_expsyms=$lt_include_expsyms
3726
3727# ### END LIBTOOL CONFIG
3728
3729__EOF__
3730
3731  case $host_os in
3732  aix3*)
3733    cat <<\EOF >> "${ofile}T"
3734
3735# AIX sometimes has problems with the GCC collect2 program.  For some
3736# reason, if we set the COLLECT_NAMES environment variable, the problems
3737# vanish in a puff of smoke.
3738if test "X${COLLECT_NAMES+set}" != Xset; then
3739  COLLECT_NAMES=
3740  export COLLECT_NAMES
3741fi
3742EOF
3743    ;;
3744  esac
3745
3746  case $host_os in
3747  cygwin* | mingw* | pw32* | os2*)
3748    cat <<'EOF' >> "${ofile}T"
3749      # This is a source program that is used to create dlls on Windows
3750      # Don't remove nor modify the starting and closing comments
3751# /* ltdll.c starts here */
3752# #define WIN32_LEAN_AND_MEAN
3753# #include <windows.h>
3754# #undef WIN32_LEAN_AND_MEAN
3755# #include <stdio.h>
3756#
3757# #ifndef __CYGWIN__
3758# #  ifdef __CYGWIN32__
3759# #    define __CYGWIN__ __CYGWIN32__
3760# #  endif
3761# #endif
3762#
3763# #ifdef __cplusplus
3764# extern "C" {
3765# #endif
3766# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3767# #ifdef __cplusplus
3768# }
3769# #endif
3770#
3771# #ifdef __CYGWIN__
3772# #include <cygwin/cygwin_dll.h>
3773# DECLARE_CYGWIN_DLL( DllMain );
3774# #endif
3775# HINSTANCE __hDllInstance_base;
3776#
3777# BOOL APIENTRY
3778# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3779# {
3780#   __hDllInstance_base = hInst;
3781#   return TRUE;
3782# }
3783# /* ltdll.c ends here */
3784	# This is a source program that is used to create import libraries
3785	# on Windows for dlls which lack them. Don't remove nor modify the
3786	# starting and closing comments
3787# /* impgen.c starts here */
3788# /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
3789#
3790#  This file is part of GNU libtool.
3791#
3792#  This program is free software; you can redistribute it and/or modify
3793#  it under the terms of the GNU General Public License as published by
3794#  the Free Software Foundation; either version 2 of the License, or
3795#  (at your option) any later version.
3796#
3797#  This program is distributed in the hope that it will be useful,
3798#  but WITHOUT ANY WARRANTY; without even the implied warranty of
3799#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3800#  GNU General Public License for more details.
3801#
3802#  You should have received a copy of the GNU General Public License
3803#  along with this program; if not, write to the Free Software
3804#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3805#  */
3806#
3807# #include <stdio.h>		/* for printf() */
3808# #include <unistd.h>		/* for open(), lseek(), read() */
3809# #include <fcntl.h>		/* for O_RDONLY, O_BINARY */
3810# #include <string.h>		/* for strdup() */
3811#
3812# /* O_BINARY isn't required (or even defined sometimes) under Unix */
3813# #ifndef O_BINARY
3814# #define O_BINARY 0
3815# #endif
3816#
3817# static unsigned int
3818# pe_get16 (fd, offset)
3819#      int fd;
3820#      int offset;
3821# {
3822#   unsigned char b[2];
3823#   lseek (fd, offset, SEEK_SET);
3824#   read (fd, b, 2);
3825#   return b[0] + (b[1]<<8);
3826# }
3827#
3828# static unsigned int
3829# pe_get32 (fd, offset)
3830#     int fd;
3831#     int offset;
3832# {
3833#   unsigned char b[4];
3834#   lseek (fd, offset, SEEK_SET);
3835#   read (fd, b, 4);
3836#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3837# }
3838#
3839# static unsigned int
3840# pe_as32 (ptr)
3841#      void *ptr;
3842# {
3843#   unsigned char *b = ptr;
3844#   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3845# }
3846#
3847# int
3848# main (argc, argv)
3849#     int argc;
3850#     char *argv[];
3851# {
3852#     int dll;
3853#     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3854#     unsigned long export_rva, export_size, nsections, secptr, expptr;
3855#     unsigned long name_rvas, nexp;
3856#     unsigned char *expdata, *erva;
3857#     char *filename, *dll_name;
3858#
3859#     filename = argv[1];
3860#
3861#     dll = open(filename, O_RDONLY|O_BINARY);
3862#     if (dll < 1)
3863# 	return 1;
3864#
3865#     dll_name = filename;
3866#
3867#     for (i=0; filename[i]; i++)
3868# 	if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
3869# 	    dll_name = filename + i +1;
3870#
3871#     pe_header_offset = pe_get32 (dll, 0x3c);
3872#     opthdr_ofs = pe_header_offset + 4 + 20;
3873#     num_entries = pe_get32 (dll, opthdr_ofs + 92);
3874#
3875#     if (num_entries < 1) /* no exports */
3876# 	return 1;
3877#
3878#     export_rva = pe_get32 (dll, opthdr_ofs + 96);
3879#     export_size = pe_get32 (dll, opthdr_ofs + 100);
3880#     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3881#     secptr = (pe_header_offset + 4 + 20 +
3882# 	      pe_get16 (dll, pe_header_offset + 4 + 16));
3883#
3884#     expptr = 0;
3885#     for (i = 0; i < nsections; i++)
3886#     {
3887# 	char sname[8];
3888# 	unsigned long secptr1 = secptr + 40 * i;
3889# 	unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3890# 	unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3891# 	unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3892# 	lseek(dll, secptr1, SEEK_SET);
3893# 	read(dll, sname, 8);
3894# 	if (vaddr <= export_rva && vaddr+vsize > export_rva)
3895# 	{
3896# 	    expptr = fptr + (export_rva - vaddr);
3897# 	    if (export_rva + export_size > vaddr + vsize)
3898# 		export_size = vsize - (export_rva - vaddr);
3899# 	    break;
3900# 	}
3901#     }
3902#
3903#     expdata = (unsigned char*)malloc(export_size);
3904#     lseek (dll, expptr, SEEK_SET);
3905#     read (dll, expdata, export_size);
3906#     erva = expdata - export_rva;
3907#
3908#     nexp = pe_as32 (expdata+24);
3909#     name_rvas = pe_as32 (expdata+32);
3910#
3911#     printf ("EXPORTS\n");
3912#     for (i = 0; i<nexp; i++)
3913#     {
3914# 	unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3915# 	printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3916#     }
3917#
3918#     return 0;
3919# }
3920# /* impgen.c ends here */
3921
3922EOF
3923    ;;
3924  esac
3925
3926  # We use sed instead of cat because bash on DJGPP gets confused if
3927  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3928  # text mode, it properly converts lines to CR/LF.  This bash problem
3929  # is reportedly fixed, but why not run on old versions too?
3930  sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
3931
3932  mv -f "${ofile}T" "$ofile" || \
3933    (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3934  chmod +x "$ofile"
3935fi
3936
3937])# _LT_AC_LTCONFIG_HACK
3938
3939# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3940AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
3941
3942# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3943AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
3944
3945# AC_ENABLE_SHARED - implement the --enable-shared flag
3946# Usage: AC_ENABLE_SHARED[(DEFAULT)]
3947#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3948#   `yes'.
3949AC_DEFUN([AC_ENABLE_SHARED],
3950[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3951AC_ARG_ENABLE(shared,
3952changequote(<<, >>)dnl
3953<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3954changequote([, ])dnl
3955[p=${PACKAGE-default}
3956case $enableval in
3957yes) enable_shared=yes ;;
3958no) enable_shared=no ;;
3959*)
3960  enable_shared=no
3961  # Look at the argument we got.  We use all the common list separators.
3962  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3963  for pkg in $enableval; do
3964    if test "X$pkg" = "X$p"; then
3965      enable_shared=yes
3966    fi
3967  done
3968  IFS="$ac_save_ifs"
3969  ;;
3970esac],
3971enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3972])
3973
3974# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3975AC_DEFUN([AC_DISABLE_SHARED],
3976[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3977AC_ENABLE_SHARED(no)])
3978
3979# AC_ENABLE_STATIC - implement the --enable-static flag
3980# Usage: AC_ENABLE_STATIC[(DEFAULT)]
3981#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3982#   `yes'.
3983AC_DEFUN([AC_ENABLE_STATIC],
3984[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3985AC_ARG_ENABLE(static,
3986changequote(<<, >>)dnl
3987<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3988changequote([, ])dnl
3989[p=${PACKAGE-default}
3990case $enableval in
3991yes) enable_static=yes ;;
3992no) enable_static=no ;;
3993*)
3994  enable_static=no
3995  # Look at the argument we got.  We use all the common list separators.
3996  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3997  for pkg in $enableval; do
3998    if test "X$pkg" = "X$p"; then
3999      enable_static=yes
4000    fi
4001  done
4002  IFS="$ac_save_ifs"
4003  ;;
4004esac],
4005enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
4006])
4007
4008# AC_DISABLE_STATIC - set the default static flag to --disable-static
4009AC_DEFUN([AC_DISABLE_STATIC],
4010[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4011AC_ENABLE_STATIC(no)])
4012
4013
4014# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
4015# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
4016#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
4017#   `yes'.
4018AC_DEFUN([AC_ENABLE_FAST_INSTALL],
4019[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
4020AC_ARG_ENABLE(fast-install,
4021changequote(<<, >>)dnl
4022<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
4023changequote([, ])dnl
4024[p=${PACKAGE-default}
4025case $enableval in
4026yes) enable_fast_install=yes ;;
4027no) enable_fast_install=no ;;
4028*)
4029  enable_fast_install=no
4030  # Look at the argument we got.  We use all the common list separators.
4031  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
4032  for pkg in $enableval; do
4033    if test "X$pkg" = "X$p"; then
4034      enable_fast_install=yes
4035    fi
4036  done
4037  IFS="$ac_save_ifs"
4038  ;;
4039esac],
4040enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
4041])
4042
4043# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
4044AC_DEFUN([AC_DISABLE_FAST_INSTALL],
4045[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4046AC_ENABLE_FAST_INSTALL(no)])
4047
4048# AC_LIBTOOL_PICMODE - implement the --with-pic flag
4049# Usage: AC_LIBTOOL_PICMODE[(MODE)]
4050#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
4051#   `both'.
4052AC_DEFUN([AC_LIBTOOL_PICMODE],
4053[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4054pic_mode=ifelse($#,1,$1,default)])
4055
4056
4057# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
4058AC_DEFUN([AC_PATH_TOOL_PREFIX],
4059[AC_MSG_CHECKING([for $1])
4060AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4061[case $MAGIC_CMD in
4062  /*)
4063  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4064  ;;
4065  ?:/*)
4066  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
4067  ;;
4068  *)
4069  ac_save_MAGIC_CMD="$MAGIC_CMD"
4070  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4071dnl $ac_dummy forces splitting on constant user-supplied paths.
4072dnl POSIX.2 word splitting is done only on the output of word expansions,
4073dnl not every word.  This closes a longstanding sh security hole.
4074  ac_dummy="ifelse([$2], , $PATH, [$2])"
4075  for ac_dir in $ac_dummy; do
4076    test -z "$ac_dir" && ac_dir=.
4077    if test -f $ac_dir/$1; then
4078      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4079      if test -n "$file_magic_test_file"; then
4080	case $deplibs_check_method in
4081	"file_magic "*)
4082	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
4083	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4084	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4085	    egrep "$file_magic_regex" > /dev/null; then
4086	    :
4087	  else
4088	    cat <<EOF 1>&2
4089
4090*** Warning: the command libtool uses to detect shared libraries,
4091*** $file_magic_cmd, produces output that libtool cannot recognize.
4092*** The result is that libtool may fail to recognize shared libraries
4093*** as such.  This will affect the creation of libtool libraries that
4094*** depend on shared libraries, but programs linked with such libtool
4095*** libraries will work regardless of this problem.  Nevertheless, you
4096*** may want to report the problem to your system manager and/or to
4097*** bug-libtool@gnu.org
4098
4099EOF
4100	  fi ;;
4101	esac
4102      fi
4103      break
4104    fi
4105  done
4106  IFS="$ac_save_ifs"
4107  MAGIC_CMD="$ac_save_MAGIC_CMD"
4108  ;;
4109esac])
4110MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4111if test -n "$MAGIC_CMD"; then
4112  AC_MSG_RESULT($MAGIC_CMD)
4113else
4114  AC_MSG_RESULT(no)
4115fi
4116])
4117
4118
4119# AC_PATH_MAGIC - find a file program which can recognise a shared library
4120AC_DEFUN([AC_PATH_MAGIC],
4121[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
4122AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
4123if test -z "$lt_cv_path_MAGIC_CMD"; then
4124  if test -n "$ac_tool_prefix"; then
4125    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
4126  else
4127    MAGIC_CMD=:
4128  fi
4129fi
4130])
4131
4132
4133# AC_PROG_LD - find the path to the GNU or non-GNU linker
4134AC_DEFUN([AC_PROG_LD],
4135[AC_ARG_WITH(gnu-ld,
4136[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
4137test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4138AC_REQUIRE([AC_PROG_CC])dnl
4139AC_REQUIRE([AC_CANONICAL_HOST])dnl
4140AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4141AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4142ac_prog=ld
4143if test "$GCC" = yes; then
4144  # Check if gcc -print-prog-name=ld gives a path.
4145  AC_MSG_CHECKING([for ld used by GCC])
4146  case $host in
4147  *-*-mingw*)
4148    # gcc leaves a trailing carriage return which upsets mingw
4149    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4150  *)
4151    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4152  esac
4153  case $ac_prog in
4154    # Accept absolute paths.
4155    [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
4156      re_direlt='/[[^/]][[^/]]*/\.\./'
4157      # Canonicalize the path of ld
4158      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4159      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4160	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4161      done
4162      test -z "$LD" && LD="$ac_prog"
4163      ;;
4164  "")
4165    # If it fails, then pretend we aren't using GCC.
4166    ac_prog=ld
4167    ;;
4168  *)
4169    # If it is relative, then search for the first ld in PATH.
4170    with_gnu_ld=unknown
4171    ;;
4172  esac
4173elif test "$with_gnu_ld" = yes; then
4174  AC_MSG_CHECKING([for GNU ld])
4175else
4176  AC_MSG_CHECKING([for non-GNU ld])
4177fi
4178AC_CACHE_VAL(lt_cv_path_LD,
4179[if test -z "$LD"; then
4180  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4181  for ac_dir in $PATH; do
4182    test -z "$ac_dir" && ac_dir=.
4183    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4184      lt_cv_path_LD="$ac_dir/$ac_prog"
4185      # Check to see if the program is GNU ld.  I'd rather use --version,
4186      # but apparently some GNU ld's only accept -v.
4187      # Break only if it was the GNU/non-GNU ld that we prefer.
4188      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4189	test "$with_gnu_ld" != no && break
4190      else
4191	test "$with_gnu_ld" != yes && break
4192      fi
4193    fi
4194  done
4195  IFS="$ac_save_ifs"
4196else
4197  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4198fi])
4199LD="$lt_cv_path_LD"
4200if test -n "$LD"; then
4201  AC_MSG_RESULT($LD)
4202else
4203  AC_MSG_RESULT(no)
4204fi
4205test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4206AC_PROG_LD_GNU
4207])
4208
4209# AC_PROG_LD_GNU -
4210AC_DEFUN([AC_PROG_LD_GNU],
4211[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4212[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4213if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4214  lt_cv_prog_gnu_ld=yes
4215else
4216  lt_cv_prog_gnu_ld=no
4217fi])
4218with_gnu_ld=$lt_cv_prog_gnu_ld
4219])
4220
4221# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
4222#   -- PORTME Some linkers may need a different reload flag.
4223AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
4224[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
4225[lt_cv_ld_reload_flag='-r'])
4226reload_flag=$lt_cv_ld_reload_flag
4227test -n "$reload_flag" && reload_flag=" $reload_flag"
4228])
4229
4230# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
4231#  -- PORTME fill in with the dynamic library characteristics
4232AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
4233[AC_CACHE_CHECK([how to recognise dependent libraries],
4234lt_cv_deplibs_check_method,
4235[lt_cv_file_magic_cmd='$MAGIC_CMD'
4236lt_cv_file_magic_test_file=
4237lt_cv_deplibs_check_method='unknown'
4238# Need to set the preceding variable on all platforms that support
4239# interlibrary dependencies.
4240# 'none' -- dependencies not supported.
4241# `unknown' -- same as none, but documents that we really don't know.
4242# 'pass_all' -- all dependencies passed with no checks.
4243# 'test_compile' -- check by making test program.
4244# 'file_magic [[regex]]' -- check by looking for files in library path
4245# which responds to the $file_magic_cmd with a given egrep regex.
4246# If you have `file' or equivalent on your system and you're not sure
4247# whether `pass_all' will *always* work, you probably want this one.
4248
4249case $host_os in
4250aix4* | aix5*)
4251  lt_cv_deplibs_check_method=pass_all
4252  ;;
4253
4254beos*)
4255  lt_cv_deplibs_check_method=pass_all
4256  ;;
4257
4258bsdi4*)
4259  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4260  lt_cv_file_magic_cmd='/usr/bin/file -L'
4261  lt_cv_file_magic_test_file=/shlib/libc.so
4262  ;;
4263
4264cygwin* | mingw* | pw32*)
4265  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4266  lt_cv_file_magic_cmd='$OBJDUMP -f'
4267  ;;
4268
4269darwin* | rhapsody*)
4270  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
4271  lt_cv_file_magic_cmd='/usr/bin/file -L'
4272  case "$host_os" in
4273  rhapsody* | darwin1.[[012]])
4274    lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
4275    ;;
4276  *) # Darwin 1.3 on
4277    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
4278    ;;
4279  esac
4280  ;;
4281
4282freebsd*)
4283  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4284    case $host_cpu in
4285    i*86 )
4286      # Not sure whether the presence of OpenBSD here was a mistake.
4287      # Let's accept both of them until this is cleared up.
4288      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
4289      lt_cv_file_magic_cmd=/usr/bin/file
4290      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4291      ;;
4292    esac
4293  else
4294    lt_cv_deplibs_check_method=pass_all
4295  fi
4296  ;;
4297
4298gnu*)
4299  lt_cv_deplibs_check_method=pass_all
4300  ;;
4301
4302hpux10.20*|hpux11*)
4303  lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
4304  lt_cv_file_magic_cmd=/usr/bin/file
4305  lt_cv_file_magic_test_file=/usr/lib/libc.sl
4306  ;;
4307
4308irix5* | irix6* | nonstopux*)
4309  case $host_os in
4310  irix5* | nonstopux*)
4311    # this will be overridden with pass_all, but let us keep it just in case
4312    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
4313    ;;
4314  *)
4315    case $LD in
4316    *-32|*"-32 ") libmagic=32-bit;;
4317    *-n32|*"-n32 ") libmagic=N32;;
4318    *-64|*"-64 ") libmagic=64-bit;;
4319    *) libmagic=never-match;;
4320    esac
4321    # this will be overridden with pass_all, but let us keep it just in case
4322    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
4323    ;;
4324  esac
4325  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
4326  lt_cv_deplibs_check_method=pass_all
4327  ;;
4328
4329# This must be Linux ELF.
4330linux-gnu*)
4331  case $host_cpu in
4332  alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | x86_64*)
4333    lt_cv_deplibs_check_method=pass_all ;;
4334  *)
4335    # glibc up to 2.1.1 does not perform some relocations on ARM
4336    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
4337  esac
4338  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
4339  ;;
4340
4341netbsd*)
4342  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4343    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
4344  else
4345    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
4346  fi
4347  ;;
4348
4349newos6*)
4350  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4351  lt_cv_file_magic_cmd=/usr/bin/file
4352  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4353  ;;
4354
4355openbsd*)
4356  lt_cv_file_magic_cmd=/usr/bin/file
4357  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4358  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4359    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
4360  else
4361    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
4362  fi
4363  ;;
4364
4365osf3* | osf4* | osf5*)
4366  # this will be overridden with pass_all, but let us keep it just in case
4367  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
4368  lt_cv_file_magic_test_file=/shlib/libc.so
4369  lt_cv_deplibs_check_method=pass_all
4370  ;;
4371
4372sco3.2v5*)
4373  lt_cv_deplibs_check_method=pass_all
4374  ;;
4375
4376solaris*)
4377  lt_cv_deplibs_check_method=pass_all
4378  lt_cv_file_magic_test_file=/lib/libc.so
4379  ;;
4380
4381sysv5uw[[78]]* | sysv4*uw2*)
4382  lt_cv_deplibs_check_method=pass_all
4383  ;;
4384
4385sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
4386  case $host_vendor in
4387  motorola)
4388    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]]'
4389    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4390    ;;
4391  ncr)
4392    lt_cv_deplibs_check_method=pass_all
4393    ;;
4394  sequent)
4395    lt_cv_file_magic_cmd='/bin/file'
4396    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4397    ;;
4398  sni)
4399    lt_cv_file_magic_cmd='/bin/file'
4400    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4401    lt_cv_file_magic_test_file=/lib/libc.so
4402    ;;
4403  siemens)
4404    lt_cv_deplibs_check_method=pass_all
4405    ;;
4406  esac
4407  ;;
4408esac
4409])
4410file_magic_cmd=$lt_cv_file_magic_cmd
4411deplibs_check_method=$lt_cv_deplibs_check_method
4412])
4413
4414
4415# AC_PROG_NM - find the path to a BSD-compatible name lister
4416AC_DEFUN([AC_PROG_NM],
4417[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
4418AC_MSG_CHECKING([for BSD-compatible nm])
4419AC_CACHE_VAL(lt_cv_path_NM,
4420[if test -n "$NM"; then
4421  # Let the user override the test.
4422  lt_cv_path_NM="$NM"
4423else
4424  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4425  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
4426    test -z "$ac_dir" && ac_dir=.
4427    tmp_nm=$ac_dir/${ac_tool_prefix}nm
4428    if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
4429      # Check to see if the nm accepts a BSD-compat flag.
4430      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4431      #   nm: unknown option "B" ignored
4432      # Tru64's nm complains that /dev/null is an invalid object file
4433      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
4434	lt_cv_path_NM="$tmp_nm -B"
4435	break
4436      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
4437	lt_cv_path_NM="$tmp_nm -p"
4438	break
4439      else
4440	lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4441	continue # so that we can try to find one that supports BSD flags
4442      fi
4443    fi
4444  done
4445  IFS="$ac_save_ifs"
4446  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
4447fi])
4448NM="$lt_cv_path_NM"
4449AC_MSG_RESULT([$NM])
4450])
4451
4452# AC_CHECK_LIBM - check for math library
4453AC_DEFUN([AC_CHECK_LIBM],
4454[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4455LIBM=
4456case $host in
4457*-*-beos* | *-*-cygwin* | *-*-pw32*)
4458  # These system don't have libm
4459  ;;
4460*-ncr-sysv4.3*)
4461  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4462  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
4463  ;;
4464*)
4465  AC_CHECK_LIB(m, main, LIBM="-lm")
4466  ;;
4467esac
4468])
4469
4470# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
4471# the libltdl convenience library and LTDLINCL to the include flags for
4472# the libltdl header and adds --enable-ltdl-convenience to the
4473# configure arguments.  Note that LIBLTDL and LTDLINCL are not
4474# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
4475# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
4476# with '${top_builddir}/' and LTDLINCL will be prefixed with
4477# '${top_srcdir}/' (note the single quotes!).  If your package is not
4478# flat and you're not using automake, define top_builddir and
4479# top_srcdir appropriately in the Makefiles.
4480AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
4481[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4482  case $enable_ltdl_convenience in
4483  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
4484  "") enable_ltdl_convenience=yes
4485      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
4486  esac
4487  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
4488  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4489  # For backwards non-gettext consistent compatibility...
4490  INCLTDL="$LTDLINCL"
4491])
4492
4493# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
4494# the libltdl installable library and LTDLINCL to the include flags for
4495# the libltdl header and adds --enable-ltdl-install to the configure
4496# arguments.  Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
4497# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
4498# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
4499# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
4500# with '${top_srcdir}/' (note the single quotes!).  If your package is
4501# not flat and you're not using automake, define top_builddir and
4502# top_srcdir appropriately in the Makefiles.
4503# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
4504AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
4505[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4506  AC_CHECK_LIB(ltdl, main,
4507  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
4508  [if test x"$enable_ltdl_install" = xno; then
4509     AC_MSG_WARN([libltdl not installed, but installation disabled])
4510   else
4511     enable_ltdl_install=yes
4512   fi
4513  ])
4514  if test x"$enable_ltdl_install" = x"yes"; then
4515    ac_configure_args="$ac_configure_args --enable-ltdl-install"
4516    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
4517    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4518  else
4519    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
4520    LIBLTDL="-lltdl"
4521    LTDLINCL=
4522  fi
4523  # For backwards non-gettext consistent compatibility...
4524  INCLTDL="$LTDLINCL"
4525])
4526
4527# old names
4528AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
4529AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
4530AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
4531AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
4532AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
4533AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
4534AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
4535
4536# This is just to silence aclocal about the macro not being used
4537ifelse([AC_DISABLE_FAST_INSTALL])
4538
4539# NOTE: This macro has been submitted for inclusion into   #
4540#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
4541#  a released version of Autoconf we should remove this    #
4542#  macro and use it instead.                               #
4543# LT_AC_PROG_SED
4544# --------------
4545# Check for a fully-functional sed program, that truncates
4546# as few characters as possible.  Prefer GNU sed if found.
4547AC_DEFUN([LT_AC_PROG_SED],
4548[AC_MSG_CHECKING([for a sed that does not truncate output])
4549AC_CACHE_VAL(lt_cv_path_SED,
4550[# Loop through the user's path and test for sed and gsed.
4551# Then use that list of sed's as ones to test for truncation.
4552as_executable_p="test -f"
4553as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4554for as_dir in $PATH
4555do
4556  IFS=$as_save_IFS
4557  test -z "$as_dir" && as_dir=.
4558  for ac_prog in sed gsed; do
4559    for ac_exec_ext in '' $ac_executable_extensions; do
4560      if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
4561        _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
4562      fi
4563    done
4564  done
4565done
4566
4567  # Create a temporary directory, and hook for its removal unless debugging.
4568$debug ||
4569{
4570  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
4571  trap '{ (exit 1); exit 1; }' 1 2 13 15
4572}
4573
4574# Create a (secure) tmp directory for tmp files.
4575: ${TMPDIR=/tmp}
4576{
4577  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
4578  test -n "$tmp" && test -d "$tmp"
4579}  ||
4580{
4581  tmp=$TMPDIR/sed$$-$RANDOM
4582  (umask 077 && mkdir $tmp)
4583} ||
4584{
4585   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
4586   { (exit 1); exit 1; }
4587}
4588  _max=0
4589  _count=0
4590  # Add /usr/xpg4/bin/sed as it is typically found on Solaris
4591  # along with /bin/sed that truncates output.
4592  for _sed in $_sed_list /usr/xpg4/bin/sed; do
4593    test ! -f ${_sed} && break
4594    cat /dev/null > "$tmp/sed.in"
4595    _count=0
4596    echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
4597    # Check for GNU sed and select it if it is found.
4598    if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
4599      lt_cv_path_SED=${_sed}
4600      break
4601    fi
4602    while true; do
4603      cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
4604      mv "$tmp/sed.tmp" "$tmp/sed.in"
4605      cp "$tmp/sed.in" "$tmp/sed.nl"
4606      echo >>"$tmp/sed.nl"
4607      ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
4608      cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
4609      # 40000 chars as input seems more than enough
4610      test $_count -gt 10 && break
4611      _count=`expr $_count + 1`
4612      if test $_count -gt $_max; then
4613        _max=$_count
4614        lt_cv_path_SED=$_sed
4615      fi
4616    done
4617  done
4618  rm -rf "$tmp"
4619])
4620if test "X$SED" != "X"; then
4621  lt_cv_path_SED=$SED
4622else
4623  SED=$lt_cv_path_SED
4624fi
4625AC_MSG_RESULT([$SED])
4626])
4627
4628# Configure paths for GLIB
4629# Owen Taylor     1997-2001
4630
4631dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
4632dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
4633dnl gthread is specified in MODULES, pass to pkg-config
4634dnl
4635AC_DEFUN(AM_PATH_GLIB_2_0,
4636[dnl
4637dnl Get the cflags and libraries from pkg-config
4638dnl
4639AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
4640		    , enable_glibtest=yes)
4641
4642  pkg_config_args=glib-2.0
4643  for module in . $4
4644  do
4645      case "$module" in
4646         gmodule)
4647             pkg_config_args="$pkg_config_args gmodule-2.0"
4648         ;;
4649         gobject)
4650             pkg_config_args="$pkg_config_args gobject-2.0"
4651         ;;
4652         gthread)
4653             pkg_config_args="$pkg_config_args gthread-2.0"
4654         ;;
4655      esac
4656  done
4657
4658  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
4659
4660  no_glib=""
4661
4662  if test x$PKG_CONFIG != xno ; then
4663    if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
4664      :
4665    else
4666      echo *** pkg-config too old; version 0.7 or better required.
4667      no_glib=yes
4668      PKG_CONFIG=no
4669    fi
4670  else
4671    no_glib=yes
4672  fi
4673
4674  min_glib_version=ifelse([$1], ,2.0.0,$1)
4675  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
4676
4677  if test x$PKG_CONFIG != xno ; then
4678    ## don't try to run the test against uninstalled libtool libs
4679    if $PKG_CONFIG --uninstalled $pkg_config_args; then
4680	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
4681	  enable_glibtest=no
4682    fi
4683
4684    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
4685	  :
4686    else
4687	  no_glib=yes
4688    fi
4689  fi
4690
4691  if test x"$no_glib" = x ; then
4692    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
4693    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
4694    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
4695
4696    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
4697    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
4698    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
4699           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
4700    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
4701           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
4702    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
4703           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
4704    if test "x$enable_glibtest" = "xyes" ; then
4705      ac_save_CFLAGS="$CFLAGS"
4706      ac_save_LIBS="$LIBS"
4707      CFLAGS="$CFLAGS $GLIB_CFLAGS"
4708      LIBS="$GLIB_LIBS $LIBS"
4709dnl
4710dnl Now check if the installed GLIB is sufficiently new. (Also sanity
4711dnl checks the results of pkg-config to some extent)
4712dnl
4713      rm -f conf.glibtest
4714      AC_TRY_RUN([
4715#include <glib.h>
4716#include <stdio.h>
4717#include <stdlib.h>
4718
4719int
4720main ()
4721{
4722  int major, minor, micro;
4723  char *tmp_version;
4724
4725  system ("touch conf.glibtest");
4726
4727  /* HP/UX 9 (%@#!) writes to sscanf strings */
4728  tmp_version = g_strdup("$min_glib_version");
4729  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
4730     printf("%s, bad version string\n", "$min_glib_version");
4731     exit(1);
4732   }
4733
4734  if ((glib_major_version != $glib_config_major_version) ||
4735      (glib_minor_version != $glib_config_minor_version) ||
4736      (glib_micro_version != $glib_config_micro_version))
4737    {
4738      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
4739             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
4740             glib_major_version, glib_minor_version, glib_micro_version);
4741      printf ("*** was found! If pkg-config was correct, then it is best\n");
4742      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
4743      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
4744      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
4745      printf("*** required on your system.\n");
4746      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
4747      printf("*** to point to the correct configuration files\n");
4748    }
4749  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
4750	   (glib_minor_version != GLIB_MINOR_VERSION) ||
4751           (glib_micro_version != GLIB_MICRO_VERSION))
4752    {
4753      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
4754	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
4755      printf("*** library (version %d.%d.%d)\n",
4756	     glib_major_version, glib_minor_version, glib_micro_version);
4757    }
4758  else
4759    {
4760      if ((glib_major_version > major) ||
4761        ((glib_major_version == major) && (glib_minor_version > minor)) ||
4762        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
4763      {
4764        return 0;
4765       }
4766     else
4767      {
4768        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
4769               glib_major_version, glib_minor_version, glib_micro_version);
4770        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
4771	       major, minor, micro);
4772        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
4773        printf("***\n");
4774        printf("*** If you have already installed a sufficiently new version, this error\n");
4775        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
4776        printf("*** being found. The easiest way to fix this is to remove the old version\n");
4777        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
4778        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
4779        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
4780        printf("*** so that the correct libraries are found at run-time))\n");
4781      }
4782    }
4783  return 1;
4784}
4785],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
4786       CFLAGS="$ac_save_CFLAGS"
4787       LIBS="$ac_save_LIBS"
4788     fi
4789  fi
4790  if test "x$no_glib" = x ; then
4791     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
4792     ifelse([$2], , :, [$2])
4793  else
4794     AC_MSG_RESULT(no)
4795     if test "$PKG_CONFIG" = "no" ; then
4796       echo "*** A new enough version of pkg-config was not found."
4797       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
4798     else
4799       if test -f conf.glibtest ; then
4800        :
4801       else
4802          echo "*** Could not run GLIB test program, checking why..."
4803          ac_save_CFLAGS="$CFLAGS"
4804          ac_save_LIBS="$LIBS"
4805          CFLAGS="$CFLAGS $GLIB_CFLAGS"
4806          LIBS="$LIBS $GLIB_LIBS"
4807          AC_TRY_LINK([
4808#include <glib.h>
4809#include <stdio.h>
4810],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
4811        [ echo "*** The test program compiled, but did not run. This usually means"
4812          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
4813          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
4814          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
4815          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
4816          echo "*** is required on your system"
4817	  echo "***"
4818          echo "*** If you have an old version installed, it is best to remove it, although"
4819          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
4820        [ echo "*** The test program failed to compile or link. See the file config.log for the"
4821          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
4822          CFLAGS="$ac_save_CFLAGS"
4823          LIBS="$ac_save_LIBS"
4824       fi
4825     fi
4826     GLIB_CFLAGS=""
4827     GLIB_LIBS=""
4828     GLIB_GENMARSHAL=""
4829     GOBJECT_QUERY=""
4830     GLIB_MKENUMS=""
4831     ifelse([$3], , :, [$3])
4832  fi
4833  AC_SUBST(GLIB_CFLAGS)
4834  AC_SUBST(GLIB_LIBS)
4835  AC_SUBST(GLIB_GENMARSHAL)
4836  AC_SUBST(GOBJECT_QUERY)
4837  AC_SUBST(GLIB_MKENUMS)
4838  rm -f conf.glibtest
4839])
4840
4841
4842dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
4843dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
4844dnl also defines GSTUFF_PKG_ERRORS on error
4845AC_DEFUN(PKG_CHECK_MODULES, [
4846  succeeded=no
4847
4848  if test -z "$PKG_CONFIG"; then
4849    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
4850  fi
4851
4852  if test "$PKG_CONFIG" = "no" ; then
4853     echo "*** The pkg-config script could not be found. Make sure it is"
4854     echo "*** in your path, or set the PKG_CONFIG environment variable"
4855     echo "*** to the full path to pkg-config."
4856     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
4857  else
4858     PKG_CONFIG_MIN_VERSION=0.9.0
4859     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
4860        AC_MSG_CHECKING(for $2)
4861
4862        if $PKG_CONFIG --exists "$2" ; then
4863            AC_MSG_RESULT(yes)
4864            succeeded=yes
4865
4866            AC_MSG_CHECKING($1_CFLAGS)
4867            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
4868            AC_MSG_RESULT($$1_CFLAGS)
4869
4870            AC_MSG_CHECKING($1_LIBS)
4871            $1_LIBS=`$PKG_CONFIG --libs "$2"`
4872            AC_MSG_RESULT($$1_LIBS)
4873        else
4874            $1_CFLAGS=""
4875            $1_LIBS=""
4876            ## If we have a custom action on failure, don't print errors, but
4877            ## do set a variable so people can do so.
4878            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
4879            ifelse([$4], ,echo $$1_PKG_ERRORS,)
4880        fi
4881
4882        AC_SUBST($1_CFLAGS)
4883        AC_SUBST($1_LIBS)
4884     else
4885        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
4886        echo "*** See http://www.freedesktop.org/software/pkgconfig"
4887     fi
4888  fi
4889
4890  if test $succeeded = yes; then
4891     ifelse([$3], , :, [$3])
4892  else
4893     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
4894  fi
4895])
4896
4897
4898
4899# iconv.m4 serial AM4 (gettext-0.11.3)
4900dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4901dnl This file is free software, distributed under the terms of the GNU
4902dnl General Public License.  As a special exception to the GNU General
4903dnl Public License, this file may be distributed as part of a program
4904dnl that contains a configuration script generated by Autoconf, under
4905dnl the same distribution terms as the rest of that program.
4906
4907dnl From Bruno Haible.
4908
4909AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
4910[
4911  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4912  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4913  AC_REQUIRE([AC_LIB_RPATH])
4914
4915  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4916  dnl accordingly.
4917  AC_LIB_LINKFLAGS_BODY([iconv])
4918])
4919
4920AC_DEFUN([AM_ICONV_LINK],
4921[
4922  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
4923  dnl those with the standalone portable GNU libiconv installed).
4924
4925  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4926  dnl accordingly.
4927  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
4928
4929  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
4930  dnl because if the user has installed libiconv and not disabled its use
4931  dnl via --without-libiconv-prefix, he wants to use it. The first
4932  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
4933  am_save_CPPFLAGS="$CPPFLAGS"
4934  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
4935
4936  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
4937    am_cv_func_iconv="no, consider installing GNU libiconv"
4938    am_cv_lib_iconv=no
4939    AC_TRY_LINK([#include <stdlib.h>
4940#include <iconv.h>],
4941      [iconv_t cd = iconv_open("","");
4942       iconv(cd,NULL,NULL,NULL,NULL);
4943       iconv_close(cd);],
4944      am_cv_func_iconv=yes)
4945    if test "$am_cv_func_iconv" != yes; then
4946      am_save_LIBS="$LIBS"
4947      LIBS="$LIBS $LIBICONV"
4948      AC_TRY_LINK([#include <stdlib.h>
4949#include <iconv.h>],
4950        [iconv_t cd = iconv_open("","");
4951         iconv(cd,NULL,NULL,NULL,NULL);
4952         iconv_close(cd);],
4953        am_cv_lib_iconv=yes
4954        am_cv_func_iconv=yes)
4955      LIBS="$am_save_LIBS"
4956    fi
4957  ])
4958  if test "$am_cv_func_iconv" = yes; then
4959    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
4960  fi
4961  if test "$am_cv_lib_iconv" = yes; then
4962    AC_MSG_CHECKING([how to link with libiconv])
4963    AC_MSG_RESULT([$LIBICONV])
4964  else
4965    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
4966    dnl either.
4967    CPPFLAGS="$am_save_CPPFLAGS"
4968    LIBICONV=
4969    LTLIBICONV=
4970  fi
4971  AC_SUBST(LIBICONV)
4972  AC_SUBST(LTLIBICONV)
4973])
4974
4975AC_DEFUN([AM_ICONV],
4976[
4977  AM_ICONV_LINK
4978  if test "$am_cv_func_iconv" = yes; then
4979    AC_MSG_CHECKING([for iconv declaration])
4980    AC_CACHE_VAL(am_cv_proto_iconv, [
4981      AC_TRY_COMPILE([
4982#include <stdlib.h>
4983#include <iconv.h>
4984extern
4985#ifdef __cplusplus
4986"C"
4987#endif
4988#if defined(__STDC__) || defined(__cplusplus)
4989size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4990#else
4991size_t iconv();
4992#endif
4993], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
4994      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
4995    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4996    AC_MSG_RESULT([$]{ac_t:-
4997         }[$]am_cv_proto_iconv)
4998    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
4999      [Define as const if the declaration of iconv() needs const.])
5000  fi
5001])
5002
5003# lib-prefix.m4 serial 1 (gettext-0.11)
5004dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
5005dnl This file is free software, distributed under the terms of the GNU
5006dnl General Public License.  As a special exception to the GNU General
5007dnl Public License, this file may be distributed as part of a program
5008dnl that contains a configuration script generated by Autoconf, under
5009dnl the same distribution terms as the rest of that program.
5010
5011dnl From Bruno Haible.
5012
5013dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
5014dnl to access previously installed libraries. The basic assumption is that
5015dnl a user will want packages to use other packages he previously installed
5016dnl with the same --prefix option.
5017dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
5018dnl libraries, but is otherwise very convenient.
5019AC_DEFUN([AC_LIB_PREFIX],
5020[
5021  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
5022  AC_REQUIRE([AC_PROG_CC])
5023  AC_REQUIRE([AC_CANONICAL_HOST])
5024  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5025  dnl By default, look in $includedir and $libdir.
5026  use_additional=yes
5027  AC_LIB_WITH_FINAL_PREFIX([
5028    eval additional_includedir=\"$includedir\"
5029    eval additional_libdir=\"$libdir\"
5030  ])
5031  AC_ARG_WITH([lib-prefix],
5032[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
5033  --without-lib-prefix    don't search for libraries in includedir and libdir],
5034[
5035    if test "X$withval" = "Xno"; then
5036      use_additional=no
5037    else
5038      if test "X$withval" = "X"; then
5039        AC_LIB_WITH_FINAL_PREFIX([
5040          eval additional_includedir=\"$includedir\"
5041          eval additional_libdir=\"$libdir\"
5042        ])
5043      else
5044        additional_includedir="$withval/include"
5045        additional_libdir="$withval/lib"
5046      fi
5047    fi
5048])
5049  if test $use_additional = yes; then
5050    dnl Potentially add $additional_includedir to $CPPFLAGS.
5051    dnl But don't add it
5052    dnl   1. if it's the standard /usr/include,
5053    dnl   2. if it's already present in $CPPFLAGS,
5054    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
5055    dnl   4. if it doesn't exist as a directory.
5056    if test "X$additional_includedir" != "X/usr/include"; then
5057      haveit=
5058      for x in $CPPFLAGS; do
5059        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5060        if test "X$x" = "X-I$additional_includedir"; then
5061          haveit=yes
5062          break
5063        fi
5064      done
5065      if test -z "$haveit"; then
5066        if test "X$additional_includedir" = "X/usr/local/include"; then
5067          if test -n "$GCC"; then
5068            case $host_os in
5069              linux*) haveit=yes;;
5070            esac
5071          fi
5072        fi
5073        if test -z "$haveit"; then
5074          if test -d "$additional_includedir"; then
5075            dnl Really add $additional_includedir to $CPPFLAGS.
5076            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
5077          fi
5078        fi
5079      fi
5080    fi
5081    dnl Potentially add $additional_libdir to $LDFLAGS.
5082    dnl But don't add it
5083    dnl   1. if it's the standard /usr/lib,
5084    dnl   2. if it's already present in $LDFLAGS,
5085    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
5086    dnl   4. if it doesn't exist as a directory.
5087    if test "X$additional_libdir" != "X/usr/lib"; then
5088      haveit=
5089      for x in $LDFLAGS; do
5090        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5091        if test "X$x" = "X-L$additional_libdir"; then
5092          haveit=yes
5093          break
5094        fi
5095      done
5096      if test -z "$haveit"; then
5097        if test "X$additional_libdir" = "X/usr/local/lib"; then
5098          if test -n "$GCC"; then
5099            case $host_os in
5100              linux*) haveit=yes;;
5101            esac
5102          fi
5103        fi
5104        if test -z "$haveit"; then
5105          if test -d "$additional_libdir"; then
5106            dnl Really add $additional_libdir to $LDFLAGS.
5107            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
5108          fi
5109        fi
5110      fi
5111    fi
5112  fi
5113])
5114
5115dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
5116dnl acl_final_exec_prefix, containing the values to which $prefix and
5117dnl $exec_prefix will expand at the end of the configure script.
5118AC_DEFUN([AC_LIB_PREPARE_PREFIX],
5119[
5120  dnl Unfortunately, prefix and exec_prefix get only finally determined
5121  dnl at the end of configure.
5122  if test "X$prefix" = "XNONE"; then
5123    acl_final_prefix="$ac_default_prefix"
5124  else
5125    acl_final_prefix="$prefix"
5126  fi
5127  if test "X$exec_prefix" = "XNONE"; then
5128    acl_final_exec_prefix='${prefix}'
5129  else
5130    acl_final_exec_prefix="$exec_prefix"
5131  fi
5132  acl_save_prefix="$prefix"
5133  prefix="$acl_final_prefix"
5134  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
5135  prefix="$acl_save_prefix"
5136])
5137
5138dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
5139dnl variables prefix and exec_prefix bound to the values they will have
5140dnl at the end of the configure script.
5141AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
5142[
5143  acl_save_prefix="$prefix"
5144  prefix="$acl_final_prefix"
5145  acl_save_exec_prefix="$exec_prefix"
5146  exec_prefix="$acl_final_exec_prefix"
5147  $1
5148  exec_prefix="$acl_save_exec_prefix"
5149  prefix="$acl_save_prefix"
5150])
5151
5152# lib-link.m4 serial 3 (gettext-0.11.3)
5153dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
5154dnl This file is free software, distributed under the terms of the GNU
5155dnl General Public License.  As a special exception to the GNU General
5156dnl Public License, this file may be distributed as part of a program
5157dnl that contains a configuration script generated by Autoconf, under
5158dnl the same distribution terms as the rest of that program.
5159
5160dnl From Bruno Haible.
5161
5162dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
5163dnl the libraries corresponding to explicit and implicit dependencies.
5164dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
5165dnl augments the CPPFLAGS variable.
5166AC_DEFUN([AC_LIB_LINKFLAGS],
5167[
5168  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5169  AC_REQUIRE([AC_LIB_RPATH])
5170  define([Name],[translit([$1],[./-], [___])])
5171  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5172                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5173  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
5174    AC_LIB_LINKFLAGS_BODY([$1], [$2])
5175    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
5176    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
5177    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
5178  ])
5179  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
5180  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
5181  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
5182  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5183  AC_SUBST([LIB]NAME)
5184  AC_SUBST([LTLIB]NAME)
5185  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
5186  dnl results of this search when this library appears as a dependency.
5187  HAVE_LIB[]NAME=yes
5188  undefine([Name])
5189  undefine([NAME])
5190])
5191
5192dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
5193dnl searches for libname and the libraries corresponding to explicit and
5194dnl implicit dependencies, together with the specified include files and
5195dnl the ability to compile and link the specified testcode. If found, it
5196dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
5197dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
5198dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
5199dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
5200AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
5201[
5202  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5203  AC_REQUIRE([AC_LIB_RPATH])
5204  define([Name],[translit([$1],[./-], [___])])
5205  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5206                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5207
5208  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
5209  dnl accordingly.
5210  AC_LIB_LINKFLAGS_BODY([$1], [$2])
5211
5212  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
5213  dnl because if the user has installed lib[]Name and not disabled its use
5214  dnl via --without-lib[]Name-prefix, he wants to use it.
5215  ac_save_CPPFLAGS="$CPPFLAGS"
5216  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5217
5218  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
5219    ac_save_LIBS="$LIBS"
5220    LIBS="$LIBS $LIB[]NAME"
5221    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
5222    LIBS="$ac_save_LIBS"
5223  ])
5224  if test "$ac_cv_lib[]Name" = yes; then
5225    HAVE_LIB[]NAME=yes
5226    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
5227    AC_MSG_CHECKING([how to link with lib[]$1])
5228    AC_MSG_RESULT([$LIB[]NAME])
5229  else
5230    HAVE_LIB[]NAME=no
5231    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
5232    dnl $INC[]NAME either.
5233    CPPFLAGS="$ac_save_CPPFLAGS"
5234    LIB[]NAME=
5235    LTLIB[]NAME=
5236  fi
5237  AC_SUBST([HAVE_LIB]NAME)
5238  AC_SUBST([LIB]NAME)
5239  AC_SUBST([LTLIB]NAME)
5240  undefine([Name])
5241  undefine([NAME])
5242])
5243
5244dnl Determine the platform dependent parameters needed to use rpath:
5245dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
5246dnl hardcode_direct, hardcode_minus_L,
5247dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
5248AC_DEFUN([AC_LIB_RPATH],
5249[
5250  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
5251  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
5252  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
5253  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
5254  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
5255    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
5256    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
5257    . ./conftest.sh
5258    rm -f ./conftest.sh
5259    acl_cv_rpath=done
5260  ])
5261  wl="$acl_cv_wl"
5262  libext="$acl_cv_libext"
5263  shlibext="$acl_cv_shlibext"
5264  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
5265  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
5266  hardcode_direct="$acl_cv_hardcode_direct"
5267  hardcode_minus_L="$acl_cv_hardcode_minus_L"
5268  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
5269  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
5270  dnl Determine whether the user wants rpath handling at all.
5271  AC_ARG_ENABLE(rpath,
5272    [  --disable-rpath         do not hardcode runtime library paths],
5273    :, enable_rpath=yes)
5274])
5275
5276dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
5277dnl the libraries corresponding to explicit and implicit dependencies.
5278dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
5279AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
5280[
5281  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5282                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5283  dnl By default, look in $includedir and $libdir.
5284  use_additional=yes
5285  AC_LIB_WITH_FINAL_PREFIX([
5286    eval additional_includedir=\"$includedir\"
5287    eval additional_libdir=\"$libdir\"
5288  ])
5289  AC_ARG_WITH([lib$1-prefix],
5290[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
5291  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
5292[
5293    if test "X$withval" = "Xno"; then
5294      use_additional=no
5295    else
5296      if test "X$withval" = "X"; then
5297        AC_LIB_WITH_FINAL_PREFIX([
5298          eval additional_includedir=\"$includedir\"
5299          eval additional_libdir=\"$libdir\"
5300        ])
5301      else
5302        additional_includedir="$withval/include"
5303        additional_libdir="$withval/lib"
5304      fi
5305    fi
5306])
5307  dnl Search the library and its dependencies in $additional_libdir and
5308  dnl $LDFLAGS. Using breadth-first-seach.
5309  LIB[]NAME=
5310  LTLIB[]NAME=
5311  INC[]NAME=
5312  rpathdirs=
5313  ltrpathdirs=
5314  names_already_handled=
5315  names_next_round='$1 $2'
5316  while test -n "$names_next_round"; do
5317    names_this_round="$names_next_round"
5318    names_next_round=
5319    for name in $names_this_round; do
5320      already_handled=
5321      for n in $names_already_handled; do
5322        if test "$n" = "$name"; then
5323          already_handled=yes
5324          break
5325        fi
5326      done
5327      if test -z "$already_handled"; then
5328        names_already_handled="$names_already_handled $name"
5329        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
5330        dnl or AC_LIB_HAVE_LINKFLAGS call.
5331        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
5332        eval value=\"\$HAVE_LIB$uppername\"
5333        if test -n "$value"; then
5334          if test "$value" = yes; then
5335            eval value=\"\$LIB$uppername\"
5336            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
5337            eval value=\"\$LTLIB$uppername\"
5338            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
5339          else
5340            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
5341            dnl that this library doesn't exist. So just drop it.
5342            :
5343          fi
5344        else
5345          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
5346          dnl and the already constructed $LIBNAME/$LTLIBNAME.
5347          found_dir=
5348          found_la=
5349          found_so=
5350          found_a=
5351          if test $use_additional = yes; then
5352            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
5353              found_dir="$additional_libdir"
5354              found_so="$additional_libdir/lib$name.$shlibext"
5355              if test -f "$additional_libdir/lib$name.la"; then
5356                found_la="$additional_libdir/lib$name.la"
5357              fi
5358            else
5359              if test -f "$additional_libdir/lib$name.$libext"; then
5360                found_dir="$additional_libdir"
5361                found_a="$additional_libdir/lib$name.$libext"
5362                if test -f "$additional_libdir/lib$name.la"; then
5363                  found_la="$additional_libdir/lib$name.la"
5364                fi
5365              fi
5366            fi
5367          fi
5368          if test "X$found_dir" = "X"; then
5369            for x in $LDFLAGS $LTLIB[]NAME; do
5370              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5371              case "$x" in
5372                -L*)
5373                  dir=`echo "X$x" | sed -e 's/^X-L//'`
5374                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
5375                    found_dir="$dir"
5376                    found_so="$dir/lib$name.$shlibext"
5377                    if test -f "$dir/lib$name.la"; then
5378                      found_la="$dir/lib$name.la"
5379                    fi
5380                  else
5381                    if test -f "$dir/lib$name.$libext"; then
5382                      found_dir="$dir"
5383                      found_a="$dir/lib$name.$libext"
5384                      if test -f "$dir/lib$name.la"; then
5385                        found_la="$dir/lib$name.la"
5386                      fi
5387                    fi
5388                  fi
5389                  ;;
5390              esac
5391              if test "X$found_dir" != "X"; then
5392                break
5393              fi
5394            done
5395          fi
5396          if test "X$found_dir" != "X"; then
5397            dnl Found the library.
5398            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
5399            if test "X$found_so" != "X"; then
5400              dnl Linking with a shared library. We attempt to hardcode its
5401              dnl directory into the executable's runpath, unless it's the
5402              dnl standard /usr/lib.
5403              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
5404                dnl No hardcoding is needed.
5405                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5406              else
5407                dnl Use an explicit option to hardcode DIR into the resulting
5408                dnl binary.
5409                dnl Potentially add DIR to ltrpathdirs.
5410                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5411                haveit=
5412                for x in $ltrpathdirs; do
5413                  if test "X$x" = "X$found_dir"; then
5414                    haveit=yes
5415                    break
5416                  fi
5417                done
5418                if test -z "$haveit"; then
5419                  ltrpathdirs="$ltrpathdirs $found_dir"
5420                fi
5421                dnl The hardcoding into $LIBNAME is system dependent.
5422                if test "$hardcode_direct" = yes; then
5423                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
5424                  dnl resulting binary.
5425                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5426                else
5427                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
5428                    dnl Use an explicit option to hardcode DIR into the resulting
5429                    dnl binary.
5430                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5431                    dnl Potentially add DIR to rpathdirs.
5432                    dnl The rpathdirs will be appended to $LIBNAME at the end.
5433                    haveit=
5434                    for x in $rpathdirs; do
5435                      if test "X$x" = "X$found_dir"; then
5436                        haveit=yes
5437                        break
5438                      fi
5439                    done
5440                    if test -z "$haveit"; then
5441                      rpathdirs="$rpathdirs $found_dir"
5442                    fi
5443                  else
5444                    dnl Rely on "-L$found_dir".
5445                    dnl But don't add it if it's already contained in the LDFLAGS
5446                    dnl or the already constructed $LIBNAME
5447                    haveit=
5448                    for x in $LDFLAGS $LIB[]NAME; do
5449                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5450                      if test "X$x" = "X-L$found_dir"; then
5451                        haveit=yes
5452                        break
5453                      fi
5454                    done
5455                    if test -z "$haveit"; then
5456                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
5457                    fi
5458                    if test "$hardcode_minus_L" != no; then
5459                      dnl FIXME: Not sure whether we should use
5460                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5461                      dnl here.
5462                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5463                    else
5464                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
5465                      dnl here, because this doesn't fit in flags passed to the
5466                      dnl compiler. So give up. No hardcoding. This affects only
5467                      dnl very old systems.
5468                      dnl FIXME: Not sure whether we should use
5469                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5470                      dnl here.
5471                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5472                    fi
5473                  fi
5474                fi
5475              fi
5476            else
5477              if test "X$found_a" != "X"; then
5478                dnl Linking with a static library.
5479                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
5480              else
5481                dnl We shouldn't come here, but anyway it's good to have a
5482                dnl fallback.
5483                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
5484              fi
5485            fi
5486            dnl Assume the include files are nearby.
5487            additional_includedir=
5488            case "$found_dir" in
5489              */lib | */lib/)
5490                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
5491                additional_includedir="$basedir/include"
5492                ;;
5493            esac
5494            if test "X$additional_includedir" != "X"; then
5495              dnl Potentially add $additional_includedir to $INCNAME.
5496              dnl But don't add it
5497              dnl   1. if it's the standard /usr/include,
5498              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
5499              dnl   3. if it's already present in $CPPFLAGS or the already
5500              dnl      constructed $INCNAME,
5501              dnl   4. if it doesn't exist as a directory.
5502              if test "X$additional_includedir" != "X/usr/include"; then
5503                haveit=
5504                if test "X$additional_includedir" = "X/usr/local/include"; then
5505                  if test -n "$GCC"; then
5506                    case $host_os in
5507                      linux*) haveit=yes;;
5508                    esac
5509                  fi
5510                fi
5511                if test -z "$haveit"; then
5512                  for x in $CPPFLAGS $INC[]NAME; do
5513                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5514                    if test "X$x" = "X-I$additional_includedir"; then
5515                      haveit=yes
5516                      break
5517                    fi
5518                  done
5519                  if test -z "$haveit"; then
5520                    if test -d "$additional_includedir"; then
5521                      dnl Really add $additional_includedir to $INCNAME.
5522                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
5523                    fi
5524                  fi
5525                fi
5526              fi
5527            fi
5528            dnl Look for dependencies.
5529            if test -n "$found_la"; then
5530              dnl Read the .la file. It defines the variables
5531              dnl dlname, library_names, old_library, dependency_libs, current,
5532              dnl age, revision, installed, dlopen, dlpreopen, libdir.
5533              save_libdir="$libdir"
5534              case "$found_la" in
5535                */* | *\\*) . "$found_la" ;;
5536                *) . "./$found_la" ;;
5537              esac
5538              libdir="$save_libdir"
5539              dnl We use only dependency_libs.
5540              for dep in $dependency_libs; do
5541                case "$dep" in
5542                  -L*)
5543                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
5544                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
5545                    dnl But don't add it
5546                    dnl   1. if it's the standard /usr/lib,
5547                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
5548                    dnl   3. if it's already present in $LDFLAGS or the already
5549                    dnl      constructed $LIBNAME,
5550                    dnl   4. if it doesn't exist as a directory.
5551                    if test "X$additional_libdir" != "X/usr/lib"; then
5552                      haveit=
5553                      if test "X$additional_libdir" = "X/usr/local/lib"; then
5554                        if test -n "$GCC"; then
5555                          case $host_os in
5556                            linux*) haveit=yes;;
5557                          esac
5558                        fi
5559                      fi
5560                      if test -z "$haveit"; then
5561                        haveit=
5562                        for x in $LDFLAGS $LIB[]NAME; do
5563                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5564                          if test "X$x" = "X-L$additional_libdir"; then
5565                            haveit=yes
5566                            break
5567                          fi
5568                        done
5569                        if test -z "$haveit"; then
5570                          if test -d "$additional_libdir"; then
5571                            dnl Really add $additional_libdir to $LIBNAME.
5572                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
5573                          fi
5574                        fi
5575                        haveit=
5576                        for x in $LDFLAGS $LTLIB[]NAME; do
5577                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5578                          if test "X$x" = "X-L$additional_libdir"; then
5579                            haveit=yes
5580                            break
5581                          fi
5582                        done
5583                        if test -z "$haveit"; then
5584                          if test -d "$additional_libdir"; then
5585                            dnl Really add $additional_libdir to $LTLIBNAME.
5586                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
5587                          fi
5588                        fi
5589                      fi
5590                    fi
5591                    ;;
5592                  -R*)
5593                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
5594                    if test "$enable_rpath" != no; then
5595                      dnl Potentially add DIR to rpathdirs.
5596                      dnl The rpathdirs will be appended to $LIBNAME at the end.
5597                      haveit=
5598                      for x in $rpathdirs; do
5599                        if test "X$x" = "X$dir"; then
5600                          haveit=yes
5601                          break
5602                        fi
5603                      done
5604                      if test -z "$haveit"; then
5605                        rpathdirs="$rpathdirs $dir"
5606                      fi
5607                      dnl Potentially add DIR to ltrpathdirs.
5608                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5609                      haveit=
5610                      for x in $ltrpathdirs; do
5611                        if test "X$x" = "X$dir"; then
5612                          haveit=yes
5613                          break
5614                        fi
5615                      done
5616                      if test -z "$haveit"; then
5617                        ltrpathdirs="$ltrpathdirs $dir"
5618                      fi
5619                    fi
5620                    ;;
5621                  -l*)
5622                    dnl Handle this in the next round.
5623                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
5624                    ;;
5625                  *.la)
5626                    dnl Handle this in the next round. Throw away the .la's
5627                    dnl directory; it is already contained in a preceding -L
5628                    dnl option.
5629                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
5630                    ;;
5631                  *)
5632                    dnl Most likely an immediate library name.
5633                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
5634                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
5635                    ;;
5636                esac
5637              done
5638            fi
5639          else
5640            dnl Didn't find the library; assume it is in the system directories
5641            dnl known to the linker and runtime loader. (All the system
5642            dnl directories known to the linker should also be known to the
5643            dnl runtime loader, otherwise the system is severely misconfigured.)
5644            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5645            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
5646          fi
5647        fi
5648      fi
5649    done
5650  done
5651  if test "X$rpathdirs" != "X"; then
5652    if test -n "$hardcode_libdir_separator"; then
5653      dnl Weird platform: only the last -rpath option counts, the user must
5654      dnl pass all path elements in one option. We can arrange that for a
5655      dnl single library, but not when more than one $LIBNAMEs are used.
5656      alldirs=
5657      for found_dir in $rpathdirs; do
5658        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
5659      done
5660      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
5661      acl_save_libdir="$libdir"
5662      libdir="$alldirs"
5663      eval flag=\"$hardcode_libdir_flag_spec\"
5664      libdir="$acl_save_libdir"
5665      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5666    else
5667      dnl The -rpath options are cumulative.
5668      for found_dir in $rpathdirs; do
5669        acl_save_libdir="$libdir"
5670        libdir="$found_dir"
5671        eval flag=\"$hardcode_libdir_flag_spec\"
5672        libdir="$acl_save_libdir"
5673        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5674      done
5675    fi
5676  fi
5677  if test "X$ltrpathdirs" != "X"; then
5678    dnl When using libtool, the option that works for both libraries and
5679    dnl executables is -R. The -R options are cumulative.
5680    for found_dir in $ltrpathdirs; do
5681      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
5682    done
5683  fi
5684])
5685
5686dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
5687dnl unless already present in VAR.
5688dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
5689dnl contains two or three consecutive elements that belong together.
5690AC_DEFUN([AC_LIB_APPENDTOVAR],
5691[
5692  for element in [$2]; do
5693    haveit=
5694    for x in $[$1]; do
5695      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5696      if test "X$x" = "X$element"; then
5697        haveit=yes
5698        break
5699      fi
5700    done
5701    if test -z "$haveit"; then
5702      [$1]="${[$1]}${[$1]:+ }$element"
5703    fi
5704  done
5705])
5706
5707# lib-ld.m4 serial 1 (gettext-0.11)
5708dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
5709dnl This file is free software, distributed under the terms of the GNU
5710dnl General Public License.  As a special exception to the GNU General
5711dnl Public License, this file may be distributed as part of a program
5712dnl that contains a configuration script generated by Autoconf, under
5713dnl the same distribution terms as the rest of that program.
5714
5715dnl Subroutines of libtool.m4,
5716dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
5717dnl with libtool.m4.
5718
5719dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
5720AC_DEFUN([AC_LIB_PROG_LD_GNU],
5721[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
5722[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5723if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5724  acl_cv_prog_gnu_ld=yes
5725else
5726  acl_cv_prog_gnu_ld=no
5727fi])
5728with_gnu_ld=$acl_cv_prog_gnu_ld
5729])
5730
5731dnl From libtool-1.4. Sets the variable LD.
5732AC_DEFUN([AC_LIB_PROG_LD],
5733[AC_ARG_WITH(gnu-ld,
5734[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
5735test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
5736AC_REQUIRE([AC_PROG_CC])dnl
5737AC_REQUIRE([AC_CANONICAL_HOST])dnl
5738ac_prog=ld
5739if test "$GCC" = yes; then
5740  # Check if gcc -print-prog-name=ld gives a path.
5741  AC_MSG_CHECKING([for ld used by GCC])
5742  case $host in
5743  *-*-mingw*)
5744    # gcc leaves a trailing carriage return which upsets mingw
5745    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5746  *)
5747    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5748  esac
5749  case $ac_prog in
5750    # Accept absolute paths.
5751    [[\\/]* | [A-Za-z]:[\\/]*)]
5752      [re_direlt='/[^/][^/]*/\.\./']
5753      # Canonicalize the path of ld
5754      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
5755      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5756	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5757      done
5758      test -z "$LD" && LD="$ac_prog"
5759      ;;
5760  "")
5761    # If it fails, then pretend we aren't using GCC.
5762    ac_prog=ld
5763    ;;
5764  *)
5765    # If it is relative, then search for the first ld in PATH.
5766    with_gnu_ld=unknown
5767    ;;
5768  esac
5769elif test "$with_gnu_ld" = yes; then
5770  AC_MSG_CHECKING([for GNU ld])
5771else
5772  AC_MSG_CHECKING([for non-GNU ld])
5773fi
5774AC_CACHE_VAL(acl_cv_path_LD,
5775[if test -z "$LD"; then
5776  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5777  for ac_dir in $PATH; do
5778    test -z "$ac_dir" && ac_dir=.
5779    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5780      acl_cv_path_LD="$ac_dir/$ac_prog"
5781      # Check to see if the program is GNU ld.  I'd rather use --version,
5782      # but apparently some GNU ld's only accept -v.
5783      # Break only if it was the GNU/non-GNU ld that we prefer.
5784      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
5785	test "$with_gnu_ld" != no && break
5786      else
5787	test "$with_gnu_ld" != yes && break
5788      fi
5789    fi
5790  done
5791  IFS="$ac_save_ifs"
5792else
5793  acl_cv_path_LD="$LD" # Let the user override the test with a path.
5794fi])
5795LD="$acl_cv_path_LD"
5796if test -n "$LD"; then
5797  AC_MSG_RESULT($LD)
5798else
5799  AC_MSG_RESULT(no)
5800fi
5801test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5802AC_LIB_PROG_LD_GNU
5803])
5804
5805# Macro to add for using GNU gettext.
5806# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
5807#
5808# Modified to never use included libintl.
5809# Owen Taylor <otaylor@redhat.com>, 12/15/1998
5810#
5811# Major rework to remove unused code
5812# Owen Taylor <otaylor@redhat.com>, 12/11/2002
5813#
5814# This file can be copied and used freely without restrictions.  It can
5815# be used in projects which are not available under the GNU Public License
5816# but which still want to provide support for the GNU gettext functionality.
5817#
5818
5819#
5820# We need this here as well, since someone might use autoconf-2.5x
5821# to configure GLib then an older version to configure a package
5822# using AM_GLIB_GNU_GETTEXT
5823AC_PREREQ(2.53)
5824
5825dnl
5826dnl We go to great lengths to make sure that aclocal won't
5827dnl try to pull in the installed version of these macros
5828dnl when running aclocal in the glib directory.
5829dnl
5830m4_copy([AC_DEFUN],[glib_DEFUN])
5831m4_copy([AC_REQUIRE],[glib_REQUIRE])
5832dnl
5833dnl At the end, if we're not within glib, we'll define the public
5834dnl definitions in terms of our private definitions.
5835dnl
5836
5837# GLIB_LC_MESSAGES
5838#--------------------
5839glib_DEFUN([GLIB_LC_MESSAGES],
5840  [AC_CHECK_HEADERS([locale.h])
5841    if test $ac_cv_header_locale_h = yes; then
5842    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
5843      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
5844       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
5845    if test $am_cv_val_LC_MESSAGES = yes; then
5846      AC_DEFINE(HAVE_LC_MESSAGES, 1,
5847        [Define if your <locale.h> file defines LC_MESSAGES.])
5848    fi
5849  fi])
5850
5851# GLIB_PATH_PROG_WITH_TEST
5852#----------------------------
5853dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
5854dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
5855glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
5856[# Extract the first word of "$2", so it can be a program name with args.
5857set dummy $2; ac_word=[$]2
5858AC_MSG_CHECKING([for $ac_word])
5859AC_CACHE_VAL(ac_cv_path_$1,
5860[case "[$]$1" in
5861  /*)
5862  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
5863  ;;
5864  *)
5865  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5866  for ac_dir in ifelse([$5], , $PATH, [$5]); do
5867    test -z "$ac_dir" && ac_dir=.
5868    if test -f $ac_dir/$ac_word; then
5869      if [$3]; then
5870	ac_cv_path_$1="$ac_dir/$ac_word"
5871	break
5872      fi
5873    fi
5874  done
5875  IFS="$ac_save_ifs"
5876dnl If no 4th arg is given, leave the cache variable unset,
5877dnl so AC_PATH_PROGS will keep looking.
5878ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
5879])dnl
5880  ;;
5881esac])dnl
5882$1="$ac_cv_path_$1"
5883if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
5884  AC_MSG_RESULT([$]$1)
5885else
5886  AC_MSG_RESULT(no)
5887fi
5888AC_SUBST($1)dnl
5889])
5890
5891# GLIB_WITH_NLS
5892#-----------------
5893glib_DEFUN([GLIB_WITH_NLS],
5894  dnl NLS is obligatory
5895  [USE_NLS=yes
5896    AC_SUBST(USE_NLS)
5897
5898    gt_cv_have_gettext=no
5899
5900    CATOBJEXT=NONE
5901    XGETTEXT=:
5902    INTLLIBS=
5903
5904    AC_CHECK_HEADER(libintl.h,
5905     [gt_cv_func_dgettext_libintl="no"
5906      libintl_extra_libs=""
5907
5908      #
5909      # First check in libc
5910      #
5911      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
5912        [AC_TRY_LINK([
5913#include <libintl.h>
5914],
5915          [return (int) dgettext ("","")],
5916	  gt_cv_func_dgettext_libc=yes,
5917          gt_cv_func_dgettext_libc=no)
5918        ])
5919
5920      if test "$gt_cv_func_dgettext_libc" = "yes" ; then
5921        AC_CHECK_FUNCS(bind_textdomain_codeset)
5922      fi
5923
5924      #
5925      # If we don't have everything we want, check in libintl
5926      #
5927      if test "$gt_cv_func_dgettext_libc" != "yes" \
5928         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
5929
5930        AC_CHECK_LIB(intl, bindtextdomain,
5931	    [AC_CHECK_LIB(intl, dgettext,
5932		          gt_cv_func_dgettext_libintl=yes)])
5933
5934	if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
5935	  AC_MSG_CHECKING([if -liconv is needed to use gettext])
5936	  AC_MSG_RESULT([])
5937          AC_CHECK_LIB(intl, dcgettext,
5938		       [gt_cv_func_dgettext_libintl=yes
5939			libintl_extra_libs=-liconv],
5940			:,-liconv)
5941        fi
5942
5943        #
5944        # If we found libintl, then check in it for bind_textdomain_codeset();
5945        # we'll prefer libc if neither have bind_textdomain_codeset(),
5946        # and both have dgettext
5947        #
5948        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
5949          glib_save_LIBS="$LIBS"
5950          LIBS="$LIBS -lintl $libintl_extra_libs"
5951          unset ac_cv_func_bind_textdomain_codeset
5952          AC_CHECK_FUNCS(bind_textdomain_codeset)
5953          LIBS="$glib_save_LIBS"
5954
5955          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
5956            gt_cv_func_dgettext_libc=no
5957          else
5958            if test "$gt_cv_func_dgettext_libc" = "yes"; then
5959              gt_cv_func_dgettext_libintl=no
5960            fi
5961          fi
5962        fi
5963      fi
5964
5965      if test "$gt_cv_func_dgettext_libc" = "yes" \
5966	|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
5967        gt_cv_have_gettext=yes
5968      fi
5969
5970      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
5971        INTLLIBS="-lintl $libintl_extra_libs"
5972      fi
5973
5974      if test "$gt_cv_have_gettext" = "yes"; then
5975	AC_DEFINE(HAVE_GETTEXT,1,
5976	  [Define if the GNU gettext() function is already present or preinstalled.])
5977	GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
5978	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
5979	if test "$MSGFMT" != "no"; then
5980	  AC_CHECK_FUNCS(dcgettext)
5981	  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
5982	  GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
5983	    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
5984	  AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
5985			 return _nl_msg_cat_cntr],
5986	    [CATOBJEXT=.gmo
5987             DATADIRNAME=share],
5988	    [CATOBJEXT=.mo
5989             DATADIRNAME=lib])
5990	  INSTOBJEXT=.mo
5991	else
5992	  gt_cv_have_gettext=no
5993	fi
5994      fi
5995    ])
5996
5997    if test "$gt_cv_have_gettext" = "yes" ; then
5998      AC_DEFINE(ENABLE_NLS, 1,
5999        [always defined to indicate that i18n is enabled])
6000    fi
6001
6002    dnl Test whether we really found GNU xgettext.
6003    if test "$XGETTEXT" != ":"; then
6004      dnl If it is not GNU xgettext we define it as : so that the
6005      dnl Makefiles still can work.
6006      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
6007        : ;
6008      else
6009        AC_MSG_RESULT(
6010	  [found xgettext program is not GNU xgettext; ignore it])
6011        XGETTEXT=":"
6012      fi
6013    fi
6014
6015    # We need to process the po/ directory.
6016    POSUB=po
6017
6018    AC_OUTPUT_COMMANDS(
6019      [case "$CONFIG_FILES" in *po/Makefile.in*)
6020        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
6021      esac])
6022
6023    dnl These rules are solely for the distribution goal.  While doing this
6024    dnl we only have to keep exactly one list of the available catalogs
6025    dnl in configure.in.
6026    for lang in $ALL_LINGUAS; do
6027      GMOFILES="$GMOFILES $lang.gmo"
6028      POFILES="$POFILES $lang.po"
6029    done
6030
6031    dnl Make all variables we use known to autoconf.
6032    AC_SUBST(CATALOGS)
6033    AC_SUBST(CATOBJEXT)
6034    AC_SUBST(DATADIRNAME)
6035    AC_SUBST(GMOFILES)
6036    AC_SUBST(INSTOBJEXT)
6037    AC_SUBST(INTLLIBS)
6038    AC_SUBST(PO_IN_DATADIR_TRUE)
6039    AC_SUBST(PO_IN_DATADIR_FALSE)
6040    AC_SUBST(POFILES)
6041    AC_SUBST(POSUB)
6042  ])
6043
6044# AM_GLIB_GNU_GETTEXT
6045# -------------------
6046# Do checks necessary for use of gettext. If a suitable implementation
6047# of gettext is found in either in libintl or in the C library,
6048# it will set INTLLIBS to the libraries needed for use of gettext
6049# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
6050# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
6051# on various variables needed by the Makefile.in.in installed by
6052# glib-gettextize.
6053dnl
6054glib_DEFUN(GLIB_GNU_GETTEXT,
6055  [AC_REQUIRE([AC_PROG_CC])dnl
6056   AC_REQUIRE([AC_HEADER_STDC])dnl
6057
6058   GLIB_LC_MESSAGES
6059   GLIB_WITH_NLS
6060
6061   if test "$gt_cv_have_gettext" = "yes"; then
6062     if test "x$ALL_LINGUAS" = "x"; then
6063       LINGUAS=
6064     else
6065       AC_MSG_CHECKING(for catalogs to be installed)
6066       NEW_LINGUAS=
6067       for lang in ${LINGUAS=$ALL_LINGUAS}; do
6068         case "$ALL_LINGUAS" in
6069          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
6070         esac
6071       done
6072       LINGUAS=$NEW_LINGUAS
6073       AC_MSG_RESULT($LINGUAS)
6074     fi
6075
6076     dnl Construct list of names of catalog files to be constructed.
6077     if test -n "$LINGUAS"; then
6078       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
6079     fi
6080   fi
6081
6082   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
6083   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
6084   dnl Try to locate is.
6085   MKINSTALLDIRS=
6086   if test -n "$ac_aux_dir"; then
6087     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
6088   fi
6089   if test -z "$MKINSTALLDIRS"; then
6090     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
6091   fi
6092   AC_SUBST(MKINSTALLDIRS)
6093
6094   dnl Generate list of files to be processed by xgettext which will
6095   dnl be included in po/Makefile.
6096   test -d po || mkdir po
6097   if test "x$srcdir" != "x."; then
6098     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
6099       posrcprefix="$srcdir/"
6100     else
6101       posrcprefix="../$srcdir/"
6102     fi
6103   else
6104     posrcprefix="../"
6105   fi
6106   rm -f po/POTFILES
6107   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
6108	< $srcdir/po/POTFILES.in > po/POTFILES
6109  ])
6110
6111# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
6112# -------------------------------
6113# Define VARIABLE to the location where catalog files will
6114# be installed by po/Makefile.
6115glib_DEFUN(GLIB_DEFINE_LOCALEDIR,
6116[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
6117glib_save_prefix="$prefix"
6118test "x$prefix" = xNONE && prefix=$ac_default_prefix
6119if test "x$CATOBJEXT" = "x.mo" ; then
6120  localedir=`eval echo "${libdir}/locale"`
6121else
6122  localedir=`eval echo "${datadir}/locale"`
6123fi
6124prefix="$glib_save_prefix"
6125AC_DEFINE_UNQUOTED($1, "$localedir",
6126  [Define the location where the catalogs will be installed])
6127])
6128
6129dnl
6130dnl Now the definitions that aclocal will find
6131dnl
6132ifdef(glib_configure_in,[],[
6133AC_DEFUN(AM_GLIB_GNU_GETTEXT,[GLIB_GNU_GETTEXT($@)])
6134AC_DEFUN(AM_GLIB_DEFINE_LOCALEDIR,[GLIB_DEFINE_LOCALEDIR($@)])
6135])dnl
6136
6137