source: trunk/third/libgnomeprintui/aclocal.m4 @ 18799

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