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