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