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