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