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