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