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