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