Initial revision
[TestXSLT.git] / libiconv / autoconf / aclocal.m4
1 # autoconf/aclocal.m4 generated automatically by aclocal 1.5
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
15 dnl This file is free software, distributed under the terms of the GNU
16 dnl General Public License.  As a special exception to the GNU General
17 dnl Public License, this file may be distributed as part of a program
18 dnl that contains a configuration script generated by Autoconf, under
19 dnl the same distribution terms as the rest of that program.
20
21 dnl From Bruno Haible, Marcus Daniels.
22
23 AC_PREREQ(2.13)
24
25 AC_DEFUN([CL_PROG_RANLIB],
26 [AC_CHECK_PROG(RANLIB, ranlib, ranlib, true)])
27
28 dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
29 dnl This file is free software, distributed under the terms of the GNU
30 dnl General Public License.  As a special exception to the GNU General
31 dnl Public License, this file may be distributed as part of a program
32 dnl that contains a configuration script generated by Autoconf, under
33 dnl the same distribution terms as the rest of that program.
34
35 dnl From Bruno Haible, Marcus Daniels.
36
37 AC_PREREQ(2.13)
38
39 AC_DEFUN([CL_PROG_CP],
40 [AC_CACHE_CHECK(how to copy files, cl_cv_prog_cp, [
41 echo "blabla" > conftest.x
42 err=`/bin/sh -c "cp -p conftest.x conftest.y 2>&1"`
43 if test -z "$err"; then
44   cl_cv_prog_cp='cp -p'
45 else
46   cl_cv_prog_cp='cp'
47 fi
48 rm -f conftest*
49 ])
50 CP="$cl_cv_prog_cp"
51 AC_SUBST(CP)dnl
52 ])
53
54 dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
55 dnl This file is free software, distributed under the terms of the GNU
56 dnl General Public License.  As a special exception to the GNU General
57 dnl Public License, this file may be distributed as part of a program
58 dnl that contains a configuration script generated by Autoconf, under
59 dnl the same distribution terms as the rest of that program.
60
61 dnl From Bruno Haible, Marcus Daniels.
62
63 AC_PREREQ(2.13)
64
65 AC_DEFUN([CL_PROG_LN],
66 [AC_REQUIRE([CL_PROG_CP])dnl
67 AC_CACHE_CHECK(how to make hard links, cl_cv_prog_LN, [
68 rm -f conftestdata conftestfile
69 echo data > conftestfile
70 if ln conftestfile conftestdata 2>/dev/null; then
71   cl_cv_prog_LN=ln
72 else
73   cl_cv_prog_LN="$cl_cv_prog_cp"
74 fi
75 rm -f conftestdata conftestfile
76 ])
77 LN="$cl_cv_prog_LN"
78 AC_SUBST(LN)dnl
79 ])
80
81 AC_DEFUN([CL_PROG_LN_S],
82 [AC_REQUIRE([CL_PROG_LN])dnl
83 dnl Make a symlink if possible; otherwise try a hard link. On filesystems
84 dnl which support neither symlink nor hard link, use a plain copy.
85 AC_MSG_CHECKING(whether ln -s works)
86 AC_CACHE_VAL(cl_cv_prog_LN_S, [
87 rm -f conftestdata
88 if ln -s X conftestdata 2>/dev/null; then
89   cl_cv_prog_LN_S="ln -s"
90 else
91   cl_cv_prog_LN_S="$cl_cv_prog_LN"
92 fi
93 rm -f conftestdata
94 ])dnl
95 if test "$cl_cv_prog_LN_S" = "ln -s"; then
96   AC_MSG_RESULT(yes)
97 else
98   AC_MSG_RESULT(no)
99 fi
100 LN_S="$cl_cv_prog_LN_S"
101 AC_SUBST(LN_S)dnl
102 ])
103
104 AC_DEFUN([CL_PROG_HLN],
105 [AC_REQUIRE([CL_PROG_LN_S])dnl
106 dnl SVR4 "ln" makes hard links to symbolic links, instead of resolving the
107 dnl symbolic link. To avoid this, use the "hln" program.
108 AC_CACHE_CHECK(how to make hard links to symlinks, cl_cv_prog_hln, [
109 cl_cv_prog_hln="ln"
110 if test "$cl_cv_prog_LN_S" = "ln -s"; then
111 echo "blabla" > conftest.x
112 ln -s conftest.x conftest.y
113 ln conftest.y conftest.z 2>&AC_FD_CC
114 rm -f conftest.x
115 if cat conftest.z > /dev/null 2>&1 ; then
116   # ln is usable.
117   cl_cv_prog_hln="ln"
118 else
119   # conftest.z is a symbolic link to the non-existent conftest.x
120   cl_cv_prog_hln="hln"
121 fi
122 else
123 # If there are no symbolic links, the problem cannot occur.
124 cl_cv_prog_hln="ln"
125 fi
126 rm -f conftest*
127 ])
128 HLN="$cl_cv_prog_hln"
129 AC_SUBST(HLN)dnl
130 ])
131
132 dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
133 dnl This file is free software, distributed under the terms of the GNU
134 dnl General Public License.  As a special exception to the GNU General
135 dnl Public License, this file may be distributed as part of a program
136 dnl that contains a configuration script generated by Autoconf, under
137 dnl the same distribution terms as the rest of that program.
138
139 dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
140
141 AC_PREREQ(2.13)
142
143 dnl without AC_MSG_...:   with AC_MSG_... and caching:
144 dnl   AC_TRY_CPP          CL_CPP_CHECK
145 dnl   AC_TRY_COMPILE      CL_COMPILE_CHECK
146 dnl   AC_TRY_LINK         CL_LINK_CHECK
147 dnl   AC_TRY_RUN          CL_RUN_CHECK - would require cross-compiling support
148 dnl Usage:
149 dnl AC_TRY_CPP(INCLUDES,
150 dnl            ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
151 dnl CL_CPP_CHECK(ECHO-TEXT, CACHE-ID,
152 dnl              INCLUDES,
153 dnl              ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
154 dnl AC_TRY_xxx(INCLUDES, FUNCTION-BODY,
155 dnl            ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
156 dnl CL_xxx_CHECK(ECHO-TEXT, CACHE-ID,
157 dnl              INCLUDES, FUNCTION-BODY,
158 dnl              ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
159
160 AC_DEFUN([CL_CPP_CHECK],
161 [AC_MSG_CHECKING(for $1)
162 AC_CACHE_VAL($2,[
163 AC_TRY_CPP([$3], $2=yes, $2=no)
164 ])
165 AC_MSG_RESULT([$]$2)
166 if test [$]$2 = yes; then
167   ifelse([$4], , :, [$4])
168 ifelse([$5], , , [else
169   $5
170 ])dnl
171 fi
172 ])
173
174 AC_DEFUN([CL_COMPILE_CHECK],
175 [AC_MSG_CHECKING(for $1)
176 AC_CACHE_VAL($2,[
177 AC_TRY_COMPILE([$3],[$4], $2=yes, $2=no)
178 ])
179 AC_MSG_RESULT([$]$2)
180 if test [$]$2 = yes; then
181   ifelse([$5], , :, [$5])
182 ifelse([$6], , , [else
183   $6
184 ])dnl
185 fi
186 ])
187
188 AC_DEFUN([CL_LINK_CHECK],
189 [AC_MSG_CHECKING(for $1)
190 AC_CACHE_VAL($2,[
191 AC_TRY_LINK([$3],[$4], $2=yes, $2=no)
192 ])
193 AC_MSG_RESULT([$]$2)
194 if test [$]$2 = yes; then
195   ifelse([$5], , :, [$5])
196 ifelse([$6], , , [else
197   $6
198 ])dnl
199 fi
200 ])
201
202 dnl CL_SILENT(ACTION)
203 dnl performs ACTION, with AC_MSG_CHECKING and AC_MSG_RESULT being defined away.
204 AC_DEFUN([CL_SILENT],
205 [pushdef([AC_MSG_CHECKING],[:])dnl
206 pushdef([AC_CHECKING],[:])dnl
207 pushdef([AC_MSG_RESULT],[:])dnl
208 $1[]dnl
209 popdef([AC_MSG_RESULT])dnl
210 popdef([AC_CHECKING])dnl
211 popdef([AC_MSG_CHECKING])dnl
212 ])
213
214 dnl Expands to the "extern ..." prefix used for system declarations.
215 dnl AC_LANG_EXTERN()
216 AC_DEFUN([AC_LANG_EXTERN],
217 [extern
218 #ifdef __cplusplus
219 "C"
220 #endif
221 ])
222
223 AC_DEFUN([CL_CC_WORKS],
224 [AC_CACHE_CHECK(whether CC works at all, cl_cv_prog_cc_works, [
225 AC_LANG_SAVE()
226 AC_LANG_C()
227 AC_TRY_RUN([int main() { exit(0); }],
228 cl_cv_prog_cc_works=yes, cl_cv_prog_cc_works=no,
229 AC_TRY_LINK([], [], cl_cv_prog_cc_works=yes, cl_cv_prog_cc_works=no))
230 AC_LANG_RESTORE()
231 ])
232 case "$cl_cv_prog_cc_works" in
233   *no) echo "Installation or configuration problem: C compiler cannot create executables."; exit 1;;
234   *yes) ;;
235 esac
236 ])
237
238 AC_DEFUN([CL_CONFIG_SUBDIRS],
239 [dnl No AC_CONFIG_AUX_DIR_DEFAULT, so we don't need install.sh.
240 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])
241 AC_CONFIG_SUBDIRS([$1])dnl
242 ])
243
244 AC_DEFUN([CL_CANONICAL_HOST],
245 [AC_REQUIRE([AC_PROG_CC]) dnl Actually: AC_REQUIRE([CL_CC_WORKS])
246 dnl Set ac_aux_dir before the cache check, because AM_PROG_LIBTOOL needs it.
247 ac_aux_dir=${srcdir}/$1
248 dnl A substitute for AC_CONFIG_AUX_DIR_DEFAULT, so we don't need install.sh.
249 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
250 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
251 dnl We have defined $ac_aux_dir.
252 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
253 dnl In autoconf-2.52, a single AC_CANONICAL_HOST has the effect of inserting
254 dnl the code of AC_CANONICAL_BUILD *before* CL_CANONICAL_HOST, i.e. before
255 dnl ac_aux_dir has been set. To work around this, we list AC_CANONICAL_BUILD
256 dnl explicitly.
257 AC_CANONICAL_BUILD
258 AC_CANONICAL_HOST
259 ])
260
261 AC_DEFUN([CL_CANONICAL_HOST_CPU],
262 [AC_REQUIRE([CL_CANONICAL_HOST])AC_REQUIRE([AC_PROG_CC])
263 case "$host_cpu" in
264 changequote(,)dnl
265   i[4567]86 )
266     host_cpu=i386
267     ;;
268   alphaev[4-7] | alphaev56 | alphapca5[67] | alphaev6[78] )
269     host_cpu=alpha
270     ;;
271   hppa1.0 | hppa1.1 | hppa2.0* )
272     host_cpu=hppa
273     ;;
274   powerpc )
275     host_cpu=rs6000
276     ;;
277   c1 | c2 | c32 | c34 | c38 | c4 )
278     host_cpu=convex
279     ;;
280   arm* )
281     host_cpu=arm
282     ;;
283 changequote([,])dnl
284   mips )
285     AC_CACHE_CHECK([for 64-bit MIPS], cl_cv_host_mips64, [
286 AC_EGREP_CPP(yes,
287 [#if defined(_MIPS_SZLONG)
288 #if (_MIPS_SZLONG == 64)
289 /* We should also check for (_MIPS_SZPTR == 64), but gcc keeps this at 32. */
290   yes
291 #endif
292 #endif
293 ], cl_cv_host_mips64=yes, cl_cv_host_mips64=no)
294 ])
295 if test $cl_cv_host_mips64 = yes; then
296   host_cpu=mips64
297 fi
298     ;;
299 dnl UltraSPARCs running Linux have `uname -m` = "sparc64", but the C compiler
300 dnl still generates 32-bit code.
301   sparc | sparc64 )
302     AC_CACHE_CHECK([for 64-bit SPARC], cl_cv_host_sparc64, [
303 AC_EGREP_CPP(yes,
304 [#if defined(__sparcv9) || defined(__arch64__)
305   yes
306 #endif
307 ], cl_cv_host_sparc64=yes, cl_cv_host_sparc64=no)
308 ])
309 if test $cl_cv_host_sparc64 = yes; then
310   host_cpu=sparc64
311 else
312   host_cpu=sparc
313 fi
314     ;;
315 esac
316 dnl was AC_DEFINE_UNQUOTED(__${host_cpu}__) but KAI C++ 3.2d doesn't like this
317 cat >> confdefs.h <<EOF
318 #ifndef __${host_cpu}__
319 #define __${host_cpu}__ 1
320 #endif
321 EOF
322 ])
323
324 AC_DEFUN([CL_CANONICAL_HOST_CPU_FOR_FFCALL],
325 [AC_REQUIRE([CL_CANONICAL_HOST])AC_REQUIRE([AC_PROG_CC])
326 case "$host_cpu" in
327 changequote(,)dnl
328   i[4567]86 )
329     host_cpu=i386
330     ;;
331   alphaev[4-7] | alphaev56 | alphapca5[67] | alphaev6[78] )
332     host_cpu=alpha
333     ;;
334   hppa1.0 | hppa1.1 | hppa2.0* )
335     host_cpu=hppa
336     ;;
337   powerpc )
338     host_cpu=rs6000
339     ;;
340   c1 | c2 | c32 | c34 | c38 | c4 )
341     host_cpu=convex
342     ;;
343   arm* )
344     host_cpu=arm
345     ;;
346 changequote([,])dnl
347   mips )
348     AC_CACHE_CHECK([for 64-bit MIPS], cl_cv_host_mips64, [
349 AC_EGREP_CPP(yes,
350 [#if defined(_MIPS_SZLONG)
351 #if (_MIPS_SZLONG == 64)
352 /* We should also check for (_MIPS_SZPTR == 64), but gcc keeps this at 32. */
353   yes
354 #endif
355 #endif
356 ], cl_cv_host_mips64=yes, cl_cv_host_mips64=no)
357 ])
358 if test $cl_cv_host_mips64 = yes; then
359   host_cpu=mips64
360 else
361   AC_CACHE_CHECK([for MIPS with n32 ABI], cl_cv_host_mipsn32, [
362 dnl Strictly speaking, the MIPS ABI (-32 or -n32) is independent from the CPU
363 dnl identification (-mips[12] or -mips[34]). But -n32 is commonly used together
364 dnl with -mips3, and it's easier to test the CPU identification.
365 AC_EGREP_CPP(yes,
366 [#if __mips >= 3
367   yes
368 #endif
369 ], cl_cv_host_mipsn32=yes, cl_cv_host_mipsn32=no)
370 ])
371 if test $cl_cv_host_mipsn32 = yes; then
372   host_cpu=mipsn32
373 fi
374 fi
375     ;;
376 dnl UltraSPARCs running Linux have `uname -m` = "sparc64", but the C compiler
377 dnl still generates 32-bit code.
378   sparc | sparc64 )
379     AC_CACHE_CHECK([for 64-bit SPARC], cl_cv_host_sparc64, [
380 AC_EGREP_CPP(yes,
381 [#if defined(__sparcv9) || defined(__arch64__)
382   yes
383 #endif
384 ], cl_cv_host_sparc64=yes, cl_cv_host_sparc64=no)
385 ])
386 if test $cl_cv_host_sparc64 = yes; then
387   host_cpu=sparc64
388 else
389   host_cpu=sparc
390 fi
391     ;;
392 esac
393 dnl was AC_DEFINE_UNQUOTED(__${host_cpu}__) but KAI C++ 3.2d doesn't like this
394 cat >> confdefs.h <<EOF
395 #ifndef __${host_cpu}__
396 #define __${host_cpu}__ 1
397 #endif
398 EOF
399 ])
400
401 # isc-posix.m4 serial 2 (gettext-0.11.2)
402 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
403 dnl This file is free software, distributed under the terms of the GNU
404 dnl General Public License.  As a special exception to the GNU General
405 dnl Public License, this file may be distributed as part of a program
406 dnl that contains a configuration script generated by Autoconf, under
407 dnl the same distribution terms as the rest of that program.
408
409 # This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
410
411 # This test replaces the one in autoconf.
412 # Currently this macro should have the same name as the autoconf macro
413 # because gettext's gettext.m4 (distributed in the automake package)
414 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
415 # give these diagnostics:
416 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
417 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
418
419 undefine([AC_ISC_POSIX])
420
421 AC_DEFUN([AC_ISC_POSIX],
422   [
423     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
424     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
425   ]
426 )
427
428 # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
429
430 # The next line was added by Bruno Haible 2001-06-08.
431 builtin([undefine],[symbols])
432
433 # serial 46 AC_PROG_LIBTOOL
434
435 AC_DEFUN([AC_PROG_LIBTOOL],
436 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
437
438 # This can be used to rebuild libtool when needed
439 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
440
441 # Always use our own libtool.
442 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
443 AC_SUBST(LIBTOOL)dnl
444
445 # Prevent multiple expansion
446 define([AC_PROG_LIBTOOL], [])
447 ])
448
449 AC_DEFUN([AC_LIBTOOL_SETUP],
450 [AC_PREREQ(2.13)dnl
451 AC_REQUIRE([AC_ENABLE_SHARED])dnl
452 AC_REQUIRE([AC_ENABLE_STATIC])dnl
453 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
454 AC_REQUIRE([CL_CANONICAL_HOST])dnl
455 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
456 AC_REQUIRE([AC_PROG_CC])dnl
457 AC_REQUIRE([AC_PROG_LD])dnl
458 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
459 AC_REQUIRE([AC_PROG_NM])dnl
460 AC_REQUIRE([CL_PROG_LN_S])dnl
461 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
462 AC_REQUIRE([AC_OBJEXT])dnl
463 AC_REQUIRE([AC_EXEEXT])dnl
464 dnl
465
466 _LT_AC_PROG_ECHO_BACKSLASH
467 # Only perform the check for file, if the check method requires it
468 case $deplibs_check_method in
469 file_magic*)
470   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
471     AC_PATH_MAGIC
472   fi
473   ;;
474 esac
475
476 AC_CHECK_TOOL(RANLIB, ranlib, :)
477 AC_CHECK_TOOL(STRIP, strip, :)
478
479 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
480 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
481 enable_win32_dll=yes, enable_win32_dll=no)
482
483 AC_ARG_ENABLE(libtool-lock,
484   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
485 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
486
487 # Some flags need to be propagated to the compiler or linker for good
488 # libtool support.
489 case $host in
490 *-*-irix6*)
491   # Find out which ABI we are using.
492   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
493   if AC_TRY_EVAL(ac_compile); then
494     case `/usr/bin/file conftest.$ac_objext` in
495     *32-bit*)
496       LD="${LD-ld} -32"
497       ;;
498     *N32*)
499       LD="${LD-ld} -n32"
500       ;;
501     *64-bit*)
502       LD="${LD-ld} -64"
503       ;;
504     esac
505   fi
506   rm -rf conftest*
507   ;;
508
509 *-*-sco3.2v5*)
510   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
511   SAVE_CFLAGS="$CFLAGS"
512   CFLAGS="$CFLAGS -belf"
513   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
514     [AC_LANG_SAVE
515      AC_LANG_C
516      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
517      AC_LANG_RESTORE])
518   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
519     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
520     CFLAGS="$SAVE_CFLAGS"
521   fi
522   ;;
523
524 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
525 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
526   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
527   AC_CHECK_TOOL(AS, as, false)
528   AC_CHECK_TOOL(OBJDUMP, objdump, false)
529
530   # recent cygwin and mingw systems supply a stub DllMain which the user
531   # can override, but on older systems we have to supply one
532   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
533     [AC_TRY_LINK([],
534       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
535       DllMain (0, 0, 0);],
536       [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
537
538   case $host/$CC in
539   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
540     # old mingw systems require "-dll" to link a DLL, while more recent ones
541     # require "-mdll"
542     SAVE_CFLAGS="$CFLAGS"
543     CFLAGS="$CFLAGS -mdll"
544     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
545       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
546     CFLAGS="$SAVE_CFLAGS" ;;
547   *-*-cygwin* | *-*-pw32*)
548     # cygwin systems need to pass --dll to the linker, and not link
549     # crt.o which will require a WinMain@16 definition.
550     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
551   esac
552   ;;
553   ])
554 esac
555
556 _LT_AC_LTCONFIG_HACK
557
558 ])
559
560 # AC_LIBTOOL_HEADER_ASSERT
561 # ------------------------
562 AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
563 [AC_CACHE_CHECK([whether $CC supports assert without backlinking],
564     [lt_cv_func_assert_works],
565     [case $host in
566     *-*-solaris*)
567       if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
568         case `$CC --version 2>/dev/null` in
569         [[12]].*) lt_cv_func_assert_works=no ;;
570         *)        lt_cv_func_assert_works=yes ;;
571         esac
572       fi
573       ;;
574     esac])
575
576 if test "x$lt_cv_func_assert_works" = xyes; then
577   AC_CHECK_HEADERS(assert.h)
578 fi
579 ])# AC_LIBTOOL_HEADER_ASSERT
580
581 # _LT_AC_CHECK_DLFCN
582 # --------------------
583 AC_DEFUN([_LT_AC_CHECK_DLFCN],
584 [AC_CHECK_HEADERS(dlfcn.h)
585 ])# _LT_AC_CHECK_DLFCN
586
587 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
588 # ---------------------------------
589 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
590 [AC_REQUIRE([CL_CANONICAL_HOST])
591 AC_REQUIRE([AC_PROG_NM])
592 AC_REQUIRE([AC_OBJEXT])
593 # Check for command to grab the raw symbol name followed by C symbol from nm.
594 AC_MSG_CHECKING([command to parse $NM output])
595 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
596
597 # These are sane defaults that work on at least a few old systems.
598 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
599
600 # Character class describing NM global symbol codes.
601 symcode='[[BCDEGRST]]'
602
603 # Regexp to match symbols that can be accessed directly from C.
604 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
605
606 # Transform the above into a raw symbol and a C symbol.
607 symxfrm='\1 \2\3 \3'
608
609 # Transform an extracted symbol line into a proper C declaration
610 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
611
612 # Transform an extracted symbol line into symbol name and symbol address
613 lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
614
615 # Define system-specific variables.
616 case $host_os in
617 aix*)
618   symcode='[[BCDT]]'
619   ;;
620 cygwin* | mingw* | pw32*)
621   symcode='[[ABCDGISTW]]'
622   ;;
623 hpux*) # Its linker distinguishes data from code symbols
624   lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
625   lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
626   ;;
627 irix*)
628   symcode='[[BCDEGRST]]'
629   ;;
630 solaris* | sysv5*)
631   symcode='[[BDT]]'
632   ;;
633 sysv4)
634   symcode='[[DFNSTU]]'
635   ;;
636 esac
637
638 # Handle CRLF in mingw tool chain
639 opt_cr=
640 case $host_os in
641 mingw*)
642   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
643   ;;
644 esac
645
646 # If we're using GNU nm, then use its standard symbol codes.
647 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
648   symcode='[[ABCDGISTW]]'
649 fi
650
651 # Try without a prefix undercore, then with it.
652 for ac_symprfx in "" "_"; do
653
654   # Write the raw and C identifiers.
655 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[        ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
656
657   # Check to see that the pipe works correctly.
658   pipe_works=no
659   rm -f conftest*
660   cat > conftest.$ac_ext <<EOF
661 #ifdef __cplusplus
662 extern "C" {
663 #endif
664 char nm_test_var;
665 void nm_test_func(){}
666 #ifdef __cplusplus
667 }
668 #endif
669 int main(){nm_test_var='a';nm_test_func();return(0);}
670 EOF
671
672   if AC_TRY_EVAL(ac_compile); then
673     # Now try to grab the symbols.
674     nlist=conftest.nm
675     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
676       # Try sorting and uniquifying the output.
677       if sort "$nlist" | uniq > "$nlist"T; then
678         mv -f "$nlist"T "$nlist"
679       else
680         rm -f "$nlist"T
681       fi
682
683       # Make sure that we snagged all the symbols we need.
684       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
685         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
686           cat <<EOF > conftest.$ac_ext
687 #ifdef __cplusplus
688 extern "C" {
689 #endif
690
691 EOF
692           # Now generate the symbol file.
693           eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
694
695           cat <<EOF >> conftest.$ac_ext
696 #if defined (__STDC__) && __STDC__
697 # define lt_ptr void *
698 #else
699 # define lt_ptr char *
700 # define const
701 #endif
702
703 /* The mapping between symbol names and symbols. */
704 const struct {
705   const char *name;
706   lt_ptr address;
707 }
708 lt_preloaded_symbols[[]] =
709 {
710 EOF
711           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
712           cat <<\EOF >> conftest.$ac_ext
713   {0, (lt_ptr) 0}
714 };
715
716 #ifdef __cplusplus
717 }
718 #endif
719 EOF
720           # Now try linking the two files.
721           mv conftest.$ac_objext conftstm.$ac_objext
722           save_LIBS="$LIBS"
723           save_CFLAGS="$CFLAGS"
724           LIBS="conftstm.$ac_objext"
725           CFLAGS="$CFLAGS$no_builtin_flag"
726           if AC_TRY_EVAL(ac_link) && test -s conftest; then
727             pipe_works=yes
728           fi
729           LIBS="$save_LIBS"
730           CFLAGS="$save_CFLAGS"
731         else
732           echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
733         fi
734       else
735         echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
736       fi
737     else
738       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
739     fi
740   else
741     echo "$progname: failed program was:" >&AC_FD_CC
742     cat conftest.$ac_ext >&5
743   fi
744   rm -f conftest* conftst*
745
746   # Do not use the global_symbol_pipe unless it works.
747   if test "$pipe_works" = yes; then
748     break
749   else
750     lt_cv_sys_global_symbol_pipe=
751   fi
752 done
753 ])
754 global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
755 if test -z "$lt_cv_sys_global_symbol_pipe"; then
756   global_symbol_to_cdecl=
757   global_symbol_to_c_name_address=
758 else
759   global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
760   global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
761 fi
762 if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
763 then
764   AC_MSG_RESULT(failed)
765 else
766   AC_MSG_RESULT(ok)
767 fi
768 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
769
770 # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
771 # ---------------------------------
772 AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
773 [# Find the correct PATH separator.  Usually this is `:', but
774 # DJGPP uses `;' like DOS.
775 if test "X${PATH_SEPARATOR+set}" != Xset; then
776   UNAME=${UNAME-`uname 2>/dev/null`}
777   case X$UNAME in
778     *-DOS) lt_cv_sys_path_separator=';' ;;
779     *)     lt_cv_sys_path_separator=':' ;;
780   esac
781   PATH_SEPARATOR=$lt_cv_sys_path_separator
782 fi
783 ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
784
785 # _LT_AC_PROG_ECHO_BACKSLASH
786 # --------------------------
787 # Add some code to the start of the generated configure script which
788 # will find an echo command which doesn't interpret backslashes.
789 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
790 [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
791                               [AC_DIVERT_PUSH(NOTICE)])
792 _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
793
794 # Check that we are running under the correct shell.
795 SHELL=${CONFIG_SHELL-/bin/sh}
796
797 case X$ECHO in
798 X*--fallback-echo)
799   # Remove one level of quotation (which was required for Make).
800   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
801   ;;
802 esac
803
804 echo=${ECHO-echo}
805 if test "X[$]1" = X--no-reexec; then
806   # Discard the --no-reexec flag, and continue.
807   shift
808 elif test "X[$]1" = X--fallback-echo; then
809   # Avoid inline document here, it may be left over
810   :
811 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
812   # Yippee, $echo works!
813   :
814 else
815   # Restart under the correct shell.
816   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
817 fi
818
819 if test "X[$]1" = X--fallback-echo; then
820   # used as fallback echo
821   shift
822   cat <<EOF
823 $*
824 EOF
825   exit 0
826 fi
827
828 # The HP-UX ksh and POSIX shell print the target directory to stdout
829 # if CDPATH is set.
830 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
831
832 if test -z "$ECHO"; then
833 if test "X${echo_test_string+set}" != Xset; then
834 # find a string as large as possible, as long as the shell can cope with it
835   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
836     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
837     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
838        echo_test_string="`eval $cmd`" &&
839        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
840     then
841       break
842     fi
843   done
844 fi
845
846 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
847    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
848    test "X$echo_testing_string" = "X$echo_test_string"; then
849   :
850 else
851   # The Solaris, AIX, and Digital Unix default echo programs unquote
852   # backslashes.  This makes it impossible to quote backslashes using
853   #   echo "$something" | sed 's/\\/\\\\/g'
854   #
855   # So, first we look for a working echo in the user's PATH.
856
857   IFS="${IFS=   }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
858   for dir in $PATH /usr/ucb; do
859     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
860        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
861        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
862        test "X$echo_testing_string" = "X$echo_test_string"; then
863       echo="$dir/echo"
864       break
865     fi
866   done
867   IFS="$save_ifs"
868
869   if test "X$echo" = Xecho; then
870     # We didn't find a better echo, so look for alternatives.
871     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
872        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
873        test "X$echo_testing_string" = "X$echo_test_string"; then
874       # This shell has a builtin print -r that does the trick.
875       echo='print -r'
876     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
877          test "X$CONFIG_SHELL" != X/bin/ksh; then
878       # If we have ksh, try running configure again with it.
879       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
880       export ORIGINAL_CONFIG_SHELL
881       CONFIG_SHELL=/bin/ksh
882       export CONFIG_SHELL
883       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
884     else
885       # Try using printf.
886       echo='printf %s\n'
887       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
888          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
889          test "X$echo_testing_string" = "X$echo_test_string"; then
890         # Cool, printf works
891         :
892       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
893            test "X$echo_testing_string" = 'X\t' &&
894            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
895            test "X$echo_testing_string" = "X$echo_test_string"; then
896         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
897         export CONFIG_SHELL
898         SHELL="$CONFIG_SHELL"
899         export SHELL
900         echo="$CONFIG_SHELL [$]0 --fallback-echo"
901       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
902            test "X$echo_testing_string" = 'X\t' &&
903            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
904            test "X$echo_testing_string" = "X$echo_test_string"; then
905         echo="$CONFIG_SHELL [$]0 --fallback-echo"
906       else
907         # maybe with a smaller string...
908         prev=:
909
910         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
911           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
912           then
913             break
914           fi
915           prev="$cmd"
916         done
917
918         if test "$prev" != 'sed 50q "[$]0"'; then
919           echo_test_string=`eval $prev`
920           export echo_test_string
921           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
922         else
923           # Oops.  We lost completely, so just stick with echo.
924           echo=echo
925         fi
926       fi
927     fi
928   fi
929 fi
930 fi
931
932 # Copy echo and quote the copy suitably for passing to libtool from
933 # the Makefile, instead of quoting the original, which is used later.
934 ECHO=$echo
935 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
936    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
937 fi
938
939 AC_SUBST(ECHO)
940 AC_DIVERT_POP
941 ])# _LT_AC_PROG_ECHO_BACKSLASH
942
943 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
944 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
945 # ------------------------------------------------------------------
946 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
947 [if test "$cross_compiling" = yes; then :
948   [$4]
949 else
950   AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
951   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
952   lt_status=$lt_dlunknown
953   cat > conftest.$ac_ext <<EOF
954 [#line __oline__ "configure"
955 #include "confdefs.h"
956
957 #if HAVE_DLFCN_H
958 #include <dlfcn.h>
959 #endif
960
961 #include <stdio.h>
962
963 #ifdef RTLD_GLOBAL
964 #  define LT_DLGLOBAL           RTLD_GLOBAL
965 #else
966 #  ifdef DL_GLOBAL
967 #    define LT_DLGLOBAL         DL_GLOBAL
968 #  else
969 #    define LT_DLGLOBAL         0
970 #  endif
971 #endif
972
973 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
974    find out it does not work in some platform. */
975 #ifndef LT_DLLAZY_OR_NOW
976 #  ifdef RTLD_LAZY
977 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
978 #  else
979 #    ifdef DL_LAZY
980 #      define LT_DLLAZY_OR_NOW          DL_LAZY
981 #    else
982 #      ifdef RTLD_NOW
983 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
984 #      else
985 #        ifdef DL_NOW
986 #          define LT_DLLAZY_OR_NOW      DL_NOW
987 #        else
988 #          define LT_DLLAZY_OR_NOW      0
989 #        endif
990 #      endif
991 #    endif
992 #  endif
993 #endif
994
995 #ifdef __cplusplus
996 extern "C" void exit (int);
997 #endif
998
999 void fnord() { int i=42;}
1000 int main ()
1001 {
1002   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1003   int status = $lt_dlunknown;
1004
1005   if (self)
1006     {
1007       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1008       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1009       /* dlclose (self); */
1010     }
1011
1012     exit (status);
1013 }]
1014 EOF
1015   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1016     (./conftest; exit; ) 2>/dev/null
1017     lt_status=$?
1018     case x$lt_status in
1019       x$lt_dlno_uscore) $1 ;;
1020       x$lt_dlneed_uscore) $2 ;;
1021       x$lt_unknown|x*) $3 ;;
1022     esac
1023   else :
1024     # compilation failed
1025     $3
1026   fi
1027 fi
1028 rm -fr conftest*
1029 ])# _LT_AC_TRY_DLOPEN_SELF
1030
1031 # AC_LIBTOOL_DLOPEN_SELF
1032 # -------------------
1033 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1034 [if test "x$enable_dlopen" != xyes; then
1035   enable_dlopen=unknown
1036   enable_dlopen_self=unknown
1037   enable_dlopen_self_static=unknown
1038 else
1039   lt_cv_dlopen=no
1040   lt_cv_dlopen_libs=
1041
1042   case $host_os in
1043   beos*)
1044     lt_cv_dlopen="load_add_on"
1045     lt_cv_dlopen_libs=
1046     lt_cv_dlopen_self=yes
1047     ;;
1048
1049   cygwin* | mingw* | pw32*)
1050     lt_cv_dlopen="LoadLibrary"
1051     lt_cv_dlopen_libs=
1052    ;;
1053
1054   *)
1055     AC_CHECK_FUNC([shl_load],
1056           [lt_cv_dlopen="shl_load"],
1057       [AC_CHECK_LIB([dld], [shl_load],
1058             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
1059         [AC_CHECK_FUNC([dlopen],
1060               [lt_cv_dlopen="dlopen"],
1061           [AC_CHECK_LIB([dl], [dlopen],
1062                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1063             [AC_CHECK_LIB([svld], [dlopen],
1064                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1065               [AC_CHECK_LIB([dld], [dld_link],
1066                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
1067               ])
1068             ])
1069           ])
1070         ])
1071       ])
1072     ;;
1073   esac
1074
1075   if test "x$lt_cv_dlopen" != xno; then
1076     enable_dlopen=yes
1077   else
1078     enable_dlopen=no
1079   fi
1080
1081   case $lt_cv_dlopen in
1082   dlopen)
1083     save_CPPFLAGS="$CPPFLAGS"
1084     AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1085     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1086
1087     save_LDFLAGS="$LDFLAGS"
1088     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1089
1090     save_LIBS="$LIBS"
1091     LIBS="$lt_cv_dlopen_libs $LIBS"
1092
1093     AC_CACHE_CHECK([whether a program can dlopen itself],
1094           lt_cv_dlopen_self, [dnl
1095           _LT_AC_TRY_DLOPEN_SELF(
1096             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1097             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1098     ])
1099
1100     if test "x$lt_cv_dlopen_self" = xyes; then
1101       LDFLAGS="$LDFLAGS $link_static_flag"
1102       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1103           lt_cv_dlopen_self_static, [dnl
1104           _LT_AC_TRY_DLOPEN_SELF(
1105             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1106             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1107       ])
1108     fi
1109
1110     CPPFLAGS="$save_CPPFLAGS"
1111     LDFLAGS="$save_LDFLAGS"
1112     LIBS="$save_LIBS"
1113     ;;
1114   esac
1115
1116   case $lt_cv_dlopen_self in
1117   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1118   *) enable_dlopen_self=unknown ;;
1119   esac
1120
1121   case $lt_cv_dlopen_self_static in
1122   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1123   *) enable_dlopen_self_static=unknown ;;
1124   esac
1125 fi
1126 ])# AC_LIBTOOL_DLOPEN_SELF
1127
1128 AC_DEFUN([_LT_AC_LTCONFIG_HACK],
1129 [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
1130 # Sed substitution that helps us do robust quoting.  It backslashifies
1131 # metacharacters that are still active within double-quoted strings.
1132 Xsed='sed -e s/^X//'
1133 sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
1134
1135 # Same as above, but do not quote variable references.
1136 double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
1137
1138 # Sed substitution to delay expansion of an escaped shell variable in a
1139 # double_quote_subst'ed string.
1140 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1141
1142 # Constants:
1143 rm="rm -f"
1144
1145 # Global variables:
1146 default_ofile=libtool
1147 can_build_shared=yes
1148
1149 # All known linkers require a `.a' archive for static linking (except M$VC,
1150 # which needs '.lib').
1151 libext=a
1152 ltmain="$ac_aux_dir/ltmain.sh"
1153 ofile="$default_ofile"
1154 with_gnu_ld="$lt_cv_prog_gnu_ld"
1155 need_locks="$enable_libtool_lock"
1156
1157 old_CC="$CC"
1158 old_CFLAGS="$CFLAGS"
1159
1160 # Set sane defaults for various variables
1161 test -z "$AR" && AR=ar
1162 test -z "$AR_FLAGS" && AR_FLAGS=cru
1163 test -z "$AS" && AS=as
1164 test -z "$CC" && CC=cc
1165 test -z "$DLLTOOL" && DLLTOOL=dlltool
1166 test -z "$LD" && LD=ld
1167 test -z "$LN_S" && LN_S="ln -s"
1168 test -z "$MAGIC_CMD" && MAGIC_CMD=file
1169 test -z "$NM" && NM=nm
1170 test -z "$OBJDUMP" && OBJDUMP=objdump
1171 test -z "$RANLIB" && RANLIB=:
1172 test -z "$STRIP" && STRIP=:
1173 test -z "$ac_objext" && ac_objext=o
1174
1175 if test x"$host" != x"$build"; then
1176   ac_tool_prefix=${host_alias}-
1177 else
1178   ac_tool_prefix=
1179 fi
1180
1181 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1182 case $host_os in
1183 linux-gnu*) ;;
1184 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1185 esac
1186
1187 case $host_os in
1188 aix3*)
1189   # AIX sometimes has problems with the GCC collect2 program.  For some
1190   # reason, if we set the COLLECT_NAMES environment variable, the problems
1191   # vanish in a puff of smoke.
1192   if test "X${COLLECT_NAMES+set}" != Xset; then
1193     COLLECT_NAMES=
1194     export COLLECT_NAMES
1195   fi
1196   ;;
1197 esac
1198
1199 # Determine commands to create old-style static archives.
1200 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1201 old_postinstall_cmds='chmod 644 $oldlib'
1202 old_postuninstall_cmds=
1203
1204 if test -n "$RANLIB"; then
1205   case $host_os in
1206   openbsd*)
1207     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1208     ;;
1209   *)
1210     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1211     ;;
1212   esac
1213   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1214 fi
1215
1216 # Allow CC to be a program name with arguments.
1217 set dummy $CC
1218 compiler="[$]2"
1219
1220 AC_MSG_CHECKING([for objdir])
1221 rm -f .libs 2>/dev/null
1222 mkdir .libs 2>/dev/null
1223 if test -d .libs; then
1224   objdir=.libs
1225 else
1226   # MS-DOS does not allow filenames that begin with a dot.
1227   objdir=_libs
1228 fi
1229 rmdir .libs 2>/dev/null
1230 AC_MSG_RESULT($objdir)
1231
1232
1233 AC_ARG_WITH(pic,
1234 [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
1235 pic_mode="$withval", pic_mode=default)
1236 test -z "$pic_mode" && pic_mode=default
1237
1238 # We assume here that the value for lt_cv_prog_cc_pic will not be cached
1239 # in isolation, and that seeing it set (from the cache) indicates that
1240 # the associated values are set (in the cache) correctly too.
1241 AC_MSG_CHECKING([for $compiler option to produce PIC])
1242 AC_CACHE_VAL(lt_cv_prog_cc_pic,
1243 [ lt_cv_prog_cc_pic=
1244   lt_cv_prog_cc_shlib=
1245   lt_cv_prog_cc_wl=
1246   lt_cv_prog_cc_static=
1247   lt_cv_prog_cc_no_builtin=
1248   lt_cv_prog_cc_can_build_shared=$can_build_shared
1249
1250   if test "$GCC" = yes; then
1251     lt_cv_prog_cc_wl='-Wl,'
1252     lt_cv_prog_cc_static='-static'
1253
1254     case $host_os in
1255     aix*)
1256       # Below there is a dirty hack to force normal static linking with -ldl
1257       # The problem is because libdl dynamically linked with both libc and
1258       # libC (AIX C++ library), which obviously doesn't included in libraries
1259       # list by gcc. This cause undefined symbols with -static flags.
1260       # This hack allows C programs to be linked with "-static -ldl", but
1261       # not sure about C++ programs.
1262       lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
1263       ;;
1264     amigaos*)
1265       # FIXME: we need at least 68020 code to build shared libraries, but
1266       # adding the `-m68020' flag to GCC prevents building anything better,
1267       # like `-m68040'.
1268       lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
1269       ;;
1270     beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
1271       # PIC is the default for these OSes.
1272       ;;
1273     darwin* | rhapsody*)
1274       # PIC is the default on this platform
1275       # Common symbols not allowed in MH_DYLIB files
1276       lt_cv_prog_cc_pic='-fno-common'
1277       ;;
1278     cygwin* | mingw* | pw32* | os2*)
1279       # This hack is so that the source file can tell whether it is being
1280       # built for inclusion in a dll (and should export symbols for example).
1281       lt_cv_prog_cc_pic='-DDLL_EXPORT'
1282       ;;
1283     sysv4*MP*)
1284       if test -d /usr/nec; then
1285          lt_cv_prog_cc_pic=-Kconform_pic
1286       fi
1287       ;;
1288     *)
1289       lt_cv_prog_cc_pic='-fPIC'
1290       ;;
1291     esac
1292   else
1293     # PORTME Check for PIC flags for the system compiler.
1294     case $host_os in
1295     aix3* | aix4* | aix5*)
1296       lt_cv_prog_cc_wl='-Wl,'
1297       # All AIX code is PIC.
1298       if test "$host_cpu" = ia64; then
1299         # AIX 5 now supports IA64 processor
1300         lt_cv_prog_cc_static='-Bstatic'
1301       else
1302         lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
1303       fi
1304       ;;
1305
1306     hpux9* | hpux10* | hpux11*)
1307       # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
1308       lt_cv_prog_cc_wl='-Wl,'
1309       lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
1310       lt_cv_prog_cc_pic='+Z'
1311       ;;
1312
1313     irix5* | irix6*)
1314       lt_cv_prog_cc_wl='-Wl,'
1315       lt_cv_prog_cc_static='-non_shared'
1316       # PIC (with -KPIC) is the default.
1317       ;;
1318
1319     linux*)
1320       echo '__INTEL_COMPILER' > conftest.$ac_ext
1321       if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
1322       then
1323         lt_cv_prog_cc_can_build_shared=no
1324       else
1325         # Intel icc
1326         lt_cv_prog_cc_pic='-KPIC'
1327         lt_cv_prog_cc_static='-static'
1328         lt_cv_prog_cc_wl='-Qoption,ld,'
1329       fi
1330       ;;
1331
1332     cygwin* | mingw* | pw32* | os2*)
1333       # This hack is so that the source file can tell whether it is being
1334       # built for inclusion in a dll (and should export symbols for example).
1335       lt_cv_prog_cc_pic='-DDLL_EXPORT'
1336       ;;
1337
1338     newsos6)
1339       lt_cv_prog_cc_pic='-KPIC'
1340       lt_cv_prog_cc_static='-Bstatic'
1341       ;;
1342
1343     osf3* | osf4* | osf5*)
1344       # All OSF/1 code is PIC.
1345       lt_cv_prog_cc_wl='-Wl,'
1346       lt_cv_prog_cc_static='-non_shared'
1347       ;;
1348
1349     sco3.2v5*)
1350       lt_cv_prog_cc_pic='-Kpic'
1351       lt_cv_prog_cc_static='-dn'
1352       lt_cv_prog_cc_shlib='-belf'
1353       ;;
1354
1355     solaris*)
1356       lt_cv_prog_cc_pic='-KPIC'
1357       lt_cv_prog_cc_static='-Bstatic'
1358       lt_cv_prog_cc_wl='-Wl,'
1359       ;;
1360
1361     sunos4*)
1362       lt_cv_prog_cc_pic='-PIC'
1363       lt_cv_prog_cc_static='-Bstatic'
1364       lt_cv_prog_cc_wl='-Qoption ld '
1365       ;;
1366
1367     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
1368       lt_cv_prog_cc_pic='-KPIC'
1369       lt_cv_prog_cc_static='-Bstatic'
1370       if test "x$host_vendor" = xsni; then
1371         lt_cv_prog_cc_wl='-LD'
1372       else
1373         lt_cv_prog_cc_wl='-Wl,'
1374       fi
1375       ;;
1376
1377     uts4*)
1378       lt_cv_prog_cc_pic='-pic'
1379       lt_cv_prog_cc_static='-Bstatic'
1380       ;;
1381
1382     sysv4*MP*)
1383       if test -d /usr/nec ;then
1384         lt_cv_prog_cc_pic='-Kconform_pic'
1385         lt_cv_prog_cc_static='-Bstatic'
1386       fi
1387       ;;
1388
1389     *)
1390       lt_cv_prog_cc_can_build_shared=no
1391       ;;
1392     esac
1393   fi
1394 ])
1395 if test -z "$lt_cv_prog_cc_pic"; then
1396   AC_MSG_RESULT([none])
1397 else
1398   AC_MSG_RESULT([$lt_cv_prog_cc_pic])
1399
1400   # Check to make sure the pic_flag actually works.
1401   AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
1402   AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
1403     save_CFLAGS="$CFLAGS"
1404     CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
1405     AC_TRY_COMPILE([], [], [dnl
1406       case $host_os in
1407       hpux9* | hpux10* | hpux11*)
1408         # On HP-UX, both CC and GCC only warn that PIC is supported... then
1409         # they create non-PIC objects.  So, if there were any warnings, we
1410         # assume that PIC is not supported.
1411         if test -s conftest.err; then
1412           lt_cv_prog_cc_pic_works=no
1413         else
1414           lt_cv_prog_cc_pic_works=yes
1415         fi
1416         ;;
1417       *)
1418         lt_cv_prog_cc_pic_works=yes
1419         ;;
1420       esac
1421     ], [dnl
1422       lt_cv_prog_cc_pic_works=no
1423     ])
1424     CFLAGS="$save_CFLAGS"
1425   ])
1426
1427   if test "X$lt_cv_prog_cc_pic_works" = Xno; then
1428     lt_cv_prog_cc_pic=
1429     lt_cv_prog_cc_can_build_shared=no
1430   else
1431     lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
1432   fi
1433
1434   AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
1435 fi
1436
1437 # Check for any special shared library compilation flags.
1438 if test -n "$lt_cv_prog_cc_shlib"; then
1439   AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
1440   if echo "$old_CC $old_CFLAGS " | egrep -e "[[         ]]$lt_cv_prog_cc_shlib[[        ]]" >/dev/null; then :
1441   else
1442    AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
1443     lt_cv_prog_cc_can_build_shared=no
1444   fi
1445 fi
1446
1447 AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
1448 AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
1449   lt_cv_prog_cc_static_works=no
1450   save_LDFLAGS="$LDFLAGS"
1451   LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
1452   AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
1453   LDFLAGS="$save_LDFLAGS"
1454 ])
1455
1456 # Belt *and* braces to stop my trousers falling down:
1457 test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
1458 AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
1459
1460 pic_flag="$lt_cv_prog_cc_pic"
1461 special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
1462 wl="$lt_cv_prog_cc_wl"
1463 link_static_flag="$lt_cv_prog_cc_static"
1464 no_builtin_flag="$lt_cv_prog_cc_no_builtin"
1465 can_build_shared="$lt_cv_prog_cc_can_build_shared"
1466
1467
1468 # Check to see if options -o and -c are simultaneously supported by compiler
1469 AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
1470 AC_CACHE_VAL([lt_cv_compiler_c_o], [
1471 $rm -r conftest 2>/dev/null
1472 mkdir conftest
1473 cd conftest
1474 echo "int some_variable = 0;" > conftest.$ac_ext
1475 mkdir out
1476 # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
1477 # that will create temporary files in the current directory regardless of
1478 # the output directory.  Thus, making CWD read-only will cause this test
1479 # to fail, enabling locking or at least warning the user not to do parallel
1480 # builds.
1481 chmod -w .
1482 save_CFLAGS="$CFLAGS"
1483 CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
1484 compiler_c_o=no
1485 if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
1486   # The compiler can only warn and ignore the option if not recognized
1487   # So say no if there are warnings
1488   if test -s out/conftest.err; then
1489     lt_cv_compiler_c_o=no
1490   else
1491     lt_cv_compiler_c_o=yes
1492   fi
1493 else
1494   # Append any errors to the config.log.
1495   cat out/conftest.err 1>&AC_FD_CC
1496   lt_cv_compiler_c_o=no
1497 fi
1498 CFLAGS="$save_CFLAGS"
1499 chmod u+w .
1500 $rm conftest* out/*
1501 rmdir out
1502 cd ..
1503 rmdir conftest
1504 $rm -r conftest 2>/dev/null
1505 ])
1506 compiler_c_o=$lt_cv_compiler_c_o
1507 AC_MSG_RESULT([$compiler_c_o])
1508
1509 if test x"$compiler_c_o" = x"yes"; then
1510   # Check to see if we can write to a .lo
1511   AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
1512   AC_CACHE_VAL([lt_cv_compiler_o_lo], [
1513   lt_cv_compiler_o_lo=no
1514   save_CFLAGS="$CFLAGS"
1515   CFLAGS="$CFLAGS -c -o conftest.lo"
1516   save_objext="$ac_objext"
1517   ac_objext=lo
1518   AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1519     # The compiler can only warn and ignore the option if not recognized
1520     # So say no if there are warnings
1521     if test -s conftest.err; then
1522       lt_cv_compiler_o_lo=no
1523     else
1524       lt_cv_compiler_o_lo=yes
1525     fi
1526   ])
1527   ac_objext="$save_objext"
1528   CFLAGS="$save_CFLAGS"
1529   ])
1530   compiler_o_lo=$lt_cv_compiler_o_lo
1531   AC_MSG_RESULT([$compiler_o_lo])
1532 else
1533   compiler_o_lo=no
1534 fi
1535
1536 # Check to see if we can do hard links to lock some files if needed
1537 hard_links="nottested"
1538 if test "$compiler_c_o" = no && test "$need_locks" != no; then
1539   # do not overwrite the value of need_locks provided by the user
1540   AC_MSG_CHECKING([if we can lock with hard links])
1541   hard_links=yes
1542   $rm conftest*
1543   ln conftest.a conftest.b 2>/dev/null && hard_links=no
1544   touch conftest.a
1545   ln conftest.a conftest.b 2>&5 || hard_links=no
1546   ln conftest.a conftest.b 2>/dev/null && hard_links=no
1547   AC_MSG_RESULT([$hard_links])
1548   if test "$hard_links" = no; then
1549     AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
1550     need_locks=warn
1551   fi
1552 else
1553   need_locks=no
1554 fi
1555
1556 if test "$GCC" = yes; then
1557   # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
1558   AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
1559   echo "int some_variable = 0;" > conftest.$ac_ext
1560   save_CFLAGS="$CFLAGS"
1561   CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
1562   compiler_rtti_exceptions=no
1563   AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
1564     # The compiler can only warn and ignore the option if not recognized
1565     # So say no if there are warnings
1566     if test -s conftest.err; then
1567       compiler_rtti_exceptions=no
1568     else
1569       compiler_rtti_exceptions=yes
1570     fi
1571   ])
1572   CFLAGS="$save_CFLAGS"
1573   AC_MSG_RESULT([$compiler_rtti_exceptions])
1574
1575   if test "$compiler_rtti_exceptions" = "yes"; then
1576     no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
1577   else
1578     no_builtin_flag=' -fno-builtin'
1579   fi
1580 fi
1581
1582 # See if the linker supports building shared libraries.
1583 AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
1584
1585 allow_undefined_flag=
1586 no_undefined_flag=
1587 need_lib_prefix=unknown
1588 need_version=unknown
1589 # when you set need_version to no, make sure it does not cause -set_version
1590 # flags to be left without arguments
1591 archive_cmds=
1592 archive_expsym_cmds=
1593 old_archive_from_new_cmds=
1594 old_archive_from_expsyms_cmds=
1595 export_dynamic_flag_spec=
1596 whole_archive_flag_spec=
1597 thread_safe_flag_spec=
1598 hardcode_into_libs=no
1599 hardcode_libdir_flag_spec=
1600 hardcode_libdir_separator=
1601 hardcode_direct=no
1602 hardcode_minus_L=no
1603 hardcode_shlibpath_var=unsupported
1604 runpath_var=
1605 link_all_deplibs=unknown
1606 always_export_symbols=no
1607 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1608 # include_expsyms should be a list of space-separated symbols to be *always*
1609 # included in the symbol list
1610 include_expsyms=
1611 # exclude_expsyms can be an egrep regular expression of symbols to exclude
1612 # it will be wrapped by ` (' and `)$', so one must not match beginning or
1613 # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1614 # as well as any symbol that contains `d'.
1615 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
1616 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
1617 # platforms (ab)use it in PIC code, but their linkers get confused if
1618 # the symbol is explicitly referenced.  Since portable code cannot
1619 # rely on this symbol name, it's probably fine to never include it in
1620 # preloaded symbol tables.
1621 extract_expsyms_cmds=
1622
1623 case $host_os in
1624 cygwin* | mingw* | pw32*)
1625   # FIXME: the MSVC++ port hasn't been tested in a loooong time
1626   # When not using gcc, we currently assume that we are using
1627   # Microsoft Visual C++.
1628   if test "$GCC" != yes; then
1629     with_gnu_ld=no
1630   fi
1631   ;;
1632 openbsd*)
1633   with_gnu_ld=no
1634   ;;
1635 esac
1636
1637 ld_shlibs=yes
1638 if test "$with_gnu_ld" = yes; then
1639   # If archive_cmds runs LD, not CC, wlarc should be empty
1640   wlarc='${wl}'
1641
1642   # See if GNU ld supports shared libraries.
1643   case $host_os in
1644   aix3* | aix4* | aix5*)
1645     # On AIX, the GNU linker is very broken
1646     # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
1647     ld_shlibs=no
1648     cat <<EOF 1>&2
1649
1650 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
1651 *** to be unable to reliably create shared libraries on AIX.
1652 *** Therefore, libtool is disabling shared libraries support.  If you
1653 *** really care for shared libraries, you may want to modify your PATH
1654 *** so that a non-GNU linker is found, and then restart.
1655
1656 EOF
1657     ;;
1658
1659   amigaos*)
1660     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)'
1661     hardcode_libdir_flag_spec='-L$libdir'
1662     hardcode_minus_L=yes
1663
1664     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1665     # that the semantics of dynamic libraries on AmigaOS, at least up
1666     # to version 4, is to share data among multiple programs linked
1667     # with the same dynamic library.  Since this doesn't match the
1668     # behavior of shared libraries on other platforms, we can use
1669     # them.
1670     ld_shlibs=no
1671     ;;
1672
1673   beos*)
1674     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1675       allow_undefined_flag=unsupported
1676       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1677       # support --undefined.  This deserves some investigation.  FIXME
1678       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1679     else
1680       ld_shlibs=no
1681     fi
1682     ;;
1683
1684   cygwin* | mingw* | pw32*)
1685     # hardcode_libdir_flag_spec is actually meaningless, as there is
1686     # no search path for DLLs.
1687     hardcode_libdir_flag_spec='-L$libdir'
1688     allow_undefined_flag=unsupported
1689     always_export_symbols=yes
1690
1691     extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
1692       sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
1693       test -f $output_objdir/impgen.exe || (cd $output_objdir && \
1694       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
1695       else $CC -o impgen impgen.c ; fi)~
1696       $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
1697
1698     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
1699
1700     # cygwin and mingw dlls have different entry points and sets of symbols
1701     # to exclude.
1702     # FIXME: what about values for MSVC?
1703     dll_entry=__cygwin_dll_entry@12
1704     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
1705     case $host_os in
1706     mingw*)
1707       # mingw values
1708       dll_entry=_DllMainCRTStartup@12
1709       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
1710       ;;
1711     esac
1712
1713     # mingw and cygwin differ, and it's simplest to just exclude the union
1714     # of the two symbol sets.
1715     dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
1716
1717     # recent cygwin and mingw systems supply a stub DllMain which the user
1718     # can override, but on older systems we have to supply one (in ltdll.c)
1719     if test "x$lt_cv_need_dllmain" = "xyes"; then
1720       ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
1721       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~
1722         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
1723     else
1724       ltdll_obj=
1725       ltdll_cmds=
1726     fi
1727
1728     # Extract the symbol export list from an `--export-all' def file,
1729     # then regenerate the def file from the symbol export list, so that
1730     # the compiled dll only exports the symbol export list.
1731     # Be careful not to strip the DATA tag left be newer dlltools.
1732     export_symbols_cmds="$ltdll_cmds"'
1733       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
1734       sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
1735
1736     # If the export-symbols file already is a .def file (1st line
1737     # is EXPORTS), use it as is.
1738     # If DATA tags from a recent dlltool are present, honour them!
1739     archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
1740         cp $export_symbols $output_objdir/$soname-def;
1741       else
1742         echo EXPORTS > $output_objdir/$soname-def;
1743         _lt_hint=1;
1744         cat $export_symbols | while read symbol; do
1745          set dummy \$symbol;
1746          case \[$]# in
1747            2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
1748            *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
1749          esac;
1750          _lt_hint=`expr 1 + \$_lt_hint`;
1751         done;
1752       fi~
1753       '"$ltdll_cmds"'
1754       $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~
1755       $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~
1756       $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~
1757       $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~
1758       $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
1759     ;;
1760
1761   netbsd*)
1762     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1763       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
1764       wlarc=
1765     else
1766       archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1767       archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1768     fi
1769     ;;
1770
1771   solaris* | sysv5*)
1772     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1773       ld_shlibs=no
1774       cat <<EOF 1>&2
1775
1776 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
1777 *** create shared libraries on Solaris systems.  Therefore, libtool
1778 *** is disabling shared libraries support.  We urge you to upgrade GNU
1779 *** binutils to release 2.9.1 or newer.  Another option is to modify
1780 *** your PATH or compiler configuration so that the native linker is
1781 *** used, and then restart.
1782
1783 EOF
1784     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1785       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1786       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1787     else
1788       ld_shlibs=no
1789     fi
1790     ;;
1791
1792   sunos4*)
1793     archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
1794     wlarc=
1795     hardcode_direct=yes
1796     hardcode_shlibpath_var=no
1797     ;;
1798
1799   *)
1800     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1801       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
1802       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1803     else
1804       ld_shlibs=no
1805     fi
1806     ;;
1807   esac
1808
1809   if test "$ld_shlibs" = yes; then
1810     runpath_var=LD_RUN_PATH
1811     hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1812     export_dynamic_flag_spec='${wl}--export-dynamic'
1813     case $host_os in
1814     cygwin* | mingw* | pw32*)
1815       # dlltool doesn't understand --whole-archive et. al.
1816       whole_archive_flag_spec=
1817       ;;
1818     *)
1819       # ancient GNU ld didn't support --whole-archive et. al.
1820       if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
1821         whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1822       else
1823         whole_archive_flag_spec=
1824       fi
1825       ;;
1826     esac
1827   fi
1828 else
1829   # PORTME fill in a description of your system's linker (not GNU ld)
1830   case $host_os in
1831   aix3*)
1832     allow_undefined_flag=unsupported
1833     always_export_symbols=yes
1834     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'
1835     # Note: this linker hardcodes the directories in LIBPATH if there
1836     # are no directories specified by -L.
1837     hardcode_minus_L=yes
1838     if test "$GCC" = yes && test -z "$link_static_flag"; then
1839       # Neither direct hardcoding nor static linking is supported with a
1840       # broken collect2.
1841       hardcode_direct=unsupported
1842     fi
1843     ;;
1844
1845   aix4* | aix5*)
1846     if test "$host_cpu" = ia64; then
1847       # On IA64, the linker does run time linking by default, so we don't
1848       # have to do anything special.
1849       aix_use_runtimelinking=no
1850       exp_sym_flag='-Bexport'
1851       no_entry_flag=""
1852     else
1853       aix_use_runtimelinking=no
1854
1855       # Test if we are trying to use run time linking or normal
1856       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
1857       # need to do runtime linking.
1858       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
1859         for ld_flag in $LDFLAGS; do
1860           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
1861             aix_use_runtimelinking=yes
1862             break
1863           fi
1864         done
1865       esac
1866
1867       exp_sym_flag='-bexport'
1868       no_entry_flag='-bnoentry'
1869     fi
1870
1871     # When large executables or shared objects are built, AIX ld can
1872     # have problems creating the table of contents.  If linking a library
1873     # or program results in "error TOC overflow" add -mminimal-toc to
1874     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
1875     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
1876
1877     hardcode_direct=yes
1878     archive_cmds=''
1879     hardcode_libdir_separator=':'
1880     if test "$GCC" = yes; then
1881       case $host_os in aix4.[[012]]|aix4.[[012]].*)
1882         collect2name=`${CC} -print-prog-name=collect2`
1883         if test -f "$collect2name" && \
1884           strings "$collect2name" | grep resolve_lib_name >/dev/null
1885         then
1886           # We have reworked collect2
1887           hardcode_direct=yes
1888         else
1889           # We have old collect2
1890           hardcode_direct=unsupported
1891           # It fails to find uninstalled libraries when the uninstalled
1892           # path is not listed in the libpath.  Setting hardcode_minus_L
1893           # to unsupported forces relinking
1894           hardcode_minus_L=yes
1895           hardcode_libdir_flag_spec='-L$libdir'
1896           hardcode_libdir_separator=
1897         fi
1898       esac
1899
1900       shared_flag='-shared'
1901     else
1902       # not using gcc
1903       if test "$host_cpu" = ia64; then
1904         shared_flag='${wl}-G'
1905       else
1906         if test "$aix_use_runtimelinking" = yes; then
1907           shared_flag='${wl}-G'
1908         else
1909           shared_flag='${wl}-bM:SRE'
1910         fi
1911       fi
1912     fi
1913
1914     # It seems that -bexpall can do strange things, so it is better to
1915     # generate a list of symbols to export.
1916     always_export_symbols=yes
1917     if test "$aix_use_runtimelinking" = yes; then
1918       # Warning - without using the other runtime loading flags (-brtl),
1919       # -berok will link without error, but may produce a broken library.
1920       allow_undefined_flag='-berok'
1921       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
1922       archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
1923     else
1924       if test "$host_cpu" = ia64; then
1925         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
1926         allow_undefined_flag="-z nodefs"
1927         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"
1928       else
1929         hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
1930         # Warning - without using the other run time loading flags,
1931         # -berok will link without error, but may produce a broken library.
1932         allow_undefined_flag='${wl}-berok'
1933         # This is a bit strange, but is similar to how AIX traditionally builds
1934         # it's shared libraries.
1935         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'
1936       fi
1937     fi
1938     ;;
1939
1940   amigaos*)
1941     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)'
1942     hardcode_libdir_flag_spec='-L$libdir'
1943     hardcode_minus_L=yes
1944     # see comment about different semantics on the GNU ld section
1945     ld_shlibs=no
1946     ;;
1947
1948   cygwin* | mingw* | pw32*)
1949     # When not using gcc, we currently assume that we are using
1950     # Microsoft Visual C++.
1951     # hardcode_libdir_flag_spec is actually meaningless, as there is
1952     # no search path for DLLs.
1953     hardcode_libdir_flag_spec=' '
1954     allow_undefined_flag=unsupported
1955     # Tell ltmain to make .lib files, not .a files.
1956     libext=lib
1957     # FIXME: Setting linknames here is a bad hack.
1958     archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1959     # The linker will automatically build a .lib file if we build a DLL.
1960     old_archive_from_new_cmds='true'
1961     # FIXME: Should let the user specify the lib program.
1962     old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
1963     fix_srcfile_path='`cygpath -w "$srcfile"`'
1964     ;;
1965
1966   darwin* | rhapsody*)
1967     case "$host_os" in
1968     rhapsody* | darwin1.[[012]])
1969       allow_undefined_flag='-undefined suppress'
1970       ;;
1971     *) # Darwin 1.3 on
1972       allow_undefined_flag='-flat_namespace -undefined suppress'
1973       ;;
1974     esac
1975     # FIXME: Relying on posixy $() will cause problems for
1976     #        cross-compilation, but unfortunately the echo tests do not
1977     #        yet detect zsh echo's removal of \ escapes.
1978     archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
1979     # We need to add '_' to the symbols in $export_symbols first
1980     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
1981     hardcode_direct=yes
1982     hardcode_shlibpath_var=no
1983     whole_archive_flag_spec='-all_load $convenience'
1984     ;;
1985
1986   freebsd1*)
1987     ld_shlibs=no
1988     ;;
1989
1990   # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1991   # support.  Future versions do this automatically, but an explicit c++rt0.o
1992   # does not break anything, and helps significantly (at the cost of a little
1993   # extra space).
1994   freebsd2.2*)
1995     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
1996     hardcode_libdir_flag_spec='-R$libdir'
1997     hardcode_direct=yes
1998     hardcode_shlibpath_var=no
1999     ;;
2000
2001   # Unfortunately, older versions of FreeBSD 2 do not have this feature.
2002   freebsd2*)
2003     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2004     hardcode_direct=yes
2005     hardcode_minus_L=yes
2006     hardcode_shlibpath_var=no
2007     ;;
2008
2009   # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
2010   freebsd*)
2011     archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
2012     hardcode_libdir_flag_spec='-R$libdir'
2013     hardcode_direct=yes
2014     hardcode_shlibpath_var=no
2015     ;;
2016
2017   hpux9* | hpux10* | hpux11*)
2018     case $host_os in
2019     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' ;;
2020     *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
2021     esac
2022     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
2023     hardcode_libdir_separator=:
2024     hardcode_direct=yes
2025     hardcode_minus_L=yes # Not in the search PATH, but as the default
2026                          # location of the library.
2027     export_dynamic_flag_spec='${wl}-E'
2028     ;;
2029
2030   irix5* | irix6*)
2031     if test "$GCC" = yes; then
2032       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'
2033     else
2034       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'
2035     fi
2036     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2037     hardcode_libdir_separator=:
2038     link_all_deplibs=yes
2039     ;;
2040
2041   netbsd*)
2042     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2043       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
2044     else
2045       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
2046     fi
2047     hardcode_libdir_flag_spec='-R$libdir'
2048     hardcode_direct=yes
2049     hardcode_shlibpath_var=no
2050     ;;
2051
2052   newsos6)
2053     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2054     hardcode_direct=yes
2055     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2056     hardcode_libdir_separator=:
2057     hardcode_shlibpath_var=no
2058     ;;
2059
2060   openbsd*)
2061     hardcode_direct=yes
2062     hardcode_shlibpath_var=no
2063     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2064       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2065       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2066       export_dynamic_flag_spec='${wl}-E'
2067     else
2068       case "$host_os" in
2069       openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
2070         archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
2071         hardcode_libdir_flag_spec='-R$libdir'
2072         ;;
2073       *)
2074         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
2075         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
2076         ;;
2077       esac
2078     fi
2079     ;;
2080
2081   os2*)
2082     hardcode_libdir_flag_spec='-L$libdir'
2083     hardcode_minus_L=yes
2084     allow_undefined_flag=unsupported
2085     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'
2086     old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
2087     ;;
2088
2089   osf3*)
2090     if test "$GCC" = yes; then
2091       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2092       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'
2093     else
2094       allow_undefined_flag=' -expect_unresolved \*'
2095       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'
2096     fi
2097     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2098     hardcode_libdir_separator=:
2099     ;;
2100
2101   osf4* | osf5*)        # as osf3* with the addition of -msym flag
2102     if test "$GCC" = yes; then
2103       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
2104       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'
2105       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
2106     else
2107       allow_undefined_flag=' -expect_unresolved \*'
2108       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'
2109       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
2110       $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'
2111
2112       #Both c and cxx compiler support -rpath directly
2113       hardcode_libdir_flag_spec='-rpath $libdir'
2114     fi
2115     hardcode_libdir_separator=:
2116     ;;
2117
2118   sco3.2v5*)
2119     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2120     hardcode_shlibpath_var=no
2121     runpath_var=LD_RUN_PATH
2122     hardcode_runpath_var=yes
2123     export_dynamic_flag_spec='${wl}-Bexport'
2124     ;;
2125
2126   solaris*)
2127     # gcc --version < 3.0 without binutils cannot create self contained
2128     # shared libraries reliably, requiring libgcc.a to resolve some of
2129     # the object symbols generated in some cases.  Libraries that use
2130     # assert need libgcc.a to resolve __eprintf, for example.  Linking
2131     # a copy of libgcc.a into every shared library to guarantee resolving
2132     # such symbols causes other problems:  According to Tim Van Holder
2133     # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
2134     # (to the application) exception stack for one thing.
2135     no_undefined_flag=' -z defs'
2136     if test "$GCC" = yes; then
2137       case `$CC --version 2>/dev/null` in
2138       [[12]].*)
2139         cat <<EOF 1>&2
2140
2141 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably
2142 *** create self contained shared libraries on Solaris systems, without
2143 *** introducing a dependency on libgcc.a.  Therefore, libtool is disabling
2144 *** -no-undefined support, which will at least allow you to build shared
2145 *** libraries.  However, you may find that when you link such libraries
2146 *** into an application without using GCC, you have to manually add
2147 *** \`gcc --print-libgcc-file-name\` to the link command.  We urge you to
2148 *** upgrade to a newer version of GCC.  Another option is to rebuild your
2149 *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
2150
2151 EOF
2152         no_undefined_flag=
2153         ;;
2154       esac
2155     fi
2156     # $CC -shared without GNU ld will not create a library from C++
2157     # object files and a static libstdc++, better avoid it by now
2158     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2159     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2160                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2161     hardcode_libdir_flag_spec='-R$libdir'
2162     hardcode_shlibpath_var=no
2163     case $host_os in
2164     solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
2165     *) # Supported since Solaris 2.6 (maybe 2.5.1?)
2166       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
2167     esac
2168     link_all_deplibs=yes
2169     ;;
2170
2171   sunos4*)
2172     if test "x$host_vendor" = xsequent; then
2173       # Use $CC to link under sequent, because it throws in some extra .o
2174       # files that make .init and .fini sections work.
2175       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
2176     else
2177       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
2178     fi
2179     hardcode_libdir_flag_spec='-L$libdir'
2180     hardcode_direct=yes
2181     hardcode_minus_L=yes
2182     hardcode_shlibpath_var=no
2183     ;;
2184
2185   sysv4)
2186     if test "x$host_vendor" = xsno; then
2187       archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
2188       hardcode_direct=yes # is this really true???
2189     else
2190       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2191       hardcode_direct=no #Motorola manual says yes, but my tests say they lie
2192     fi
2193     runpath_var='LD_RUN_PATH'
2194     hardcode_shlibpath_var=no
2195     ;;
2196
2197   sysv4.3*)
2198     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2199     hardcode_shlibpath_var=no
2200     export_dynamic_flag_spec='-Bexport'
2201     ;;
2202
2203   sysv5*)
2204     no_undefined_flag=' -z text'
2205     # $CC -shared without GNU ld will not create a library from C++
2206     # object files and a static libstdc++, better avoid it by now
2207     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
2208     archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
2209                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
2210     hardcode_libdir_flag_spec=
2211     hardcode_shlibpath_var=no
2212     runpath_var='LD_RUN_PATH'
2213     ;;
2214
2215   uts4*)
2216     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2217     hardcode_libdir_flag_spec='-L$libdir'
2218     hardcode_shlibpath_var=no
2219     ;;
2220
2221   dgux*)
2222     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2223     hardcode_libdir_flag_spec='-L$libdir'
2224     hardcode_shlibpath_var=no
2225     ;;
2226
2227   sysv4*MP*)
2228     if test -d /usr/nec; then
2229       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
2230       hardcode_shlibpath_var=no
2231       runpath_var=LD_RUN_PATH
2232       hardcode_runpath_var=yes
2233       ld_shlibs=yes
2234     fi
2235     ;;
2236
2237   sysv4.2uw2*)
2238     archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
2239     hardcode_direct=yes
2240     hardcode_minus_L=no
2241     hardcode_shlibpath_var=no
2242     hardcode_runpath_var=yes
2243     runpath_var=LD_RUN_PATH
2244     ;;
2245
2246   sysv5uw7* | unixware7*)
2247     no_undefined_flag='${wl}-z ${wl}text'
2248     if test "$GCC" = yes; then
2249       archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2250     else
2251       archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
2252     fi
2253     runpath_var='LD_RUN_PATH'
2254     hardcode_shlibpath_var=no
2255     ;;
2256
2257   *)
2258     ld_shlibs=no
2259     ;;
2260   esac
2261 fi
2262 AC_MSG_RESULT([$ld_shlibs])
2263 test "$ld_shlibs" = no && can_build_shared=no
2264
2265 # Check hardcoding attributes.
2266 AC_MSG_CHECKING([how to hardcode library paths into programs])
2267 hardcode_action=
2268 if test -n "$hardcode_libdir_flag_spec" || \
2269    test -n "$runpath_var"; then
2270
2271   # We can hardcode non-existant directories.
2272   if test "$hardcode_direct" != no &&
2273      # If the only mechanism to avoid hardcoding is shlibpath_var, we
2274      # have to relink, otherwise we might link with an installed library
2275      # when we should be linking with a yet-to-be-installed one
2276      ## test "$hardcode_shlibpath_var" != no &&
2277      test "$hardcode_minus_L" != no; then
2278     # Linking always hardcodes the temporary library directory.
2279     hardcode_action=relink
2280   else
2281     # We can link without hardcoding, and we can hardcode nonexisting dirs.
2282     hardcode_action=immediate
2283   fi
2284 else
2285   # We cannot hardcode anything, or else we can only hardcode existing
2286   # directories.
2287   hardcode_action=unsupported
2288 fi
2289 AC_MSG_RESULT([$hardcode_action])
2290
2291 striplib=
2292 old_striplib=
2293 AC_MSG_CHECKING([whether stripping libraries is possible])
2294 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2295   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2296   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2297   AC_MSG_RESULT([yes])
2298 else
2299   AC_MSG_RESULT([no])
2300 fi
2301
2302 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2303 test -z "$deplibs_check_method" && deplibs_check_method=unknown
2304
2305 # PORTME Fill in your ld.so characteristics
2306 AC_MSG_CHECKING([dynamic linker characteristics])
2307 library_names_spec=
2308 libname_spec='lib$name'
2309 soname_spec=
2310 postinstall_cmds=
2311 postuninstall_cmds=
2312 finish_cmds=
2313 finish_eval=
2314 shlibpath_var=
2315 shlibpath_overrides_runpath=unknown
2316 version_type=none
2317 dynamic_linker="$host_os ld.so"
2318 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2319 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2320
2321 case $host_os in
2322 aix3*)
2323   version_type=linux
2324   library_names_spec='${libname}${release}.so$versuffix $libname.a'
2325   shlibpath_var=LIBPATH
2326
2327   # AIX has no versioning support, so we append a major version to the name.
2328   soname_spec='${libname}${release}.so$major'
2329   ;;
2330
2331 aix4* | aix5*)
2332   version_type=linux
2333   if test "$host_cpu" = ia64; then
2334     # AIX 5 supports IA64
2335     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
2336     shlibpath_var=LD_LIBRARY_PATH
2337   else
2338     # With GCC up to 2.95.x, collect2 would create an import file
2339     # for dependence libraries.  The import file would start with
2340     # the line `#! .'.  This would cause the generated library to
2341     # depend on `.', always an invalid library.  This was fixed in
2342     # development snapshots of GCC prior to 3.0.
2343     case $host_os in
2344       aix4 | aix4.[[01]] | aix4.[[01]].*)
2345         if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2346              echo ' yes '
2347              echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2348           :
2349         else
2350           can_build_shared=no
2351         fi
2352         ;;
2353     esac
2354     # AIX (on Power*) has no versioning support, so currently we can
2355     # not hardcode correct soname into executable. Probably we can
2356     # add versioning support to collect2, so additional links can
2357     # be useful in future.
2358     if test "$aix_use_runtimelinking" = yes; then
2359       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2360       # instead of lib<name>.a to let people know that these are not
2361       # typical AIX shared libraries.
2362       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2363     else
2364       # We preserve .a as extension for shared libraries through AIX4.2
2365       # and later when we are not doing run time linking.
2366       library_names_spec='${libname}${release}.a $libname.a'
2367       soname_spec='${libname}${release}.so$major'
2368     fi
2369     shlibpath_var=LIBPATH
2370   fi
2371   ;;
2372
2373 amigaos*)
2374   library_names_spec='$libname.ixlibrary $libname.a'
2375   # Create ${libname}_ixlibrary.a entries in /sys/libs.
2376   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'
2377   ;;
2378
2379 beos*)
2380   library_names_spec='${libname}.so'
2381   dynamic_linker="$host_os ld.so"
2382   shlibpath_var=LIBRARY_PATH
2383   ;;
2384
2385 bsdi4*)
2386   version_type=linux
2387   need_version=no
2388   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2389   soname_spec='${libname}${release}.so$major'
2390   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2391   shlibpath_var=LD_LIBRARY_PATH
2392   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2393   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2394   export_dynamic_flag_spec=-rdynamic
2395   # the default ld.so.conf also contains /usr/contrib/lib and
2396   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2397   # libtool to hard-code these into programs
2398   ;;
2399
2400 cygwin* | mingw* | pw32*)
2401   version_type=windows
2402   need_version=no
2403   need_lib_prefix=no
2404   case $GCC,$host_os in
2405   yes,cygwin*)
2406     library_names_spec='$libname.dll.a'
2407     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2408     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
2409       dldir=$destdir/`dirname \$dlpath`~
2410       test -d \$dldir || mkdir -p \$dldir~
2411       $install_prog .libs/$dlname \$dldir/$dlname'
2412     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
2413       dlpath=$dir/\$dldll~
2414        $rm \$dlpath'
2415     ;;
2416   yes,mingw*)
2417     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
2418     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
2419     ;;
2420   yes,pw32*)
2421     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
2422     ;;
2423   *)
2424     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
2425     ;;
2426   esac
2427   dynamic_linker='Win32 ld.exe'
2428   # FIXME: first we should search . and the directory the executable is in
2429   shlibpath_var=PATH
2430   ;;
2431
2432 darwin* | rhapsody*)
2433   dynamic_linker="$host_os dyld"
2434   version_type=darwin
2435   need_lib_prefix=no
2436   need_version=no
2437   # FIXME: Relying on posixy $() will cause problems for
2438   #        cross-compilation, but unfortunately the echo tests do not
2439   #        yet detect zsh echo's removal of \ escapes.
2440   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)'
2441   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
2442   shlibpath_overrides_runpath=yes
2443   shlibpath_var=DYLD_LIBRARY_PATH
2444   ;;
2445
2446 freebsd1*)
2447   dynamic_linker=no
2448   ;;
2449
2450 freebsd*)
2451   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
2452   version_type=freebsd-$objformat
2453   case $version_type in
2454     freebsd-elf*)
2455       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2456       need_version=no
2457       need_lib_prefix=no
2458       ;;
2459     freebsd-*)
2460       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
2461       need_version=yes
2462       ;;
2463   esac
2464   shlibpath_var=LD_LIBRARY_PATH
2465   case $host_os in
2466   freebsd2*)
2467     shlibpath_overrides_runpath=yes
2468     ;;
2469   *)
2470     shlibpath_overrides_runpath=no
2471     hardcode_into_libs=yes
2472     ;;
2473   esac
2474   ;;
2475
2476 gnu*)
2477   version_type=linux
2478   need_lib_prefix=no
2479   need_version=no
2480   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
2481   soname_spec='${libname}${release}.so$major'
2482   shlibpath_var=LD_LIBRARY_PATH
2483   hardcode_into_libs=yes
2484   ;;
2485
2486 hpux9* | hpux10* | hpux11*)
2487   # Give a soname corresponding to the major version so that dld.sl refuses to
2488   # link against other versions.
2489   dynamic_linker="$host_os dld.sl"
2490   version_type=sunos
2491   need_lib_prefix=no
2492   need_version=no
2493   shlibpath_var=SHLIB_PATH
2494   shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2495   library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
2496   soname_spec='${libname}${release}.sl$major'
2497   # HP-UX runs *really* slowly unless shared libraries are mode 555.
2498   postinstall_cmds='chmod 555 $lib'
2499   ;;
2500
2501 irix5* | irix6*)
2502   version_type=irix
2503   need_lib_prefix=no
2504   need_version=no
2505   soname_spec='${libname}${release}.so$major'
2506   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
2507   case $host_os in
2508   irix5*)
2509     libsuff= shlibsuff=
2510     ;;
2511   *)
2512     case $LD in # libtool.m4 will add one of these switches to LD
2513     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
2514     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
2515     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
2516     *) libsuff= shlibsuff= libmagic=never-match;;
2517     esac
2518     ;;
2519   esac
2520   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2521   shlibpath_overrides_runpath=no
2522   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2523   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2524   ;;
2525
2526 # No shared lib support for Linux oldld, aout, or coff.
2527 linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
2528   dynamic_linker=no
2529   ;;
2530
2531 # This must be Linux ELF.
2532 linux-gnu*)
2533   version_type=linux
2534   need_lib_prefix=no
2535   need_version=no
2536   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2537   soname_spec='${libname}${release}.so$major'
2538   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2539   shlibpath_var=LD_LIBRARY_PATH
2540   shlibpath_overrides_runpath=no
2541   # This implies no fast_install, which is unacceptable.
2542   # Some rework will be needed to allow for fast_install
2543   # before this can be enabled.
2544   hardcode_into_libs=yes
2545
2546   # We used to test for /lib/ld.so.1 and disable shared libraries on
2547   # powerpc, because MkLinux only supported shared libraries with the
2548   # GNU dynamic linker.  Since this was broken with cross compilers,
2549   # most powerpc-linux boxes support dynamic linking these days and
2550   # people can always --disable-shared, the test was removed, and we
2551   # assume the GNU/Linux dynamic linker is in use.
2552   dynamic_linker='GNU/Linux ld.so'
2553   ;;
2554
2555 netbsd*)
2556   version_type=sunos
2557   need_lib_prefix=no
2558   need_version=no
2559   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2560     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2561     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2562     dynamic_linker='NetBSD (a.out) ld.so'
2563   else
2564     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
2565     soname_spec='${libname}${release}.so$major'
2566     dynamic_linker='NetBSD ld.elf_so'
2567   fi
2568   shlibpath_var=LD_LIBRARY_PATH
2569   shlibpath_overrides_runpath=yes
2570   hardcode_into_libs=yes
2571   ;;
2572
2573 newsos6)
2574   version_type=linux
2575   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2576   shlibpath_var=LD_LIBRARY_PATH
2577   shlibpath_overrides_runpath=yes
2578   ;;
2579
2580 openbsd*)
2581   version_type=sunos
2582   need_lib_prefix=no
2583   need_version=no
2584   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2585     case "$host_os" in
2586     openbsd2.[[89]] | openbsd2.[[89]].*)
2587       shlibpath_overrides_runpath=no
2588       ;;
2589     *)
2590       shlibpath_overrides_runpath=yes
2591       ;;
2592     esac
2593   else
2594     shlibpath_overrides_runpath=yes
2595   fi
2596   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2597   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2598   shlibpath_var=LD_LIBRARY_PATH
2599   ;;
2600
2601 os2*)
2602   libname_spec='$name'
2603   need_lib_prefix=no
2604   library_names_spec='$libname.dll $libname.a'
2605   dynamic_linker='OS/2 ld.exe'
2606   shlibpath_var=LIBPATH
2607   ;;
2608
2609 osf3* | osf4* | osf5*)
2610   version_type=osf
2611   need_version=no
2612   soname_spec='${libname}${release}.so'
2613   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2614   shlibpath_var=LD_LIBRARY_PATH
2615   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2616   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2617   ;;
2618
2619 sco3.2v5*)
2620   version_type=osf
2621   soname_spec='${libname}${release}.so$major'
2622   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2623   shlibpath_var=LD_LIBRARY_PATH
2624   ;;
2625
2626 solaris*)
2627   version_type=linux
2628   need_lib_prefix=no
2629   need_version=no
2630   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2631   soname_spec='${libname}${release}.so$major'
2632   shlibpath_var=LD_LIBRARY_PATH
2633   shlibpath_overrides_runpath=yes
2634   hardcode_into_libs=yes
2635   # ldd complains unless libraries are executable
2636   postinstall_cmds='chmod +x $lib'
2637   ;;
2638
2639 sunos4*)
2640   version_type=sunos
2641   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2642   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2643   shlibpath_var=LD_LIBRARY_PATH
2644   shlibpath_overrides_runpath=yes
2645   if test "$with_gnu_ld" = yes; then
2646     need_lib_prefix=no
2647   fi
2648   need_version=yes
2649   ;;
2650
2651 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2652   version_type=linux
2653   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2654   soname_spec='${libname}${release}.so$major'
2655   shlibpath_var=LD_LIBRARY_PATH
2656   case $host_vendor in
2657     sni)
2658       shlibpath_overrides_runpath=no
2659       ;;
2660     motorola)
2661       need_lib_prefix=no
2662       need_version=no
2663       shlibpath_overrides_runpath=no
2664       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2665       ;;
2666   esac
2667   ;;
2668
2669 uts4*)
2670   version_type=linux
2671   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2672   soname_spec='${libname}${release}.so$major'
2673   shlibpath_var=LD_LIBRARY_PATH
2674   ;;
2675
2676 dgux*)
2677   version_type=linux
2678   need_lib_prefix=no
2679   need_version=no
2680   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2681   soname_spec='${libname}${release}.so$major'
2682   shlibpath_var=LD_LIBRARY_PATH
2683   ;;
2684
2685 sysv4*MP*)
2686   if test -d /usr/nec ;then
2687     version_type=linux
2688     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
2689     soname_spec='$libname.so.$major'
2690     shlibpath_var=LD_LIBRARY_PATH
2691   fi
2692   ;;
2693
2694 *)
2695   dynamic_linker=no
2696   ;;
2697 esac
2698 AC_MSG_RESULT([$dynamic_linker])
2699 test "$dynamic_linker" = no && can_build_shared=no
2700
2701 # Report the final consequences.
2702 AC_MSG_CHECKING([if libtool supports shared libraries])
2703 AC_MSG_RESULT([$can_build_shared])
2704
2705 AC_MSG_CHECKING([whether to build shared libraries])
2706 test "$can_build_shared" = "no" && enable_shared=no
2707
2708 # On AIX, shared libraries and static libraries use the same namespace, and
2709 # are all built from PIC.
2710 case "$host_os" in
2711 aix3*)
2712   test "$enable_shared" = yes && enable_static=no
2713   if test -n "$RANLIB"; then
2714     archive_cmds="$archive_cmds~\$RANLIB \$lib"
2715     postinstall_cmds='$RANLIB $lib'
2716   fi
2717   ;;
2718
2719 aix4*)
2720   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2721     test "$enable_shared" = yes && enable_static=no
2722   fi
2723   ;;
2724 esac
2725 AC_MSG_RESULT([$enable_shared])
2726
2727 AC_MSG_CHECKING([whether to build static libraries])
2728 # Make sure either enable_shared or enable_static is yes.
2729 test "$enable_shared" = yes || enable_static=yes
2730 AC_MSG_RESULT([$enable_static])
2731
2732 if test "$hardcode_action" = relink; then
2733   # Fast installation is not supported
2734   enable_fast_install=no
2735 elif test "$shlibpath_overrides_runpath" = yes ||
2736      test "$enable_shared" = no; then
2737   # Fast installation is not necessary
2738   enable_fast_install=needless
2739 fi
2740
2741 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2742 if test "$GCC" = yes; then
2743   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2744 fi
2745
2746 AC_LIBTOOL_DLOPEN_SELF
2747
2748 if test "$enable_shared" = yes && test "$GCC" = yes; then
2749   case $archive_cmds in
2750   *'~'*)
2751     # FIXME: we may have to deal with multi-command sequences.
2752     ;;
2753   '$CC '*)
2754     # Test whether the compiler implicitly links with -lc since on some
2755     # systems, -lgcc has to come before -lc. If gcc already passes -lc
2756     # to ld, don't add -lc before -lgcc.
2757     AC_MSG_CHECKING([whether -lc should be explicitly linked in])
2758     AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
2759     [$rm conftest*
2760     echo 'static int dummy;' > conftest.$ac_ext
2761
2762     if AC_TRY_EVAL(ac_compile); then
2763       soname=conftest
2764       lib=conftest
2765       libobjs=conftest.$ac_objext
2766       deplibs=
2767       wl=$lt_cv_prog_cc_wl
2768       compiler_flags=-v
2769       linker_flags=-v
2770       verstring=
2771       output_objdir=.
2772       libname=conftest
2773       save_allow_undefined_flag=$allow_undefined_flag
2774       allow_undefined_flag=
2775       if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
2776       then
2777         lt_cv_archive_cmds_need_lc=no
2778       else
2779         lt_cv_archive_cmds_need_lc=yes
2780       fi
2781       allow_undefined_flag=$save_allow_undefined_flag
2782     else
2783       cat conftest.err 1>&5
2784     fi
2785     $rm conftest*
2786     ])
2787     AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
2788     ;;
2789   esac
2790 fi
2791 need_lc=${lt_cv_archive_cmds_need_lc-yes}
2792
2793 # The second clause should only fire when bootstrapping the
2794 # libtool distribution, otherwise you forgot to ship ltmain.sh
2795 # with your package, and you will get complaints that there are
2796 # no rules to generate ltmain.sh.
2797 if test -f "$ltmain"; then
2798   :
2799 else
2800   # If there is no Makefile yet, we rely on a make rule to execute
2801   # `config.status --recheck' to rerun these tests and create the
2802   # libtool script then.
2803   test -f Makefile && make "$ltmain"
2804 fi
2805
2806 if test -f "$ltmain"; then
2807   trap "$rm \"${ofile}T\"; exit 1" 1 2 15
2808   $rm -f "${ofile}T"
2809
2810   echo creating $ofile
2811
2812   # Now quote all the things that may contain metacharacters while being
2813   # careful not to overquote the AC_SUBSTed values.  We take copies of the
2814   # variables and quote the copies for generation of the libtool script.
2815   for var in echo old_CC old_CFLAGS \
2816     AR AR_FLAGS CC LD LN_S NM SHELL \
2817     reload_flag reload_cmds wl \
2818     pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
2819     thread_safe_flag_spec whole_archive_flag_spec libname_spec \
2820     library_names_spec soname_spec \
2821     RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
2822     old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
2823     postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
2824     old_striplib striplib file_magic_cmd export_symbols_cmds \
2825     deplibs_check_method allow_undefined_flag no_undefined_flag \
2826     finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
2827     global_symbol_to_c_name_address \
2828     hardcode_libdir_flag_spec hardcode_libdir_separator  \
2829     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
2830     compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
2831
2832     case $var in
2833     reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
2834     old_postinstall_cmds | old_postuninstall_cmds | \
2835     export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
2836     extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
2837     postinstall_cmds | postuninstall_cmds | \
2838     finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
2839       # Double-quote double-evaled strings.
2840       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
2841       ;;
2842     *)
2843       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
2844       ;;
2845     esac
2846   done
2847
2848   cat <<__EOF__ > "${ofile}T"
2849 #! $SHELL
2850
2851 # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
2852 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
2853 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
2854 #
2855 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
2856 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
2857 #
2858 # This program is free software; you can redistribute it and/or modify
2859 # it under the terms of the GNU General Public License as published by
2860 # the Free Software Foundation; either version 2 of the License, or
2861 # (at your option) any later version.
2862 #
2863 # This program is distributed in the hope that it will be useful, but
2864 # WITHOUT ANY WARRANTY; without even the implied warranty of
2865 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2866 # General Public License for more details.
2867 #
2868 # You should have received a copy of the GNU General Public License
2869 # along with this program; if not, write to the Free Software
2870 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2871 #
2872 # As a special exception to the GNU General Public License, if you
2873 # distribute this file as part of a program that contains a
2874 # configuration script generated by Autoconf, you may include it under
2875 # the same distribution terms that you use for the rest of that program.
2876
2877 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
2878 Xsed="sed -e s/^X//"
2879
2880 # The HP-UX ksh and POSIX shell print the target directory to stdout
2881 # if CDPATH is set.
2882 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
2883
2884 # ### BEGIN LIBTOOL CONFIG
2885
2886 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2887
2888 # Shell to use when invoking shell scripts.
2889 SHELL=$lt_SHELL
2890
2891 # Whether or not to build shared libraries.
2892 build_libtool_libs=$enable_shared
2893
2894 # Whether or not to build static libraries.
2895 build_old_libs=$enable_static
2896
2897 # Whether or not to add -lc for building shared libraries.
2898 build_libtool_need_lc=$need_lc
2899
2900 # Whether or not to optimize for fast installation.
2901 fast_install=$enable_fast_install
2902
2903 # The host system.
2904 host_alias=$host_alias
2905 host=$host
2906
2907 # An echo program that does not interpret backslashes.
2908 echo=$lt_echo
2909
2910 # The archiver.
2911 AR=$lt_AR
2912 AR_FLAGS=$lt_AR_FLAGS
2913
2914 # The default C compiler.
2915 CC=$lt_CC
2916
2917 # Is the compiler the GNU C compiler?
2918 with_gcc=$GCC
2919
2920 # The linker used to build libraries.
2921 LD=$lt_LD
2922
2923 # Whether we need hard or soft links.
2924 LN_S=$lt_LN_S
2925
2926 # A BSD-compatible nm program.
2927 NM=$lt_NM
2928
2929 # A symbol stripping program
2930 STRIP=$STRIP
2931
2932 # Used to examine libraries when file_magic_cmd begins "file"
2933 MAGIC_CMD=$MAGIC_CMD
2934
2935 # Used on cygwin: DLL creation program.
2936 DLLTOOL="$DLLTOOL"
2937
2938 # Used on cygwin: object dumper.
2939 OBJDUMP="$OBJDUMP"
2940
2941 # Used on cygwin: assembler.
2942 AS="$AS"
2943
2944 # The name of the directory that contains temporary libtool files.
2945 objdir=$objdir
2946
2947 # How to create reloadable object files.
2948 reload_flag=$lt_reload_flag
2949 reload_cmds=$lt_reload_cmds
2950
2951 # How to pass a linker flag through the compiler.
2952 wl=$lt_wl
2953
2954 # Object file suffix (normally "o").
2955 objext="$ac_objext"
2956
2957 # Old archive suffix (normally "a").
2958 libext="$libext"
2959
2960 # Executable file suffix (normally "").
2961 exeext="$exeext"
2962
2963 # Additional compiler flags for building library objects.
2964 pic_flag=$lt_pic_flag
2965 pic_mode=$pic_mode
2966
2967 # Does compiler simultaneously support -c and -o options?
2968 compiler_c_o=$lt_compiler_c_o
2969
2970 # Can we write directly to a .lo ?
2971 compiler_o_lo=$lt_compiler_o_lo
2972
2973 # Must we lock files when doing compilation ?
2974 need_locks=$lt_need_locks
2975
2976 # Do we need the lib prefix for modules?
2977 need_lib_prefix=$need_lib_prefix
2978
2979 # Do we need a version for libraries?
2980 need_version=$need_version
2981
2982 # Whether dlopen is supported.
2983 dlopen_support=$enable_dlopen
2984
2985 # Whether dlopen of programs is supported.
2986 dlopen_self=$enable_dlopen_self
2987
2988 # Whether dlopen of statically linked programs is supported.
2989 dlopen_self_static=$enable_dlopen_self_static
2990
2991 # Compiler flag to prevent dynamic linking.
2992 link_static_flag=$lt_link_static_flag
2993
2994 # Compiler flag to turn off builtin functions.
2995 no_builtin_flag=$lt_no_builtin_flag
2996
2997 # Compiler flag to allow reflexive dlopens.
2998 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
2999
3000 # Compiler flag to generate shared objects directly from archives.
3001 whole_archive_flag_spec=$lt_whole_archive_flag_spec
3002
3003 # Compiler flag to generate thread-safe objects.
3004 thread_safe_flag_spec=$lt_thread_safe_flag_spec
3005
3006 # Library versioning type.
3007 version_type=$version_type
3008
3009 # Format of library name prefix.
3010 libname_spec=$lt_libname_spec
3011
3012 # List of archive names.  First name is the real one, the rest are links.
3013 # The last name is the one that the linker finds with -lNAME.
3014 library_names_spec=$lt_library_names_spec
3015
3016 # The coded name of the library, if different from the real name.
3017 soname_spec=$lt_soname_spec
3018
3019 # Commands used to build and install an old-style archive.
3020 RANLIB=$lt_RANLIB
3021 old_archive_cmds=$lt_old_archive_cmds
3022 old_postinstall_cmds=$lt_old_postinstall_cmds
3023 old_postuninstall_cmds=$lt_old_postuninstall_cmds
3024
3025 # Create an old-style archive from a shared archive.
3026 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
3027
3028 # Create a temporary old-style archive to link instead of a shared archive.
3029 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
3030
3031 # Commands used to build and install a shared archive.
3032 archive_cmds=$lt_archive_cmds
3033 archive_expsym_cmds=$lt_archive_expsym_cmds
3034 postinstall_cmds=$lt_postinstall_cmds
3035 postuninstall_cmds=$lt_postuninstall_cmds
3036
3037 # Commands to strip libraries.
3038 old_striplib=$lt_old_striplib
3039 striplib=$lt_striplib
3040
3041 # Method to check whether dependent libraries are shared objects.
3042 deplibs_check_method=$lt_deplibs_check_method
3043
3044 # Command to use when deplibs_check_method == file_magic.
3045 file_magic_cmd=$lt_file_magic_cmd
3046
3047 # Flag that allows shared libraries with undefined symbols to be built.
3048 allow_undefined_flag=$lt_allow_undefined_flag
3049
3050 # Flag that forces no undefined symbols.
3051 no_undefined_flag=$lt_no_undefined_flag
3052
3053 # Commands used to finish a libtool library installation in a directory.
3054 finish_cmds=$lt_finish_cmds
3055
3056 # Same as above, but a single script fragment to be evaled but not shown.
3057 finish_eval=$lt_finish_eval
3058
3059 # Take the output of nm and produce a listing of raw symbols and C names.
3060 global_symbol_pipe=$lt_global_symbol_pipe
3061
3062 # Transform the output of nm in a proper C declaration
3063 global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
3064
3065 # Transform the output of nm in a C name address pair
3066 global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
3067
3068 # This is the shared library runtime path variable.
3069 runpath_var=$runpath_var
3070
3071 # This is the shared library path variable.
3072 shlibpath_var=$shlibpath_var
3073
3074 # Is shlibpath searched before the hard-coded library search path?
3075 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
3076
3077 # How to hardcode a shared library path into an executable.
3078 hardcode_action=$hardcode_action
3079
3080 # Whether we should hardcode library paths into libraries.
3081 hardcode_into_libs=$hardcode_into_libs
3082
3083 # Flag to hardcode \$libdir into a binary during linking.
3084 # This must work even if \$libdir does not exist.
3085 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
3086
3087 # Whether we need a single -rpath flag with a separated argument.
3088 hardcode_libdir_separator=$lt_hardcode_libdir_separator
3089
3090 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
3091 # resulting binary.
3092 hardcode_direct=$hardcode_direct
3093
3094 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
3095 # resulting binary.
3096 hardcode_minus_L=$hardcode_minus_L
3097
3098 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
3099 # the resulting binary.
3100 hardcode_shlibpath_var=$hardcode_shlibpath_var
3101
3102 # Variables whose values should be saved in libtool wrapper scripts and
3103 # restored at relink time.
3104 variables_saved_for_relink="$variables_saved_for_relink"
3105
3106 # Whether libtool must link a program against all its dependency libraries.
3107 link_all_deplibs=$link_all_deplibs
3108
3109 # Compile-time system search path for libraries
3110 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
3111
3112 # Run-time system search path for libraries
3113 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
3114
3115 # Fix the shell variable \$srcfile for the compiler.
3116 fix_srcfile_path="$fix_srcfile_path"
3117
3118 # Set to yes if exported symbols are required.
3119 always_export_symbols=$always_export_symbols
3120
3121 # The commands to list exported symbols.
3122 export_symbols_cmds=$lt_export_symbols_cmds
3123
3124 # The commands to extract the exported symbol list from a shared archive.
3125 extract_expsyms_cmds=$lt_extract_expsyms_cmds
3126
3127 # Symbols that should not be listed in the preloaded symbols.
3128 exclude_expsyms=$lt_exclude_expsyms
3129
3130 # Symbols that must always be exported.
3131 include_expsyms=$lt_include_expsyms
3132
3133 # ### END LIBTOOL CONFIG
3134
3135 __EOF__
3136
3137   case $host_os in
3138   aix3*)
3139     cat <<\EOF >> "${ofile}T"
3140
3141 # AIX sometimes has problems with the GCC collect2 program.  For some
3142 # reason, if we set the COLLECT_NAMES environment variable, the problems
3143 # vanish in a puff of smoke.
3144 if test "X${COLLECT_NAMES+set}" != Xset; then
3145   COLLECT_NAMES=
3146   export COLLECT_NAMES
3147 fi
3148 EOF
3149     ;;
3150   esac
3151
3152   case $host_os in
3153   cygwin* | mingw* | pw32* | os2*)
3154     cat <<'EOF' >> "${ofile}T"
3155       # This is a source program that is used to create dlls on Windows
3156       # Don't remove nor modify the starting and closing comments
3157 # /* ltdll.c starts here */
3158 # #define WIN32_LEAN_AND_MEAN
3159 # #include <windows.h>
3160 # #undef WIN32_LEAN_AND_MEAN
3161 # #include <stdio.h>
3162 #
3163 # #ifndef __CYGWIN__
3164 # #  ifdef __CYGWIN32__
3165 # #    define __CYGWIN__ __CYGWIN32__
3166 # #  endif
3167 # #endif
3168 #
3169 # #ifdef __cplusplus
3170 # extern "C" {
3171 # #endif
3172 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
3173 # #ifdef __cplusplus
3174 # }
3175 # #endif
3176 #
3177 # #ifdef __CYGWIN__
3178 # #include <cygwin/cygwin_dll.h>
3179 # DECLARE_CYGWIN_DLL( DllMain );
3180 # #endif
3181 # HINSTANCE __hDllInstance_base;
3182 #
3183 # BOOL APIENTRY
3184 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
3185 # {
3186 #   __hDllInstance_base = hInst;
3187 #   return TRUE;
3188 # }
3189 # /* ltdll.c ends here */
3190         # This is a source program that is used to create import libraries
3191         # on Windows for dlls which lack them. Don't remove nor modify the
3192         # starting and closing comments
3193 # /* impgen.c starts here */
3194 # /*   Copyright (C) 1999-2000 Free Software Foundation, Inc.
3195 #
3196 #  This file is part of GNU libtool.
3197 #
3198 #  This program is free software; you can redistribute it and/or modify
3199 #  it under the terms of the GNU General Public License as published by
3200 #  the Free Software Foundation; either version 2 of the License, or
3201 #  (at your option) any later version.
3202 #
3203 #  This program is distributed in the hope that it will be useful,
3204 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
3205 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3206 #  GNU General Public License for more details.
3207 #
3208 #  You should have received a copy of the GNU General Public License
3209 #  along with this program; if not, write to the Free Software
3210 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3211 #  */
3212 #
3213 # #include <stdio.h>            /* for printf() */
3214 # #include <unistd.h>           /* for open(), lseek(), read() */
3215 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
3216 # #include <string.h>           /* for strdup() */
3217 #
3218 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
3219 # #ifndef O_BINARY
3220 # #define O_BINARY 0
3221 # #endif
3222 #
3223 # static unsigned int
3224 # pe_get16 (fd, offset)
3225 #      int fd;
3226 #      int offset;
3227 # {
3228 #   unsigned char b[2];
3229 #   lseek (fd, offset, SEEK_SET);
3230 #   read (fd, b, 2);
3231 #   return b[0] + (b[1]<<8);
3232 # }
3233 #
3234 # static unsigned int
3235 # pe_get32 (fd, offset)
3236 #     int fd;
3237 #     int offset;
3238 # {
3239 #   unsigned char b[4];
3240 #   lseek (fd, offset, SEEK_SET);
3241 #   read (fd, b, 4);
3242 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3243 # }
3244 #
3245 # static unsigned int
3246 # pe_as32 (ptr)
3247 #      void *ptr;
3248 # {
3249 #   unsigned char *b = ptr;
3250 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
3251 # }
3252 #
3253 # int
3254 # main (argc, argv)
3255 #     int argc;
3256 #     char *argv[];
3257 # {
3258 #     int dll;
3259 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
3260 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
3261 #     unsigned long name_rvas, nexp;
3262 #     unsigned char *expdata, *erva;
3263 #     char *filename, *dll_name;
3264 #
3265 #     filename = argv[1];
3266 #
3267 #     dll = open(filename, O_RDONLY|O_BINARY);
3268 #     if (dll < 1)
3269 #       return 1;
3270 #
3271 #     dll_name = filename;
3272 #
3273 #     for (i=0; filename[i]; i++)
3274 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
3275 #           dll_name = filename + i +1;
3276 #
3277 #     pe_header_offset = pe_get32 (dll, 0x3c);
3278 #     opthdr_ofs = pe_header_offset + 4 + 20;
3279 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
3280 #
3281 #     if (num_entries < 1) /* no exports */
3282 #       return 1;
3283 #
3284 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
3285 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
3286 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
3287 #     secptr = (pe_header_offset + 4 + 20 +
3288 #             pe_get16 (dll, pe_header_offset + 4 + 16));
3289 #
3290 #     expptr = 0;
3291 #     for (i = 0; i < nsections; i++)
3292 #     {
3293 #       char sname[8];
3294 #       unsigned long secptr1 = secptr + 40 * i;
3295 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
3296 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
3297 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
3298 #       lseek(dll, secptr1, SEEK_SET);
3299 #       read(dll, sname, 8);
3300 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
3301 #       {
3302 #           expptr = fptr + (export_rva - vaddr);
3303 #           if (export_rva + export_size > vaddr + vsize)
3304 #               export_size = vsize - (export_rva - vaddr);
3305 #           break;
3306 #       }
3307 #     }
3308 #
3309 #     expdata = (unsigned char*)malloc(export_size);
3310 #     lseek (dll, expptr, SEEK_SET);
3311 #     read (dll, expdata, export_size);
3312 #     erva = expdata - export_rva;
3313 #
3314 #     nexp = pe_as32 (expdata+24);
3315 #     name_rvas = pe_as32 (expdata+32);
3316 #
3317 #     printf ("EXPORTS\n");
3318 #     for (i = 0; i<nexp; i++)
3319 #     {
3320 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
3321 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
3322 #     }
3323 #
3324 #     return 0;
3325 # }
3326 # /* impgen.c ends here */
3327
3328 EOF
3329     ;;
3330   esac
3331
3332   # We use sed instead of cat because bash on DJGPP gets confused if
3333   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
3334   # text mode, it properly converts lines to CR/LF.  This bash problem
3335   # is reportedly fixed, but why not run on old versions too?
3336   sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
3337
3338   mv -f "${ofile}T" "$ofile" || \
3339     (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
3340   chmod +x "$ofile"
3341 fi
3342
3343 ])# _LT_AC_LTCONFIG_HACK
3344
3345 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
3346 AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
3347
3348 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
3349 AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
3350
3351 # AC_ENABLE_SHARED - implement the --enable-shared flag
3352 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
3353 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3354 #   `yes'.
3355 AC_DEFUN([AC_ENABLE_SHARED],
3356 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3357 AC_ARG_ENABLE(shared,
3358 changequote(<<, >>)dnl
3359 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
3360 changequote([, ])dnl
3361 [p=${PACKAGE-default}
3362 case $enableval in
3363 yes) enable_shared=yes ;;
3364 no) enable_shared=no ;;
3365 *)
3366   enable_shared=no
3367   # Look at the argument we got.  We use all the common list separators.
3368   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3369   for pkg in $enableval; do
3370     if test "X$pkg" = "X$p"; then
3371       enable_shared=yes
3372     fi
3373   done
3374   IFS="$ac_save_ifs"
3375   ;;
3376 esac],
3377 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
3378 ])
3379
3380 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
3381 AC_DEFUN([AC_DISABLE_SHARED],
3382 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3383 AC_ENABLE_SHARED(no)])
3384
3385 # AC_ENABLE_STATIC - implement the --enable-static flag
3386 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
3387 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3388 #   `yes'.
3389 AC_DEFUN([AC_ENABLE_STATIC],
3390 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3391 AC_ARG_ENABLE(static,
3392 changequote(<<, >>)dnl
3393 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
3394 changequote([, ])dnl
3395 [p=${PACKAGE-default}
3396 case $enableval in
3397 yes) enable_static=yes ;;
3398 no) enable_static=no ;;
3399 *)
3400   enable_static=no
3401   # Look at the argument we got.  We use all the common list separators.
3402   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3403   for pkg in $enableval; do
3404     if test "X$pkg" = "X$p"; then
3405       enable_static=yes
3406     fi
3407   done
3408   IFS="$ac_save_ifs"
3409   ;;
3410 esac],
3411 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
3412 ])
3413
3414 # AC_DISABLE_STATIC - set the default static flag to --disable-static
3415 AC_DEFUN([AC_DISABLE_STATIC],
3416 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3417 AC_ENABLE_STATIC(no)])
3418
3419
3420 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
3421 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
3422 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
3423 #   `yes'.
3424 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
3425 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3426 AC_ARG_ENABLE(fast-install,
3427 changequote(<<, >>)dnl
3428 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
3429 changequote([, ])dnl
3430 [p=${PACKAGE-default}
3431 case $enableval in
3432 yes) enable_fast_install=yes ;;
3433 no) enable_fast_install=no ;;
3434 *)
3435   enable_fast_install=no
3436   # Look at the argument we got.  We use all the common list separators.
3437   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3438   for pkg in $enableval; do
3439     if test "X$pkg" = "X$p"; then
3440       enable_fast_install=yes
3441     fi
3442   done
3443   IFS="$ac_save_ifs"
3444   ;;
3445 esac],
3446 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
3447 ])
3448
3449 # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
3450 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
3451 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3452 AC_ENABLE_FAST_INSTALL(no)])
3453
3454 # AC_LIBTOOL_PICMODE - implement the --with-pic flag
3455 # Usage: AC_LIBTOOL_PICMODE[(MODE)]
3456 #   Where MODE is either `yes' or `no'.  If omitted, it defaults to
3457 #   `both'.
3458 AC_DEFUN([AC_LIBTOOL_PICMODE],
3459 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3460 pic_mode=ifelse($#,1,$1,default)])
3461
3462
3463 # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
3464 AC_DEFUN([AC_PATH_TOOL_PREFIX],
3465 [AC_MSG_CHECKING([for $1])
3466 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3467 [case $MAGIC_CMD in
3468   /*)
3469   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3470   ;;
3471   ?:/*)
3472   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
3473   ;;
3474   *)
3475   ac_save_MAGIC_CMD="$MAGIC_CMD"
3476   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3477 dnl $ac_dummy forces splitting on constant user-supplied paths.
3478 dnl POSIX.2 word splitting is done only on the output of word expansions,
3479 dnl not every word.  This closes a longstanding sh security hole.
3480   ac_dummy="ifelse([$2], , $PATH, [$2])"
3481   for ac_dir in $ac_dummy; do
3482     test -z "$ac_dir" && ac_dir=.
3483     if test -f $ac_dir/$1; then
3484       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3485       if test -n "$file_magic_test_file"; then
3486         case $deplibs_check_method in
3487         "file_magic "*)
3488           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3489           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3490           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3491             egrep "$file_magic_regex" > /dev/null; then
3492             :
3493           else
3494             cat <<EOF 1>&2
3495
3496 *** Warning: the command libtool uses to detect shared libraries,
3497 *** $file_magic_cmd, produces output that libtool cannot recognize.
3498 *** The result is that libtool may fail to recognize shared libraries
3499 *** as such.  This will affect the creation of libtool libraries that
3500 *** depend on shared libraries, but programs linked with such libtool
3501 *** libraries will work regardless of this problem.  Nevertheless, you
3502 *** may want to report the problem to your system manager and/or to
3503 *** bug-libtool@gnu.org
3504
3505 EOF
3506           fi ;;
3507         esac
3508       fi
3509       break
3510     fi
3511   done
3512   IFS="$ac_save_ifs"
3513   MAGIC_CMD="$ac_save_MAGIC_CMD"
3514   ;;
3515 esac])
3516 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3517 if test -n "$MAGIC_CMD"; then
3518   AC_MSG_RESULT($MAGIC_CMD)
3519 else
3520   AC_MSG_RESULT(no)
3521 fi
3522 ])
3523
3524
3525 # AC_PATH_MAGIC - find a file program which can recognise a shared library
3526 AC_DEFUN([AC_PATH_MAGIC],
3527 [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
3528 AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
3529 if test -z "$lt_cv_path_MAGIC_CMD"; then
3530   if test -n "$ac_tool_prefix"; then
3531     AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
3532   else
3533     MAGIC_CMD=:
3534   fi
3535 fi
3536 ])
3537
3538
3539 # AC_PROG_LD - find the path to the GNU or non-GNU linker
3540 AC_DEFUN([AC_PROG_LD],
3541 [AC_ARG_WITH(gnu-ld,
3542 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
3543 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3544 AC_REQUIRE([AC_PROG_CC])dnl
3545 AC_REQUIRE([CL_CANONICAL_HOST])dnl
3546 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3547 AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
3548 ac_prog=ld
3549 if test "$GCC" = yes; then
3550   # Check if gcc -print-prog-name=ld gives a path.
3551   AC_MSG_CHECKING([for ld used by GCC])
3552   case $host in
3553   *-*-mingw*)
3554     # gcc leaves a trailing carriage return which upsets mingw
3555     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3556   *)
3557     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3558   esac
3559   case $ac_prog in
3560     # Accept absolute paths.
3561     [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
3562       re_direlt='/[[^/]][[^/]]*/\.\./'
3563       # Canonicalize the path of ld
3564       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3565       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3566         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3567       done
3568       test -z "$LD" && LD="$ac_prog"
3569       ;;
3570   "")
3571     # If it fails, then pretend we aren't using GCC.
3572     ac_prog=ld
3573     ;;
3574   *)
3575     # If it is relative, then search for the first ld in PATH.
3576     with_gnu_ld=unknown
3577     ;;
3578   esac
3579 elif test "$with_gnu_ld" = yes; then
3580   AC_MSG_CHECKING([for GNU ld])
3581 else
3582   AC_MSG_CHECKING([for non-GNU ld])
3583 fi
3584 AC_CACHE_VAL(lt_cv_path_LD,
3585 [if test -z "$LD"; then
3586   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3587   for ac_dir in $PATH; do
3588     test -z "$ac_dir" && ac_dir=.
3589     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3590       lt_cv_path_LD="$ac_dir/$ac_prog"
3591       # Check to see if the program is GNU ld.  I'd rather use --version,
3592       # but apparently some GNU ld's only accept -v.
3593       # Break only if it was the GNU/non-GNU ld that we prefer.
3594       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3595         test "$with_gnu_ld" != no && break
3596       else
3597         test "$with_gnu_ld" != yes && break
3598       fi
3599     fi
3600   done
3601   IFS="$ac_save_ifs"
3602 else
3603   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3604 fi])
3605 LD="$lt_cv_path_LD"
3606 if test -n "$LD"; then
3607   AC_MSG_RESULT($LD)
3608 else
3609   AC_MSG_RESULT(no)
3610 fi
3611 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3612 AC_PROG_LD_GNU
3613 ])
3614
3615 # AC_PROG_LD_GNU -
3616 AC_DEFUN([AC_PROG_LD_GNU],
3617 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3618 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3619 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3620   lt_cv_prog_gnu_ld=yes
3621 else
3622   lt_cv_prog_gnu_ld=no
3623 fi])
3624 with_gnu_ld=$lt_cv_prog_gnu_ld
3625 ])
3626
3627 # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
3628 #   -- PORTME Some linkers may need a different reload flag.
3629 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
3630 [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
3631 [lt_cv_ld_reload_flag='-r'])
3632 reload_flag=$lt_cv_ld_reload_flag
3633 test -n "$reload_flag" && reload_flag=" $reload_flag"
3634 ])
3635
3636 # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
3637 #  -- PORTME fill in with the dynamic library characteristics
3638 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
3639 [AC_CACHE_CHECK([how to recognise dependant libraries],
3640 lt_cv_deplibs_check_method,
3641 [lt_cv_file_magic_cmd='$MAGIC_CMD'
3642 lt_cv_file_magic_test_file=
3643 lt_cv_deplibs_check_method='unknown'
3644 # Need to set the preceding variable on all platforms that support
3645 # interlibrary dependencies.
3646 # 'none' -- dependencies not supported.
3647 # `unknown' -- same as none, but documents that we really don't know.
3648 # 'pass_all' -- all dependencies passed with no checks.
3649 # 'test_compile' -- check by making test program.
3650 # 'file_magic [[regex]]' -- check by looking for files in library path
3651 # which responds to the $file_magic_cmd with a given egrep regex.
3652 # If you have `file' or equivalent on your system and you're not sure
3653 # whether `pass_all' will *always* work, you probably want this one.
3654
3655 case $host_os in
3656 aix4* | aix5*)
3657   lt_cv_deplibs_check_method=pass_all
3658   ;;
3659
3660 beos*)
3661   lt_cv_deplibs_check_method=pass_all
3662   ;;
3663
3664 bsdi4*)
3665   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3666   lt_cv_file_magic_cmd='/usr/bin/file -L'
3667   lt_cv_file_magic_test_file=/shlib/libc.so
3668   ;;
3669
3670 cygwin* | mingw* | pw32*)
3671   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3672   lt_cv_file_magic_cmd='$OBJDUMP -f'
3673   ;;
3674
3675 darwin* | rhapsody*)
3676   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
3677   lt_cv_file_magic_cmd='/usr/bin/file -L'
3678   case "$host_os" in
3679   rhapsody* | darwin1.[[012]])
3680     lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
3681     ;;
3682   *) # Darwin 1.3 on
3683     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
3684     ;;
3685   esac
3686   ;;
3687
3688 freebsd*)
3689   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3690     case $host_cpu in
3691     i*86 )
3692       # Not sure whether the presence of OpenBSD here was a mistake.
3693       # Let's accept both of them until this is cleared up.
3694       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
3695       lt_cv_file_magic_cmd=/usr/bin/file
3696       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3697       ;;
3698     esac
3699   else
3700     lt_cv_deplibs_check_method=pass_all
3701   fi
3702   ;;
3703
3704 gnu*)
3705   lt_cv_deplibs_check_method=pass_all
3706   ;;
3707
3708 hpux10.20*|hpux11*)
3709   lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3710   lt_cv_file_magic_cmd=/usr/bin/file
3711   lt_cv_file_magic_test_file=/usr/lib/libc.sl
3712   ;;
3713
3714 irix5* | irix6*)
3715   case $host_os in
3716   irix5*)
3717     # this will be overridden with pass_all, but let us keep it just in case
3718     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3719     ;;
3720   *)
3721     case $LD in
3722     *-32|*"-32 ") libmagic=32-bit;;
3723     *-n32|*"-n32 ") libmagic=N32;;
3724     *-64|*"-64 ") libmagic=64-bit;;
3725     *) libmagic=never-match;;
3726     esac
3727     # this will be overridden with pass_all, but let us keep it just in case
3728     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
3729     ;;
3730   esac
3731   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3732   lt_cv_deplibs_check_method=pass_all
3733   ;;
3734
3735 # This must be Linux ELF.
3736 linux-gnu*)
3737   case $host_cpu in
3738   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
3739     lt_cv_deplibs_check_method=pass_all ;;
3740   *)
3741     # glibc up to 2.1.1 does not perform some relocations on ARM
3742     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
3743   esac
3744   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3745   ;;
3746
3747 netbsd*)
3748   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3749     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
3750   else
3751     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
3752   fi
3753   ;;
3754
3755 newos6*)
3756   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3757   lt_cv_file_magic_cmd=/usr/bin/file
3758   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3759   ;;
3760
3761 openbsd*)
3762   lt_cv_file_magic_cmd=/usr/bin/file
3763   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3764   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3765     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
3766   else
3767     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3768   fi
3769   ;;
3770
3771 osf3* | osf4* | osf5*)
3772   # this will be overridden with pass_all, but let us keep it just in case
3773   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3774   lt_cv_file_magic_test_file=/shlib/libc.so
3775   lt_cv_deplibs_check_method=pass_all
3776   ;;
3777
3778 sco3.2v5*)
3779   lt_cv_deplibs_check_method=pass_all
3780   ;;
3781
3782 solaris*)
3783   lt_cv_deplibs_check_method=pass_all
3784   lt_cv_file_magic_test_file=/lib/libc.so
3785   ;;
3786
3787 sysv5uw[[78]]* | sysv4*uw2*)
3788   lt_cv_deplibs_check_method=pass_all
3789   ;;
3790
3791 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3792   case $host_vendor in
3793   motorola)
3794     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]]'
3795     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3796     ;;
3797   ncr)
3798     lt_cv_deplibs_check_method=pass_all
3799     ;;
3800   sequent)
3801     lt_cv_file_magic_cmd='/bin/file'
3802     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3803     ;;
3804   sni)
3805     lt_cv_file_magic_cmd='/bin/file'
3806     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3807     lt_cv_file_magic_test_file=/lib/libc.so
3808     ;;
3809   esac
3810   ;;
3811 esac
3812 ])
3813 file_magic_cmd=$lt_cv_file_magic_cmd
3814 deplibs_check_method=$lt_cv_deplibs_check_method
3815 ])
3816
3817
3818 # AC_PROG_NM - find the path to a BSD-compatible name lister
3819 AC_DEFUN([AC_PROG_NM],
3820 [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
3821 AC_MSG_CHECKING([for BSD-compatible nm])
3822 AC_CACHE_VAL(lt_cv_path_NM,
3823 [if test -n "$NM"; then
3824   # Let the user override the test.
3825   lt_cv_path_NM="$NM"
3826 else
3827   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3828   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3829     test -z "$ac_dir" && ac_dir=.
3830     tmp_nm=$ac_dir/${ac_tool_prefix}nm
3831     if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
3832       # Check to see if the nm accepts a BSD-compat flag.
3833       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3834       #   nm: unknown option "B" ignored
3835       # Tru64's nm complains that /dev/null is an invalid object file
3836       if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
3837         lt_cv_path_NM="$tmp_nm -B"
3838         break
3839       elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3840         lt_cv_path_NM="$tmp_nm -p"
3841         break
3842       else
3843         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3844         continue # so that we can try to find one that supports BSD flags
3845       fi
3846     fi
3847   done
3848   IFS="$ac_save_ifs"
3849   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3850 fi])
3851 NM="$lt_cv_path_NM"
3852 AC_MSG_RESULT([$NM])
3853 ])
3854
3855 # AC_CHECK_LIBM - check for math library
3856 AC_DEFUN([AC_CHECK_LIBM],
3857 [AC_REQUIRE([CL_CANONICAL_HOST])dnl
3858 LIBM=
3859 case $host in
3860 *-*-beos* | *-*-cygwin* | *-*-pw32*)
3861   # These system don't have libm
3862   ;;
3863 *-ncr-sysv4.3*)
3864   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3865   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
3866   ;;
3867 *)
3868   AC_CHECK_LIB(m, main, LIBM="-lm")
3869   ;;
3870 esac
3871 ])
3872
3873 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
3874 # the libltdl convenience library and INCLTDL to the include flags for
3875 # the libltdl header and adds --enable-ltdl-convenience to the
3876 # configure arguments.  Note that LIBLTDL and INCLTDL are not
3877 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
3878 # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
3879 # with '${top_builddir}/' and INCLTDL will be prefixed with
3880 # '${top_srcdir}/' (note the single quotes!).  If your package is not
3881 # flat and you're not using automake, define top_builddir and
3882 # top_srcdir appropriately in the Makefiles.
3883 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3884 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3885   case $enable_ltdl_convenience in
3886   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3887   "") enable_ltdl_convenience=yes
3888       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3889   esac
3890   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3891   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3892 ])
3893
3894 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
3895 # the libltdl installable library and INCLTDL to the include flags for
3896 # the libltdl header and adds --enable-ltdl-install to the configure
3897 # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
3898 # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
3899 # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
3900 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
3901 # with '${top_srcdir}/' (note the single quotes!).  If your package is
3902 # not flat and you're not using automake, define top_builddir and
3903 # top_srcdir appropriately in the Makefiles.
3904 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3905 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3906 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3907   AC_CHECK_LIB(ltdl, main,
3908   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3909   [if test x"$enable_ltdl_install" = xno; then
3910      AC_MSG_WARN([libltdl not installed, but installation disabled])
3911    else
3912      enable_ltdl_install=yes
3913    fi
3914   ])
3915   if test x"$enable_ltdl_install" = x"yes"; then
3916     ac_configure_args="$ac_configure_args --enable-ltdl-install"
3917     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3918     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3919   else
3920     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3921     LIBLTDL="-lltdl"
3922     INCLTDL=
3923   fi
3924 ])
3925
3926 # old names
3927 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
3928 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
3929 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
3930 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
3931 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
3932 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
3933 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
3934
3935 # This is just to silence aclocal about the macro not being used
3936 ifelse([AC_DISABLE_FAST_INSTALL])
3937
3938 # iconv.m4 serial AM3 (gettext-0.11)
3939 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3940 dnl This file is free software, distributed under the terms of the GNU
3941 dnl General Public License.  As a special exception to the GNU General
3942 dnl Public License, this file may be distributed as part of a program
3943 dnl that contains a configuration script generated by Autoconf, under
3944 dnl the same distribution terms as the rest of that program.
3945
3946 dnl From Bruno Haible.
3947
3948 AC_DEFUN([AM_ICONV_LINK],
3949 [
3950   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
3951   dnl those with the standalone portable GNU libiconv installed).
3952
3953   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
3954   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3955   AC_REQUIRE([AC_LIB_RPATH])
3956
3957   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3958   dnl accordingly.
3959   AC_LIB_LINKFLAGS_BODY([iconv])
3960
3961   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
3962   dnl because if the user has installed libiconv and not disabled its use
3963   dnl via --without-libiconv-prefix, he wants to use it. The first
3964   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
3965   am_save_CPPFLAGS="$CPPFLAGS"
3966   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
3967
3968   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
3969     am_cv_func_iconv="no, consider installing GNU libiconv"
3970     am_cv_lib_iconv=no
3971     AC_TRY_LINK([#include <stdlib.h>
3972 #include <iconv.h>],
3973       [iconv_t cd = iconv_open("","");
3974        iconv(cd,NULL,NULL,NULL,NULL);
3975        iconv_close(cd);],
3976       am_cv_func_iconv=yes)
3977     if test "$am_cv_func_iconv" != yes; then
3978       am_save_LIBS="$LIBS"
3979       LIBS="$LIBS $LIBICONV"
3980       AC_TRY_LINK([#include <stdlib.h>
3981 #include <iconv.h>],
3982         [iconv_t cd = iconv_open("","");
3983          iconv(cd,NULL,NULL,NULL,NULL);
3984          iconv_close(cd);],
3985         am_cv_lib_iconv=yes
3986         am_cv_func_iconv=yes)
3987       LIBS="$am_save_LIBS"
3988     fi
3989   ])
3990   if test "$am_cv_func_iconv" = yes; then
3991     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
3992   fi
3993   if test "$am_cv_lib_iconv" = yes; then
3994     AC_MSG_CHECKING([how to link with libiconv])
3995     AC_MSG_RESULT([$LIBICONV])
3996   else
3997     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
3998     dnl either.
3999     CPPFLAGS="$am_save_CPPFLAGS"
4000     LIBICONV=
4001     LTLIBICONV=
4002   fi
4003   AC_SUBST(LIBICONV)
4004   AC_SUBST(LTLIBICONV)
4005 ])
4006
4007 AC_DEFUN([AM_ICONV],
4008 [
4009   AC_REQUIRE([AM_ICONV_LINK])
4010   if test "$am_cv_func_iconv" = yes; then
4011     AC_MSG_CHECKING([for iconv declaration])
4012     AC_CACHE_VAL(am_cv_proto_iconv, [
4013       AC_TRY_COMPILE([
4014 #include <stdlib.h>
4015 #include <iconv.h>
4016 extern
4017 #ifdef __cplusplus
4018 "C"
4019 #endif
4020 #if defined(__STDC__) || defined(__cplusplus)
4021 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4022 #else
4023 size_t iconv();
4024 #endif
4025 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
4026       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
4027     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4028     AC_MSG_RESULT([$]{ac_t:-
4029          }[$]am_cv_proto_iconv)
4030     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
4031       [Define as const if the declaration of iconv() needs const.])
4032   fi
4033 ])
4034
4035 # lib-prefix.m4 serial 1 (gettext-0.11)
4036 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4037 dnl This file is free software, distributed under the terms of the GNU
4038 dnl General Public License.  As a special exception to the GNU General
4039 dnl Public License, this file may be distributed as part of a program
4040 dnl that contains a configuration script generated by Autoconf, under
4041 dnl the same distribution terms as the rest of that program.
4042
4043 dnl From Bruno Haible.
4044
4045 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
4046 dnl to access previously installed libraries. The basic assumption is that
4047 dnl a user will want packages to use other packages he previously installed
4048 dnl with the same --prefix option.
4049 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
4050 dnl libraries, but is otherwise very convenient.
4051 AC_DEFUN([AC_LIB_PREFIX],
4052 [
4053   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
4054   AC_REQUIRE([AC_PROG_CC])
4055   AC_REQUIRE([AC_CANONICAL_HOST])
4056   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4057   dnl By default, look in $includedir and $libdir.
4058   use_additional=yes
4059   AC_LIB_WITH_FINAL_PREFIX([
4060     eval additional_includedir=\"$includedir\"
4061     eval additional_libdir=\"$libdir\"
4062   ])
4063   AC_ARG_WITH([lib-prefix],
4064 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
4065   --without-lib-prefix    don't search for libraries in includedir and libdir],
4066 [
4067     if test "X$withval" = "Xno"; then
4068       use_additional=no
4069     else
4070       if test "X$withval" = "X"; then
4071         AC_LIB_WITH_FINAL_PREFIX([
4072           eval additional_includedir=\"$includedir\"
4073           eval additional_libdir=\"$libdir\"
4074         ])
4075       else
4076         additional_includedir="$withval/include"
4077         additional_libdir="$withval/lib"
4078       fi
4079     fi
4080 ])
4081   if test $use_additional = yes; then
4082     dnl Potentially add $additional_includedir to $CPPFLAGS.
4083     dnl But don't add it
4084     dnl   1. if it's the standard /usr/include,
4085     dnl   2. if it's already present in $CPPFLAGS,
4086     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
4087     dnl   4. if it doesn't exist as a directory.
4088     if test "X$additional_includedir" != "X/usr/include"; then
4089       haveit=
4090       for x in $CPPFLAGS; do
4091         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4092         if test "X$x" = "X-I$additional_includedir"; then
4093           haveit=yes
4094           break
4095         fi
4096       done
4097       if test -z "$haveit"; then
4098         if test "X$additional_includedir" = "X/usr/local/include"; then
4099           if test -n "$GCC"; then
4100             case $host_os in
4101               linux*) haveit=yes;;
4102             esac
4103           fi
4104         fi
4105         if test -z "$haveit"; then
4106           if test -d "$additional_includedir"; then
4107             dnl Really add $additional_includedir to $CPPFLAGS.
4108             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
4109           fi
4110         fi
4111       fi
4112     fi
4113     dnl Potentially add $additional_libdir to $LDFLAGS.
4114     dnl But don't add it
4115     dnl   1. if it's the standard /usr/lib,
4116     dnl   2. if it's already present in $LDFLAGS,
4117     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
4118     dnl   4. if it doesn't exist as a directory.
4119     if test "X$additional_libdir" != "X/usr/lib"; then
4120       haveit=
4121       for x in $LDFLAGS; do
4122         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4123         if test "X$x" = "X-L$additional_libdir"; then
4124           haveit=yes
4125           break
4126         fi
4127       done
4128       if test -z "$haveit"; then
4129         if test "X$additional_libdir" = "X/usr/local/lib"; then
4130           if test -n "$GCC"; then
4131             case $host_os in
4132               linux*) haveit=yes;;
4133             esac
4134           fi
4135         fi
4136         if test -z "$haveit"; then
4137           if test -d "$additional_libdir"; then
4138             dnl Really add $additional_libdir to $LDFLAGS.
4139             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
4140           fi
4141         fi
4142       fi
4143     fi
4144   fi
4145 ])
4146
4147 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
4148 dnl acl_final_exec_prefix, containing the values to which $prefix and
4149 dnl $exec_prefix will expand at the end of the configure script.
4150 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
4151 [
4152   dnl Unfortunately, prefix and exec_prefix get only finally determined
4153   dnl at the end of configure.
4154   if test "X$prefix" = "XNONE"; then
4155     acl_final_prefix="$ac_default_prefix"
4156   else
4157     acl_final_prefix="$prefix"
4158   fi
4159   if test "X$exec_prefix" = "XNONE"; then
4160     acl_final_exec_prefix='${prefix}'
4161   else
4162     acl_final_exec_prefix="$exec_prefix"
4163   fi
4164   acl_save_prefix="$prefix"
4165   prefix="$acl_final_prefix"
4166   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
4167   prefix="$acl_save_prefix"
4168 ])
4169
4170 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
4171 dnl variables prefix and exec_prefix bound to the values they will have
4172 dnl at the end of the configure script.
4173 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
4174 [
4175   acl_save_prefix="$prefix"
4176   prefix="$acl_final_prefix"
4177   acl_save_exec_prefix="$exec_prefix"
4178   exec_prefix="$acl_final_exec_prefix"
4179   $1
4180   exec_prefix="$acl_save_exec_prefix"
4181   prefix="$acl_save_prefix"
4182 ])
4183
4184 # lib-link.m4 serial 2 (gettext-0.11.2)
4185 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4186 dnl This file is free software, distributed under the terms of the GNU
4187 dnl General Public License.  As a special exception to the GNU General
4188 dnl Public License, this file may be distributed as part of a program
4189 dnl that contains a configuration script generated by Autoconf, under
4190 dnl the same distribution terms as the rest of that program.
4191
4192 dnl From Bruno Haible.
4193
4194 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
4195 dnl the libraries corresponding to explicit and implicit dependencies.
4196 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
4197 dnl augments the CPPFLAGS variable.
4198 AC_DEFUN([AC_LIB_LINKFLAGS],
4199 [
4200   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4201   AC_REQUIRE([AC_LIB_RPATH])
4202   define([Name],[translit([$1],[./-], [___])])
4203   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4204                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4205   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
4206     AC_LIB_LINKFLAGS_BODY([$1], [$2])
4207     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
4208     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
4209     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
4210   ])
4211   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
4212   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
4213   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
4214   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4215   AC_SUBST([LIB]NAME)
4216   AC_SUBST([LTLIB]NAME)
4217   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
4218   dnl results of this search when this library appears as a dependency.
4219   HAVE_LIB[]NAME=yes
4220   undefine([Name])
4221   undefine([NAME])
4222 ])
4223
4224 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
4225 dnl searches for libname and the libraries corresponding to explicit and
4226 dnl implicit dependencies, together with the specified include files and
4227 dnl the ability to compile and link the specified testcode. If found, it
4228 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
4229 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
4230 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
4231 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
4232 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
4233 [
4234   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4235   AC_REQUIRE([AC_LIB_RPATH])
4236   define([Name],[translit([$1],[./-], [___])])
4237   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4238                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4239
4240   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
4241   dnl accordingly.
4242   AC_LIB_LINKFLAGS_BODY([$1], [$2])
4243
4244   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
4245   dnl because if the user has installed lib[]Name and not disabled its use
4246   dnl via --without-lib[]Name-prefix, he wants to use it.
4247   ac_save_CPPFLAGS="$CPPFLAGS"
4248   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4249
4250   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
4251     ac_save_LIBS="$LIBS"
4252     LIBS="$LIBS $LIB[]NAME"
4253     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
4254     LIBS="$ac_save_LIBS"
4255   ])
4256   if test "$ac_cv_lib[]Name" = yes; then
4257     HAVE_LIB[]NAME=yes
4258     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
4259     AC_MSG_CHECKING([how to link with lib[]$1])
4260     AC_MSG_RESULT([$LIB[]NAME])
4261   else
4262     HAVE_LIB[]NAME=no
4263     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
4264     dnl $INC[]NAME either.
4265     CPPFLAGS="$ac_save_CPPFLAGS"
4266     LIB[]NAME=
4267     LTLIB[]NAME=
4268   fi
4269   AC_SUBST([HAVE_LIB]NAME)
4270   AC_SUBST([LIB]NAME)
4271   AC_SUBST([LTLIB]NAME)
4272   undefine([Name])
4273   undefine([NAME])
4274 ])
4275
4276 dnl Determine the platform dependent parameters needed to use rpath:
4277 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
4278 dnl hardcode_direct, hardcode_minus_L,
4279 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
4280 AC_DEFUN([AC_LIB_RPATH],
4281 [
4282   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
4283   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
4284   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
4285   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
4286   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
4287     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
4288     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
4289     . ./conftest.sh
4290     rm -f ./conftest.sh
4291     acl_cv_rpath=done
4292   ])
4293   wl="$acl_cv_wl"
4294   libext="$acl_cv_libext"
4295   shlibext="$acl_cv_shlibext"
4296   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
4297   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
4298   hardcode_direct="$acl_cv_hardcode_direct"
4299   hardcode_minus_L="$acl_cv_hardcode_minus_L"
4300   sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
4301   sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
4302 ])
4303
4304 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
4305 dnl the libraries corresponding to explicit and implicit dependencies.
4306 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
4307 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
4308 [
4309   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4310                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4311   dnl By default, look in $includedir and $libdir.
4312   use_additional=yes
4313   AC_LIB_WITH_FINAL_PREFIX([
4314     eval additional_includedir=\"$includedir\"
4315     eval additional_libdir=\"$libdir\"
4316   ])
4317   AC_ARG_WITH([lib$1-prefix],
4318 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
4319   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
4320 [
4321     if test "X$withval" = "Xno"; then
4322       use_additional=no
4323     else
4324       if test "X$withval" = "X"; then
4325         AC_LIB_WITH_FINAL_PREFIX([
4326           eval additional_includedir=\"$includedir\"
4327           eval additional_libdir=\"$libdir\"
4328         ])
4329       else
4330         additional_includedir="$withval/include"
4331         additional_libdir="$withval/lib"
4332       fi
4333     fi
4334 ])
4335   dnl Search the library and its dependencies in $additional_libdir and
4336   dnl $LDFLAGS. Using breadth-first-seach.
4337   LIB[]NAME=
4338   LTLIB[]NAME=
4339   INC[]NAME=
4340   rpathdirs=
4341   ltrpathdirs=
4342   names_already_handled=
4343   names_next_round='$1 $2'
4344   while test -n "$names_next_round"; do
4345     names_this_round="$names_next_round"
4346     names_next_round=
4347     for name in $names_this_round; do
4348       already_handled=
4349       for n in $names_already_handled; do
4350         if test "$n" = "$name"; then
4351           already_handled=yes
4352           break
4353         fi
4354       done
4355       if test -z "$already_handled"; then
4356         names_already_handled="$names_already_handled $name"
4357         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
4358         dnl or AC_LIB_HAVE_LINKFLAGS call.
4359         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
4360         eval value=\"\$HAVE_LIB$uppername\"
4361         if test -n "$value"; then
4362           if test "$value" = yes; then
4363             eval value=\"\$LIB$uppername\"
4364             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
4365             eval value=\"\$LTLIB$uppername\"
4366             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
4367           else
4368             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
4369             dnl that this library doesn't exist. So just drop it.
4370             :
4371           fi
4372         else
4373           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
4374           dnl and the already constructed $LIBNAME/$LTLIBNAME.
4375           found_dir=
4376           found_la=
4377           found_so=
4378           found_a=
4379           if test $use_additional = yes; then
4380             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
4381               found_dir="$additional_libdir"
4382               found_so="$additional_libdir/lib$name.$shlibext"
4383               if test -f "$additional_libdir/lib$name.la"; then
4384                 found_la="$additional_libdir/lib$name.la"
4385               fi
4386             else
4387               if test -f "$additional_libdir/lib$name.$libext"; then
4388                 found_dir="$additional_libdir"
4389                 found_a="$additional_libdir/lib$name.$libext"
4390                 if test -f "$additional_libdir/lib$name.la"; then
4391                   found_la="$additional_libdir/lib$name.la"
4392                 fi
4393               fi
4394             fi
4395           fi
4396           if test "X$found_dir" = "X"; then
4397             for x in $LDFLAGS $LTLIB[]NAME; do
4398               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4399               case "$x" in
4400                 -L*)
4401                   dir=`echo "X$x" | sed -e 's/^X-L//'`
4402                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
4403                     found_dir="$dir"
4404                     found_so="$dir/lib$name.$shlibext"
4405                     if test -f "$dir/lib$name.la"; then
4406                       found_la="$dir/lib$name.la"
4407                     fi
4408                   else
4409                     if test -f "$dir/lib$name.$libext"; then
4410                       found_dir="$dir"
4411                       found_a="$dir/lib$name.$libext"
4412                       if test -f "$dir/lib$name.la"; then
4413                         found_la="$dir/lib$name.la"
4414                       fi
4415                     fi
4416                   fi
4417                   ;;
4418               esac
4419               if test "X$found_dir" != "X"; then
4420                 break
4421               fi
4422             done
4423           fi
4424           if test "X$found_dir" != "X"; then
4425             dnl Found the library.
4426             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
4427             if test "X$found_so" != "X"; then
4428               dnl Linking with a shared library. We attempt to hardcode its
4429               dnl directory into the executable's runpath, unless it's the
4430               dnl standard /usr/lib.
4431               if test "X$found_dir" = "X/usr/lib"; then
4432                 dnl No hardcoding is needed.
4433                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4434               else
4435                 dnl Use an explicit option to hardcode DIR into the resulting
4436                 dnl binary.
4437                 dnl Potentially add DIR to ltrpathdirs.
4438                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4439                 haveit=
4440                 for x in $ltrpathdirs; do
4441                   if test "X$x" = "X$found_dir"; then
4442                     haveit=yes
4443                     break
4444                   fi
4445                 done
4446                 if test -z "$haveit"; then
4447                   ltrpathdirs="$ltrpathdirs $found_dir"
4448                 fi
4449                 dnl The hardcoding into $LIBNAME is system dependent.
4450                 if test "$hardcode_direct" = yes; then
4451                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
4452                   dnl resulting binary.
4453                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4454                 else
4455                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
4456                     dnl Use an explicit option to hardcode DIR into the resulting
4457                     dnl binary.
4458                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4459                     dnl Potentially add DIR to rpathdirs.
4460                     dnl The rpathdirs will be appended to $LIBNAME at the end.
4461                     haveit=
4462                     for x in $rpathdirs; do
4463                       if test "X$x" = "X$found_dir"; then
4464                         haveit=yes
4465                         break
4466                       fi
4467                     done
4468                     if test -z "$haveit"; then
4469                       rpathdirs="$rpathdirs $found_dir"
4470                     fi
4471                   else
4472                     dnl Rely on "-L$found_dir".
4473                     dnl But don't add it if it's already contained in the LDFLAGS
4474                     dnl or the already constructed $LIBNAME
4475                     haveit=
4476                     for x in $LDFLAGS $LIB[]NAME; do
4477                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4478                       if test "X$x" = "X-L$found_dir"; then
4479                         haveit=yes
4480                         break
4481                       fi
4482                     done
4483                     if test -z "$haveit"; then
4484                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
4485                     fi
4486                     if test "$hardcode_minus_L" != no; then
4487                       dnl FIXME: Not sure whether we should use
4488                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4489                       dnl here.
4490                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4491                     else
4492                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
4493                       dnl here, because this doesn't fit in flags passed to the
4494                       dnl compiler. So give up. No hardcoding. This affects only
4495                       dnl very old systems.
4496                       dnl FIXME: Not sure whether we should use
4497                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4498                       dnl here.
4499                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4500                     fi
4501                   fi
4502                 fi
4503               fi
4504             else
4505               if test "X$found_a" != "X"; then
4506                 dnl Linking with a static library.
4507                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
4508               else
4509                 dnl We shouldn't come here, but anyway it's good to have a
4510                 dnl fallback.
4511                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
4512               fi
4513             fi
4514             dnl Assume the include files are nearby.
4515             additional_includedir=
4516             case "$found_dir" in
4517               */lib | */lib/)
4518                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
4519                 additional_includedir="$basedir/include"
4520                 ;;
4521             esac
4522             if test "X$additional_includedir" != "X"; then
4523               dnl Potentially add $additional_includedir to $INCNAME.
4524               dnl But don't add it
4525               dnl   1. if it's the standard /usr/include,
4526               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
4527               dnl   3. if it's already present in $CPPFLAGS or the already
4528               dnl      constructed $INCNAME,
4529               dnl   4. if it doesn't exist as a directory.
4530               if test "X$additional_includedir" != "X/usr/include"; then
4531                 haveit=
4532                 if test "X$additional_includedir" = "X/usr/local/include"; then
4533                   if test -n "$GCC"; then
4534                     case $host_os in
4535                       linux*) haveit=yes;;
4536                     esac
4537                   fi
4538                 fi
4539                 if test -z "$haveit"; then
4540                   for x in $CPPFLAGS $INC[]NAME; do
4541                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4542                     if test "X$x" = "X-I$additional_includedir"; then
4543                       haveit=yes
4544                       break
4545                     fi
4546                   done
4547                   if test -z "$haveit"; then
4548                     if test -d "$additional_includedir"; then
4549                       dnl Really add $additional_includedir to $INCNAME.
4550                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
4551                     fi
4552                   fi
4553                 fi
4554               fi
4555             fi
4556             dnl Look for dependencies.
4557             if test -n "$found_la"; then
4558               dnl Read the .la file. It defines the variables
4559               dnl dlname, library_names, old_library, dependency_libs, current,
4560               dnl age, revision, installed, dlopen, dlpreopen, libdir.
4561               save_libdir="$libdir"
4562               case "$found_la" in
4563                 */* | *\\*) . "$found_la" ;;
4564                 *) . "./$found_la" ;;
4565               esac
4566               libdir="$save_libdir"
4567               dnl We use only dependency_libs.
4568               for dep in $dependency_libs; do
4569                 case "$dep" in
4570                   -L*)
4571                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
4572                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
4573                     dnl But don't add it
4574                     dnl   1. if it's the standard /usr/lib,
4575                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
4576                     dnl   3. if it's already present in $LDFLAGS or the already
4577                     dnl      constructed $LIBNAME,
4578                     dnl   4. if it doesn't exist as a directory.
4579                     if test "X$additional_libdir" != "X/usr/lib"; then
4580                       haveit=
4581                       if test "X$additional_libdir" = "X/usr/local/lib"; then
4582                         if test -n "$GCC"; then
4583                           case $host_os in
4584                             linux*) haveit=yes;;
4585                           esac
4586                         fi
4587                       fi
4588                       if test -z "$haveit"; then
4589                         haveit=
4590                         for x in $LDFLAGS $LIB[]NAME; do
4591                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4592                           if test "X$x" = "X-L$additional_libdir"; then
4593                             haveit=yes
4594                             break
4595                           fi
4596                         done
4597                         if test -z "$haveit"; then
4598                           if test -d "$additional_libdir"; then
4599                             dnl Really add $additional_libdir to $LIBNAME.
4600                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
4601                           fi
4602                         fi
4603                         haveit=
4604                         for x in $LDFLAGS $LTLIB[]NAME; do
4605                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4606                           if test "X$x" = "X-L$additional_libdir"; then
4607                             haveit=yes
4608                             break
4609                           fi
4610                         done
4611                         if test -z "$haveit"; then
4612                           if test -d "$additional_libdir"; then
4613                             dnl Really add $additional_libdir to $LTLIBNAME.
4614                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
4615                           fi
4616                         fi
4617                       fi
4618                     fi
4619                     ;;
4620                   -R*)
4621                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
4622                     dnl Potentially add DIR to rpathdirs.
4623                     dnl The rpathdirs will be appended to $LIBNAME at the end.
4624                     haveit=
4625                     for x in $rpathdirs; do
4626                       if test "X$x" = "X$dir"; then
4627                         haveit=yes
4628                         break
4629                       fi
4630                     done
4631                     if test -z "$haveit"; then
4632                       rpathdirs="$rpathdirs $dir"
4633                     fi
4634                     dnl Potentially add DIR to ltrpathdirs.
4635                     dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4636                     haveit=
4637                     for x in $ltrpathdirs; do
4638                       if test "X$x" = "X$dir"; then
4639                         haveit=yes
4640                         break
4641                       fi
4642                     done
4643                     if test -z "$haveit"; then
4644                       ltrpathdirs="$ltrpathdirs $dir"
4645                     fi
4646                     ;;
4647                   -l*)
4648                     dnl Handle this in the next round.
4649                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
4650                     ;;
4651                   *.la)
4652                     dnl Handle this in the next round. Throw away the .la's
4653                     dnl directory; it is already contained in a preceding -L
4654                     dnl option.
4655                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
4656                     ;;
4657                   *)
4658                     dnl Most likely an immediate library name.
4659                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
4660                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
4661                     ;;
4662                 esac
4663               done
4664             fi
4665           else
4666             dnl Didn't find the library; assume it is in the system directories
4667             dnl known to the linker and runtime loader. (All the system
4668             dnl directories known to the linker should also be known to the
4669             dnl runtime loader, otherwise the system is severely misconfigured.)
4670             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4671             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
4672           fi
4673         fi
4674       fi
4675     done
4676   done
4677   if test "X$rpathdirs" != "X"; then
4678     if test -n "$hardcode_libdir_separator"; then
4679       dnl Weird platform: only the last -rpath option counts, the user must
4680       dnl pass all path elements in one option. We can arrange that for a
4681       dnl single library, but not when more than one $LIBNAMEs are used.
4682       alldirs=
4683       for found_dir in $rpathdirs; do
4684         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
4685       done
4686       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
4687       acl_save_libdir="$libdir"
4688       libdir="$alldirs"
4689       eval flag=\"$hardcode_libdir_flag_spec\"
4690       libdir="$acl_save_libdir"
4691       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4692     else
4693       dnl The -rpath options are cumulative.
4694       for found_dir in $rpathdirs; do
4695         acl_save_libdir="$libdir"
4696         libdir="$found_dir"
4697         eval flag=\"$hardcode_libdir_flag_spec\"
4698         libdir="$acl_save_libdir"
4699         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4700       done
4701     fi
4702   fi
4703   if test "X$ltrpathdirs" != "X"; then
4704     dnl When using libtool, the option that works for both libraries and
4705     dnl executables is -R. The -R options are cumulative.
4706     for found_dir in $ltrpathdirs; do
4707       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
4708     done
4709   fi
4710 ])
4711
4712 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
4713 dnl unless already present in VAR.
4714 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
4715 dnl contains two or three consecutive elements that belong together.
4716 AC_DEFUN([AC_LIB_APPENDTOVAR],
4717 [
4718   for element in [$2]; do
4719     haveit=
4720     for x in $[$1]; do
4721       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4722       if test "X$x" = "X$element"; then
4723         haveit=yes
4724         break
4725       fi
4726     done
4727     if test -z "$haveit"; then
4728       [$1]="${[$1]}${[$1]:+ }$element"
4729     fi
4730   done
4731 ])
4732
4733 # lib-ld.m4 serial 1 (gettext-0.11)
4734 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
4735 dnl This file is free software, distributed under the terms of the GNU
4736 dnl General Public License.  As a special exception to the GNU General
4737 dnl Public License, this file may be distributed as part of a program
4738 dnl that contains a configuration script generated by Autoconf, under
4739 dnl the same distribution terms as the rest of that program.
4740
4741 dnl Subroutines of libtool.m4,
4742 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
4743 dnl with libtool.m4.
4744
4745 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
4746 AC_DEFUN([AC_LIB_PROG_LD_GNU],
4747 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
4748 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4749 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4750   acl_cv_prog_gnu_ld=yes
4751 else
4752   acl_cv_prog_gnu_ld=no
4753 fi])
4754 with_gnu_ld=$acl_cv_prog_gnu_ld
4755 ])
4756
4757 dnl From libtool-1.4. Sets the variable LD.
4758 AC_DEFUN([AC_LIB_PROG_LD],
4759 [AC_ARG_WITH(gnu-ld,
4760 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
4761 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4762 AC_REQUIRE([AC_PROG_CC])dnl
4763 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4764 ac_prog=ld
4765 if test "$GCC" = yes; then
4766   # Check if gcc -print-prog-name=ld gives a path.
4767   AC_MSG_CHECKING([for ld used by GCC])
4768   case $host in
4769   *-*-mingw*)
4770     # gcc leaves a trailing carriage return which upsets mingw
4771     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4772   *)
4773     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4774   esac
4775   case $ac_prog in
4776     # Accept absolute paths.
4777     [[\\/]* | [A-Za-z]:[\\/]*)]
4778       [re_direlt='/[^/][^/]*/\.\./']
4779       # Canonicalize the path of ld
4780       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4781       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4782         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4783       done
4784       test -z "$LD" && LD="$ac_prog"
4785       ;;
4786   "")
4787     # If it fails, then pretend we aren't using GCC.
4788     ac_prog=ld
4789     ;;
4790   *)
4791     # If it is relative, then search for the first ld in PATH.
4792     with_gnu_ld=unknown
4793     ;;
4794   esac
4795 elif test "$with_gnu_ld" = yes; then
4796   AC_MSG_CHECKING([for GNU ld])
4797 else
4798   AC_MSG_CHECKING([for non-GNU ld])
4799 fi
4800 AC_CACHE_VAL(acl_cv_path_LD,
4801 [if test -z "$LD"; then
4802   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4803   for ac_dir in $PATH; do
4804     test -z "$ac_dir" && ac_dir=.
4805     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4806       acl_cv_path_LD="$ac_dir/$ac_prog"
4807       # Check to see if the program is GNU ld.  I'd rather use --version,
4808       # but apparently some GNU ld's only accept -v.
4809       # Break only if it was the GNU/non-GNU ld that we prefer.
4810       if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4811         test "$with_gnu_ld" != no && break
4812       else
4813         test "$with_gnu_ld" != yes && break
4814       fi
4815     fi
4816   done
4817   IFS="$ac_save_ifs"
4818 else
4819   acl_cv_path_LD="$LD" # Let the user override the test with a path.
4820 fi])
4821 LD="$acl_cv_path_LD"
4822 if test -n "$LD"; then
4823   AC_MSG_RESULT($LD)
4824 else
4825   AC_MSG_RESULT(no)
4826 fi
4827 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4828 AC_LIB_PROG_LD_GNU
4829 ])
4830
4831 # gettext.m4 serial 14 (gettext-0.11.2)
4832 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
4833 dnl This file is free software, distributed under the terms of the GNU
4834 dnl General Public License.  As a special exception to the GNU General
4835 dnl Public License, this file may be distributed as part of a program
4836 dnl that contains a configuration script generated by Autoconf, under
4837 dnl the same distribution terms as the rest of that program.
4838 dnl
4839 dnl This file can can be used in projects which are not available under
4840 dnl the GNU General Public License or the GNU Library General Public
4841 dnl License but which still want to provide support for the GNU gettext
4842 dnl functionality.
4843 dnl Please note that the actual code of the GNU gettext library is covered
4844 dnl by the GNU Library General Public License, and the rest of the GNU
4845 dnl gettext package package is covered by the GNU General Public License.
4846 dnl They are *not* in the public domain.
4847
4848 dnl Authors:
4849 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
4850 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
4851
4852 dnl Macro to add for using GNU gettext.
4853
4854 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
4855 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
4856 dnl    default (if it is not specified or empty) is 'no-libtool'.
4857 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
4858 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
4859 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
4860 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
4861 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
4862 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
4863 dnl    $(top_builddir)/intl/libintl.a will be created.
4864 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
4865 dnl    implementations (in libc or libintl) without the ngettext() function
4866 dnl    will be ignored.
4867 dnl INTLDIR is used to find the intl libraries.  If empty,
4868 dnl    the value `$(top_builddir)/intl/' is used.
4869 dnl
4870 dnl The result of the configuration is one of three cases:
4871 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
4872 dnl    and used.
4873 dnl    Catalog format: GNU --> install in $(datadir)
4874 dnl    Catalog extension: .mo after installation, .gmo in source tree
4875 dnl 2) GNU gettext has been found in the system's C library.
4876 dnl    Catalog format: GNU --> install in $(datadir)
4877 dnl    Catalog extension: .mo after installation, .gmo in source tree
4878 dnl 3) No internationalization, always use English msgid.
4879 dnl    Catalog format: none
4880 dnl    Catalog extension: none
4881 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
4882 dnl The use of .gmo is historical (it was needed to avoid overwriting the
4883 dnl GNU format catalogs when building on a platform with an X/Open gettext),
4884 dnl but we keep it in order not to force irrelevant filename changes on the
4885 dnl maintainers.
4886 dnl
4887 AC_DEFUN([AM_GNU_GETTEXT],
4888 [
4889   dnl Argument checking.
4890   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
4891     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
4892 ])])])])])
4893   ifelse([$2], [], , [ifelse([$2], [need-ngettext], ,
4894     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
4895 ])])])
4896   define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
4897   define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
4898
4899   AC_REQUIRE([AM_PO_SUBDIRS])dnl
4900   ifelse(gt_included_intl, yes, [
4901     AC_REQUIRE([AM_INTL_SUBDIR])dnl
4902   ])
4903
4904   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4905   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4906   AC_REQUIRE([AC_LIB_RPATH])
4907
4908   AC_MSG_CHECKING([whether NLS is requested])
4909   dnl Default is enabled NLS
4910   AC_ARG_ENABLE(nls,
4911     [  --disable-nls           do not use Native Language Support],
4912     USE_NLS=$enableval, USE_NLS=yes)
4913   AC_MSG_RESULT($USE_NLS)
4914   AC_SUBST(USE_NLS)
4915
4916   ifelse(gt_included_intl, yes, [
4917     BUILD_INCLUDED_LIBINTL=no
4918     USE_INCLUDED_LIBINTL=no
4919   ])
4920   LIBINTL=
4921   LTLIBINTL=
4922   POSUB=
4923
4924   dnl If we use NLS figure out what method
4925   if test "$USE_NLS" = "yes"; then
4926     gt_use_preinstalled_gnugettext=no
4927     ifelse(gt_included_intl, yes, [
4928       AC_MSG_CHECKING([whether included gettext is requested])
4929       AC_ARG_WITH(included-gettext,
4930         [  --with-included-gettext use the GNU gettext library included here],
4931         nls_cv_force_use_gnu_gettext=$withval,
4932         nls_cv_force_use_gnu_gettext=no)
4933       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
4934
4935       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
4936       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
4937     ])
4938         dnl User does not insist on using GNU NLS library.  Figure out what
4939         dnl to use.  If GNU gettext is available we use this.  Else we have
4940         dnl to fall back to GNU NLS library.
4941
4942         dnl Add a version number to the cache macros.
4943         define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1))
4944         define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
4945         define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
4946
4947         AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
4948          [AC_TRY_LINK([#include <libintl.h>
4949 extern int _nl_msg_cat_cntr;
4950 extern int *_nl_domain_bindings;],
4951             [bindtextdomain ("", "");
4952 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
4953             gt_cv_func_gnugettext_libc=yes,
4954             gt_cv_func_gnugettext_libc=no)])
4955
4956         if test "$gt_cv_func_gnugettext_libc" != "yes"; then
4957           dnl Sometimes libintl requires libiconv, so first search for libiconv.
4958           ifelse(gt_included_intl, yes, , [
4959             AM_ICONV_LINK
4960           ])
4961           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
4962           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
4963           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
4964           dnl even if libiconv doesn't exist.
4965           AC_LIB_LINKFLAGS_BODY([intl])
4966           AC_CACHE_CHECK([for GNU gettext in libintl],
4967             gt_cv_func_gnugettext_libintl,
4968            [gt_save_CPPFLAGS="$CPPFLAGS"
4969             CPPFLAGS="$CPPFLAGS $INCINTL"
4970             gt_save_LIBS="$LIBS"
4971             LIBS="$LIBS $LIBINTL"
4972             dnl Now see whether libintl exists and does not depend on libiconv.
4973             AC_TRY_LINK([#include <libintl.h>
4974 extern int _nl_msg_cat_cntr;
4975 extern
4976 #ifdef __cplusplus
4977 "C"
4978 #endif
4979 const char *_nl_expand_alias ();],
4980               [bindtextdomain ("", "");
4981 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
4982               gt_cv_func_gnugettext_libintl=yes,
4983               gt_cv_func_gnugettext_libintl=no)
4984             dnl Now see whether libintl exists and depends on libiconv.
4985             if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
4986               LIBS="$LIBS $LIBICONV"
4987               AC_TRY_LINK([#include <libintl.h>
4988 extern int _nl_msg_cat_cntr;
4989 extern
4990 #ifdef __cplusplus
4991 "C"
4992 #endif
4993 const char *_nl_expand_alias ();],
4994                 [bindtextdomain ("", "");
4995 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
4996                [LIBINTL="$LIBINTL $LIBICONV"
4997                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
4998                 gt_cv_func_gnugettext_libintl=yes
4999                ])
5000             fi
5001             CPPFLAGS="$gt_save_CPPFLAGS"
5002             LIBS="$gt_save_LIBS"])
5003         fi
5004
5005         dnl If an already present or preinstalled GNU gettext() is found,
5006         dnl use it.  But if this macro is used in GNU gettext, and GNU
5007         dnl gettext is already preinstalled in libintl, we update this
5008         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
5009         if test "$gt_cv_func_gnugettext_libc" = "yes" \
5010            || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
5011                 && test "$PACKAGE" != gettext; }; then
5012           gt_use_preinstalled_gnugettext=yes
5013         else
5014           dnl Reset the values set by searching for libintl.
5015           LIBINTL=
5016           LTLIBINTL=
5017           INCINTL=
5018         fi
5019
5020     ifelse(gt_included_intl, yes, [
5021         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
5022           dnl GNU gettext is not found in the C library.
5023           dnl Fall back on included GNU gettext library.
5024           nls_cv_use_gnu_gettext=yes
5025         fi
5026       fi
5027
5028       if test "$nls_cv_use_gnu_gettext" = "yes"; then
5029         dnl Mark actions used to generate GNU NLS library.
5030         INTLOBJS="\$(GETTOBJS)"
5031         BUILD_INCLUDED_LIBINTL=yes
5032         USE_INCLUDED_LIBINTL=yes
5033         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
5034         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
5035         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
5036       fi
5037
5038       if test "$gt_use_preinstalled_gnugettext" = "yes" \
5039          || test "$nls_cv_use_gnu_gettext" = "yes"; then
5040         dnl Mark actions to use GNU gettext tools.
5041         CATOBJEXT=.gmo
5042       fi
5043     ])
5044
5045     if test "$gt_use_preinstalled_gnugettext" = "yes" \
5046        || test "$nls_cv_use_gnu_gettext" = "yes"; then
5047       AC_DEFINE(ENABLE_NLS, 1,
5048         [Define to 1 if translation of program messages to the user's native language
5049    is requested.])
5050     else
5051       USE_NLS=no
5052     fi
5053   fi
5054
5055   if test "$USE_NLS" = "yes"; then
5056
5057     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
5058       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
5059         AC_MSG_CHECKING([how to link with libintl])
5060         AC_MSG_RESULT([$LIBINTL])
5061         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
5062       fi
5063
5064       dnl For backward compatibility. Some packages may be using this.
5065       AC_DEFINE(HAVE_GETTEXT, 1,
5066        [Define if the GNU gettext() function is already present or preinstalled.])
5067       AC_DEFINE(HAVE_DCGETTEXT, 1,
5068        [Define if the GNU dcgettext() function is already present or preinstalled.])
5069     fi
5070
5071     dnl We need to process the po/ directory.
5072     POSUB=po
5073   fi
5074
5075   ifelse(gt_included_intl, yes, [
5076     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
5077     dnl to 'yes' because some of the testsuite requires it.
5078     if test "$PACKAGE" = gettext; then
5079       BUILD_INCLUDED_LIBINTL=yes
5080     fi
5081
5082     dnl Make all variables we use known to autoconf.
5083     AC_SUBST(BUILD_INCLUDED_LIBINTL)
5084     AC_SUBST(USE_INCLUDED_LIBINTL)
5085     AC_SUBST(CATOBJEXT)
5086     AC_SUBST(INTLOBJS)
5087
5088     dnl For backward compatibility. Some configure.ins may be using this.
5089     nls_cv_header_intl=
5090     nls_cv_header_libgt=
5091
5092     dnl For backward compatibility. Some Makefiles may be using this.
5093     DATADIRNAME=share
5094     AC_SUBST(DATADIRNAME)
5095
5096     dnl For backward compatibility. Some Makefiles may be using this.
5097     INSTOBJEXT=.mo
5098     AC_SUBST(INSTOBJEXT)
5099
5100     dnl For backward compatibility. Some Makefiles may be using this.
5101     GENCAT=gencat
5102     AC_SUBST(GENCAT)
5103
5104     dnl Enable libtool support if the surrounding package wishes it.
5105     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
5106     AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
5107   ])
5108
5109   dnl For backward compatibility. Some Makefiles may be using this.
5110   INTLLIBS="$LIBINTL"
5111   AC_SUBST(INTLLIBS)
5112
5113   dnl Make all documented variables known to autoconf.
5114   AC_SUBST(LIBINTL)
5115   AC_SUBST(LTLIBINTL)
5116   AC_SUBST(POSUB)
5117 ])
5118
5119
5120 dnl Checks for all prerequisites of the po subdirectory,
5121 dnl except for USE_NLS.
5122 AC_DEFUN([AM_PO_SUBDIRS],
5123 [
5124   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
5125   AC_REQUIRE([AC_PROG_INSTALL])dnl
5126   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5127
5128   dnl Perform the following tests also if --disable-nls has been given,
5129   dnl because they are needed for "make dist" to work.
5130
5131   dnl Search for GNU msgfmt in the PATH.
5132   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
5133   dnl The second test excludes FreeBSD msgfmt.
5134   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
5135     [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
5136      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5137     :)
5138   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
5139
5140   dnl Search for GNU xgettext 0.11 or newer in the PATH.
5141   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
5142   dnl The second test excludes FreeBSD xgettext.
5143   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
5144     [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5145      (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5146     :)
5147   dnl Remove leftover from FreeBSD xgettext call.
5148   rm -f messages.po
5149
5150   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
5151   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
5152     [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
5153
5154   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5155   dnl Test whether we really found GNU msgfmt.
5156   if test "$GMSGFMT" != ":"; then
5157     dnl If it is no GNU msgfmt we define it as : so that the
5158     dnl Makefiles still can work.
5159     if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
5160        (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5161       : ;
5162     else
5163       GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
5164       AC_MSG_RESULT(
5165         [found $GMSGFMT program is not GNU msgfmt; ignore it])
5166       GMSGFMT=":"
5167     fi
5168   fi
5169
5170   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5171   dnl Test whether we really found GNU xgettext.
5172   if test "$XGETTEXT" != ":"; then
5173     dnl If it is no GNU xgettext we define it as : so that the
5174     dnl Makefiles still can work.
5175     if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5176        (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5177       : ;
5178     else
5179       AC_MSG_RESULT(
5180         [found xgettext program is not GNU xgettext; ignore it])
5181       XGETTEXT=":"
5182     fi
5183     dnl Remove leftover from FreeBSD xgettext call.
5184     rm -f messages.po
5185   fi
5186
5187   AC_OUTPUT_COMMANDS([
5188     for ac_file in $CONFIG_FILES; do
5189       # Support "outfile[:infile[:infile...]]"
5190       case "$ac_file" in
5191         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5192       esac
5193       # PO directories have a Makefile.in generated from Makefile.in.in.
5194       case "$ac_file" in */Makefile.in)
5195         # Adjust a relative srcdir.
5196         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
5197         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
5198         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
5199         # In autoconf-2.13 it is called $ac_given_srcdir.
5200         # In autoconf-2.50 it is called $srcdir.
5201         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
5202         case "$ac_given_srcdir" in
5203           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
5204           /*) top_srcdir="$ac_given_srcdir" ;;
5205           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
5206         esac
5207         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
5208           rm -f "$ac_dir/POTFILES"
5209           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
5210           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
5211           # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
5212           # on $ac_dir but don't depend on user-specified configuration
5213           # parameters.
5214           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
5215             # The LINGUAS file contains the set of available languages.
5216             if test -n "$ALL_LINGUAS"; then
5217               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
5218             fi
5219             ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
5220             # Hide the ALL_LINGUAS assigment from automake.
5221             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
5222           fi
5223           case "$ac_given_srcdir" in
5224             .) srcdirpre= ;;
5225             *) srcdirpre='$(srcdir)/' ;;
5226           esac
5227           POFILES=
5228           GMOFILES=
5229           UPDATEPOFILES=
5230           DUMMYPOFILES=
5231           for lang in $ALL_LINGUAS; do
5232             POFILES="$POFILES $srcdirpre$lang.po"
5233             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
5234             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
5235             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
5236           done
5237           # CATALOGS depends on both $ac_dir and the user's LINGUAS
5238           # environment variable.
5239           INST_LINGUAS=
5240           if test -n "$ALL_LINGUAS"; then
5241             for presentlang in $ALL_LINGUAS; do
5242               useit=no
5243               if test "%UNSET%" != "$LINGUAS"; then
5244                 desiredlanguages="$LINGUAS"
5245               else
5246                 desiredlanguages="$ALL_LINGUAS"
5247               fi
5248               for desiredlang in $desiredlanguages; do
5249                 # Use the presentlang catalog if desiredlang is
5250                 #   a. equal to presentlang, or
5251                 #   b. a variant of presentlang (because in this case,
5252                 #      presentlang can be used as a fallback for messages
5253                 #      which are not translated in the desiredlang catalog).
5254                 case "$desiredlang" in
5255                   "$presentlang"*) useit=yes;;
5256                 esac
5257               done
5258               if test $useit = yes; then
5259                 INST_LINGUAS="$INST_LINGUAS $presentlang"
5260               fi
5261             done
5262           fi
5263           CATALOGS=
5264           if test -n "$INST_LINGUAS"; then
5265             for lang in $INST_LINGUAS; do
5266               CATALOGS="$CATALOGS $lang.gmo"
5267             done
5268           fi
5269           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
5270           sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
5271           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
5272             if test -f "$f"; then
5273               case "$f" in
5274                 *.orig | *.bak | *~) ;;
5275                 *) cat "$f" >> "$ac_dir/Makefile" ;;
5276               esac
5277             fi
5278           done
5279         fi
5280         ;;
5281       esac
5282     done],
5283    [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
5284     # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
5285     # from automake.
5286     eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
5287     # Capture the value of LINGUAS because we need it to compute CATALOGS.
5288     LINGUAS="${LINGUAS-%UNSET%}"
5289    ])
5290 ])
5291
5292
5293 dnl Checks for all prerequisites of the intl subdirectory,
5294 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
5295 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
5296 AC_DEFUN([AM_INTL_SUBDIR],
5297 [
5298   AC_REQUIRE([AC_PROG_INSTALL])dnl
5299   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5300   AC_REQUIRE([AC_PROG_CC])dnl
5301   AC_REQUIRE([AC_CANONICAL_HOST])dnl
5302   AC_REQUIRE([AC_PROG_RANLIB])dnl
5303   AC_REQUIRE([AC_ISC_POSIX])dnl
5304   AC_REQUIRE([AC_HEADER_STDC])dnl
5305   AC_REQUIRE([AC_C_CONST])dnl
5306   AC_REQUIRE([AC_C_INLINE])dnl
5307   AC_REQUIRE([AC_TYPE_OFF_T])dnl
5308   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
5309   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
5310   AC_REQUIRE([AC_FUNC_MMAP])dnl
5311   AC_REQUIRE([jm_GLIBC21])dnl
5312
5313   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
5314 stdlib.h string.h unistd.h sys/param.h])
5315   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
5316 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
5317 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
5318
5319   AM_ICONV
5320   AM_LANGINFO_CODESET
5321   AM_LC_MESSAGES
5322
5323   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
5324   dnl because plural.y uses bison specific features. It requires at least
5325   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
5326   dnl compile.
5327   dnl bison is only needed for the maintainer (who touches plural.y). But in
5328   dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
5329   dnl the rule in general Makefile. Now, some people carelessly touch the
5330   dnl files or have a broken "make" program, hence the plural.c rule will
5331   dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
5332   dnl present or too old.
5333   AC_CHECK_PROGS([INTLBISON], [bison])
5334   if test -z "$INTLBISON"; then
5335     ac_verc_fail=yes
5336   else
5337     dnl Found it, now check the version.
5338     AC_MSG_CHECKING([version of bison])
5339 changequote(<<,>>)dnl
5340     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
5341     case $ac_prog_version in
5342       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
5343       1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
5344 changequote([,])dnl
5345          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
5346       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
5347     esac
5348     AC_MSG_RESULT([$ac_prog_version])
5349   fi
5350   if test $ac_verc_fail = yes; then
5351     INTLBISON=:
5352   fi
5353 ])
5354
5355
5356 AC_DEFUN([AM_MKINSTALLDIRS],
5357 [
5358   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
5359   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
5360   dnl Try to locate is.
5361   MKINSTALLDIRS=
5362   if test -n "$ac_aux_dir"; then
5363     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
5364   fi
5365   if test -z "$MKINSTALLDIRS"; then
5366     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
5367   fi
5368   AC_SUBST(MKINSTALLDIRS)
5369 ])
5370
5371 # progtest.m4 serial 2 (gettext-0.10.40)
5372 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
5373 dnl This file is free software, distributed under the terms of the GNU
5374 dnl General Public License.  As a special exception to the GNU General
5375 dnl Public License, this file may be distributed as part of a program
5376 dnl that contains a configuration script generated by Autoconf, under
5377 dnl the same distribution terms as the rest of that program.
5378 dnl
5379 dnl This file can can be used in projects which are not available under
5380 dnl the GNU General Public License or the GNU Library General Public
5381 dnl License but which still want to provide support for the GNU gettext
5382 dnl functionality.
5383 dnl Please note that the actual code of the GNU gettext library is covered
5384 dnl by the GNU Library General Public License, and the rest of the GNU
5385 dnl gettext package package is covered by the GNU General Public License.
5386 dnl They are *not* in the public domain.
5387
5388 dnl Authors:
5389 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
5390
5391 # Search path for a program which passes the given test.
5392
5393 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
5394 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
5395 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
5396 [# Extract the first word of "$2", so it can be a program name with args.
5397 set dummy $2; ac_word=[$]2
5398 AC_MSG_CHECKING([for $ac_word])
5399 AC_CACHE_VAL(ac_cv_path_$1,
5400 [case "[$]$1" in
5401   /*)
5402   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
5403   ;;
5404   *)
5405   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5406   for ac_dir in ifelse([$5], , $PATH, [$5]); do
5407     test -z "$ac_dir" && ac_dir=.
5408     if test -f $ac_dir/$ac_word; then
5409       if [$3]; then
5410         ac_cv_path_$1="$ac_dir/$ac_word"
5411         break
5412       fi
5413     fi
5414   done
5415   IFS="$ac_save_ifs"
5416 dnl If no 4th arg is given, leave the cache variable unset,
5417 dnl so AC_PATH_PROGS will keep looking.
5418 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
5419 ])dnl
5420   ;;
5421 esac])dnl
5422 $1="$ac_cv_path_$1"
5423 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
5424   AC_MSG_RESULT([$]$1)
5425 else
5426   AC_MSG_RESULT(no)
5427 fi
5428 AC_SUBST($1)dnl
5429 ])
5430
5431 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
5432 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5433 dnl This file is free software, distributed under the terms of the GNU
5434 dnl General Public License.  As a special exception to the GNU General
5435 dnl Public License, this file may be distributed as part of a program
5436 dnl that contains a configuration script generated by Autoconf, under
5437 dnl the same distribution terms as the rest of that program.
5438
5439 # Test for the GNU C Library, version 2.1 or newer.
5440 # From Bruno Haible.
5441
5442 AC_DEFUN([jm_GLIBC21],
5443   [
5444     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
5445       ac_cv_gnu_library_2_1,
5446       [AC_EGREP_CPP([Lucky GNU user],
5447         [
5448 #include <features.h>
5449 #ifdef __GNU_LIBRARY__
5450  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
5451   Lucky GNU user
5452  #endif
5453 #endif
5454         ],
5455         ac_cv_gnu_library_2_1=yes,
5456         ac_cv_gnu_library_2_1=no)
5457       ]
5458     )
5459     AC_SUBST(GLIBC21)
5460     GLIBC21="$ac_cv_gnu_library_2_1"
5461   ]
5462 )
5463
5464 # codeset.m4 serial AM1 (gettext-0.10.40)
5465 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5466 dnl This file is free software, distributed under the terms of the GNU
5467 dnl General Public License.  As a special exception to the GNU General
5468 dnl Public License, this file may be distributed as part of a program
5469 dnl that contains a configuration script generated by Autoconf, under
5470 dnl the same distribution terms as the rest of that program.
5471
5472 dnl From Bruno Haible.
5473
5474 AC_DEFUN([AM_LANGINFO_CODESET],
5475 [
5476   AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
5477     [AC_TRY_LINK([#include <langinfo.h>],
5478       [char* cs = nl_langinfo(CODESET);],
5479       am_cv_langinfo_codeset=yes,
5480       am_cv_langinfo_codeset=no)
5481     ])
5482   if test $am_cv_langinfo_codeset = yes; then
5483     AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
5484       [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
5485   fi
5486 ])
5487
5488 # lcmessage.m4 serial 2 (gettext-0.10.40)
5489 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5490 dnl This file is free software, distributed under the terms of the GNU
5491 dnl General Public License.  As a special exception to the GNU General
5492 dnl Public License, this file may be distributed as part of a program
5493 dnl that contains a configuration script generated by Autoconf, under
5494 dnl the same distribution terms as the rest of that program.
5495 dnl
5496 dnl This file can can be used in projects which are not available under
5497 dnl the GNU General Public License or the GNU Library General Public
5498 dnl License but which still want to provide support for the GNU gettext
5499 dnl functionality.
5500 dnl Please note that the actual code of the GNU gettext library is covered
5501 dnl by the GNU Library General Public License, and the rest of the GNU
5502 dnl gettext package package is covered by the GNU General Public License.
5503 dnl They are *not* in the public domain.
5504
5505 dnl Authors:
5506 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
5507
5508 # Check whether LC_MESSAGES is available in <locale.h>.
5509
5510 AC_DEFUN([AM_LC_MESSAGES],
5511   [if test $ac_cv_header_locale_h = yes; then
5512     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
5513       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
5514        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
5515     if test $am_cv_val_LC_MESSAGES = yes; then
5516       AC_DEFINE(HAVE_LC_MESSAGES, 1,
5517         [Define if your <locale.h> file defines LC_MESSAGES.])
5518     fi
5519   fi])
5520
5521 # mbstate_t.m4 serial 9 (fileutils-4.1.3)
5522 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
5523 dnl This file is free software, distributed under the terms of the GNU
5524 dnl General Public License.  As a special exception to the GNU General
5525 dnl Public License, this file may be distributed as part of a program
5526 dnl that contains a configuration script generated by Autoconf, under
5527 dnl the same distribution terms as the rest of that program.
5528
5529 # From Paul Eggert.
5530
5531 # BeOS 5 has <wchar.h> but does not define mbstate_t,
5532 # so you can't declare an object of that type.
5533 # Check for this incompatibility with Standard C.
5534
5535 # Include stdlib.h first, because otherwise this test would fail on Linux
5536 # (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
5537 # a syntax error in wchar.h due to the use of undefined __int32_t.
5538
5539 AC_DEFUN([AC_MBSTATE_T],
5540   [
5541    AC_CHECK_HEADERS(stdlib.h)
5542
5543    AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
5544     [AC_TRY_COMPILE([
5545 #if HAVE_STDLIB_H
5546 # include <stdlib.h>
5547 #endif
5548 #include <wchar.h>],
5549       [mbstate_t x; return sizeof x;],
5550       ac_cv_type_mbstate_t=yes,
5551       ac_cv_type_mbstate_t=no)])
5552    if test $ac_cv_type_mbstate_t = no; then
5553      AC_DEFINE(mbstate_t, int,
5554                [Define to a type if <wchar.h> does not define.])
5555    fi])
5556
5557 #serial 1
5558
5559 AC_PREREQ(2.50)
5560
5561 # The EILSEQ errno value ought to be defined in <errno.h>, according to
5562 # ISO C 99 and POSIX.  But some systems (like SunOS 4) don't define it,
5563 # and some systems (like BSD/OS) define it in <wchar.h> not <errno.h>.
5564
5565 # Define EILSEQ as a C macro and as a substituted macro in such a way that
5566 # 1. on all systems, after inclusion of <errno.h>, EILSEQ is usable,
5567 # 2. on systems where EILSEQ is defined elsewhere, we use the same numeric
5568 #    value.
5569
5570 AC_DEFUN([AC_EILSEQ],
5571 [
5572   AC_REQUIRE([AC_PROG_CC])dnl
5573
5574   dnl Check for any extra headers that could define EILSEQ.
5575   AC_CHECK_HEADERS(wchar.h)
5576
5577   AC_CACHE_CHECK([for EILSEQ], ac_cv_decl_EILSEQ, [
5578     AC_EGREP_CPP(yes,[
5579 #include <errno.h>
5580 #ifdef EILSEQ
5581 yes
5582 #endif
5583       ], have_eilseq=1)
5584     if test -n "$have_eilseq"; then
5585       dnl EILSEQ exists in <errno.h>. Don't need to define EILSEQ ourselves.
5586       ac_cv_decl_EILSEQ=yes
5587     else
5588       AC_EGREP_CPP(yes,[
5589 #include <errno.h>
5590 #if HAVE_WCHAR_H
5591 #include <wchar.h>
5592 #endif
5593 #ifdef EILSEQ
5594 yes
5595 #endif
5596         ], have_eilseq=1)
5597       if test -n "$have_eilseq"; then
5598         dnl EILSEQ exists in some other system header.
5599         dnl Define it to the same value.
5600         _AC_COMPUTE_INT([EILSEQ], ac_cv_decl_EILSEQ, [
5601 #include <errno.h>
5602 #if HAVE_WCHAR_H
5603 #include <wchar.h>
5604 #endif
5605 /* The following two lines are a workaround against an autoconf-2.52 bug.  */
5606 #include <stdio.h>
5607 #include <stdlib.h>
5608 ])
5609       else
5610         dnl EILSEQ isn't defined by the system. Define EILSEQ ourselves, but
5611         dnl don't define it as EINVAL, because iconv() callers want to
5612         dnl distinguish EINVAL and EILSEQ.
5613         ac_cv_decl_EILSEQ=ENOENT
5614       fi
5615     fi
5616   ])
5617   if test "$ac_cv_decl_EILSEQ" != yes; then
5618     AC_DEFINE_UNQUOTED([EILSEQ], [$ac_cv_decl_EILSEQ],
5619                        [Define as good substitute value for EILSEQ.])
5620     EILSEQ="$ac_cv_decl_EILSEQ"
5621     AC_SUBST(EILSEQ)
5622   fi
5623 ])
5624
5625 dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
5626 dnl This file is free software, distributed under the terms of the GNU
5627 dnl General Public License.  As a special exception to the GNU General
5628 dnl Public License, this file may be distributed as part of a program
5629 dnl that contains a configuration script generated by Autoconf, under
5630 dnl the same distribution terms as the rest of that program.
5631
5632 dnl From Bruno Haible, Marcus Daniels.
5633
5634 AC_PREREQ(2.13)
5635
5636 AC_DEFUN([CL_WORDS_LITTLEENDIAN],
5637 [AC_CACHE_CHECK(byte ordering, cl_cv_sys_endian, [
5638 AC_TRY_RUN([int main () {
5639   /* Are we little or big endian?  From Harbison&Steele.  */
5640   union
5641   {
5642     long l;
5643     char c[sizeof (long)];
5644   } u;
5645   u.l = 1;
5646   exit (u.c[0] == 1);
5647 }],
5648 cl_cv_sys_endian="big endian",
5649 cl_cv_sys_endian="little endian",
5650 : # must guess the endianness
5651 )
5652 if test -z "$cl_cv_sys_endian"; then
5653 AC_EGREP_CPP(yes,[#if defined(m68k) || defined(__m68k__) || defined(mc68000) || defined(mc68020) || defined(__mc68020__) || defined(sparc) || defined(__sparc__) || defined(MIPSEB) || defined(__MIPSEB__) || defined(hppa) || defined(__hppa) || defined(m88000) || defined(__m88k__)
5654   yes
5655 #endif
5656 ], cl_cv_sys_endian="big endian")
5657 fi
5658 if test -z "$cl_cv_sys_endian"; then
5659 AC_EGREP_CPP(yes,[#if defined(i386) || defined(__i386) || defined(__i386__) || defined(_I386) || defined(MIPSEL) || defined(__MIPSEL__) || defined(__alpha)
5660   yes
5661 #endif
5662 ], cl_cv_sys_endian="little endian")
5663 fi
5664 if test -z "$cl_cv_sys_endian"; then
5665 cl_cv_sys_endian="guessing little endian"
5666 fi
5667 ])
5668 case "$cl_cv_sys_endian" in
5669   *little*) AC_DEFINE(WORDS_LITTLEENDIAN) ;;
5670   *big*)    ;;
5671 esac
5672 ])
5673