Adds a check if first call to strtok returns NULL in perl_xlat (closes: #218)
[freeradius.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl See whether we need a declaration for a function.
14 dnl RADIUSD_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
15 AC_DEFUN(RADIUSD_NEED_DECLARATION,
16 [AC_MSG_CHECKING([whether $1 must be declared])
17 AC_CACHE_VAL(radius_cv_decl_needed_$1,
18 [AC_TRY_COMPILE([
19 #include <stdio.h>
20 #include <string.h>
21 #ifdef HAVE_UNISTD_H
22 #include <unistd.h>
23 #endif
24 #ifdef HAVE_CRYPT_H
25 #include <crypt.h>
26 #endif
27 #ifdef HAVE_ERRNO_H
28 #include <errno.h>
29 #endif
30 #ifdef HAVE_RESOURCE_H
31 #include <resource.h>
32 #endif
33 #ifdef HAVE_GETOPT_H
34 #include <getopt.h>
35 #endif
36 #ifdef HAVE_MALLOC_H
37 #include <malloc.h>
38 #endif
39 #ifdef HAVE_UTMP_H
40 #include <utmp.h>
41 #endif
42 #ifdef HAVE_UTMPX_H
43 #include <utmpx.h>
44 #endif
45 #ifdef HAVE_SYS_SELECT_H
46 #include <sys/select.h>
47 #endif
48 #ifdef HAVE_DLFCN_H
49 #include <dlfcn.h>
50 #endif
51 #ifdef HAVE_REGEX_H
52 #include <regex.h>
53 #endif
54 #ifdef HAVE_SYSLOG_H
55 #include <syslog.h>
56 #endif
57 #ifdef HAVE_INTTYPES_H
58 #include <inttypes.h>
59 #endif
60 #ifdef HAVE_STDINT_H
61 #include <stdint.h>
62 #endif
63 #ifdef HAVE_ARPA_INET_H
64 #include <arpa/inet.h>
65 #endif
66 $2],
67 [char *(*pfn) = (char *(*)) $1],
68 eval "radius_cv_decl_needed_$1=no", eval "radius_cv_decl_needed_$1=yes")])
69 if eval "test \"`echo '$radius_cv_decl_needed_'$1`\" = yes"; then
70   AC_MSG_RESULT(yes)
71   radius_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
72   AC_DEFINE_UNQUOTED($radius_tr_decl)
73 else
74   AC_MSG_RESULT(no)
75 fi
76 ])dnl
77
78 dnl Check multiple functions to see whether each needs a declaration.
79 dnl RADIUSD_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
80 AC_DEFUN(RADIUSD_NEED_DECLARATIONS,
81 [for ac_func in $1
82 do
83 RADIUSD_NEED_DECLARATION($ac_func, $2)
84 done
85 ])
86
87 dnl Checks to see if this is SUNPro we're building with
88 dnl Usage:
89 dnl AC_PROG_CC_SUNPRO
90 AC_DEFUN(AC_PROG_CC_SUNPRO,
91 [AC_CACHE_CHECK(whether we are using SUNPro C, ac_cv_prog_suncc,
92 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
93 cat > conftest.c <<EOF
94 #ifdef __SUNPRO_C
95   yes;
96 #endif
97 EOF
98 if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
99   ac_cv_prog_suncc=yes
100 else
101   ac_cv_prog_suncc=no
102 fi])])
103
104 dnl #
105 dnl # FR_CHECK_TYPE_INCLUDE([#includes ...], type, default-C-types)
106 dnl #
107 dnl # This function is like AC_CHECK_TYPE, but you can give this one
108 dnl # a list of include files to check.
109 dnl #
110 AC_DEFUN(FR_CHECK_TYPE_INCLUDE,
111 [
112   AC_CACHE_CHECK(for $2, ac_cv_type_$2,
113     [ ac_cv_type_$2=no
114       AC_TRY_COMPILE($1,
115         [$2 foo],
116         ac_cv_type_$2=yes,
117       )
118     ]
119   )
120
121   if test "$ac_cv_type_$2" != "yes"; then
122          AC_DEFINE($2, $3, $4)
123   fi
124 ])
125
126 dnl #######################################################################
127 dnl #
128 dnl #  Look for SNMP in a variety of places.
129 dnl #
130 AC_DEFUN(SNMP_CHECKS, [
131         AC_SUBST(SNMP_LIBS)
132         AC_SUBST(SNMP_INCLUDE)
133
134 AC_MSG_CHECKING([for asn1.h,snmp.h,snmp_impl.h])
135
136 dnl #
137 dnl #  First, see if we can build it WITHOUT using any special includes and in ucd-snmp
138 dnl #
139 AC_TRY_COMPILE([
140 #ifdef HAVE_SYS_TYPES_H
141 #include <sys/types.h>
142 #endif
143 #ifdef HAVE_STDINT_H
144 #include <stdint.h>
145 #endif
146 #ifdef HAVE_STDIO_H
147 #include <stdio.h>
148 #endif
149 #ifdef HAVE_NETDB_H
150 #include <netdb.h>
151 #endif
152 #ifdef HAVE_UNISTD_H
153 #include <unistd.h>
154 #endif
155 #include <ucd-snmp/ucd-snmp-config.h>
156 #include <ucd-snmp/asn1.h>
157 #include <ucd-snmp/snmp.h>
158 #include <ucd-snmp/snmp_impl.h>],
159                [ int a = 1;],
160                SNMP_INCLUDE="";ucdsnmp=yes,
161                ucdsnmp=)
162
163 dnl #
164 dnl #  If not, look for it in a number of directories and in ucd-snmp.
165 dnl #
166 if test "x$ucdsnmp" = "x"; then
167   old_CFLAGS="$CFLAGS"
168   for try in /usr/include /usr/local/include $snmp_include_dir; do
169     CFLAGS="$old_CFLAGS -I$try"
170     AC_TRY_COMPILE([
171 #ifdef HAVE_SYS_TYPES_H
172 #include <sys/types.h>
173 #endif
174 #ifdef HAVE_STDINT_H
175 #include <stdint.h>
176 #endif
177 #ifdef HAVE_STDIO_H
178 #include <stdio.h>
179 #endif
180 #ifdef HAVE_NETDB_H
181 #include <netdb.h>
182 #endif
183 #ifdef HAVE_UNISTD_H
184 #include <unistd.h>
185 #endif
186 #include <ucd-snmp/ucd-snmp-config.h>
187 #include <ucd-snmp/asn1.h>
188 #include <ucd-snmp/snmp.h>
189 #include <ucd-snmp/snmp_impl.h>],
190                    [ int a = 1;],
191                    SNMP_INCLUDE="-I$try";ucdsnmp=yes,
192                    ucdsnmp=)
193     if test "x$ucdsnmp" != "x"; then
194       break;
195     fi
196   done
197   CFLAGS="$old_CFLAGS"
198 fi
199
200 if test "x$ucdsnmp" = "x"; then
201   old_CFLAGS="$CFLAGS"
202   for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
203     CFLAGS="$old_CFLAGS -I$try"
204 dnl #
205 dnl #  First, see if we can build it WITHOUT using any special includes and without ucd-snmp
206 dnl #
207 AC_TRY_COMPILE([
208 #ifdef HAVE_SYS_TYPES_H
209 #include <sys/types.h>
210 #endif
211 #ifdef HAVE_STDINT_H
212 #include <stdint.h>
213 #endif
214 #ifdef HAVE_STDIO_H
215 #include <stdio.h>
216 #endif
217 #ifdef HAVE_NETDB_H
218 #include <netdb.h>
219 #endif
220 #ifdef HAVE_UNISTD_H
221 #include <unistd.h>
222 #endif
223 #include <asn1.h>
224 #include <snmp.h>
225 #include <snmp_impl.h>],
226                [ int a = 1;],
227                SNMP_INCLUDE="";ucdsnmp=no,
228                ucdsnmp=)
229     if test "x$ucdsnmp" != "x"; then
230       break;
231     fi
232   done
233   CFLAGS="$old_CFLAGS"
234 fi
235
236 dnl #
237 dnl #  If not, look for it in a number of directories and without ucd-snmp
238 dnl #
239 if test "x$ucdsnmp" = "x"; then
240   old_CFLAGS="$CFLAGS"
241   for try in /usr/include/ucd-snmp /usr/local/include/ucd-snmp $snmp_include_dir; do
242     CFLAGS="$old_CFLAGS -I$try"
243     AC_TRY_COMPILE([
244 #ifdef HAVE_SYS_TYPES_H
245 #include <sys/types.h>
246 #endif
247 #ifdef HAVE_STDINT_H
248 #include <stdint.h>
249 #endif
250 #ifdef HAVE_STDIO_H
251 #include <stdio.h>
252 #endif
253 #ifdef HAVE_NETDB_H
254 #include <netdb.h>
255 #endif
256 #ifdef HAVE_UNISTD_H
257 #include <unistd.h>
258 #endif
259 #include <asn1.h>
260 #include <snmp.h>
261 #include <snmp_impl.h>],
262                    [ int a = 1;],
263                    SNMP_INCLUDE="-I$try";ucdsnmp=no,
264                    ucdsnmp=)
265     if test "x$ucdsnmp" != "x"; then
266       break;
267     fi
268   done
269   CFLAGS="$old_CFLAGS"
270 fi
271
272 if test "x$ucdsnmp" = "x"; then
273   AC_MSG_RESULT(no)
274 else
275   if test "x$ucdsnmp" = "xyes"; then
276     AC_MSG_RESULT((ucd-snmp)yes)
277     AC_DEFINE(HAVE_UCD_SNMP_ASN1_SNMP_SNMPIMPL_H, [], [Define if you have the <ucd-snmp/asn1.h>, <ucd-snmp/snmp_impl.h> and <ucd-snmp/snmp.h> header file.])
278   else
279     AC_MSG_RESULT(yes)
280     AC_DEFINE(HAVE_ASN1_SNMP_SNMPIMPL_H, [], [Define if you have the <asn1.h>, <snmp_impl.h> and <snmp.h> header file.])
281   fi
282 dnl #
283 dnl #  Now do the same thing, looking for the SNMP library directory
284 dnl #
285   AC_MSG_CHECKING([for snmp_build_var_op in -lsnmp])
286
287 dnl #
288 dnl #  First, see if we can build it WITHOUT using any special includes
289 dnl #
290   old_LIBS="$LIBS"
291   LIBS="$old_LIBS -lsnmp"
292   AC_TRY_LINK([extern char snmp_build_var_op();],
293               [ snmp_build_var_op()],
294               SNMP_LIBS="-lsnmp",
295               SNMP_LIBS=)
296
297   if test "x$SNMP_LIBS" = "x"; then
298     for try in /usr/lib /usr/local/lib /usr/local/snmp/lib $with_snmp_lib_dir; do
299       LIBS="$old_LIBS -L$try -lsnmp"
300       AC_TRY_LINK([extern char snmp_build_var_op();],
301                   [ snmp_build_var_op()],
302                   SNMP_LIBS="-L$try -lsnmp",
303                   SNMP_LIBS=)
304       if test "x$SNMP_LIBS" != "x"; then
305         break;
306       fi
307 dnl   #
308 dnl   #  That didn't work.  Try adding the '-lcrypto' line.
309 dnl   #  Some SNMP libraries are linked against SSL...
310 dnl   #
311       LIBS="$old_LIBS -L$try -lsnmp -lcrypto"
312       AC_TRY_LINK([extern char snmp_build_var_op();],
313                   [ snmp_build_var_op()],
314                   SNMP_LIBS="-L$try -lsnmp -lcrypto",
315                   SNMP_LIBS=)
316       if test "x$SNMP_LIBS" != "x"; then
317         break;
318       fi
319 dnl   #
320 dnl   #  That didn't work.  Try adding the '-lkstat' line.
321 dnl   #  Some SNMP libraries are linked against Kernel Statistics,
322 dnl   #  in particular, Solaris 9...
323 dnl   #
324       LIBS="$old_LIBS -L$try -lsnmp -lcrypto -lkstat"
325       AC_TRY_LINK([extern char snmp_build_var_op();],
326                   [ snmp_build_var_op()],
327                   SNMP_LIBS="-L$try -lsnmp -lcrypto -lkstat",
328                   SNMP_LIBS=)
329       if test "x$SNMP_LIBS" != "x"; then
330         break;
331       fi
332     done
333   fi
334   LIBS="$old_LIBS"
335
336   dnl #
337   dnl #  If one or the other isn't found, disable them both..
338   dnl #  If both are found, enable them both.
339   dnl #
340   CFLAGS="$old_CFLAGS"
341   if test "x$SNMP_LIBS" = "x"; then
342     AC_MSG_RESULT(no)
343     SNMP_INCLUDE=
344   else
345     AC_MSG_RESULT(yes)
346     AC_DEFINE(WITH_SNMP, [], [Include SNMP subagent])
347     AC_DEFINE(HAVE_LIBSNMP, [], [Define if you have the snmp library (-lsnmp).])
348   fi
349 fi
350 ])
351
352
353 dnl #
354 dnl #  Locate the directory in which a particular file is found.
355 dnl #
356 dnl #  Usage: FR_LOCATE_DIR(MYSQLLIB_DIR, libmysqlclient.a)
357 dnl #
358 dnl #    Defines the variable MYSQLLIB_DIR to be the directory(s) in
359 dnl #    which the file libmysqlclient.a is to be found.
360 dnl #
361 dnl #
362 AC_DEFUN(FR_LOCATE_DIR,
363 [
364 dnl # If we have the program 'locate', then the problem of finding a
365 dnl # particular file becomes MUCH easier.
366 dnl #
367
368 dnl #
369 dnl #  No 'locate' defined, do NOT do anything.
370 dnl #
371 if test "x$LOCATE" != "x"; then
372   dnl #
373   dnl #  Root through a series of directories, looking for the given file.
374   dnl #
375   DIRS=
376   file=$2
377
378   for x in `${LOCATE} $file 2>/dev/null`; do
379     dnl #
380     dnl #  When asked for 'foo', locate will also find 'foo_bar', which we
381     dnl #  don't want.  We want that EXACT filename.
382     dnl #
383     dnl #  We ALSO want to be able to look for files like 'mysql/mysql.h',
384     dnl #  and properly match them, too.  So we try to strip off the last
385     dnl #  part of the filename, using the name of the file we're looking
386     dnl #  for.  If we CANNOT strip it off, then the name will be unchanged.
387     dnl #
388     base=`echo $x | sed "s%/${file}%%"`
389     if test "x$x" = "x$base"; then
390       continue;
391     fi
392
393     dir=`${DIRNAME} $x 2>/dev/null`
394     dnl #
395     dnl #  Exclude a number of directories.
396     dnl #
397     exclude=`echo ${dir} | ${GREP} /home`
398     if test "x$exclude" != "x"; then
399       continue
400     fi
401
402     dnl #
403     dnl #  OK, we have an exact match.  Let's be sure that we only find ONE
404     dnl #  matching directory.
405     dnl #
406     already=`echo \$$1 ${DIRS} | ${GREP} ${dir}`
407     if test "x$already" = "x"; then
408       DIRS="$DIRS $dir"
409     fi
410   done
411 fi
412
413 dnl #
414 dnl #  And remember the directory in which we found the file.
415 dnl #
416 eval "$1=\"\$$1 $DIRS\""
417 ])
418
419
420 dnl #######################################################################
421 dnl #
422 dnl #  Look for a library in a number of places.
423 dnl #
424 AC_DEFUN(FR_SMART_CHECK_LIB, [
425
426 sm_lib_safe=`echo "$1" | sed 'y%./+-%__p_%'`
427 sm_func_safe=`echo "$2" | sed 'y%./+-%__p_%'`
428 AC_MSG_CHECKING([for $2 in -l$1])
429
430 smart_lib=
431 smart_lib_dir=
432
433 dnl #
434 dnl #  Try to link it first, using the default libs && library paths
435 dnl #
436   old_LIBS="$LIBS"
437   LIBS="$LIBS -l$1"
438   AC_TRY_LINK([extern char $2();],
439               [ $2()],
440               smart_lib="-l$1")
441
442   if test "x$smart_lib" = "x"; then
443     FR_LOCATE_DIR(smart_lib_dir,[lib$1${libltdl_cv_shlibext}])
444     FR_LOCATE_DIR(smart_lib_dir,[lib$1.a])
445
446     for try in $smart_try_dir $smart_lib_dir /usr/local/lib/ /opt/lib; do
447       LIBS="$old_LIBS -L$try -l$1"
448
449       AC_TRY_LINK([extern char $2();],
450                   [ $2()],
451                   smart_lib="-L$try -l$1")
452       if test "x$smart_lib" != "x"; then
453         break;
454       fi
455     done
456     LIBS="$old_LIBS"
457   fi
458
459   dnl #
460   dnl #  Found it, set the appropriate variable.
461   dnl #
462   if test "x$smart_lib" != "x"; then
463     AC_MSG_RESULT(yes)
464     eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
465     LIBS="$old_LIBS $smart_lib"
466     SMART_LIBS="$SMART_LIBS $smart_lib"
467   else
468     AC_MSG_RESULT(no) 
469 fi
470 ])
471
472 dnl #######################################################################
473 dnl #
474 dnl #  Look for a header file in a number of places.
475 dnl #
476 dnl #  FR_SMART_CHECK_INCLUDE(foo.h, [ #include <other.h> ])
477 dnl #
478 AC_DEFUN(FR_SMART_CHECK_INCLUDE, [
479
480 ac_safe=`echo "$1" | sed 'y%./+-%__pm%'`
481 AC_MSG_CHECKING([for $1])
482
483 smart_include=
484 smart_include_dir=
485
486 dnl #
487 dnl #  Try to link it first, using the default includes
488 dnl #
489   old_CFLAGS="$CFLAGS"
490   AC_TRY_COMPILE([$2
491                   #include <$1>],
492                  [ int a = 1;],
493                  smart_include=" ",
494                  smart_include=)
495
496   if test "x$smart_include" = "x"; then
497     FR_LOCATE_DIR(smart_include_dir,$1)
498
499     for try in $smart_try_dir $smart_include_dir /usr/local/include/ /opt/include; do
500       CFLAGS="$old_CFLAGS -I$try"
501
502       AC_TRY_COMPILE([$2
503                        #include <$1>],
504                      [ int a = 1;],
505                      smart_include="-I$try",
506                      smart_include=)
507
508       if test "x$smart_include" != "x"; then
509         break;
510       fi
511     done
512     CFLAGS="$old_CFLAGS"
513   fi
514
515   dnl #
516   dnl #  Found it, set the appropriate variable.
517   dnl #
518   if test "x$smart_include" != "x"; then
519     AC_MSG_RESULT(yes)
520     eval "ac_cv_header_$ac_safe=yes"
521     CFLAGS="$old_CFLAGS $smart_include"
522     SMART_CFLAGS="$SMART_CFLAGS $smart_include"
523   else
524     AC_MSG_RESULT(no) 
525 fi
526 ])
527
528 dnl #######################################################################
529 dnl #
530 dnl #  Look for a header file in a number of places.
531 dnl #
532 dnl #  Usage:  FR_CHECK_STRUCT_HAS_MEMBER([#include <foo.h>], [struct foo], member)
533 dnl #  If the member is defined, then the variable
534 dnl #     ac_cv_type_struct_foo_has_member is set to 'yes'
535 dnl #
536 AC_DEFUN(FR_CHECK_STRUCT_HAS_MEMBER, [
537   AC_MSG_CHECKING([for $3 in $2])
538
539 dnl BASED on 'offsetof':
540 dnl #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
541 dnl
542
543   AC_TRY_COMPILE([
544 $1
545 #ifndef offsetof
546 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
547 #endif
548 ],
549                  [ int foo = offsetof($2, $3) ],
550                  has_element=" ",
551                  has_element=)
552
553   ac_safe_type=`echo "$2" | sed 'y% %_%'`
554   if test "x$has_element" != "x"; then
555     AC_MSG_RESULT(yes)
556     eval "ac_cv_type_${ac_safe_type}_has_$3=yes"
557   else
558     AC_MSG_RESULT(no) 
559     eval "ac_cv_type_${ac_safe_type}_has_$3="
560  fi
561 ])
562
563 AC_DEFUN(FR_LIBLTDL_PATH,
564 [
565    LIBLTDLPATH=
566    if test x"$enable_ltdl_install" = x"yes"; then
567      AC_CONFIG_SUBDIRS('libltdl')
568      LIBLTDLPATH=libltdl
569     fi
570    AC_SUBST(LIBLTDLPATH)
571 ])
572
573 # lib-prefix.m4 serial 3 (gettext-0.13)
574 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
575 dnl This file is free software, distributed under the terms of the GNU
576 dnl General Public License.  As a special exception to the GNU General
577 dnl Public License, this file may be distributed as part of a program
578 dnl that contains a configuration script generated by Autoconf, under
579 dnl the same distribution terms as the rest of that program.
580
581 dnl From Bruno Haible.
582
583 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
584 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
585 dnl require excessive bracketing.
586 ifdef([AC_HELP_STRING],
587 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
588 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
589
590 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
591 dnl to access previously installed libraries. The basic assumption is that
592 dnl a user will want packages to use other packages he previously installed
593 dnl with the same --prefix option.
594 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
595 dnl libraries, but is otherwise very convenient.
596 AC_DEFUN([AC_LIB_PREFIX],
597 [
598   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
599   AC_REQUIRE([AC_PROG_CC])
600   AC_REQUIRE([AC_CANONICAL_HOST])
601   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
602   dnl By default, look in $includedir and $libdir.
603   use_additional=yes
604   AC_LIB_WITH_FINAL_PREFIX([
605     eval additional_includedir=\"$includedir\"
606     eval additional_libdir=\"$libdir\"
607   ])
608   AC_LIB_ARG_WITH([lib-prefix],
609 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
610   --without-lib-prefix    don't search for libraries in includedir and libdir],
611 [
612     if test "X$withval" = "Xno"; then
613       use_additional=no
614     else
615       if test "X$withval" = "X"; then
616         AC_LIB_WITH_FINAL_PREFIX([
617           eval additional_includedir=\"$includedir\"
618           eval additional_libdir=\"$libdir\"
619         ])
620       else
621         additional_includedir="$withval/include"
622         additional_libdir="$withval/lib"
623       fi
624     fi
625 ])
626   if test $use_additional = yes; then
627     dnl Potentially add $additional_includedir to $CPPFLAGS.
628     dnl But don't add it
629     dnl   1. if it's the standard /usr/include,
630     dnl   2. if it's already present in $CPPFLAGS,
631     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
632     dnl   4. if it doesn't exist as a directory.
633     if test "X$additional_includedir" != "X/usr/include"; then
634       haveit=
635       for x in $CPPFLAGS; do
636         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
637         if test "X$x" = "X-I$additional_includedir"; then
638           haveit=yes
639           break
640         fi
641       done
642       if test -z "$haveit"; then
643         if test "X$additional_includedir" = "X/usr/local/include"; then
644           if test -n "$GCC"; then
645             case $host_os in
646               linux*) haveit=yes;;
647             esac
648           fi
649         fi
650         if test -z "$haveit"; then
651           if test -d "$additional_includedir"; then
652             dnl Really add $additional_includedir to $CPPFLAGS.
653             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
654           fi
655         fi
656       fi
657     fi
658     dnl Potentially add $additional_libdir to $LDFLAGS.
659     dnl But don't add it
660     dnl   1. if it's the standard /usr/lib,
661     dnl   2. if it's already present in $LDFLAGS,
662     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
663     dnl   4. if it doesn't exist as a directory.
664     if test "X$additional_libdir" != "X/usr/lib"; then
665       haveit=
666       for x in $LDFLAGS; do
667         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
668         if test "X$x" = "X-L$additional_libdir"; then
669           haveit=yes
670           break
671         fi
672       done
673       if test -z "$haveit"; then
674         if test "X$additional_libdir" = "X/usr/local/lib"; then
675           if test -n "$GCC"; then
676             case $host_os in
677               linux*) haveit=yes;;
678             esac
679           fi
680         fi
681         if test -z "$haveit"; then
682           if test -d "$additional_libdir"; then
683             dnl Really add $additional_libdir to $LDFLAGS.
684             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
685           fi
686         fi
687       fi
688     fi
689   fi
690 ])
691
692 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
693 dnl acl_final_exec_prefix, containing the values to which $prefix and
694 dnl $exec_prefix will expand at the end of the configure script.
695 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
696 [
697   dnl Unfortunately, prefix and exec_prefix get only finally determined
698   dnl at the end of configure.
699   if test "X$prefix" = "XNONE"; then
700     acl_final_prefix="$ac_default_prefix"
701   else
702     acl_final_prefix="$prefix"
703   fi
704   if test "X$exec_prefix" = "XNONE"; then
705     acl_final_exec_prefix='${prefix}'
706   else
707     acl_final_exec_prefix="$exec_prefix"
708   fi
709   acl_save_prefix="$prefix"
710   prefix="$acl_final_prefix"
711   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
712   prefix="$acl_save_prefix"
713 ])
714
715 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
716 dnl variables prefix and exec_prefix bound to the values they will have
717 dnl at the end of the configure script.
718 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
719 [
720   acl_save_prefix="$prefix"
721   prefix="$acl_final_prefix"
722   acl_save_exec_prefix="$exec_prefix"
723   exec_prefix="$acl_final_exec_prefix"
724   $1
725   exec_prefix="$acl_save_exec_prefix"
726   prefix="$acl_save_prefix"
727 ])
728
729 # lib-link.m4 serial 4 (gettext-0.12)
730 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
731 dnl This file is free software, distributed under the terms of the GNU
732 dnl General Public License.  As a special exception to the GNU General
733 dnl Public License, this file may be distributed as part of a program
734 dnl that contains a configuration script generated by Autoconf, under
735 dnl the same distribution terms as the rest of that program.
736
737 dnl From Bruno Haible.
738
739 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
740 dnl the libraries corresponding to explicit and implicit dependencies.
741 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
742 dnl augments the CPPFLAGS variable.
743 AC_DEFUN([AC_LIB_LINKFLAGS],
744 [
745   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
746   AC_REQUIRE([AC_LIB_RPATH])
747   define([Name],[translit([$1],[./-], [___])])
748   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
749                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
750   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
751     AC_LIB_LINKFLAGS_BODY([$1], [$2])
752     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
753     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
754     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
755   ])
756   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
757   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
758   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
759   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
760   AC_SUBST([LIB]NAME)
761   AC_SUBST([LTLIB]NAME)
762   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
763   dnl results of this search when this library appears as a dependency.
764   HAVE_LIB[]NAME=yes
765   undefine([Name])
766   undefine([NAME])
767 ])
768
769 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
770 dnl searches for libname and the libraries corresponding to explicit and
771 dnl implicit dependencies, together with the specified include files and
772 dnl the ability to compile and link the specified testcode. If found, it
773 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
774 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
775 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
776 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
777 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
778 [
779   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
780   AC_REQUIRE([AC_LIB_RPATH])
781   define([Name],[translit([$1],[./-], [___])])
782   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
783                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
784
785   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
786   dnl accordingly.
787   AC_LIB_LINKFLAGS_BODY([$1], [$2])
788
789   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
790   dnl because if the user has installed lib[]Name and not disabled its use
791   dnl via --without-lib[]Name-prefix, he wants to use it.
792   ac_save_CPPFLAGS="$CPPFLAGS"
793   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
794
795   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
796     ac_save_LIBS="$LIBS"
797     LIBS="$LIBS $LIB[]NAME"
798     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
799     LIBS="$ac_save_LIBS"
800   ])
801   if test "$ac_cv_lib[]Name" = yes; then
802     HAVE_LIB[]NAME=yes
803     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
804     AC_MSG_CHECKING([how to link with lib[]$1])
805     AC_MSG_RESULT([$LIB[]NAME])
806   else
807     HAVE_LIB[]NAME=no
808     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
809     dnl $INC[]NAME either.
810     CPPFLAGS="$ac_save_CPPFLAGS"
811     LIB[]NAME=
812     LTLIB[]NAME=
813   fi
814   AC_SUBST([HAVE_LIB]NAME)
815   AC_SUBST([LIB]NAME)
816   AC_SUBST([LTLIB]NAME)
817   undefine([Name])
818   undefine([NAME])
819 ])
820
821 dnl Determine the platform dependent parameters needed to use rpath:
822 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
823 dnl hardcode_direct, hardcode_minus_L.
824 AC_DEFUN([AC_LIB_RPATH],
825 [
826   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
827   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
828   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
829   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
830   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
831     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
832     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
833     . ./conftest.sh
834     rm -f ./conftest.sh
835     acl_cv_rpath=done
836   ])
837   wl="$acl_cv_wl"
838   libext="$acl_cv_libext"
839   shlibext="$acl_cv_shlibext"
840   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
841   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
842   hardcode_direct="$acl_cv_hardcode_direct"
843   hardcode_minus_L="$acl_cv_hardcode_minus_L"
844   dnl Determine whether the user wants rpath handling at all.
845   AC_ARG_ENABLE(rpath,
846     [  --disable-rpath         do not hardcode runtime library paths],
847     :, enable_rpath=yes)
848 ])
849
850 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
851 dnl the libraries corresponding to explicit and implicit dependencies.
852 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
853 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
854 [
855   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
856                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
857   dnl By default, look in $includedir and $libdir.
858   use_additional=yes
859   AC_LIB_WITH_FINAL_PREFIX([
860     eval additional_includedir=\"$includedir\"
861     eval additional_libdir=\"$libdir\"
862   ])
863   AC_LIB_ARG_WITH([lib$1-prefix],
864 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
865   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
866 [
867     if test "X$withval" = "Xno"; then
868       use_additional=no
869     else
870       if test "X$withval" = "X"; then
871         AC_LIB_WITH_FINAL_PREFIX([
872           eval additional_includedir=\"$includedir\"
873           eval additional_libdir=\"$libdir\"
874         ])
875       else
876         additional_includedir="$withval/include"
877         additional_libdir="$withval/lib"
878       fi
879     fi
880 ])
881   dnl Search the library and its dependencies in $additional_libdir and
882   dnl $LDFLAGS. Using breadth-first-seach.
883   LIB[]NAME=
884   LTLIB[]NAME=
885   INC[]NAME=
886   rpathdirs=
887   ltrpathdirs=
888   names_already_handled=
889   names_next_round='$1 $2'
890   while test -n "$names_next_round"; do
891     names_this_round="$names_next_round"
892     names_next_round=
893     for name in $names_this_round; do
894       already_handled=
895       for n in $names_already_handled; do
896         if test "$n" = "$name"; then
897           already_handled=yes
898           break
899         fi
900       done
901       if test -z "$already_handled"; then
902         names_already_handled="$names_already_handled $name"
903         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
904         dnl or AC_LIB_HAVE_LINKFLAGS call.
905         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
906         eval value=\"\$HAVE_LIB$uppername\"
907         if test -n "$value"; then
908           if test "$value" = yes; then
909             eval value=\"\$LIB$uppername\"
910             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
911             eval value=\"\$LTLIB$uppername\"
912             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
913           else
914             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
915             dnl that this library doesn't exist. So just drop it.
916             :
917           fi
918         else
919           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
920           dnl and the already constructed $LIBNAME/$LTLIBNAME.
921           found_dir=
922           found_la=
923           found_so=
924           found_a=
925           if test $use_additional = yes; then
926             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
927               found_dir="$additional_libdir"
928               found_so="$additional_libdir/lib$name.$shlibext"
929               if test -f "$additional_libdir/lib$name.la"; then
930                 found_la="$additional_libdir/lib$name.la"
931               fi
932             else
933               if test -f "$additional_libdir/lib$name.$libext"; then
934                 found_dir="$additional_libdir"
935                 found_a="$additional_libdir/lib$name.$libext"
936                 if test -f "$additional_libdir/lib$name.la"; then
937                   found_la="$additional_libdir/lib$name.la"
938                 fi
939               fi
940             fi
941           fi
942           if test "X$found_dir" = "X"; then
943             for x in $LDFLAGS $LTLIB[]NAME; do
944               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
945               case "$x" in
946                 -L*)
947                   dir=`echo "X$x" | sed -e 's/^X-L//'`
948                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
949                     found_dir="$dir"
950                     found_so="$dir/lib$name.$shlibext"
951                     if test -f "$dir/lib$name.la"; then
952                       found_la="$dir/lib$name.la"
953                     fi
954                   else
955                     if test -f "$dir/lib$name.$libext"; then
956                       found_dir="$dir"
957                       found_a="$dir/lib$name.$libext"
958                       if test -f "$dir/lib$name.la"; then
959                         found_la="$dir/lib$name.la"
960                       fi
961                     fi
962                   fi
963                   ;;
964               esac
965               if test "X$found_dir" != "X"; then
966                 break
967               fi
968             done
969           fi
970           if test "X$found_dir" != "X"; then
971             dnl Found the library.
972             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
973             if test "X$found_so" != "X"; then
974               dnl Linking with a shared library. We attempt to hardcode its
975               dnl directory into the executable's runpath, unless it's the
976               dnl standard /usr/lib.
977               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
978                 dnl No hardcoding is needed.
979                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
980               else
981                 dnl Use an explicit option to hardcode DIR into the resulting
982                 dnl binary.
983                 dnl Potentially add DIR to ltrpathdirs.
984                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
985                 haveit=
986                 for x in $ltrpathdirs; do
987                   if test "X$x" = "X$found_dir"; then
988                     haveit=yes
989                     break
990                   fi
991                 done
992                 if test -z "$haveit"; then
993                   ltrpathdirs="$ltrpathdirs $found_dir"
994                 fi
995                 dnl The hardcoding into $LIBNAME is system dependent.
996                 if test "$hardcode_direct" = yes; then
997                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
998                   dnl resulting binary.
999                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1000                 else
1001                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1002                     dnl Use an explicit option to hardcode DIR into the resulting
1003                     dnl binary.
1004                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1005                     dnl Potentially add DIR to rpathdirs.
1006                     dnl The rpathdirs will be appended to $LIBNAME at the end.
1007                     haveit=
1008                     for x in $rpathdirs; do
1009                       if test "X$x" = "X$found_dir"; then
1010                         haveit=yes
1011                         break
1012                       fi
1013                     done
1014                     if test -z "$haveit"; then
1015                       rpathdirs="$rpathdirs $found_dir"
1016                     fi
1017                   else
1018                     dnl Rely on "-L$found_dir".
1019                     dnl But don't add it if it's already contained in the LDFLAGS
1020                     dnl or the already constructed $LIBNAME
1021                     haveit=
1022                     for x in $LDFLAGS $LIB[]NAME; do
1023                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1024                       if test "X$x" = "X-L$found_dir"; then
1025                         haveit=yes
1026                         break
1027                       fi
1028                     done
1029                     if test -z "$haveit"; then
1030                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1031                     fi
1032                     if test "$hardcode_minus_L" != no; then
1033                       dnl FIXME: Not sure whether we should use
1034                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1035                       dnl here.
1036                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1037                     else
1038                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1039                       dnl here, because this doesn't fit in flags passed to the
1040                       dnl compiler. So give up. No hardcoding. This affects only
1041                       dnl very old systems.
1042                       dnl FIXME: Not sure whether we should use
1043                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1044                       dnl here.
1045                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1046                     fi
1047                   fi
1048                 fi
1049               fi
1050             else
1051               if test "X$found_a" != "X"; then
1052                 dnl Linking with a static library.
1053                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1054               else
1055                 dnl We shouldn't come here, but anyway it's good to have a
1056                 dnl fallback.
1057                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1058               fi
1059             fi
1060             dnl Assume the include files are nearby.
1061             additional_includedir=
1062             case "$found_dir" in
1063               */lib | */lib/)
1064                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1065                 additional_includedir="$basedir/include"
1066                 ;;
1067             esac
1068             if test "X$additional_includedir" != "X"; then
1069               dnl Potentially add $additional_includedir to $INCNAME.
1070               dnl But don't add it
1071               dnl   1. if it's the standard /usr/include,
1072               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1073               dnl   3. if it's already present in $CPPFLAGS or the already
1074               dnl      constructed $INCNAME,
1075               dnl   4. if it doesn't exist as a directory.
1076               if test "X$additional_includedir" != "X/usr/include"; then
1077                 haveit=
1078                 if test "X$additional_includedir" = "X/usr/local/include"; then
1079                   if test -n "$GCC"; then
1080                     case $host_os in
1081                       linux*) haveit=yes;;
1082                     esac
1083                   fi
1084                 fi
1085                 if test -z "$haveit"; then
1086                   for x in $CPPFLAGS $INC[]NAME; do
1087                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1088                     if test "X$x" = "X-I$additional_includedir"; then
1089                       haveit=yes
1090                       break
1091                     fi
1092                   done
1093                   if test -z "$haveit"; then
1094                     if test -d "$additional_includedir"; then
1095                       dnl Really add $additional_includedir to $INCNAME.
1096                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1097                     fi
1098                   fi
1099                 fi
1100               fi
1101             fi
1102             dnl Look for dependencies.
1103             if test -n "$found_la"; then
1104               dnl Read the .la file. It defines the variables
1105               dnl dlname, library_names, old_library, dependency_libs, current,
1106               dnl age, revision, installed, dlopen, dlpreopen, libdir.
1107               save_libdir="$libdir"
1108               case "$found_la" in
1109                 */* | *\\*) . "$found_la" ;;
1110                 *) . "./$found_la" ;;
1111               esac
1112               libdir="$save_libdir"
1113               dnl We use only dependency_libs.
1114               for dep in $dependency_libs; do
1115                 case "$dep" in
1116                   -L*)
1117                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1118                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1119                     dnl But don't add it
1120                     dnl   1. if it's the standard /usr/lib,
1121                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
1122                     dnl   3. if it's already present in $LDFLAGS or the already
1123                     dnl      constructed $LIBNAME,
1124                     dnl   4. if it doesn't exist as a directory.
1125                     if test "X$additional_libdir" != "X/usr/lib"; then
1126                       haveit=
1127                       if test "X$additional_libdir" = "X/usr/local/lib"; then
1128                         if test -n "$GCC"; then
1129                           case $host_os in
1130                             linux*) haveit=yes;;
1131                           esac
1132                         fi
1133                       fi
1134                       if test -z "$haveit"; then
1135                         haveit=
1136                         for x in $LDFLAGS $LIB[]NAME; do
1137                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1138                           if test "X$x" = "X-L$additional_libdir"; then
1139                             haveit=yes
1140                             break
1141                           fi
1142                         done
1143                         if test -z "$haveit"; then
1144                           if test -d "$additional_libdir"; then
1145                             dnl Really add $additional_libdir to $LIBNAME.
1146                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1147                           fi
1148                         fi
1149                         haveit=
1150                         for x in $LDFLAGS $LTLIB[]NAME; do
1151                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1152                           if test "X$x" = "X-L$additional_libdir"; then
1153                             haveit=yes
1154                             break
1155                           fi
1156                         done
1157                         if test -z "$haveit"; then
1158                           if test -d "$additional_libdir"; then
1159                             dnl Really add $additional_libdir to $LTLIBNAME.
1160                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1161                           fi
1162                         fi
1163                       fi
1164                     fi
1165                     ;;
1166                   -R*)
1167                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
1168                     if test "$enable_rpath" != no; then
1169                       dnl Potentially add DIR to rpathdirs.
1170                       dnl The rpathdirs will be appended to $LIBNAME at the end.
1171                       haveit=
1172                       for x in $rpathdirs; do
1173                         if test "X$x" = "X$dir"; then
1174                           haveit=yes
1175                           break
1176                         fi
1177                       done
1178                       if test -z "$haveit"; then
1179                         rpathdirs="$rpathdirs $dir"
1180                       fi
1181                       dnl Potentially add DIR to ltrpathdirs.
1182                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1183                       haveit=
1184                       for x in $ltrpathdirs; do
1185                         if test "X$x" = "X$dir"; then
1186                           haveit=yes
1187                           break
1188                         fi
1189                       done
1190                       if test -z "$haveit"; then
1191                         ltrpathdirs="$ltrpathdirs $dir"
1192                       fi
1193                     fi
1194                     ;;
1195                   -l*)
1196                     dnl Handle this in the next round.
1197                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1198                     ;;
1199                   *.la)
1200                     dnl Handle this in the next round. Throw away the .la's
1201                     dnl directory; it is already contained in a preceding -L
1202                     dnl option.
1203                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1204                     ;;
1205                   *)
1206                     dnl Most likely an immediate library name.
1207                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1208                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1209                     ;;
1210                 esac
1211               done
1212             fi
1213           else
1214             dnl Didn't find the library; assume it is in the system directories
1215             dnl known to the linker and runtime loader. (All the system
1216             dnl directories known to the linker should also be known to the
1217             dnl runtime loader, otherwise the system is severely misconfigured.)
1218             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1219             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1220           fi
1221         fi
1222       fi
1223     done
1224   done
1225   if test "X$rpathdirs" != "X"; then
1226     if test -n "$hardcode_libdir_separator"; then
1227       dnl Weird platform: only the last -rpath option counts, the user must
1228       dnl pass all path elements in one option. We can arrange that for a
1229       dnl single library, but not when more than one $LIBNAMEs are used.
1230       alldirs=
1231       for found_dir in $rpathdirs; do
1232         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1233       done
1234       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1235       acl_save_libdir="$libdir"
1236       libdir="$alldirs"
1237       eval flag=\"$hardcode_libdir_flag_spec\"
1238       libdir="$acl_save_libdir"
1239       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1240     else
1241       dnl The -rpath options are cumulative.
1242       for found_dir in $rpathdirs; do
1243         acl_save_libdir="$libdir"
1244         libdir="$found_dir"
1245         eval flag=\"$hardcode_libdir_flag_spec\"
1246         libdir="$acl_save_libdir"
1247         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1248       done
1249     fi
1250   fi
1251   if test "X$ltrpathdirs" != "X"; then
1252     dnl When using libtool, the option that works for both libraries and
1253     dnl executables is -R. The -R options are cumulative.
1254     for found_dir in $ltrpathdirs; do
1255       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1256     done
1257   fi
1258 ])
1259
1260 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1261 dnl unless already present in VAR.
1262 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1263 dnl contains two or three consecutive elements that belong together.
1264 AC_DEFUN([AC_LIB_APPENDTOVAR],
1265 [
1266   for element in [$2]; do
1267     haveit=
1268     for x in $[$1]; do
1269       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1270       if test "X$x" = "X$element"; then
1271         haveit=yes
1272         break
1273       fi
1274     done
1275     if test -z "$haveit"; then
1276       [$1]="${[$1]}${[$1]:+ }$element"
1277     fi
1278   done
1279 ])
1280
1281 # lib-ld.m4 serial 3 (gettext-0.13)
1282 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1283 dnl This file is free software, distributed under the terms of the GNU
1284 dnl General Public License.  As a special exception to the GNU General
1285 dnl Public License, this file may be distributed as part of a program
1286 dnl that contains a configuration script generated by Autoconf, under
1287 dnl the same distribution terms as the rest of that program.
1288
1289 dnl Subroutines of libtool.m4,
1290 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1291 dnl with libtool.m4.
1292
1293 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1294 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1295 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1296 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1297 case `$LD -v 2>&1 </dev/null` in
1298 *GNU* | *'with BFD'*)
1299   acl_cv_prog_gnu_ld=yes ;;
1300 *)
1301   acl_cv_prog_gnu_ld=no ;;
1302 esac])
1303 with_gnu_ld=$acl_cv_prog_gnu_ld
1304 ])
1305
1306 dnl From libtool-1.4. Sets the variable LD.
1307 AC_DEFUN([AC_LIB_PROG_LD],
1308 [AC_ARG_WITH(gnu-ld,
1309 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
1310 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1311 AC_REQUIRE([AC_PROG_CC])dnl
1312 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1313 # Prepare PATH_SEPARATOR.
1314 # The user is always right.
1315 if test "${PATH_SEPARATOR+set}" != set; then
1316   echo "#! /bin/sh" >conf$$.sh
1317   echo  "exit 0"   >>conf$$.sh
1318   chmod +x conf$$.sh
1319   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1320     PATH_SEPARATOR=';'
1321   else
1322     PATH_SEPARATOR=:
1323   fi
1324   rm -f conf$$.sh
1325 fi
1326 ac_prog=ld
1327 if test "$GCC" = yes; then
1328   # Check if gcc -print-prog-name=ld gives a path.
1329   AC_MSG_CHECKING([for ld used by GCC])
1330   case $host in
1331   *-*-mingw*)
1332     # gcc leaves a trailing carriage return which upsets mingw
1333     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1334   *)
1335     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1336   esac
1337   case $ac_prog in
1338     # Accept absolute paths.
1339     [[\\/]* | [A-Za-z]:[\\/]*)]
1340       [re_direlt='/[^/][^/]*/\.\./']
1341       # Canonicalize the path of ld
1342       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1343       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1344         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1345       done
1346       test -z "$LD" && LD="$ac_prog"
1347       ;;
1348   "")
1349     # If it fails, then pretend we aren't using GCC.
1350     ac_prog=ld
1351     ;;
1352   *)
1353     # If it is relative, then search for the first ld in PATH.
1354     with_gnu_ld=unknown
1355     ;;
1356   esac
1357 elif test "$with_gnu_ld" = yes; then
1358   AC_MSG_CHECKING([for GNU ld])
1359 else
1360   AC_MSG_CHECKING([for non-GNU ld])
1361 fi
1362 AC_CACHE_VAL(acl_cv_path_LD,
1363 [if test -z "$LD"; then
1364   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1365   for ac_dir in $PATH; do
1366     test -z "$ac_dir" && ac_dir=.
1367     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1368       acl_cv_path_LD="$ac_dir/$ac_prog"
1369       # Check to see if the program is GNU ld.  I'd rather use --version,
1370       # but apparently some GNU ld's only accept -v.
1371       # Break only if it was the GNU/non-GNU ld that we prefer.
1372       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1373       *GNU* | *'with BFD'*)
1374         test "$with_gnu_ld" != no && break ;;
1375       *)
1376         test "$with_gnu_ld" != yes && break ;;
1377       esac
1378     fi
1379   done
1380   IFS="$ac_save_ifs"
1381 else
1382   acl_cv_path_LD="$LD" # Let the user override the test with a path.
1383 fi])
1384 LD="$acl_cv_path_LD"
1385 if test -n "$LD"; then
1386   AC_MSG_RESULT($LD)
1387 else
1388   AC_MSG_RESULT(no)
1389 fi
1390 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1391 AC_LIB_PROG_LD_GNU
1392 ])
1393
1394 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1395
1396 # serial 47 AC_PROG_LIBTOOL
1397 # Debian $Rev: 214 $
1398
1399
1400 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
1401 # -----------------------------------------------------------
1402 # If this macro is not defined by Autoconf, define it here.
1403 m4_ifdef([AC_PROVIDE_IFELSE],
1404          [],
1405          [m4_define([AC_PROVIDE_IFELSE],
1406                  [m4_ifdef([AC_PROVIDE_$1],
1407                            [$2], [$3])])])
1408
1409
1410 # AC_PROG_LIBTOOL
1411 # ---------------
1412 AC_DEFUN([AC_PROG_LIBTOOL],
1413 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
1414 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
1415 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
1416   AC_PROVIDE_IFELSE([AC_PROG_CXX],
1417     [AC_LIBTOOL_CXX],
1418     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
1419   ])])
1420 dnl And a similar setup for Fortran 77 support
1421   AC_PROVIDE_IFELSE([AC_PROG_F77],
1422     [AC_LIBTOOL_F77],
1423     [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
1424 ])])
1425
1426 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
1427 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
1428 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
1429   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
1430     [AC_LIBTOOL_GCJ],
1431     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1432       [AC_LIBTOOL_GCJ],
1433       [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
1434         [AC_LIBTOOL_GCJ],
1435       [ifdef([AC_PROG_GCJ],
1436              [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
1437        ifdef([A][M_PROG_GCJ],
1438              [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
1439        ifdef([LT_AC_PROG_GCJ],
1440              [define([LT_AC_PROG_GCJ],
1441                 defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
1442 ])])# AC_PROG_LIBTOOL
1443
1444
1445 # _AC_PROG_LIBTOOL
1446 # ----------------
1447 AC_DEFUN([_AC_PROG_LIBTOOL],
1448 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1449 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
1450 AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
1451 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
1452
1453 # This can be used to rebuild libtool when needed
1454 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
1455
1456 # Always use our own libtool.
1457 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1458 AC_SUBST(LIBTOOL)dnl
1459
1460 # Prevent multiple expansion
1461 define([AC_PROG_LIBTOOL], [])
1462 ])# _AC_PROG_LIBTOOL
1463
1464
1465 # AC_LIBTOOL_SETUP
1466 # ----------------
1467 AC_DEFUN([AC_LIBTOOL_SETUP],
1468 [AC_PREREQ(2.50)dnl
1469 AC_REQUIRE([AC_ENABLE_SHARED])dnl
1470 AC_REQUIRE([AC_ENABLE_STATIC])dnl
1471 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1472 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1473 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1474 AC_REQUIRE([AC_PROG_CC])dnl
1475 AC_REQUIRE([AC_PROG_LD])dnl
1476 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1477 AC_REQUIRE([AC_PROG_NM])dnl
1478
1479 AC_REQUIRE([AC_PROG_LN_S])dnl
1480 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1481 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
1482 AC_REQUIRE([AC_OBJEXT])dnl
1483 AC_REQUIRE([AC_EXEEXT])dnl
1484 dnl
1485
1486 AC_LIBTOOL_SYS_MAX_CMD_LEN
1487 AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1488 AC_LIBTOOL_OBJDIR
1489
1490 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1491 _LT_AC_PROG_ECHO_BACKSLASH
1492
1493 case $host_os in
1494 aix3*)
1495   # AIX sometimes has problems with the GCC collect2 program.  For some
1496   # reason, if we set the COLLECT_NAMES environment variable, the problems
1497   # vanish in a puff of smoke.
1498   if test "X${COLLECT_NAMES+set}" != Xset; then
1499     COLLECT_NAMES=
1500     export COLLECT_NAMES
1501   fi
1502   ;;
1503 esac
1504
1505 # Sed substitution that helps us do robust quoting.  It backslashifies
1506 # metacharacters that are still active within double-quoted strings.
1507 Xsed='sed -e s/^X//'
1508 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
1509
1510 # Same as above, but do not quote variable references.
1511 [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
1512
1513 # Sed substitution to delay expansion of an escaped shell variable in a
1514 # double_quote_subst'ed string.
1515 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1516
1517 # Sed substitution to avoid accidental globbing in evaled expressions
1518 no_glob_subst='s/\*/\\\*/g'
1519
1520 # Constants:
1521 rm="rm -f"
1522
1523 # Global variables:
1524 default_ofile=libtool
1525 can_build_shared=yes
1526
1527 # All known linkers require a `.a' archive for static linking (except M$VC,
1528 # which needs '.lib').
1529 libext=a
1530 ltmain="$ac_aux_dir/ltmain.sh"
1531 ofile="$default_ofile"
1532 with_gnu_ld="$lt_cv_prog_gnu_ld"
1533
1534 AC_CHECK_TOOL(AR, ar, false)
1535 AC_CHECK_TOOL(RANLIB, ranlib, :)
1536 AC_CHECK_TOOL(STRIP, strip, :)
1537
1538 old_CC="$CC"
1539 old_CFLAGS="$CFLAGS"
1540
1541 # Set sane defaults for various variables
1542 test -z "$AR" && AR=ar
1543 test -z "$AR_FLAGS" && AR_FLAGS=cru
1544 test -z "$AS" && AS=as
1545 test -z "$CC" && CC=cc
1546 test -z "$LTCC" && LTCC=$CC
1547 test -z "$DLLTOOL" && DLLTOOL=dlltool
1548 test -z "$LD" && LD=ld
1549 test -z "$LN_S" && LN_S="ln -s"
1550 test -z "$MAGIC_CMD" && MAGIC_CMD=file
1551 test -z "$NM" && NM=nm
1552 test -z "$SED" && SED=sed
1553 test -z "$OBJDUMP" && OBJDUMP=objdump
1554 test -z "$RANLIB" && RANLIB=:
1555 test -z "$STRIP" && STRIP=:
1556 test -z "$ac_objext" && ac_objext=o
1557
1558 # Determine commands to create old-style static archives.
1559 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1560 old_postinstall_cmds='chmod 644 $oldlib'
1561 old_postuninstall_cmds=
1562
1563 if test -n "$RANLIB"; then
1564   case $host_os in
1565   openbsd*)
1566     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1567     ;;
1568   *)
1569     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1570     ;;
1571   esac
1572   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1573 fi
1574
1575 # Only perform the check for file, if the check method requires it
1576 case $deplibs_check_method in
1577 file_magic*)
1578   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1579     AC_PATH_MAGIC
1580   fi
1581   ;;
1582 esac
1583
1584 AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1585 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
1586 enable_win32_dll=yes, enable_win32_dll=no)
1587
1588 AC_ARG_ENABLE([libtool-lock],
1589     [AC_HELP_STRING([--disable-libtool-lock],
1590         [avoid locking (might break parallel builds)])])
1591 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1592
1593 AC_ARG_WITH([pic],
1594     [AC_HELP_STRING([--with-pic],
1595         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
1596     [pic_mode="$withval"],
1597     [pic_mode=default])
1598 test -z "$pic_mode" && pic_mode=default
1599
1600 # Use C for the default configuration in the libtool script
1601 tagname=
1602 AC_LIBTOOL_LANG_C_CONFIG
1603 _LT_AC_TAGCONFIG
1604 ])# AC_LIBTOOL_SETUP
1605
1606
1607 # _LT_AC_SYS_COMPILER
1608 # -------------------
1609 AC_DEFUN([_LT_AC_SYS_COMPILER],
1610 [AC_REQUIRE([AC_PROG_CC])dnl
1611
1612 # If no C compiler was specified, use CC.
1613 LTCC=${LTCC-"$CC"}
1614
1615 # Allow CC to be a program name with arguments.
1616 compiler=$CC
1617 ])# _LT_AC_SYS_COMPILER
1618
1619
1620 # _LT_AC_SYS_LIBPATH_AIX
1621 # ----------------------
1622 # Links a minimal program and checks the executable
1623 # for the system default hardcoded library path. In most cases,
1624 # this is /usr/lib:/lib, but when the MPI compilers are used
1625 # the location of the communication and MPI libs are included too.
1626 # If we don't find anything, use the default library path according
1627 # to the aix ld manual.
1628 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
1629 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1630 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
1631 }'`
1632 # Check for a 64-bit object if we didn't find anything.
1633 if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
1634 }'`; fi],[])
1635 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1636 ])# _LT_AC_SYS_LIBPATH_AIX
1637
1638
1639 # _LT_AC_SHELL_INIT(ARG)
1640 # ----------------------
1641 AC_DEFUN([_LT_AC_SHELL_INIT],
1642 [ifdef([AC_DIVERSION_NOTICE],
1643              [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1644          [AC_DIVERT_PUSH(NOTICE)])
1645 $1
1646 AC_DIVERT_POP
1647 ])# _LT_AC_SHELL_INIT
1648
1649
1650 # _LT_AC_PROG_ECHO_BACKSLASH
1651 # --------------------------
1652 # Add some code to the start of the generated configure script which
1653 # will find an echo command which doesn't interpret backslashes.
1654 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
1655 [_LT_AC_SHELL_INIT([
1656 # Check that we are running under the correct shell.
1657 SHELL=${CONFIG_SHELL-/bin/sh}
1658
1659 case X$ECHO in
1660 X*--fallback-echo)
1661   # Remove one level of quotation (which was required for Make).
1662   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1663   ;;
1664 esac
1665
1666 echo=${ECHO-echo}
1667 if test "X[$]1" = X--no-reexec; then
1668   # Discard the --no-reexec flag, and continue.
1669   shift
1670 elif test "X[$]1" = X--fallback-echo; then
1671   # Avoid inline document here, it may be left over
1672   :
1673 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
1674   # Yippee, $echo works!
1675   :
1676 else
1677   # Restart under the correct shell.
1678   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1679 fi
1680
1681 if test "X[$]1" = X--fallback-echo; then
1682   # used as fallback echo
1683   shift
1684   cat <<EOF
1685 [$]*
1686 EOF
1687   exit 0
1688 fi
1689
1690 # The HP-UX ksh and POSIX shell print the target directory to stdout
1691 # if CDPATH is set.
1692 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
1693
1694 if test -z "$ECHO"; then
1695 if test "X${echo_test_string+set}" != Xset; then
1696 # find a string as large as possible, as long as the shell can cope with it
1697   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1698     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1699     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
1700        echo_test_string="`eval $cmd`" &&
1701        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
1702     then
1703       break
1704     fi
1705   done
1706 fi
1707
1708 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1709    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1710    test "X$echo_testing_string" = "X$echo_test_string"; then
1711   :
1712 else
1713   # The Solaris, AIX, and Digital Unix default echo programs unquote
1714   # backslashes.  This makes it impossible to quote backslashes using
1715   #   echo "$something" | sed 's/\\/\\\\/g'
1716   #
1717   # So, first we look for a working echo in the user's PATH.
1718
1719   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1720   for dir in $PATH /usr/ucb; do
1721     IFS="$lt_save_ifs"
1722     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1723        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1724        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1725        test "X$echo_testing_string" = "X$echo_test_string"; then
1726       echo="$dir/echo"
1727       break
1728     fi
1729   done
1730   IFS="$lt_save_ifs"
1731
1732   if test "X$echo" = Xecho; then
1733     # We didn't find a better echo, so look for alternatives.
1734     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
1735        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
1736        test "X$echo_testing_string" = "X$echo_test_string"; then
1737       # This shell has a builtin print -r that does the trick.
1738       echo='print -r'
1739     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
1740          test "X$CONFIG_SHELL" != X/bin/ksh; then
1741       # If we have ksh, try running configure again with it.
1742       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1743       export ORIGINAL_CONFIG_SHELL
1744       CONFIG_SHELL=/bin/ksh
1745       export CONFIG_SHELL
1746       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1747     else
1748       # Try using printf.
1749       echo='printf %s\n'
1750       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1751          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1752          test "X$echo_testing_string" = "X$echo_test_string"; then
1753         # Cool, printf works
1754         :
1755       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1756            test "X$echo_testing_string" = 'X\t' &&
1757            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1758            test "X$echo_testing_string" = "X$echo_test_string"; then
1759         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1760         export CONFIG_SHELL
1761         SHELL="$CONFIG_SHELL"
1762         export SHELL
1763         echo="$CONFIG_SHELL [$]0 --fallback-echo"
1764       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1765            test "X$echo_testing_string" = 'X\t' &&
1766            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1767            test "X$echo_testing_string" = "X$echo_test_string"; then
1768         echo="$CONFIG_SHELL [$]0 --fallback-echo"
1769       else
1770         # maybe with a smaller string...
1771         prev=:
1772
1773         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1774           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
1775           then
1776             break
1777           fi
1778           prev="$cmd"
1779         done
1780
1781         if test "$prev" != 'sed 50q "[$]0"'; then
1782           echo_test_string=`eval $prev`
1783           export echo_test_string
1784           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1785         else
1786           # Oops.  We lost completely, so just stick with echo.
1787           echo=echo
1788         fi
1789       fi
1790     fi
1791   fi
1792 fi
1793 fi
1794
1795 # Copy echo and quote the copy suitably for passing to libtool from
1796 # the Makefile, instead of quoting the original, which is used later.
1797 ECHO=$echo
1798 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1799    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1800 fi
1801
1802 AC_SUBST(ECHO)
1803 ])])# _LT_AC_PROG_ECHO_BACKSLASH
1804
1805
1806 # _LT_AC_LOCK
1807 # -----------
1808 AC_DEFUN([_LT_AC_LOCK],
1809 [AC_ARG_ENABLE([libtool-lock],
1810     [AC_HELP_STRING([--disable-libtool-lock],
1811         [avoid locking (might break parallel builds)])])
1812 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1813
1814 # Some flags need to be propagated to the compiler or linker for good
1815 # libtool support.
1816 case $host in
1817 ia64-*-hpux*)
1818   # Find out which ABI we are using.
1819   echo 'int i;' > conftest.$ac_ext
1820   if AC_TRY_EVAL(ac_compile); then
1821     case `/usr/bin/file conftest.$ac_objext` in
1822     *ELF-32*)
1823       HPUX_IA64_MODE="32"
1824       ;;
1825     *ELF-64*)
1826       HPUX_IA64_MODE="64"
1827       ;;
1828     esac
1829   fi
1830   rm -rf conftest*
1831   ;;
1832 *-*-irix6*)
1833   # Find out which ABI we are using.
1834   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1835   if AC_TRY_EVAL(ac_compile); then
1836    if test "$lt_cv_prog_gnu_ld" = yes; then
1837     case `/usr/bin/file conftest.$ac_objext` in
1838     *32-bit*)
1839       LD="${LD-ld} -melf32bsmip"
1840       ;;
1841     *N32*)
1842       LD="${LD-ld} -melf32bmipn32"
1843       ;;
1844     *64-bit*)
1845       LD="${LD-ld} -melf64bmip"
1846       ;;
1847     esac
1848    else
1849     case `/usr/bin/file conftest.$ac_objext` in
1850     *32-bit*)
1851       LD="${LD-ld} -32"
1852       ;;
1853     *N32*)
1854       LD="${LD-ld} -n32"
1855       ;;
1856     *64-bit*)
1857       LD="${LD-ld} -64"
1858       ;;
1859     esac
1860    fi
1861   fi
1862   rm -rf conftest*
1863   ;;
1864
1865 x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
1866   # Find out which ABI we are using.
1867   echo 'int i;' > conftest.$ac_ext
1868   if AC_TRY_EVAL(ac_compile); then
1869     case "`/usr/bin/file conftest.o`" in
1870     *32-bit*)
1871       case $host in
1872         x86_64-*linux*)
1873           LD="${LD-ld} -m elf_i386"
1874           ;;
1875         ppc64-*linux*|powerpc64-*linux*)
1876           LD="${LD-ld} -m elf32ppclinux"
1877           ;;
1878         s390x-*linux*)
1879           LD="${LD-ld} -m elf_s390"
1880           ;;
1881         sparc64-*linux*)
1882           LD="${LD-ld} -m elf32_sparc"
1883           ;;
1884       esac
1885       ;;
1886     *64-bit*)
1887       case $host in
1888         x86_64-*linux*)
1889           LD="${LD-ld} -m elf_x86_64"
1890           ;;
1891         ppc*-*linux*|powerpc*-*linux*)
1892           LD="${LD-ld} -m elf64ppc"
1893           ;;
1894         s390*-*linux*)
1895           LD="${LD-ld} -m elf64_s390"
1896           ;;
1897         sparc*-*linux*)
1898           LD="${LD-ld} -m elf64_sparc"
1899           ;;
1900       esac
1901       ;;
1902     esac
1903   fi
1904   rm -rf conftest*
1905   ;;
1906
1907 *-*-sco3.2v5*)
1908   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1909   SAVE_CFLAGS="$CFLAGS"
1910   CFLAGS="$CFLAGS -belf"
1911   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1912     [AC_LANG_PUSH(C)
1913      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1914      AC_LANG_POP])
1915   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1916     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1917     CFLAGS="$SAVE_CFLAGS"
1918   fi
1919   ;;
1920 AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
1921 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1922   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1923   AC_CHECK_TOOL(AS, as, false)
1924   AC_CHECK_TOOL(OBJDUMP, objdump, false)
1925   ;;
1926   ])
1927 esac
1928
1929 need_locks="$enable_libtool_lock"
1930
1931 ])# _LT_AC_LOCK
1932
1933
1934 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1935 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1936 # ----------------------------------------------------------------
1937 # Check whether the given compiler option works
1938 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
1939 [AC_REQUIRE([LT_AC_PROG_SED])
1940 AC_CACHE_CHECK([$1], [$2],
1941   [$2=no
1942   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1943    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1944    lt_compiler_flag="$3"
1945    # Insert the option either (1) after the last *FLAGS variable, or
1946    # (2) before a word containing "conftest.", or (3) at the end.
1947    # Note that $ac_compile itself does not contain backslashes and begins
1948    # with a dollar sign (not a hyphen), so the echo should work correctly.
1949    # The option is referenced via a variable to avoid confusing sed.
1950    lt_compile=`echo "$ac_compile" | $SED \
1951    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1952    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1953    -e 's:$: $lt_compiler_flag:'`
1954    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1955    (eval "$lt_compile" 2>conftest.err)
1956    ac_status=$?
1957    cat conftest.err >&AS_MESSAGE_LOG_FD
1958    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1959    if (exit $ac_status) && test -s "$ac_outfile"; then
1960      # The compiler can only warn and ignore the option if not recognized
1961      # So say no if there are warnings
1962      if test ! -s conftest.err; then
1963        $2=yes
1964      fi
1965    fi
1966    $rm conftest*
1967 ])
1968
1969 if test x"[$]$2" = xyes; then
1970     ifelse([$5], , :, [$5])
1971 else
1972     ifelse([$6], , :, [$6])
1973 fi
1974 ])# AC_LIBTOOL_COMPILER_OPTION
1975
1976
1977 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1978 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
1979 # ------------------------------------------------------------
1980 # Check whether the given compiler option works
1981 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
1982 [AC_CACHE_CHECK([$1], [$2],
1983   [$2=no
1984    save_LDFLAGS="$LDFLAGS"
1985    LDFLAGS="$LDFLAGS $3"
1986    printf "$lt_simple_link_test_code" > conftest.$ac_ext
1987    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1988      # The compiler can only warn and ignore the option if not recognized
1989      # So say no if there are warnings
1990      if test -s conftest.err; then
1991        # Append any errors to the config.log.
1992        cat conftest.err 1>&AS_MESSAGE_LOG_FD
1993      else
1994        $2=yes
1995      fi
1996    fi
1997    $rm conftest*
1998    LDFLAGS="$save_LDFLAGS"
1999 ])
2000
2001 if test x"[$]$2" = xyes; then
2002     ifelse([$4], , :, [$4])
2003 else
2004     ifelse([$5], , :, [$5])
2005 fi
2006 ])# AC_LIBTOOL_LINKER_OPTION
2007
2008
2009 # AC_LIBTOOL_SYS_MAX_CMD_LEN
2010 # --------------------------
2011 AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
2012 [# find the maximum length of command line arguments
2013 AC_MSG_CHECKING([the maximum length of command line arguments])
2014 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2015   i=0
2016   teststring="ABCD"
2017
2018   case $build_os in
2019   msdosdjgpp*)
2020     # On DJGPP, this test can blow up pretty badly due to problems in libc
2021     # (any single argument exceeding 2000 bytes causes a buffer overrun
2022     # during glob expansion).  Even if it were fixed, the result of this
2023     # check would be larger than it should be.
2024     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2025     ;;
2026
2027   gnu*)
2028     # Under GNU Hurd, this test is not required because there is
2029     # no limit to the length of command line arguments.
2030     # Libtool will interpret -1 as no limit whatsoever
2031     lt_cv_sys_max_cmd_len=-1;
2032     ;;
2033
2034   cygwin* | mingw*)
2035     # On Win9x/ME, this test blows up -- it succeeds, but takes
2036     # about 5 minutes as the teststring grows exponentially.
2037     # Worse, since 9x/ME are not pre-emptively multitasking,
2038     # you end up with a "frozen" computer, even though with patience
2039     # the test eventually succeeds (with a max line length of 256k).
2040     # Instead, let's just punt: use the minimum linelength reported by
2041     # all of the supported platforms: 8192 (on NT/2K/XP).
2042     lt_cv_sys_max_cmd_len=8192;
2043     ;;
2044
2045   amigaos*)
2046     # On AmigaOS with pdksh, this test takes hours, literally.
2047     # So we just punt and use a minimum line length of 8192.
2048     lt_cv_sys_max_cmd_len=8192;
2049     ;;
2050
2051  *)
2052     # If test is not a shell built-in, we'll probably end up computing a
2053     # maximum length that is only half of the actual maximum length, but
2054     # we can't tell.
2055     while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
2056                = "XX$teststring") >/dev/null 2>&1 &&
2057             new_result=`expr "X$teststring" : ".*" 2>&1` &&
2058             lt_cv_sys_max_cmd_len=$new_result &&
2059             test $i != 17 # 1/2 MB should be enough
2060     do
2061       i=`expr $i + 1`
2062       teststring=$teststring$teststring
2063     done
2064     teststring=
2065     # Add a significant safety factor because C++ compilers can tack on massive
2066     # amounts of additional arguments before passing them to the linker.
2067     # It appears as though 1/2 is a usable value.
2068     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2069     ;;
2070   esac
2071 ])
2072 if test -n $lt_cv_sys_max_cmd_len ; then
2073   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2074 else
2075   AC_MSG_RESULT(none)
2076 fi
2077 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
2078
2079
2080 # _LT_AC_CHECK_DLFCN
2081 # --------------------
2082 AC_DEFUN([_LT_AC_CHECK_DLFCN],
2083 [AC_CHECK_HEADERS(dlfcn.h)dnl
2084 ])# _LT_AC_CHECK_DLFCN
2085
2086
2087 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2088 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2089 # ------------------------------------------------------------------
2090 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
2091 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
2092 if test "$cross_compiling" = yes; then :
2093   [$4]
2094 else
2095   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2096   lt_status=$lt_dlunknown
2097   cat > conftest.$ac_ext <<EOF
2098 [#line __oline__ "configure"
2099 #include "confdefs.h"
2100
2101 #if HAVE_DLFCN_H
2102 #include <dlfcn.h>
2103 #endif
2104
2105 #include <stdio.h>
2106
2107 #ifdef RTLD_GLOBAL
2108 #  define LT_DLGLOBAL           RTLD_GLOBAL
2109 #else
2110 #  ifdef DL_GLOBAL
2111 #    define LT_DLGLOBAL         DL_GLOBAL
2112 #  else
2113 #    define LT_DLGLOBAL         0
2114 #  endif
2115 #endif
2116
2117 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2118    find out it does not work in some platform. */
2119 #ifndef LT_DLLAZY_OR_NOW
2120 #  ifdef RTLD_LAZY
2121 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
2122 #  else
2123 #    ifdef DL_LAZY
2124 #      define LT_DLLAZY_OR_NOW          DL_LAZY
2125 #    else
2126 #      ifdef RTLD_NOW
2127 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
2128 #      else
2129 #        ifdef DL_NOW
2130 #          define LT_DLLAZY_OR_NOW      DL_NOW
2131 #        else
2132 #          define LT_DLLAZY_OR_NOW      0
2133 #        endif
2134 #      endif
2135 #    endif
2136 #  endif
2137 #endif
2138
2139 #ifdef __cplusplus
2140 extern "C" void exit (int);
2141 #endif
2142
2143 void fnord() { int i=42;}
2144 int main ()
2145 {
2146   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2147   int status = $lt_dlunknown;
2148
2149   if (self)
2150     {
2151       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2152       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
2153       /* dlclose (self); */
2154     }
2155
2156     exit (status);
2157 }]
2158 EOF
2159   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2160     (./conftest; exit; ) 2>/dev/null
2161     lt_status=$?
2162     case x$lt_status in
2163       x$lt_dlno_uscore) $1 ;;
2164       x$lt_dlneed_uscore) $2 ;;
2165       x$lt_unknown|x*) $3 ;;
2166     esac
2167   else :
2168     # compilation failed
2169     $3
2170   fi
2171 fi
2172 rm -fr conftest*
2173 ])# _LT_AC_TRY_DLOPEN_SELF
2174
2175
2176 # AC_LIBTOOL_DLOPEN_SELF
2177 # -------------------
2178 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
2179 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
2180 if test "x$enable_dlopen" != xyes; then
2181   enable_dlopen=unknown
2182   enable_dlopen_self=unknown
2183   enable_dlopen_self_static=unknown
2184 else
2185   lt_cv_dlopen=no
2186   lt_cv_dlopen_libs=
2187
2188   case $host_os in
2189   beos*)
2190     lt_cv_dlopen="load_add_on"
2191     lt_cv_dlopen_libs=
2192     lt_cv_dlopen_self=yes
2193     ;;
2194
2195   mingw* | pw32*)
2196     lt_cv_dlopen="LoadLibrary"
2197     lt_cv_dlopen_libs=
2198    ;;
2199
2200   cygwin*)
2201     lt_cv_dlopen="dlopen"
2202     lt_cv_dlopen_libs=
2203    ;;
2204
2205   darwin*)
2206   # if libdl is installed we need to link against it
2207     AC_CHECK_LIB([dl], [dlopen],
2208                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2209     lt_cv_dlopen="dyld"
2210     lt_cv_dlopen_libs=
2211     lt_cv_dlopen_self=yes
2212     ])
2213    ;;
2214
2215   *)
2216     AC_CHECK_FUNC([shl_load],
2217           [lt_cv_dlopen="shl_load"],
2218       [AC_CHECK_LIB([dld], [shl_load],
2219             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
2220         [AC_CHECK_FUNC([dlopen],
2221               [lt_cv_dlopen="dlopen"],
2222           [AC_CHECK_LIB([dl], [dlopen],
2223                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2224             [AC_CHECK_LIB([svld], [dlopen],
2225                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2226               [AC_CHECK_LIB([dld], [dld_link],
2227                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
2228               ])
2229             ])
2230           ])
2231         ])
2232       ])
2233     ;;
2234   esac
2235
2236   if test "x$lt_cv_dlopen" != xno; then
2237     enable_dlopen=yes
2238   else
2239     enable_dlopen=no
2240   fi
2241
2242   case $lt_cv_dlopen in
2243   dlopen)
2244     save_CPPFLAGS="$CPPFLAGS"
2245     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2246
2247     save_LDFLAGS="$LDFLAGS"
2248     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2249
2250     save_LIBS="$LIBS"
2251     LIBS="$lt_cv_dlopen_libs $LIBS"
2252
2253     AC_CACHE_CHECK([whether a program can dlopen itself],
2254           lt_cv_dlopen_self, [dnl
2255           _LT_AC_TRY_DLOPEN_SELF(
2256             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2257             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2258     ])
2259
2260     if test "x$lt_cv_dlopen_self" = xyes; then
2261       LDFLAGS="$LDFLAGS $link_static_flag"
2262       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2263           lt_cv_dlopen_self_static, [dnl
2264           _LT_AC_TRY_DLOPEN_SELF(
2265             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2266             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2267       ])
2268     fi
2269
2270     CPPFLAGS="$save_CPPFLAGS"
2271     LDFLAGS="$save_LDFLAGS"
2272     LIBS="$save_LIBS"
2273     ;;
2274   esac
2275
2276   case $lt_cv_dlopen_self in
2277   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2278   *) enable_dlopen_self=unknown ;;
2279   esac
2280
2281   case $lt_cv_dlopen_self_static in
2282   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2283   *) enable_dlopen_self_static=unknown ;;
2284   esac
2285 fi
2286 ])# AC_LIBTOOL_DLOPEN_SELF
2287
2288
2289 # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
2290 # ---------------------------------
2291 # Check to see if options -c and -o are simultaneously supported by compiler
2292 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
2293 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
2294 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2295   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2296   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2297    $rm -r conftest 2>/dev/null
2298    mkdir conftest
2299    cd conftest
2300    mkdir out
2301    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
2302
2303    lt_compiler_flag="-o out/conftest2.$ac_objext"
2304    # Insert the option either (1) after the last *FLAGS variable, or
2305    # (2) before a word containing "conftest.", or (3) at the end.
2306    # Note that $ac_compile itself does not contain backslashes and begins
2307    # with a dollar sign (not a hyphen), so the echo should work correctly.
2308    lt_compile=`echo "$ac_compile" | $SED \
2309    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
2310    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2311    -e 's:$: $lt_compiler_flag:'`
2312    (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2313    (eval "$lt_compile" 2>out/conftest.err)
2314    ac_status=$?
2315    cat out/conftest.err >&AS_MESSAGE_LOG_FD
2316    echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2317    if (exit $ac_status) && test -s out/conftest2.$ac_objext
2318    then
2319      # The compiler can only warn and ignore the option if not recognized
2320      # So say no if there are warnings
2321      if test ! -s out/conftest.err; then
2322        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2323      fi
2324    fi
2325    chmod u+w .
2326    $rm conftest*
2327    # SGI C++ compiler will create directory out/ii_files/ for
2328    # template instantiation
2329    test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
2330    $rm out/* && rmdir out
2331    cd ..
2332    rmdir conftest
2333    $rm conftest*
2334 ])
2335 ])# AC_LIBTOOL_PROG_CC_C_O
2336
2337
2338 # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
2339 # -----------------------------------------
2340 # Check to see if we can do hard links to lock some files if needed
2341 AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
2342 [AC_REQUIRE([_LT_AC_LOCK])dnl
2343
2344 hard_links="nottested"
2345 if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2346   # do not overwrite the value of need_locks provided by the user
2347   AC_MSG_CHECKING([if we can lock with hard links])
2348   hard_links=yes
2349   $rm conftest*
2350   ln conftest.a conftest.b 2>/dev/null && hard_links=no
2351   touch conftest.a
2352   ln conftest.a conftest.b 2>&5 || hard_links=no
2353   ln conftest.a conftest.b 2>/dev/null && hard_links=no
2354   AC_MSG_RESULT([$hard_links])
2355   if test "$hard_links" = no; then
2356     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2357     need_locks=warn
2358   fi
2359 else
2360   need_locks=no
2361 fi
2362 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
2363
2364
2365 # AC_LIBTOOL_OBJDIR
2366 # -----------------
2367 AC_DEFUN([AC_LIBTOOL_OBJDIR],
2368 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2369 [rm -f .libs 2>/dev/null
2370 mkdir .libs 2>/dev/null
2371 if test -d .libs; then
2372   lt_cv_objdir=.libs
2373 else
2374   # MS-DOS does not allow filenames that begin with a dot.
2375   lt_cv_objdir=_libs
2376 fi
2377 rmdir .libs 2>/dev/null])
2378 objdir=$lt_cv_objdir
2379 ])# AC_LIBTOOL_OBJDIR
2380
2381
2382 # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
2383 # ----------------------------------------------
2384 # Check hardcoding attributes.
2385 AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
2386 [AC_MSG_CHECKING([how to hardcode library paths into programs])
2387 _LT_AC_TAGVAR(hardcode_action, $1)=
2388 if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
2389    test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
2390    test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
2391
2392   # We can hardcode non-existant directories.
2393   if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
2394      # If the only mechanism to avoid hardcoding is shlibpath_var, we
2395      # have to relink, otherwise we might link with an installed library
2396      # when we should be linking with a yet-to-be-installed one
2397      ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2398      test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
2399     # Linking always hardcodes the temporary library directory.
2400     _LT_AC_TAGVAR(hardcode_action, $1)=relink
2401   else
2402     # We can link without hardcoding, and we can hardcode nonexisting dirs.
2403     _LT_AC_TAGVAR(hardcode_action, $1)=immediate
2404   fi
2405 else
2406   # We cannot hardcode anything, or else we can only hardcode existing
2407   # directories.
2408   _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
2409 fi
2410 AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
2411
2412 if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
2413   # Fast installation is not supported
2414   enable_fast_install=no
2415 elif test "$shlibpath_overrides_runpath" = yes ||
2416      test "$enable_shared" = no; then
2417   # Fast installation is not necessary
2418   enable_fast_install=needless
2419 fi
2420 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
2421
2422
2423 # AC_LIBTOOL_SYS_LIB_STRIP
2424 # ------------------------
2425 AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
2426 [striplib=
2427 old_striplib=
2428 AC_MSG_CHECKING([whether stripping libraries is possible])
2429 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2430   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2431   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2432   AC_MSG_RESULT([yes])
2433 else
2434 # FIXME - insert some real tests, host_os isn't really good enough
2435   case $host_os in
2436    darwin*)
2437        if test -n "$STRIP" ; then
2438          striplib="$STRIP -x"
2439          AC_MSG_RESULT([yes])
2440        else
2441   AC_MSG_RESULT([no])
2442 fi
2443        ;;
2444    *)
2445   AC_MSG_RESULT([no])
2446     ;;
2447   esac
2448 fi
2449 ])# AC_LIBTOOL_SYS_LIB_STRIP
2450
2451
2452 # AC_LIBTOOL_SYS_DYNAMIC_LINKER
2453 # -----------------------------
2454 # PORTME Fill in your ld.so characteristics
2455 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
2456 [AC_MSG_CHECKING([dynamic linker characteristics])
2457 library_names_spec=
2458 libname_spec='lib$name'
2459 soname_spec=
2460 shrext_cmds=".so"
2461 postinstall_cmds=
2462 postuninstall_cmds=
2463 finish_cmds=
2464 finish_eval=
2465 shlibpath_var=
2466 shlibpath_overrides_runpath=unknown
2467 version_type=none
2468 dynamic_linker="$host_os ld.so"
2469 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2470 if test "$GCC" = yes; then
2471   sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2472   if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
2473     # if the path contains ";" then we assume it to be the separator
2474     # otherwise default to the standard path separator (i.e. ":") - it is
2475     # assumed that no part of a normal pathname contains ";" but that should
2476     # okay in the real world where ";" in dirpaths is itself problematic.
2477     sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2478   else
2479     sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2480   fi
2481 else
2482   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2483 fi
2484 need_lib_prefix=unknown
2485 hardcode_into_libs=no
2486
2487 # when you set need_version to no, make sure it does not cause -set_version
2488 # flags to be left without arguments
2489 need_version=unknown
2490
2491 case $host_os in
2492 aix3*)
2493   version_type=linux
2494   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2495   shlibpath_var=LIBPATH
2496
2497   # AIX 3 has no versioning support, so we append a major version to the name.
2498   soname_spec='${libname}${release}${shared_ext}$major'
2499   ;;
2500
2501 aix4* | aix5*)
2502   version_type=linux
2503   need_lib_prefix=no
2504   need_version=no
2505   hardcode_into_libs=yes
2506   if test "$host_cpu" = ia64; then
2507     # AIX 5 supports IA64
2508     library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2509     shlibpath_var=LD_LIBRARY_PATH
2510   else
2511     # With GCC up to 2.95.x, collect2 would create an import file
2512     # for dependence libraries.  The import file would start with
2513     # the line `#! .'.  This would cause the generated library to
2514     # depend on `.', always an invalid library.  This was fixed in
2515     # development snapshots of GCC prior to 3.0.
2516     case $host_os in
2517       aix4 | aix4.[[01]] | aix4.[[01]].*)
2518       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2519            echo ' yes '
2520            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2521         :
2522       else
2523         can_build_shared=no
2524       fi
2525       ;;
2526     esac
2527     # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2528     # soname into executable. Probably we can add versioning support to
2529     # collect2, so additional links can be useful in future.
2530     if test "$aix_use_runtimelinking" = yes; then
2531       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2532       # instead of lib<name>.a to let people know that these are not
2533       # typical AIX shared libraries.
2534       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2535     else
2536       # We preserve .a as extension for shared libraries through AIX4.2
2537       # and later when we are not doing run time linking.
2538       library_names_spec='${libname}${release}.a $libname.a'
2539       soname_spec='${libname}${release}${shared_ext}$major'
2540     fi
2541     shlibpath_var=LIBPATH
2542   fi
2543   ;;
2544
2545 amigaos*)
2546   library_names_spec='$libname.ixlibrary $libname.a'
2547   # Create ${libname}_ixlibrary.a entries in /sys/libs.
2548   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'
2549   ;;
2550
2551 beos*)
2552   library_names_spec='${libname}${shared_ext}'
2553   dynamic_linker="$host_os ld.so"
2554   shlibpath_var=LIBRARY_PATH
2555   ;;
2556
2557 bsdi4*)
2558   version_type=linux
2559   need_version=no
2560   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2561   soname_spec='${libname}${release}${shared_ext}$major'
2562   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2563   shlibpath_var=LD_LIBRARY_PATH
2564   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2565   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2566   # the default ld.so.conf also contains /usr/contrib/lib and
2567   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2568   # libtool to hard-code these into programs
2569   ;;
2570
2571 cygwin* | mingw* | pw32*)
2572   version_type=windows
2573   shrext_cmds=".dll"
2574   need_version=no
2575   need_lib_prefix=no
2576
2577   case $GCC,$host_os in
2578   yes,cygwin* | yes,mingw* | yes,pw32*)
2579     library_names_spec='$libname.dll.a'
2580     # DLL is installed to $(libdir)/../bin by postinstall_cmds
2581     postinstall_cmds='base_file=`basename \${file}`~
2582       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
2583       dldir=$destdir/`dirname \$dlpath`~
2584       test -d \$dldir || mkdir -p \$dldir~
2585       $install_prog $dir/$dlname \$dldir/$dlname'
2586     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2587       dlpath=$dir/\$dldll~
2588        $rm \$dlpath'
2589     shlibpath_overrides_runpath=yes
2590
2591     case $host_os in
2592     cygwin*)
2593       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2594       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2595       sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2596       ;;
2597     mingw*)
2598       # MinGW DLLs use traditional 'lib' prefix
2599       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2600       sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2601       if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
2602         # It is most probably a Windows format PATH printed by
2603         # mingw gcc, but we are running on Cygwin. Gcc prints its search
2604         # path with ; separators, and with drive letters. We can handle the
2605         # drive letters (cygwin fileutils understands them), so leave them,
2606         # especially as we might pass files found there to a mingw objdump,
2607         # which wouldn't understand a cygwinified path. Ahh.
2608         sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2609       else
2610         sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2611       fi
2612       ;;
2613     pw32*)
2614       # pw32 DLLs use 'pw' prefix rather than 'lib'
2615       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
2616       ;;
2617     esac
2618     ;;
2619
2620   *)
2621     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2622     ;;
2623   esac
2624   dynamic_linker='Win32 ld.exe'
2625   # FIXME: first we should search . and the directory the executable is in
2626   shlibpath_var=PATH
2627   ;;
2628
2629 darwin* | rhapsody*)
2630   dynamic_linker="$host_os dyld"
2631   version_type=darwin
2632   need_lib_prefix=no
2633   need_version=no
2634   library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2635   soname_spec='${libname}${release}${major}$shared_ext'
2636   shlibpath_overrides_runpath=yes
2637   shlibpath_var=DYLD_LIBRARY_PATH
2638   shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
2639   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
2640   if test "$GCC" = yes; then
2641     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
2642   else
2643     sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
2644   fi
2645   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2646   ;;
2647
2648 dgux*)
2649   version_type=linux
2650   need_lib_prefix=no
2651   need_version=no
2652   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2653   soname_spec='${libname}${release}${shared_ext}$major'
2654   shlibpath_var=LD_LIBRARY_PATH
2655   ;;
2656
2657 freebsd1*)
2658   dynamic_linker=no
2659   ;;
2660
2661 kfreebsd*-gnu)
2662   version_type=linux
2663   need_lib_prefix=no
2664   need_version=no
2665   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2666   soname_spec='${libname}${release}${shared_ext}$major'
2667   shlibpath_var=LD_LIBRARY_PATH
2668   shlibpath_overrides_runpath=no
2669   hardcode_into_libs=yes
2670   dynamic_linker='GNU ld.so'
2671   ;;
2672
2673 freebsd*)
2674   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
2675   version_type=freebsd-$objformat
2676   case $version_type in
2677     freebsd-elf*)
2678       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2679       need_version=no
2680       need_lib_prefix=no
2681       ;;
2682     freebsd-*)
2683       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2684       need_version=yes
2685       ;;
2686   esac
2687   shlibpath_var=LD_LIBRARY_PATH
2688   case $host_os in
2689   freebsd2*)
2690     shlibpath_overrides_runpath=yes
2691     ;;
2692   freebsd3.[01]* | freebsdelf3.[01]*)
2693     shlibpath_overrides_runpath=yes
2694     hardcode_into_libs=yes
2695     ;;
2696   *) # from 3.2 on
2697     shlibpath_overrides_runpath=no
2698     hardcode_into_libs=yes
2699     ;;
2700   esac
2701   ;;
2702
2703 gnu*)
2704   version_type=linux
2705   need_lib_prefix=no
2706   need_version=no
2707   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2708   soname_spec='${libname}${release}${shared_ext}$major'
2709   shlibpath_var=LD_LIBRARY_PATH
2710   hardcode_into_libs=yes
2711   ;;
2712
2713 hpux9* | hpux10* | hpux11*)
2714   # Give a soname corresponding to the major version so that dld.sl refuses to
2715   # link against other versions.
2716   version_type=sunos
2717   need_lib_prefix=no
2718   need_version=no
2719   case "$host_cpu" in
2720   ia64*)
2721     shrext_cmds='.so'
2722     hardcode_into_libs=yes
2723     dynamic_linker="$host_os dld.so"
2724     shlibpath_var=LD_LIBRARY_PATH
2725     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2726     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2727     soname_spec='${libname}${release}${shared_ext}$major'
2728     if test "X$HPUX_IA64_MODE" = X32; then
2729       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2730     else
2731       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2732     fi
2733     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2734     ;;
2735    hppa*64*)
2736      shrext_cmds='.sl'
2737      hardcode_into_libs=yes
2738      dynamic_linker="$host_os dld.sl"
2739      shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2740      shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2741      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2742      soname_spec='${libname}${release}${shared_ext}$major'
2743      sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2744      sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2745      ;;
2746    *)
2747     shrext_cmds='.sl'
2748     dynamic_linker="$host_os dld.sl"
2749     shlibpath_var=SHLIB_PATH
2750     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2751     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2752     soname_spec='${libname}${release}${shared_ext}$major'
2753     ;;
2754   esac
2755   # HP-UX runs *really* slowly unless shared libraries are mode 555.
2756   postinstall_cmds='chmod 555 $lib'
2757   ;;
2758
2759 irix5* | irix6* | nonstopux*)
2760   case $host_os in
2761     nonstopux*) version_type=nonstopux ;;
2762     *)
2763         if test "$lt_cv_prog_gnu_ld" = yes; then
2764                 version_type=linux
2765         else
2766                 version_type=irix
2767         fi ;;
2768   esac
2769   need_lib_prefix=no
2770   need_version=no
2771   soname_spec='${libname}${release}${shared_ext}$major'
2772   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2773   case $host_os in
2774   irix5* | nonstopux*)
2775     libsuff= shlibsuff=
2776     ;;
2777   *)
2778     case $LD in # libtool.m4 will add one of these switches to LD
2779     *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2780       libsuff= shlibsuff= libmagic=32-bit;;
2781     *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2782       libsuff=32 shlibsuff=N32 libmagic=N32;;
2783     *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2784       libsuff=64 shlibsuff=64 libmagic=64-bit;;
2785     *) libsuff= shlibsuff= libmagic=never-match;;
2786     esac
2787     ;;
2788   esac
2789   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2790   shlibpath_overrides_runpath=no
2791   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2792   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2793   hardcode_into_libs=yes
2794   ;;
2795
2796 # No shared lib support for Linux oldld, aout, or coff.
2797 linux*oldld* | linux*aout* | linux*coff*)
2798   dynamic_linker=no
2799   ;;
2800
2801 # This must be Linux ELF.
2802 linux*)
2803   version_type=linux
2804   need_lib_prefix=no
2805   need_version=no
2806   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2807   soname_spec='${libname}${release}${shared_ext}$major'
2808   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2809   shlibpath_var=LD_LIBRARY_PATH
2810   shlibpath_overrides_runpath=no
2811   # This implies no fast_install, which is unacceptable.
2812   # Some rework will be needed to allow for fast_install
2813   # before this can be enabled.
2814   hardcode_into_libs=yes
2815
2816   # Append ld.so.conf contents to the search path
2817   if test -f /etc/ld.so.conf; then
2818     lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '`
2819     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2820   fi
2821
2822   # We used to test for /lib/ld.so.1 and disable shared libraries on
2823   # powerpc, because MkLinux only supported shared libraries with the
2824   # GNU dynamic linker.  Since this was broken with cross compilers,
2825   # most powerpc-linux boxes support dynamic linking these days and
2826   # people can always --disable-shared, the test was removed, and we
2827   # assume the GNU/Linux dynamic linker is in use.
2828   dynamic_linker='GNU/Linux ld.so'
2829   ;;
2830
2831 netbsdelf*-gnu)
2832   version_type=linux
2833   need_lib_prefix=no
2834   need_version=no
2835   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2836   soname_spec='${libname}${release}${shared_ext}$major'
2837   shlibpath_var=LD_LIBRARY_PATH
2838   shlibpath_overrides_runpath=no
2839   hardcode_into_libs=yes
2840   dynamic_linker='NetBSD ld.elf_so'
2841   ;;
2842
2843 knetbsd*-gnu)
2844   version_type=linux
2845   need_lib_prefix=no
2846   need_version=no
2847   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2848   soname_spec='${libname}${release}${shared_ext}$major'
2849   shlibpath_var=LD_LIBRARY_PATH
2850   shlibpath_overrides_runpath=no
2851   hardcode_into_libs=yes
2852   dynamic_linker='GNU ld.so'
2853   ;;
2854
2855 netbsd*)
2856   version_type=sunos
2857   need_lib_prefix=no
2858   need_version=no
2859   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2860     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2861     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2862     dynamic_linker='NetBSD (a.out) ld.so'
2863   else
2864     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2865     soname_spec='${libname}${release}${shared_ext}$major'
2866     dynamic_linker='NetBSD ld.elf_so'
2867   fi
2868   shlibpath_var=LD_LIBRARY_PATH
2869   shlibpath_overrides_runpath=yes
2870   hardcode_into_libs=yes
2871   ;;
2872
2873 newsos6)
2874   version_type=linux
2875   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2876   shlibpath_var=LD_LIBRARY_PATH
2877   shlibpath_overrides_runpath=yes
2878   ;;
2879
2880 nto-qnx*)
2881   version_type=linux
2882   need_lib_prefix=no
2883   need_version=no
2884   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2885   soname_spec='${libname}${release}${shared_ext}$major'
2886   shlibpath_var=LD_LIBRARY_PATH
2887   shlibpath_overrides_runpath=yes
2888   ;;
2889
2890 openbsd*)
2891   version_type=sunos
2892   need_lib_prefix=no
2893   need_version=yes
2894   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2895   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2896   shlibpath_var=LD_LIBRARY_PATH
2897   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2898     case $host_os in
2899       openbsd2.[[89]] | openbsd2.[[89]].*)
2900         shlibpath_overrides_runpath=no
2901         ;;
2902       *)
2903         shlibpath_overrides_runpath=yes
2904         ;;
2905       esac
2906   else
2907     shlibpath_overrides_runpath=yes
2908   fi
2909   ;;
2910
2911 os2*)
2912   libname_spec='$name'
2913   shrext_cmds=".dll"
2914   need_lib_prefix=no
2915   library_names_spec='$libname${shared_ext} $libname.a'
2916   dynamic_linker='OS/2 ld.exe'
2917   shlibpath_var=LIBPATH
2918   ;;
2919
2920 osf3* | osf4* | osf5*)
2921   version_type=osf
2922   need_lib_prefix=no
2923   need_version=no
2924   soname_spec='${libname}${release}${shared_ext}$major'
2925   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2926   shlibpath_var=LD_LIBRARY_PATH
2927   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2928   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2929   ;;
2930
2931 sco3.2v5*)
2932   version_type=osf
2933   soname_spec='${libname}${release}${shared_ext}$major'
2934   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2935   shlibpath_var=LD_LIBRARY_PATH
2936   ;;
2937
2938 solaris*)
2939   version_type=linux
2940   need_lib_prefix=no
2941   need_version=no
2942   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2943   soname_spec='${libname}${release}${shared_ext}$major'
2944   shlibpath_var=LD_LIBRARY_PATH
2945   shlibpath_overrides_runpath=yes
2946   hardcode_into_libs=yes
2947   # ldd complains unless libraries are executable
2948   postinstall_cmds='chmod +x $lib'
2949   ;;
2950
2951 sunos4*)
2952   version_type=sunos
2953   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2954   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2955   shlibpath_var=LD_LIBRARY_PATH
2956   shlibpath_overrides_runpath=yes
2957   if test "$with_gnu_ld" = yes; then
2958     need_lib_prefix=no
2959   fi
2960   need_version=yes
2961   ;;
2962
2963 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2964   version_type=linux
2965   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2966   soname_spec='${libname}${release}${shared_ext}$major'
2967   shlibpath_var=LD_LIBRARY_PATH
2968   case $host_vendor in
2969     sni)
2970       shlibpath_overrides_runpath=no
2971       need_lib_prefix=no
2972       export_dynamic_flag_spec='${wl}-Blargedynsym'
2973       runpath_var=LD_RUN_PATH
2974       ;;
2975     siemens)
2976       need_lib_prefix=no
2977       ;;
2978     motorola)
2979       need_lib_prefix=no
2980       need_version=no
2981       shlibpath_overrides_runpath=no
2982       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2983       ;;
2984   esac
2985   ;;
2986
2987 sysv4*MP*)
2988   if test -d /usr/nec ;then
2989     version_type=linux
2990     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2991     soname_spec='$libname${shared_ext}.$major'
2992     shlibpath_var=LD_LIBRARY_PATH
2993   fi
2994   ;;
2995
2996 uts4*)
2997   version_type=linux
2998   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2999   soname_spec='${libname}${release}${shared_ext}$major'
3000   shlibpath_var=LD_LIBRARY_PATH
3001   ;;
3002
3003 *)
3004   dynamic_linker=no
3005   ;;
3006 esac
3007 AC_MSG_RESULT([$dynamic_linker])
3008 test "$dynamic_linker" = no && can_build_shared=no
3009 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
3010
3011
3012 # _LT_AC_TAGCONFIG
3013 # ----------------
3014 AC_DEFUN([_LT_AC_TAGCONFIG],
3015 [AC_ARG_WITH([tags],
3016     [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
3017         [include additional configurations @<:@automatic@:>@])],
3018     [tagnames="$withval"])
3019
3020 if test -f "$ltmain" && test -n "$tagnames"; then
3021   if test ! -f "${ofile}"; then
3022     AC_MSG_WARN([output file `$ofile' does not exist])
3023   fi
3024
3025   if test -z "$LTCC"; then
3026     eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
3027     if test -z "$LTCC"; then
3028       AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
3029     else
3030       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
3031     fi
3032   fi
3033
3034   # Extract list of available tagged configurations in $ofile.
3035   # Note that this assumes the entire list is on one line.
3036   available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
3037
3038   lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3039   for tagname in $tagnames; do
3040     IFS="$lt_save_ifs"
3041     # Check whether tagname contains only valid characters
3042     case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
3043     "") ;;
3044     *)  AC_MSG_ERROR([invalid tag name: $tagname])
3045         ;;
3046     esac
3047
3048     if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
3049     then
3050       AC_MSG_ERROR([tag name \"$tagname\" already exists])
3051     fi
3052
3053     # Update the list of available tags.
3054     if test -n "$tagname"; then
3055       echo appending configuration tag \"$tagname\" to $ofile
3056
3057       case $tagname in
3058       CXX)
3059         if test -n "$CXX" && test "X$CXX" != "Xno"; then
3060           AC_LIBTOOL_LANG_CXX_CONFIG
3061         else
3062           tagname=""
3063         fi
3064         ;;
3065
3066       F77)
3067         if test -n "$F77" && test "X$F77" != "Xno"; then
3068           AC_LIBTOOL_LANG_F77_CONFIG
3069         else
3070           tagname=""
3071         fi
3072         ;;
3073
3074       GCJ)
3075         if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
3076           AC_LIBTOOL_LANG_GCJ_CONFIG
3077         else
3078           tagname=""
3079         fi
3080         ;;
3081
3082       RC)
3083         AC_LIBTOOL_LANG_RC_CONFIG
3084         ;;
3085
3086       *)
3087         AC_MSG_ERROR([Unsupported tag name: $tagname])
3088         ;;
3089       esac
3090
3091       # Append the new tag name to the list of available tags.
3092       if test -n "$tagname" ; then
3093       available_tags="$available_tags $tagname"
3094     fi
3095     fi
3096   done
3097   IFS="$lt_save_ifs"
3098
3099   # Now substitute the updated list of available tags.
3100   if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
3101     mv "${ofile}T" "$ofile"
3102     chmod +x "$ofile"
3103   else
3104     rm -f "${ofile}T"
3105     AC_MSG_ERROR([unable to update list of available tagged configurations.])
3106   fi
3107 fi
3108 ])# _LT_AC_TAGCONFIG
3109
3110
3111 # AC_LIBTOOL_DLOPEN
3112 # -----------------
3113 # enable checks for dlopen support
3114 AC_DEFUN([AC_LIBTOOL_DLOPEN],
3115  [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
3116 ])# AC_LIBTOOL_DLOPEN
3117
3118
3119 # AC_LIBTOOL_WIN32_DLL
3120 # --------------------
3121 # declare package support for building win32 dll's
3122 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
3123 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
3124 ])# AC_LIBTOOL_WIN32_DLL
3125
3126
3127 # AC_ENABLE_SHARED([DEFAULT])
3128 # ---------------------------
3129 # implement the --enable-shared flag
3130 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3131 AC_DEFUN([AC_ENABLE_SHARED],
3132 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3133 AC_ARG_ENABLE([shared],
3134     [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
3135         [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
3136     [p=${PACKAGE-default}
3137     case $enableval in
3138     yes) enable_shared=yes ;;
3139     no) enable_shared=no ;;
3140     *)
3141       enable_shared=no
3142       # Look at the argument we got.  We use all the common list separators.
3143       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3144       for pkg in $enableval; do
3145         IFS="$lt_save_ifs"
3146         if test "X$pkg" = "X$p"; then
3147           enable_shared=yes
3148         fi
3149       done
3150       IFS="$lt_save_ifs"
3151       ;;
3152     esac],
3153     [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
3154 ])# AC_ENABLE_SHARED
3155
3156
3157 # AC_DISABLE_SHARED
3158 # -----------------
3159 #- set the default shared flag to --disable-shared
3160 AC_DEFUN([AC_DISABLE_SHARED],
3161 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3162 AC_ENABLE_SHARED(no)
3163 ])# AC_DISABLE_SHARED
3164
3165
3166 # AC_ENABLE_STATIC([DEFAULT])
3167 # ---------------------------
3168 # implement the --enable-static flag
3169 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3170 AC_DEFUN([AC_ENABLE_STATIC],
3171 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3172 AC_ARG_ENABLE([static],
3173     [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
3174         [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
3175     [p=${PACKAGE-default}
3176     case $enableval in
3177     yes) enable_static=yes ;;
3178     no) enable_static=no ;;
3179     *)
3180      enable_static=no
3181       # Look at the argument we got.  We use all the common list separators.
3182       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3183       for pkg in $enableval; do
3184         IFS="$lt_save_ifs"
3185         if test "X$pkg" = "X$p"; then
3186           enable_static=yes
3187         fi
3188       done
3189       IFS="$lt_save_ifs"
3190       ;;
3191     esac],
3192     [enable_static=]AC_ENABLE_STATIC_DEFAULT)
3193 ])# AC_ENABLE_STATIC
3194
3195
3196 # AC_DISABLE_STATIC
3197 # -----------------
3198 # set the default static flag to --disable-static
3199 AC_DEFUN([AC_DISABLE_STATIC],
3200 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3201 AC_ENABLE_STATIC(no)
3202 ])# AC_DISABLE_STATIC
3203
3204
3205 # AC_ENABLE_FAST_INSTALL([DEFAULT])
3206 # ---------------------------------
3207 # implement the --enable-fast-install flag
3208 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3209 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
3210 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3211 AC_ARG_ENABLE([fast-install],
3212     [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
3213     [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
3214     [p=${PACKAGE-default}
3215     case $enableval in
3216     yes) enable_fast_install=yes ;;
3217     no) enable_fast_install=no ;;
3218     *)
3219       enable_fast_install=no
3220       # Look at the argument we got.  We use all the common list separators.
3221       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3222       for pkg in $enableval; do
3223         IFS="$lt_save_ifs"
3224         if test "X$pkg" = "X$p"; then
3225           enable_fast_install=yes
3226         fi
3227       done
3228       IFS="$lt_save_ifs"
3229       ;;
3230     esac],
3231     [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
3232 ])# AC_ENABLE_FAST_INSTALL
3233
3234
3235 # AC_DISABLE_FAST_INSTALL
3236 # -----------------------
3237 # set the default to --disable-fast-install
3238 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
3239 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3240 AC_ENABLE_FAST_INSTALL(no)
3241 ])# AC_DISABLE_FAST_INSTALL
3242
3243
3244 # AC_LIBTOOL_PICMODE([MODE])
3245 # --------------------------
3246 # implement the --with-pic flag
3247 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
3248 AC_DEFUN([AC_LIBTOOL_PICMODE],
3249 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3250 pic_mode=ifelse($#,1,$1,default)
3251 ])# AC_LIBTOOL_PICMODE
3252
3253
3254 # AC_PROG_EGREP
3255 # -------------
3256 # This is predefined starting with Autoconf 2.54, so this conditional
3257 # definition can be removed once we require Autoconf 2.54 or later.
3258 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
3259 [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
3260    [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
3261     then ac_cv_prog_egrep='grep -E'
3262     else ac_cv_prog_egrep='egrep'
3263     fi])
3264  EGREP=$ac_cv_prog_egrep
3265  AC_SUBST([EGREP])
3266 ])])
3267
3268
3269 # AC_PATH_TOOL_PREFIX
3270 # -------------------
3271 # find a file program which can recognise shared library
3272 AC_DEFUN([AC_PATH_TOOL_PREFIX],
3273 [AC_REQUIRE([AC_PROG_EGREP])dnl
3274 AC_MSG_CHECKING([for $1])
3275 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3276 [case $MAGIC_CMD in
3277 [[\\/*] |  ?:[\\/]*])
3278   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3279   ;;
3280 *)
3281   lt_save_MAGIC_CMD="$MAGIC_CMD"
3282   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3283 dnl $ac_dummy forces splitting on constant user-supplied paths.
3284 dnl POSIX.2 word splitting is done only on the output of word expansions,
3285 dnl not every word.  This closes a longstanding sh security hole.
3286   ac_dummy="ifelse([$2], , $PATH, [$2])"
3287   for ac_dir in $ac_dummy; do
3288     IFS="$lt_save_ifs"
3289     test -z "$ac_dir" && ac_dir=.
3290     if test -f $ac_dir/$1; then
3291       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3292       if test -n "$file_magic_test_file"; then
3293         case $deplibs_check_method in
3294         "file_magic "*)
3295           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3296           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3297           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3298             $EGREP "$file_magic_regex" > /dev/null; then
3299             :
3300           else
3301             cat <<EOF 1>&2
3302
3303 *** Warning: the command libtool uses to detect shared libraries,
3304 *** $file_magic_cmd, produces output that libtool cannot recognize.
3305 *** The result is that libtool may fail to recognize shared libraries
3306 *** as such.  This will affect the creation of libtool libraries that
3307 *** depend on shared libraries, but programs linked with such libtool
3308 *** libraries will work regardless of this problem.  Nevertheless, you
3309 *** may want to report the problem to your system manager and/or to
3310 *** bug-libtool@gnu.org
3311
3312 EOF
3313           fi ;;
3314         esac
3315       fi
3316       break
3317     fi
3318   done
3319   IFS="$lt_save_ifs"
3320   MAGIC_CMD="$lt_save_MAGIC_CMD"
3321   ;;
3322 esac])
3323 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3324 if test -n "$MAGIC_CMD"; then
3325   AC_MSG_RESULT($MAGIC_CMD)
3326 else
3327   AC_MSG_RESULT(no)
3328 fi
3329 ])# AC_PATH_TOOL_PREFIX
3330
3331
3332 # AC_PATH_MAGIC
3333 # -------------
3334 # find a file program which can recognise a shared library
3335 AC_DEFUN([AC_PATH_MAGIC],
3336 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3337 if test -z "$lt_cv_path_MAGIC_CMD"; then
3338   if test -n "$ac_tool_prefix"; then
3339     AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3340   else
3341     MAGIC_CMD=:
3342   fi
3343 fi
3344 ])# AC_PATH_MAGIC
3345
3346
3347 # AC_PROG_LD
3348 # ----------
3349 # find the pathname to the GNU or non-GNU linker
3350 AC_DEFUN([AC_PROG_LD],
3351 [AC_ARG_WITH([gnu-ld],
3352     [AC_HELP_STRING([--with-gnu-ld],
3353         [assume the C compiler uses GNU ld @<:@default=no@:>@])],
3354     [test "$withval" = no || with_gnu_ld=yes],
3355     [with_gnu_ld=no])
3356 AC_REQUIRE([LT_AC_PROG_SED])dnl
3357 AC_REQUIRE([AC_PROG_CC])dnl
3358 AC_REQUIRE([AC_CANONICAL_HOST])dnl
3359 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3360 ac_prog=ld
3361 if test "$GCC" = yes; then
3362   # Check if gcc -print-prog-name=ld gives a path.
3363   AC_MSG_CHECKING([for ld used by $CC])
3364   case $host in
3365   *-*-mingw*)
3366     # gcc leaves a trailing carriage return which upsets mingw
3367     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3368   *)
3369     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3370   esac
3371   case $ac_prog in
3372     # Accept absolute paths.
3373     [[\\/]]* | ?:[[\\/]]*)
3374       re_direlt='/[[^/]][[^/]]*/\.\./'
3375       # Canonicalize the pathname of ld
3376       ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
3377       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3378         ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
3379       done
3380       test -z "$LD" && LD="$ac_prog"
3381       ;;
3382   "")
3383     # If it fails, then pretend we aren't using GCC.
3384     ac_prog=ld
3385     ;;
3386   *)
3387     # If it is relative, then search for the first ld in PATH.
3388     with_gnu_ld=unknown
3389     ;;
3390   esac
3391 elif test "$with_gnu_ld" = yes; then
3392   AC_MSG_CHECKING([for GNU ld])
3393 else
3394   AC_MSG_CHECKING([for non-GNU ld])
3395 fi
3396 AC_CACHE_VAL(lt_cv_path_LD,
3397 [if test -z "$LD"; then
3398   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3399   for ac_dir in $PATH; do
3400     IFS="$lt_save_ifs"
3401     test -z "$ac_dir" && ac_dir=.
3402     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3403       lt_cv_path_LD="$ac_dir/$ac_prog"
3404       # Check to see if the program is GNU ld.  I'd rather use --version,
3405       # but apparently some GNU ld's only accept -v.
3406       # Break only if it was the GNU/non-GNU ld that we prefer.
3407       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3408       *GNU* | *'with BFD'*)
3409         test "$with_gnu_ld" != no && break
3410         ;;
3411       *)
3412         test "$with_gnu_ld" != yes && break
3413         ;;
3414       esac
3415     fi
3416   done
3417   IFS="$lt_save_ifs"
3418 else
3419   lt_cv_path_LD="$LD" # Let the user override the test with a path.
3420 fi])
3421 LD="$lt_cv_path_LD"
3422 if test -n "$LD"; then
3423   AC_MSG_RESULT($LD)
3424 else
3425   AC_MSG_RESULT(no)
3426 fi
3427 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3428 AC_PROG_LD_GNU
3429 ])# AC_PROG_LD
3430
3431
3432 # AC_PROG_LD_GNU
3433 # --------------
3434 AC_DEFUN([AC_PROG_LD_GNU],
3435 [AC_REQUIRE([AC_PROG_EGREP])dnl
3436 AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3437 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3438 case `$LD -v 2>&1 </dev/null` in
3439 *GNU* | *'with BFD'*)
3440   lt_cv_prog_gnu_ld=yes
3441   ;;
3442 *)
3443   lt_cv_prog_gnu_ld=no
3444   ;;
3445 esac])
3446 with_gnu_ld=$lt_cv_prog_gnu_ld
3447 ])# AC_PROG_LD_GNU
3448
3449
3450 # AC_PROG_LD_RELOAD_FLAG
3451 # ----------------------
3452 # find reload flag for linker
3453 #   -- PORTME Some linkers may need a different reload flag.
3454 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
3455 [AC_CACHE_CHECK([for $LD option to reload object files],
3456   lt_cv_ld_reload_flag,
3457   [lt_cv_ld_reload_flag='-r'])
3458 reload_flag=$lt_cv_ld_reload_flag
3459 case $reload_flag in
3460 "" | " "*) ;;
3461 *) reload_flag=" $reload_flag" ;;
3462 esac
3463 reload_cmds='$LD$reload_flag -o $output$reload_objs'
3464 ])# AC_PROG_LD_RELOAD_FLAG
3465
3466
3467 # AC_DEPLIBS_CHECK_METHOD
3468 # -----------------------
3469 # how to check for library dependencies
3470 #  -- PORTME fill in with the dynamic library characteristics
3471 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
3472 [AC_CACHE_CHECK([how to recognise dependent libraries],
3473 lt_cv_deplibs_check_method,
3474 [lt_cv_file_magic_cmd='$MAGIC_CMD'
3475 lt_cv_file_magic_test_file=
3476 lt_cv_deplibs_check_method='unknown'
3477 # Need to set the preceding variable on all platforms that support
3478 # interlibrary dependencies.
3479 # 'none' -- dependencies not supported.
3480 # `unknown' -- same as none, but documents that we really don't know.
3481 # 'pass_all' -- all dependencies passed with no checks.
3482 # 'test_compile' -- check by making test program.
3483 # 'file_magic [[regex]]' -- check by looking for files in library path
3484 # which responds to the $file_magic_cmd with a given extended regex.
3485 # If you have `file' or equivalent on your system and you're not sure
3486 # whether `pass_all' will *always* work, you probably want this one.
3487
3488 case $host_os in
3489 aix4* | aix5*)
3490   lt_cv_deplibs_check_method=pass_all
3491   ;;
3492
3493 beos*)
3494   lt_cv_deplibs_check_method=pass_all
3495   ;;
3496
3497 bsdi4*)
3498   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3499   lt_cv_file_magic_cmd='/usr/bin/file -L'
3500   lt_cv_file_magic_test_file=/shlib/libc.so
3501   ;;
3502
3503 cygwin*)
3504   # func_win32_libid is a shell function defined in ltmain.sh
3505   lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3506   lt_cv_file_magic_cmd='func_win32_libid'
3507   ;;
3508
3509 mingw* | pw32*)
3510   # Base MSYS/MinGW do not provide the 'file' command needed by
3511   # func_win32_libid shell function, so use a weaker test based on 'objdump'.
3512   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3513   lt_cv_file_magic_cmd='$OBJDUMP -f'
3514   ;;
3515
3516 darwin* | rhapsody*)
3517   lt_cv_deplibs_check_method=pass_all
3518   ;;
3519
3520 freebsd* | kfreebsd*-gnu)
3521   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3522     case $host_cpu in
3523     i*86 )
3524       # Not sure whether the presence of OpenBSD here was a mistake.
3525       # Let's accept both of them until this is cleared up.
3526       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
3527       lt_cv_file_magic_cmd=/usr/bin/file
3528       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3529       ;;
3530     esac
3531   else
3532     lt_cv_deplibs_check_method=pass_all
3533   fi
3534   ;;
3535
3536 gnu*)
3537   lt_cv_deplibs_check_method=pass_all
3538   ;;
3539
3540 hpux10.20* | hpux11*)
3541   lt_cv_file_magic_cmd=/usr/bin/file
3542   case "$host_cpu" in
3543   ia64*)
3544     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3545     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3546     ;;
3547   hppa*64*)
3548     [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
3549     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3550     ;;
3551   *)
3552     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3553     lt_cv_file_magic_test_file=/usr/lib/libc.sl
3554     ;;
3555   esac
3556   ;;
3557
3558 irix5* | irix6* | nonstopux*)
3559   case $LD in
3560   *-32|*"-32 ") libmagic=32-bit;;
3561   *-n32|*"-n32 ") libmagic=N32;;
3562   *-64|*"-64 ") libmagic=64-bit;;
3563   *) libmagic=never-match;;
3564   esac
3565   lt_cv_deplibs_check_method=pass_all
3566   ;;
3567
3568 # This must be Linux ELF.
3569 linux*)
3570   lt_cv_deplibs_check_method=pass_all
3571   ;;
3572
3573 netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
3574   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3575     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3576   else
3577     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3578   fi
3579   ;;
3580
3581 newos6*)
3582   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3583   lt_cv_file_magic_cmd=/usr/bin/file
3584   lt_cv_file_magic_test_file=/usr/lib/libnls.so
3585   ;;
3586
3587 nto-qnx*)
3588   lt_cv_deplibs_check_method=unknown
3589   ;;
3590
3591 openbsd*)
3592   lt_cv_file_magic_cmd=/usr/bin/file
3593   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3594   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3595     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
3596   else
3597     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
3598   fi
3599   ;;
3600
3601 osf3* | osf4* | osf5*)
3602   lt_cv_deplibs_check_method=pass_all
3603   ;;
3604
3605 sco3.2v5*)
3606   lt_cv_deplibs_check_method=pass_all
3607   ;;
3608
3609 solaris*)
3610   lt_cv_deplibs_check_method=pass_all
3611   ;;
3612
3613 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3614   case $host_vendor in
3615   motorola)
3616     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]]'
3617     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3618     ;;
3619   ncr)
3620     lt_cv_deplibs_check_method=pass_all
3621     ;;
3622   sequent)
3623     lt_cv_file_magic_cmd='/bin/file'
3624     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3625     ;;
3626   sni)
3627     lt_cv_file_magic_cmd='/bin/file'
3628     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3629     lt_cv_file_magic_test_file=/lib/libc.so
3630     ;;
3631   siemens)
3632     lt_cv_deplibs_check_method=pass_all
3633     ;;
3634   esac
3635   ;;
3636
3637 sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
3638   lt_cv_deplibs_check_method=pass_all
3639   ;;
3640 esac
3641 ])
3642 file_magic_cmd=$lt_cv_file_magic_cmd
3643 deplibs_check_method=$lt_cv_deplibs_check_method
3644 test -z "$deplibs_check_method" && deplibs_check_method=unknown
3645 ])# AC_DEPLIBS_CHECK_METHOD
3646
3647
3648 # AC_PROG_NM
3649 # ----------
3650 # find the pathname to a BSD-compatible name lister
3651 AC_DEFUN([AC_PROG_NM],
3652 [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
3653 [if test -n "$NM"; then
3654   # Let the user override the test.
3655   lt_cv_path_NM="$NM"
3656 else
3657   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3658   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3659     IFS="$lt_save_ifs"
3660     test -z "$ac_dir" && ac_dir=.
3661     tmp_nm="$ac_dir/${ac_tool_prefix}nm"
3662     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3663       # Check to see if the nm accepts a BSD-compat flag.
3664       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3665       #   nm: unknown option "B" ignored
3666       # Tru64's nm complains that /dev/null is an invalid object file
3667       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3668       */dev/null* | *'Invalid file or object type'*)
3669         lt_cv_path_NM="$tmp_nm -B"
3670         break
3671         ;;
3672       *)
3673         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3674         */dev/null*)
3675           lt_cv_path_NM="$tmp_nm -p"
3676           break
3677           ;;
3678         *)
3679           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3680           continue # so that we can try to find one that supports BSD flags
3681           ;;
3682         esac
3683       esac
3684     fi
3685   done
3686   IFS="$lt_save_ifs"
3687   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3688 fi])
3689 NM="$lt_cv_path_NM"
3690 ])# AC_PROG_NM
3691
3692
3693 # AC_CHECK_LIBM
3694 # -------------
3695 # check for math library
3696 AC_DEFUN([AC_CHECK_LIBM],
3697 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3698 LIBM=
3699 case $host in
3700 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3701   # These system don't have libm, or don't need it
3702   ;;
3703 *-ncr-sysv4.3*)
3704   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3705   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3706   ;;
3707 *)
3708   AC_CHECK_LIB(m, cos, LIBM="-lm")
3709   ;;
3710 esac
3711 ])# AC_CHECK_LIBM
3712
3713
3714 # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
3715 # -----------------------------------
3716 # sets LIBLTDL to the link flags for the libltdl convenience library and
3717 # LTDLINCL to the include flags for the libltdl header and adds
3718 # --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
3719 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
3720 # DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
3721 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
3722 # '${top_srcdir}/' (note the single quotes!).  If your package is not
3723 # flat and you're not using automake, define top_builddir and
3724 # top_srcdir appropriately in the Makefiles.
3725 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3726 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3727   case $enable_ltdl_convenience in
3728   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3729   "") enable_ltdl_convenience=yes
3730       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3731   esac
3732   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3733   LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3734   # For backwards non-gettext consistent compatibility...
3735   INCLTDL="$LTDLINCL"
3736 ])# AC_LIBLTDL_CONVENIENCE
3737
3738
3739 # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
3740 # -----------------------------------
3741 # sets LIBLTDL to the link flags for the libltdl installable library and
3742 # LTDLINCL to the include flags for the libltdl header and adds
3743 # --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
3744 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
3745 # DIRECTORY is not provided and an installed libltdl is not found, it is
3746 # assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
3747 # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
3748 # quotes!).  If your package is not flat and you're not using automake,
3749 # define top_builddir and top_srcdir appropriately in the Makefiles.
3750 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3751 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3752 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3753   AC_CHECK_LIB(ltdl, lt_dlinit,
3754   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3755   [if test x"$enable_ltdl_install" = xno; then
3756      AC_MSG_WARN([libltdl not installed, but installation disabled])
3757    else
3758      enable_ltdl_install=yes
3759    fi
3760   ])
3761   if test x"$enable_ltdl_install" = x"yes"; then
3762     ac_configure_args="$ac_configure_args --enable-ltdl-install"
3763     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3764     LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3765   else
3766     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3767     LIBLTDL="-lltdl"
3768     LTDLINCL=
3769   fi
3770   # For backwards non-gettext consistent compatibility...
3771   INCLTDL="$LTDLINCL"
3772 ])# AC_LIBLTDL_INSTALLABLE
3773
3774
3775 # AC_LIBTOOL_CXX
3776 # --------------
3777 # enable support for C++ libraries
3778 AC_DEFUN([AC_LIBTOOL_CXX],
3779 [AC_REQUIRE([_LT_AC_LANG_CXX])
3780 ])# AC_LIBTOOL_CXX
3781
3782
3783 # _LT_AC_LANG_CXX
3784 # ---------------
3785 AC_DEFUN([_LT_AC_LANG_CXX],
3786 [AC_REQUIRE([AC_PROG_CXX])
3787 AC_REQUIRE([AC_PROG_CXXCPP])
3788 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
3789 ])# _LT_AC_LANG_CXX
3790
3791
3792 # AC_LIBTOOL_F77
3793 # --------------
3794 # enable support for Fortran 77 libraries
3795 AC_DEFUN([AC_LIBTOOL_F77],
3796 [AC_REQUIRE([_LT_AC_LANG_F77])
3797 ])# AC_LIBTOOL_F77
3798
3799
3800 # _LT_AC_LANG_F77
3801 # ---------------
3802 AC_DEFUN([_LT_AC_LANG_F77],
3803 [AC_REQUIRE([AC_PROG_F77])
3804 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
3805 ])# _LT_AC_LANG_F77
3806
3807
3808 # AC_LIBTOOL_GCJ
3809 # --------------
3810 # enable support for GCJ libraries
3811 AC_DEFUN([AC_LIBTOOL_GCJ],
3812 [AC_REQUIRE([_LT_AC_LANG_GCJ])
3813 ])# AC_LIBTOOL_GCJ
3814
3815
3816 # _LT_AC_LANG_GCJ
3817 # ---------------
3818 AC_DEFUN([_LT_AC_LANG_GCJ],
3819 [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
3820   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
3821     [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
3822       [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
3823          [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
3824            [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
3825 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
3826 ])# _LT_AC_LANG_GCJ
3827
3828
3829 # AC_LIBTOOL_RC
3830 # --------------
3831 # enable support for Windows resource files
3832 AC_DEFUN([AC_LIBTOOL_RC],
3833 [AC_REQUIRE([LT_AC_PROG_RC])
3834 _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
3835 ])# AC_LIBTOOL_RC
3836
3837
3838 # AC_LIBTOOL_LANG_C_CONFIG
3839 # ------------------------
3840 # Ensure that the configuration vars for the C compiler are
3841 # suitably defined.  Those variables are subsequently used by
3842 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3843 AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
3844 AC_DEFUN([_LT_AC_LANG_C_CONFIG],
3845 [lt_save_CC="$CC"
3846 AC_LANG_PUSH(C)
3847
3848 # Source file extension for C test sources.
3849 ac_ext=c
3850
3851 # Object file extension for compiled C test sources.
3852 objext=o
3853 _LT_AC_TAGVAR(objext, $1)=$objext
3854
3855 # Code to be used in simple compile tests
3856 lt_simple_compile_test_code="int some_variable = 0;\n"
3857
3858 # Code to be used in simple link tests
3859 lt_simple_link_test_code='int main(){return(0);}\n'
3860
3861 _LT_AC_SYS_COMPILER
3862
3863 #
3864 # Check for any special shared library compilation flags.
3865 #
3866 _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
3867 if test "$GCC" = no; then
3868   case $host_os in
3869   sco3.2v5*)
3870     _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
3871     ;;
3872   esac
3873 fi
3874 if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
3875   AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
3876   if echo "$old_CC $old_CFLAGS " | grep "[[     ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[        ]]" >/dev/null; then :
3877   else
3878     AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
3879     _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
3880   fi
3881 fi
3882
3883
3884 #
3885 # Check to make sure the static flag actually works.
3886 #
3887 AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
3888   _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
3889   $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
3890   [],
3891   [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
3892
3893
3894 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
3895 AC_LIBTOOL_PROG_COMPILER_PIC($1)
3896 AC_LIBTOOL_PROG_CC_C_O($1)
3897 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3898 AC_LIBTOOL_PROG_LD_SHLIBS($1)
3899 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3900 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3901 AC_LIBTOOL_SYS_LIB_STRIP
3902 AC_LIBTOOL_DLOPEN_SELF($1)
3903
3904 # Report which librarie types wil actually be built
3905 AC_MSG_CHECKING([if libtool supports shared libraries])
3906 AC_MSG_RESULT([$can_build_shared])
3907
3908 AC_MSG_CHECKING([whether to build shared libraries])
3909 test "$can_build_shared" = "no" && enable_shared=no
3910
3911 # On AIX, shared libraries and static libraries use the same namespace, and
3912 # are all built from PIC.
3913 case "$host_os" in
3914 aix3*)
3915   test "$enable_shared" = yes && enable_static=no
3916   if test -n "$RANLIB"; then
3917     archive_cmds="$archive_cmds~\$RANLIB \$lib"
3918     postinstall_cmds='$RANLIB $lib'
3919   fi
3920   ;;
3921
3922 aix4* | aix5*)
3923   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3924     test "$enable_shared" = yes && enable_static=no
3925   fi
3926   ;;
3927   darwin* | rhapsody*)
3928   if test "$GCC" = yes; then
3929     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3930     case "$host_os" in
3931     rhapsody* | darwin1.[[012]])
3932       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
3933       ;;
3934     *) # Darwin 1.3 on
3935       if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
3936         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
3937       else
3938         case ${MACOSX_DEPLOYMENT_TARGET} in
3939           10.[[012]])
3940             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
3941             ;;
3942           10.*)
3943             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
3944             ;;
3945         esac
3946       fi
3947       ;;
3948     esac
3949     output_verbose_link_cmd='echo'
3950     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
3951     _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3952     # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
3953     _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3954     _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3955     _LT_AC_TAGVAR(hardcode_direct, $1)=no
3956     _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
3957     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3958     _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
3959     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3960   else
3961     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3962   fi
3963     ;;
3964 esac
3965 AC_MSG_RESULT([$enable_shared])
3966
3967 AC_MSG_CHECKING([whether to build static libraries])
3968 # Make sure either enable_shared or enable_static is yes.
3969 test "$enable_shared" = yes || enable_static=yes
3970 AC_MSG_RESULT([$enable_static])
3971
3972 AC_LIBTOOL_CONFIG($1)
3973
3974 AC_LANG_POP
3975 CC="$lt_save_CC"
3976 ])# AC_LIBTOOL_LANG_C_CONFIG
3977
3978
3979 # AC_LIBTOOL_LANG_CXX_CONFIG
3980 # --------------------------
3981 # Ensure that the configuration vars for the C compiler are
3982 # suitably defined.  Those variables are subsequently used by
3983 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3984 AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
3985 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
3986 [AC_LANG_PUSH(C++)
3987 AC_REQUIRE([AC_PROG_CXX])
3988 AC_REQUIRE([AC_PROG_CXXCPP])
3989
3990 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3991 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
3992 _LT_AC_TAGVAR(always_export_symbols, $1)=no
3993 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
3994 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
3995 _LT_AC_TAGVAR(hardcode_direct, $1)=no
3996 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
3997 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
3998 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3999 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
4000 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
4001 _LT_AC_TAGVAR(module_cmds, $1)=
4002 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
4003 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
4004 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4005 _LT_AC_TAGVAR(no_undefined_flag, $1)=
4006 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4007 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4008
4009 # Dependencies to place before and after the object being linked:
4010 _LT_AC_TAGVAR(predep_objects, $1)=
4011 _LT_AC_TAGVAR(postdep_objects, $1)=
4012 _LT_AC_TAGVAR(predeps, $1)=
4013 _LT_AC_TAGVAR(postdeps, $1)=
4014 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
4015
4016 # Source file extension for C++ test sources.
4017 ac_ext=cc
4018
4019 # Object file extension for compiled C++ test sources.
4020 objext=o
4021 _LT_AC_TAGVAR(objext, $1)=$objext
4022
4023 # Code to be used in simple compile tests
4024 lt_simple_compile_test_code="int some_variable = 0;\n"
4025
4026 # Code to be used in simple link tests
4027 lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
4028
4029 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
4030 _LT_AC_SYS_COMPILER
4031
4032 # Allow CC to be a program name with arguments.
4033 lt_save_CC=$CC
4034 lt_save_LD=$LD
4035 lt_save_GCC=$GCC
4036 GCC=$GXX
4037 lt_save_with_gnu_ld=$with_gnu_ld
4038 lt_save_path_LD=$lt_cv_path_LD
4039 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
4040   lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
4041 else
4042   unset lt_cv_prog_gnu_ld
4043 fi
4044 if test -n "${lt_cv_path_LDCXX+set}"; then
4045   lt_cv_path_LD=$lt_cv_path_LDCXX
4046 else
4047   unset lt_cv_path_LD
4048 fi
4049 test -z "${LDCXX+set}" || LD=$LDCXX
4050 CC=${CXX-"c++"}
4051 compiler=$CC
4052 _LT_AC_TAGVAR(compiler, $1)=$CC
4053 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
4054
4055 # We don't want -fno-exception wen compiling C++ code, so set the
4056 # no_builtin_flag separately
4057 if test "$GXX" = yes; then
4058   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
4059 else
4060   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4061 fi
4062
4063 if test "$GXX" = yes; then
4064   # Set up default GNU C++ configuration
4065
4066   AC_PROG_LD
4067
4068   # Check if GNU C++ uses GNU ld as the underlying linker, since the
4069   # archiving commands below assume that GNU ld is being used.
4070   if test "$with_gnu_ld" = yes; then
4071     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
4072     _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4073
4074     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
4075     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4076
4077     # If archive_cmds runs LD, not CC, wlarc should be empty
4078     # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
4079     #     investigate it a little bit more. (MM)
4080     wlarc='${wl}'
4081
4082     # ancient GNU ld didn't support --whole-archive et. al.
4083     if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
4084         grep 'no-whole-archive' > /dev/null; then
4085       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4086     else
4087       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4088     fi
4089   else
4090     with_gnu_ld=no
4091     wlarc=
4092
4093     # A generic and very simple default shared library creation
4094     # command for GNU C++ for the case where it uses the native
4095     # linker, instead of GNU ld.  If possible, this setting should
4096     # overridden to take advantage of the native linker features on
4097     # the platform it is being used on.
4098     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
4099   fi
4100
4101   # Commands to make compiler produce verbose output that lists
4102   # what "hidden" libraries, object files and flags are used when
4103   # linking a shared library.
4104   output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
4105
4106 else
4107   GXX=no
4108   with_gnu_ld=no
4109   wlarc=
4110 fi
4111
4112 # PORTME: fill in a description of your system's C++ link characteristics
4113 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4114 _LT_AC_TAGVAR(ld_shlibs, $1)=yes
4115 case $host_os in
4116   aix3*)
4117     # FIXME: insert proper C++ library support
4118     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4119     ;;
4120   aix4* | aix5*)
4121     if test "$host_cpu" = ia64; then
4122       # On IA64, the linker does run time linking by default, so we don't
4123       # have to do anything special.
4124       aix_use_runtimelinking=no
4125       exp_sym_flag='-Bexport'
4126       no_entry_flag=""
4127     else
4128       aix_use_runtimelinking=no
4129
4130       # Test if we are trying to use run time linking or normal
4131       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
4132       # need to do runtime linking.
4133       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
4134         for ld_flag in $LDFLAGS; do
4135           case $ld_flag in
4136           *-brtl*)
4137             aix_use_runtimelinking=yes
4138             break
4139             ;;
4140           esac
4141         done
4142       esac
4143
4144       exp_sym_flag='-bexport'
4145       no_entry_flag='-bnoentry'
4146     fi
4147
4148     # When large executables or shared objects are built, AIX ld can
4149     # have problems creating the table of contents.  If linking a library
4150     # or program results in "error TOC overflow" add -mminimal-toc to
4151     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4152     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4153
4154     _LT_AC_TAGVAR(archive_cmds, $1)=''
4155     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4156     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
4157     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4158
4159     if test "$GXX" = yes; then
4160       case $host_os in aix4.[012]|aix4.[012].*)
4161       # We only want to do this on AIX 4.2 and lower, the check
4162       # below for broken collect2 doesn't work under 4.3+
4163         collect2name=`${CC} -print-prog-name=collect2`
4164         if test -f "$collect2name" && \
4165            strings "$collect2name" | grep resolve_lib_name >/dev/null
4166         then
4167           # We have reworked collect2
4168           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4169         else
4170           # We have old collect2
4171           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
4172           # It fails to find uninstalled libraries when the uninstalled
4173           # path is not listed in the libpath.  Setting hardcode_minus_L
4174           # to unsupported forces relinking
4175           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
4176           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4177           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4178         fi
4179       esac
4180       shared_flag='-shared'
4181     else
4182       # not using gcc
4183       if test "$host_cpu" = ia64; then
4184         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4185         # chokes on -Wl,-G. The following line is correct:
4186         shared_flag='-G'
4187       else
4188         if test "$aix_use_runtimelinking" = yes; then
4189           shared_flag='${wl}-G'
4190         else
4191           shared_flag='${wl}-bM:SRE'
4192         fi
4193       fi
4194     fi
4195
4196     # It seems that -bexpall does not export symbols beginning with
4197     # underscore (_), so it is better to generate a list of symbols to export.
4198     _LT_AC_TAGVAR(always_export_symbols, $1)=yes
4199     if test "$aix_use_runtimelinking" = yes; then
4200       # Warning - without using the other runtime loading flags (-brtl),
4201       # -berok will link without error, but may produce a broken library.
4202       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
4203       # Determine the default libpath from the value encoded in an empty executable.
4204       _LT_AC_SYS_LIBPATH_AIX
4205       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4206
4207       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
4208      else
4209       if test "$host_cpu" = ia64; then
4210         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4211         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4212         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
4213       else
4214         # Determine the default libpath from the value encoded in an empty executable.
4215         _LT_AC_SYS_LIBPATH_AIX
4216         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4217         # Warning - without using the other run time loading flags,
4218         # -berok will link without error, but may produce a broken library.
4219         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4220         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4221         # -bexpall does not export symbols beginning with underscore (_)
4222         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
4223         # Exported symbols can be pulled into shared objects from archives
4224         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
4225         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
4226         # This is similar to how AIX traditionally builds it's shared libraries.
4227         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
4228       fi
4229     fi
4230     ;;
4231   chorus*)
4232     case $cc_basename in
4233       *)
4234         # FIXME: insert proper C++ library support
4235         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4236         ;;
4237     esac
4238     ;;
4239
4240   cygwin* | mingw* | pw32*)
4241     # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4242     # as there is no search path for DLLs.
4243     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4244     _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
4245     _LT_AC_TAGVAR(always_export_symbols, $1)=no
4246     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4247
4248     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
4249       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
4250       # If the export-symbols file already is a .def file (1st line
4251       # is EXPORTS), use it as is; otherwise, prepend...
4252       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4253         cp $export_symbols $output_objdir/$soname.def;
4254       else
4255         echo EXPORTS > $output_objdir/$soname.def;
4256         cat $export_symbols >> $output_objdir/$soname.def;
4257       fi~
4258       $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
4259     else
4260       _LT_AC_TAGVAR(ld_shlibs, $1)=no
4261     fi
4262   ;;
4263
4264   darwin* | rhapsody*)
4265   if test "$GXX" = yes; then
4266     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4267     case "$host_os" in
4268     rhapsody* | darwin1.[[012]])
4269       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
4270       ;;
4271     *) # Darwin 1.3 on
4272       if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
4273         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
4274       else
4275         case ${MACOSX_DEPLOYMENT_TARGET} in
4276           10.[[012]])
4277             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
4278             ;;
4279           10.*)
4280             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
4281             ;;
4282         esac
4283       fi
4284       ;;
4285     esac
4286     lt_int_apple_cc_single_mod=no
4287     output_verbose_link_cmd='echo'
4288     if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
4289       lt_int_apple_cc_single_mod=yes
4290     fi
4291     if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
4292       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
4293     else
4294       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
4295     fi
4296     _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
4297
4298     # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
4299     if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
4300       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4301     else
4302       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4303     fi
4304     _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4305     _LT_AC_TAGVAR(hardcode_direct, $1)=no
4306     _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
4307     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4308     _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
4309     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4310   else
4311     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4312   fi
4313     ;;
4314
4315   dgux*)
4316     case $cc_basename in
4317       ec++)
4318         # FIXME: insert proper C++ library support
4319         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4320         ;;
4321       ghcx)
4322         # Green Hills C++ Compiler
4323         # FIXME: insert proper C++ library support
4324         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4325         ;;
4326       *)
4327         # FIXME: insert proper C++ library support
4328         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4329         ;;
4330     esac
4331     ;;
4332   freebsd[12]*)
4333     # C++ shared libraries reported to be fairly broken before switch to ELF
4334     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4335     ;;
4336   freebsd-elf*)
4337     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4338     ;;
4339   freebsd* | kfreebsd*-gnu)
4340     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
4341     # conventions
4342     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
4343     ;;
4344   gnu*)
4345     ;;
4346   hpux9*)
4347     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4348     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4349     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4350     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4351     _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
4352                                 # but as the default
4353                                 # location of the library.
4354
4355     case $cc_basename in
4356     CC)
4357       # FIXME: insert proper C++ library support
4358       _LT_AC_TAGVAR(ld_shlibs, $1)=no
4359       ;;
4360     aCC)
4361       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4362       # Commands to make compiler produce verbose output that lists
4363       # what "hidden" libraries, object files and flags are used when
4364       # linking a shared library.
4365       #
4366       # There doesn't appear to be a way to prevent this compiler from
4367       # explicitly linking system object files so we need to strip them
4368       # from the output so that they don't get included in the library
4369       # dependencies.
4370       output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4371       ;;
4372     *)
4373       if test "$GXX" = yes; then
4374         _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4375       else
4376         # FIXME: insert proper C++ library support
4377         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4378       fi
4379       ;;
4380     esac
4381     ;;
4382   hpux10*|hpux11*)
4383     if test $with_gnu_ld = no; then
4384       case "$host_cpu" in
4385       hppa*64*)
4386         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4387         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4388         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4389         ;;
4390       ia64*)
4391         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4392         ;;
4393       *)
4394         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4395         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4396         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4397         ;;
4398       esac
4399     fi
4400     case "$host_cpu" in
4401     hppa*64*)
4402       _LT_AC_TAGVAR(hardcode_direct, $1)=no
4403       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4404       ;;
4405     ia64*)
4406       _LT_AC_TAGVAR(hardcode_direct, $1)=no
4407       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4408       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
4409                                               # but as the default
4410                                               # location of the library.
4411       ;;
4412     *)
4413       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4414       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
4415                                               # but as the default
4416                                               # location of the library.
4417       ;;
4418     esac
4419
4420     case $cc_basename in
4421       CC)
4422         # FIXME: insert proper C++ library support
4423         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4424         ;;
4425       aCC)
4426         case "$host_cpu" in
4427         hppa*64*|ia64*)
4428           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
4429           ;;
4430         *)
4431           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4432           ;;
4433         esac
4434         # Commands to make compiler produce verbose output that lists
4435         # what "hidden" libraries, object files and flags are used when
4436         # linking a shared library.
4437         #
4438         # There doesn't appear to be a way to prevent this compiler from
4439         # explicitly linking system object files so we need to strip them
4440         # from the output so that they don't get included in the library
4441         # dependencies.
4442         output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4443         ;;
4444       *)
4445         if test "$GXX" = yes; then
4446           if test $with_gnu_ld = no; then
4447             case "$host_cpu" in
4448             ia64*|hppa*64*)
4449               _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
4450               ;;
4451             *)
4452               _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4453               ;;
4454             esac
4455           fi
4456         else
4457           # FIXME: insert proper C++ library support
4458           _LT_AC_TAGVAR(ld_shlibs, $1)=no
4459         fi
4460         ;;
4461     esac
4462     ;;
4463   irix5* | irix6*)
4464     case $cc_basename in
4465       CC)
4466         # SGI C++
4467         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
4468
4469         # Archives containing C++ object files must be created using
4470         # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
4471         # necessary to make sure instantiated templates are included
4472         # in the archive.
4473         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
4474         ;;
4475       *)
4476         if test "$GXX" = yes; then
4477           if test "$with_gnu_ld" = no; then
4478             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
4479           else
4480             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
4481           fi
4482         fi
4483         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4484         ;;
4485     esac
4486     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4487     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4488     ;;
4489   linux*)
4490     case $cc_basename in
4491       KCC)
4492         # Kuck and Associates, Inc. (KAI) C++ Compiler
4493
4494         # KCC will only create a shared library if the output file
4495         # ends with ".so" (or ".sl" for HP-UX), so rename the library
4496         # to its proper name (with version) after linking.
4497         _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
4498         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
4499         # Commands to make compiler produce verbose output that lists
4500         # what "hidden" libraries, object files and flags are used when
4501         # linking a shared library.
4502         #
4503         # There doesn't appear to be a way to prevent this compiler from
4504         # explicitly linking system object files so we need to strip them
4505         # from the output so that they don't get included in the library
4506         # dependencies.
4507         output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4508
4509         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
4510         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4511
4512         # Archives containing C++ object files must be created using
4513         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
4514         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
4515         ;;
4516       icpc)
4517         # Intel C++
4518         with_gnu_ld=yes
4519         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4520         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
4521         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4522         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4523         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4524         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
4525         ;;
4526       cxx)
4527         # Compaq C++
4528         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
4529         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
4530
4531         runpath_var=LD_RUN_PATH
4532         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4533         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4534
4535         # Commands to make compiler produce verbose output that lists
4536         # what "hidden" libraries, object files and flags are used when
4537         # linking a shared library.
4538         #
4539         # There doesn't appear to be a way to prevent this compiler from
4540         # explicitly linking system object files so we need to strip them
4541         # from the output so that they don't get included in the library
4542         # dependencies.
4543         output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4544         ;;
4545     esac
4546     ;;
4547   lynxos*)
4548     # FIXME: insert proper C++ library support
4549     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4550     ;;
4551   m88k*)
4552     # FIXME: insert proper C++ library support
4553     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4554     ;;
4555   mvs*)
4556     case $cc_basename in
4557       cxx)
4558         # FIXME: insert proper C++ library support
4559         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4560         ;;
4561       *)
4562         # FIXME: insert proper C++ library support
4563         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4564         ;;
4565     esac
4566     ;;
4567   netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
4568     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
4569       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
4570       wlarc=
4571       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4572       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4573       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4574     fi
4575     # Workaround some broken pre-1.5 toolchains
4576     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
4577     ;;
4578   osf3*)
4579     case $cc_basename in
4580       KCC)
4581         # Kuck and Associates, Inc. (KAI) C++ Compiler
4582
4583         # KCC will only create a shared library if the output file
4584         # ends with ".so" (or ".sl" for HP-UX), so rename the library
4585         # to its proper name (with version) after linking.
4586         _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
4587
4588         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4589         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4590
4591         # Archives containing C++ object files must be created using
4592         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
4593         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
4594
4595         ;;
4596       RCC)
4597         # Rational C++ 2.4.1
4598         # FIXME: insert proper C++ library support
4599         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4600         ;;
4601       cxx)
4602         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4603         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
4604
4605         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4606         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4607
4608         # Commands to make compiler produce verbose output that lists
4609         # what "hidden" libraries, object files and flags are used when
4610         # linking a shared library.
4611         #
4612         # There doesn't appear to be a way to prevent this compiler from
4613         # explicitly linking system object files so we need to strip them
4614         # from the output so that they don't get included in the library
4615         # dependencies.
4616         output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4617         ;;
4618       *)
4619         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
4620           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4621           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
4622
4623           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4624           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4625
4626           # Commands to make compiler produce verbose output that lists
4627           # what "hidden" libraries, object files and flags are used when
4628           # linking a shared library.
4629           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
4630
4631         else
4632           # FIXME: insert proper C++ library support
4633           _LT_AC_TAGVAR(ld_shlibs, $1)=no
4634         fi
4635         ;;
4636     esac
4637     ;;
4638   osf4* | osf5*)
4639     case $cc_basename in
4640       KCC)
4641         # Kuck and Associates, Inc. (KAI) C++ Compiler
4642
4643         # KCC will only create a shared library if the output file
4644         # ends with ".so" (or ".sl" for HP-UX), so rename the library
4645         # to its proper name (with version) after linking.
4646         _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
4647
4648         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4649         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4650
4651         # Archives containing C++ object files must be created using
4652         # the KAI C++ compiler.
4653         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
4654         ;;
4655       RCC)
4656         # Rational C++ 2.4.1
4657         # FIXME: insert proper C++ library support
4658         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4659         ;;
4660       cxx)
4661         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4662         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
4663         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
4664           echo "-hidden">> $lib.exp~
4665           $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
4666           $rm $lib.exp'
4667
4668         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4669         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4670
4671         # Commands to make compiler produce verbose output that lists
4672         # what "hidden" libraries, object files and flags are used when
4673         # linking a shared library.
4674         #
4675         # There doesn't appear to be a way to prevent this compiler from
4676         # explicitly linking system object files so we need to strip them
4677         # from the output so that they don't get included in the library
4678         # dependencies.
4679         output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4680         ;;
4681       *)
4682         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
4683           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4684          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
4685
4686           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4687           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4688
4689           # Commands to make compiler produce verbose output that lists
4690           # what "hidden" libraries, object files and flags are used when
4691           # linking a shared library.
4692           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
4693
4694         else
4695           # FIXME: insert proper C++ library support
4696           _LT_AC_TAGVAR(ld_shlibs, $1)=no
4697         fi
4698         ;;
4699     esac
4700     ;;
4701   psos*)
4702     # FIXME: insert proper C++ library support
4703     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4704     ;;
4705   sco*)
4706     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4707     case $cc_basename in
4708       CC)
4709         # FIXME: insert proper C++ library support
4710         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4711         ;;
4712       *)
4713         # FIXME: insert proper C++ library support
4714         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4715         ;;
4716     esac
4717     ;;
4718   sunos4*)
4719     case $cc_basename in
4720       CC)
4721         # Sun C++ 4.x
4722         # FIXME: insert proper C++ library support
4723         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4724         ;;
4725       lcc)
4726         # Lucid
4727         # FIXME: insert proper C++ library support
4728         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4729         ;;
4730       *)
4731         # FIXME: insert proper C++ library support
4732         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4733         ;;
4734     esac
4735     ;;
4736   solaris*)
4737     case $cc_basename in
4738       CC)
4739         # Sun C++ 4.2, 5.x and Centerline C++
4740         _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
4741         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4742         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
4743         $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
4744
4745         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4746         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4747         case $host_os in
4748           solaris2.[0-5] | solaris2.[0-5].*) ;;
4749           *)
4750             # The C++ compiler is used as linker so we must use $wl
4751             # flag to pass the commands to the underlying system
4752             # linker.
4753             # Supported since Solaris 2.6 (maybe 2.5.1?)
4754             _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4755             ;;
4756         esac
4757         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4758
4759         # Commands to make compiler produce verbose output that lists
4760         # what "hidden" libraries, object files and flags are used when
4761         # linking a shared library.
4762         #
4763         # There doesn't appear to be a way to prevent this compiler from
4764         # explicitly linking system object files so we need to strip them
4765         # from the output so that they don't get included in the library
4766         # dependencies.
4767         output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4768
4769         # Archives containing C++ object files must be created using
4770         # "CC -xar", where "CC" is the Sun C++ compiler.  This is
4771         # necessary to make sure instantiated templates are included
4772         # in the archive.
4773         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
4774         ;;
4775       gcx)
4776         # Green Hills C++ Compiler
4777         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
4778
4779         # The C++ compiler must be used to create the archive.
4780         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
4781         ;;
4782       *)
4783         # GNU C++ compiler with Solaris linker
4784         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
4785           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
4786           if $CC --version | grep -v '^2\.7' > /dev/null; then
4787             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
4788             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
4789                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
4790
4791             # Commands to make compiler produce verbose output that lists
4792             # what "hidden" libraries, object files and flags are used when
4793             # linking a shared library.
4794             output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
4795           else
4796             # g++ 2.7 appears to require `-G' NOT `-shared' on this
4797             # platform.
4798             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
4799             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
4800                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
4801
4802             # Commands to make compiler produce verbose output that lists
4803             # what "hidden" libraries, object files and flags are used when
4804             # linking a shared library.
4805             output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
4806           fi
4807
4808           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
4809         fi
4810         ;;
4811     esac
4812     ;;
4813   sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
4814     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4815     ;;
4816   tandem*)
4817     case $cc_basename in
4818       NCC)
4819         # NonStop-UX NCC 3.20
4820         # FIXME: insert proper C++ library support
4821         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4822         ;;
4823       *)
4824         # FIXME: insert proper C++ library support
4825         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4826         ;;
4827     esac
4828     ;;
4829   vxworks*)
4830     # FIXME: insert proper C++ library support
4831     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4832     ;;
4833   *)
4834     # FIXME: insert proper C++ library support
4835     _LT_AC_TAGVAR(ld_shlibs, $1)=no
4836     ;;
4837 esac
4838 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
4839 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
4840
4841 _LT_AC_TAGVAR(GCC, $1)="$GXX"
4842 _LT_AC_TAGVAR(LD, $1)="$LD"
4843
4844 AC_LIBTOOL_POSTDEP_PREDEP($1)
4845 AC_LIBTOOL_PROG_COMPILER_PIC($1)
4846 AC_LIBTOOL_PROG_CC_C_O($1)
4847 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4848 AC_LIBTOOL_PROG_LD_SHLIBS($1)
4849 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4850 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4851 AC_LIBTOOL_SYS_LIB_STRIP
4852 AC_LIBTOOL_DLOPEN_SELF($1)
4853
4854 AC_LIBTOOL_CONFIG($1)
4855
4856 AC_LANG_POP
4857 CC=$lt_save_CC
4858 LDCXX=$LD
4859 LD=$lt_save_LD
4860 GCC=$lt_save_GCC
4861 with_gnu_ldcxx=$with_gnu_ld
4862 with_gnu_ld=$lt_save_with_gnu_ld
4863 lt_cv_path_LDCXX=$lt_cv_path_LD
4864 lt_cv_path_LD=$lt_save_path_LD
4865 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
4866 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
4867 ])# AC_LIBTOOL_LANG_CXX_CONFIG
4868
4869 # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
4870 # ------------------------
4871 # Figure out "hidden" library dependencies from verbose
4872 # compiler output when linking a shared library.
4873 # Parse the compiler output and extract the necessary
4874 # objects, libraries and library flags.
4875 AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
4876 dnl we can't use the lt_simple_compile_test_code here,
4877 dnl because it contains code intended for an executable,
4878 dnl not a library.  It's possible we should let each
4879 dnl tag define a new lt_????_link_test_code variable,
4880 dnl but it's only used here...
4881 ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
4882 int a;
4883 void foo (void) { a = 0; }
4884 EOF
4885 ],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
4886 class Foo
4887 {
4888 public:
4889   Foo (void) { a = 0; }
4890 private:
4891   int a;
4892 };
4893 EOF
4894 ],[$1],[F77],[cat > conftest.$ac_ext <<EOF
4895       subroutine foo
4896       implicit none
4897       integer*4 a
4898       a=0
4899       return
4900       end
4901 EOF
4902 ],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
4903 public class foo {
4904   private int a;
4905   public void bar (void) {
4906     a = 0;
4907   }
4908 };
4909 EOF
4910 ])
4911 dnl Parse the compiler output and extract the necessary
4912 dnl objects, libraries and library flags.
4913 if AC_TRY_EVAL(ac_compile); then
4914   # Parse the compiler output and extract the necessary
4915   # objects, libraries and library flags.
4916
4917   # Sentinel used to keep track of whether or not we are before
4918   # the conftest object file.
4919   pre_test_object_deps_done=no
4920
4921   # The `*' in the case matches for architectures that use `case' in
4922   # $output_verbose_cmd can trigger glob expansion during the loop
4923   # eval without this substitution.
4924   output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
4925
4926   for p in `eval $output_verbose_link_cmd`; do
4927     case $p in
4928
4929     -L* | -R* | -l*)
4930        # Some compilers place space between "-{L,R}" and the path.
4931        # Remove the space.
4932        if test $p = "-L" \
4933           || test $p = "-R"; then
4934          prev=$p
4935          continue
4936        else
4937          prev=
4938        fi
4939
4940        if test "$pre_test_object_deps_done" = no; then
4941          case $p in
4942          -L* | -R*)
4943            # Internal compiler library paths should come after those
4944            # provided the user.  The postdeps already come after the
4945            # user supplied libs so there is no need to process them.
4946            if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
4947              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
4948            else
4949              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
4950            fi
4951            ;;
4952          # The "-l" case would never come before the object being
4953          # linked, so don't bother handling this case.
4954          esac
4955        else
4956          if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
4957            _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
4958          else
4959            _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
4960          fi
4961        fi
4962        ;;
4963
4964     *.$objext)
4965        # This assumes that the test object file only shows up
4966        # once in the compiler output.
4967        if test "$p" = "conftest.$objext"; then
4968          pre_test_object_deps_done=yes
4969          continue
4970        fi
4971
4972        if test "$pre_test_object_deps_done" = no; then
4973          if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
4974            _LT_AC_TAGVAR(predep_objects, $1)="$p"
4975          else
4976            _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
4977          fi
4978        else
4979          if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
4980            _LT_AC_TAGVAR(postdep_objects, $1)="$p"
4981          else
4982            _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
4983          fi
4984        fi
4985        ;;
4986
4987     *) ;; # Ignore the rest.
4988
4989     esac
4990   done
4991
4992   # Clean up.
4993   rm -f a.out a.exe
4994 else
4995   echo "libtool.m4: error: problem compiling $1 test program"
4996 fi
4997
4998 $rm -f confest.$objext
4999
5000 case " $_LT_AC_TAGVAR(postdeps, $1) " in
5001 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
5002 esac
5003 ])# AC_LIBTOOL_POSTDEP_PREDEP
5004
5005 # AC_LIBTOOL_LANG_F77_CONFIG
5006 # ------------------------
5007 # Ensure that the configuration vars for the C compiler are
5008 # suitably defined.  Those variables are subsequently used by
5009 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5010 AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
5011 AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
5012 [AC_REQUIRE([AC_PROG_F77])
5013 AC_LANG_PUSH(Fortran 77)
5014
5015 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5016 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5017 _LT_AC_TAGVAR(always_export_symbols, $1)=no
5018 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5019 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5020 _LT_AC_TAGVAR(hardcode_direct, $1)=no
5021 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5022 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5023 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5024 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5025 _LT_AC_TAGVAR(hardcode_automatic, $1)=no
5026 _LT_AC_TAGVAR(module_cmds, $1)=
5027 _LT_AC_TAGVAR(module_expsym_cmds, $1)=
5028 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5029 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5030 _LT_AC_TAGVAR(no_undefined_flag, $1)=
5031 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5032 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5033
5034 # Source file extension for f77 test sources.
5035 ac_ext=f
5036
5037 # Object file extension for compiled f77 test sources.
5038 objext=o
5039 _LT_AC_TAGVAR(objext, $1)=$objext
5040
5041 # Code to be used in simple compile tests
5042 lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
5043
5044 # Code to be used in simple link tests
5045 lt_simple_link_test_code="      program t\n      end\n"
5046
5047 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5048 _LT_AC_SYS_COMPILER
5049
5050 # Allow CC to be a program name with arguments.
5051 lt_save_CC="$CC"
5052 CC=${F77-"f77"}
5053 compiler=$CC
5054 _LT_AC_TAGVAR(compiler, $1)=$CC
5055 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
5056
5057 AC_MSG_CHECKING([if libtool supports shared libraries])
5058 AC_MSG_RESULT([$can_build_shared])
5059
5060 AC_MSG_CHECKING([whether to build shared libraries])
5061 test "$can_build_shared" = "no" && enable_shared=no
5062
5063 # On AIX, shared libraries and static libraries use the same namespace, and
5064 # are all built from PIC.
5065 case "$host_os" in
5066 aix3*)
5067   test "$enable_shared" = yes && enable_static=no
5068   if test -n "$RANLIB"; then
5069     archive_cmds="$archive_cmds~\$RANLIB \$lib"
5070     postinstall_cmds='$RANLIB $lib'
5071   fi
5072   ;;
5073 aix4* | aix5*)
5074   test "$enable_shared" = yes && enable_static=no
5075   ;;
5076 esac
5077 AC_MSG_RESULT([$enable_shared])
5078
5079 AC_MSG_CHECKING([whether to build static libraries])
5080 # Make sure either enable_shared or enable_static is yes.
5081 test "$enable_shared" = yes || enable_static=yes
5082 AC_MSG_RESULT([$enable_static])
5083
5084 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5085
5086 _LT_AC_TAGVAR(GCC, $1)="$G77"
5087 _LT_AC_TAGVAR(LD, $1)="$LD"
5088
5089 AC_LIBTOOL_PROG_COMPILER_PIC($1)
5090 AC_LIBTOOL_PROG_CC_C_O($1)
5091 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
5092 AC_LIBTOOL_PROG_LD_SHLIBS($1)
5093 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
5094 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
5095 AC_LIBTOOL_SYS_LIB_STRIP
5096
5097
5098 AC_LIBTOOL_CONFIG($1)
5099
5100 AC_LANG_POP
5101 CC="$lt_save_CC"
5102 ])# AC_LIBTOOL_LANG_F77_CONFIG
5103
5104
5105 # AC_LIBTOOL_LANG_GCJ_CONFIG
5106 # --------------------------
5107 # Ensure that the configuration vars for the C compiler are
5108 # suitably defined.  Those variables are subsequently used by
5109 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5110 AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
5111 AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
5112 [AC_LANG_SAVE
5113
5114 # Source file extension for Java test sources.
5115 ac_ext=java
5116
5117 # Object file extension for compiled Java test sources.
5118 objext=o
5119 _LT_AC_TAGVAR(objext, $1)=$objext
5120
5121 # Code to be used in simple compile tests
5122 lt_simple_compile_test_code="class foo {}\n"
5123
5124 # Code to be used in simple link tests
5125 lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
5126
5127 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5128 _LT_AC_SYS_COMPILER
5129
5130 # Allow CC to be a program name with arguments.
5131 lt_save_CC="$CC"
5132 CC=${GCJ-"gcj"}
5133 compiler=$CC
5134 _LT_AC_TAGVAR(compiler, $1)=$CC
5135
5136 # GCJ did not exist at the time GCC didn't implicitly link libc in.
5137 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5138
5139 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
5140 AC_LIBTOOL_PROG_COMPILER_PIC($1)
5141 AC_LIBTOOL_PROG_CC_C_O($1)
5142 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
5143 AC_LIBTOOL_PROG_LD_SHLIBS($1)
5144 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
5145 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
5146 AC_LIBTOOL_SYS_LIB_STRIP
5147 AC_LIBTOOL_DLOPEN_SELF($1)
5148
5149 AC_LIBTOOL_CONFIG($1)
5150
5151 AC_LANG_RESTORE
5152 CC="$lt_save_CC"
5153 ])# AC_LIBTOOL_LANG_GCJ_CONFIG
5154
5155
5156 # AC_LIBTOOL_LANG_RC_CONFIG
5157 # --------------------------
5158 # Ensure that the configuration vars for the Windows resource compiler are
5159 # suitably defined.  Those variables are subsequently used by
5160 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5161 AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
5162 AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
5163 [AC_LANG_SAVE
5164
5165 # Source file extension for RC test sources.
5166 ac_ext=rc
5167
5168 # Object file extension for compiled RC test sources.
5169 objext=o
5170 _LT_AC_TAGVAR(objext, $1)=$objext
5171
5172 # Code to be used in simple compile tests
5173 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
5174
5175 # Code to be used in simple link tests
5176 lt_simple_link_test_code="$lt_simple_compile_test_code"
5177
5178 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5179 _LT_AC_SYS_COMPILER
5180
5181 # Allow CC to be a program name with arguments.
5182 lt_save_CC="$CC"
5183 CC=${RC-"windres"}
5184 compiler=$CC
5185 _LT_AC_TAGVAR(compiler, $1)=$CC
5186 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
5187
5188 AC_LIBTOOL_CONFIG($1)
5189
5190 AC_LANG_RESTORE
5191 CC="$lt_save_CC"
5192 ])# AC_LIBTOOL_LANG_RC_CONFIG
5193
5194
5195 # AC_LIBTOOL_CONFIG([TAGNAME])
5196 # ----------------------------
5197 # If TAGNAME is not passed, then create an initial libtool script
5198 # with a default configuration from the untagged config vars.  Otherwise
5199 # add code to config.status for appending the configuration named by
5200 # TAGNAME from the matching tagged config vars.
5201 AC_DEFUN([AC_LIBTOOL_CONFIG],
5202 [# The else clause should only fire when bootstrapping the
5203 # libtool distribution, otherwise you forgot to ship ltmain.sh
5204 # with your package, and you will get complaints that there are
5205 # no rules to generate ltmain.sh.
5206 if test -f "$ltmain"; then
5207   # See if we are running on zsh, and set the options which allow our commands through
5208   # without removal of \ escapes.
5209   if test -n "${ZSH_VERSION+set}" ; then
5210     setopt NO_GLOB_SUBST
5211   fi
5212   # Now quote all the things that may contain metacharacters while being
5213   # careful not to overquote the AC_SUBSTed values.  We take copies of the
5214   # variables and quote the copies for generation of the libtool script.
5215   for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
5216     SED SHELL STRIP \
5217     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
5218     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
5219     deplibs_check_method reload_flag reload_cmds need_locks \
5220     lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
5221     lt_cv_sys_global_symbol_to_c_name_address \
5222     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
5223     old_postinstall_cmds old_postuninstall_cmds \
5224     _LT_AC_TAGVAR(compiler, $1) \
5225     _LT_AC_TAGVAR(CC, $1) \
5226     _LT_AC_TAGVAR(LD, $1) \
5227     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
5228     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
5229     _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
5230     _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
5231     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
5232     _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
5233     _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
5234     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
5235     _LT_AC_TAGVAR(old_archive_cmds, $1) \
5236     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
5237     _LT_AC_TAGVAR(predep_objects, $1) \
5238     _LT_AC_TAGVAR(postdep_objects, $1) \
5239     _LT_AC_TAGVAR(predeps, $1) \
5240     _LT_AC_TAGVAR(postdeps, $1) \
5241     _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
5242     _LT_AC_TAGVAR(archive_cmds, $1) \
5243     _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
5244     _LT_AC_TAGVAR(postinstall_cmds, $1) \
5245     _LT_AC_TAGVAR(postuninstall_cmds, $1) \
5246     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
5247     _LT_AC_TAGVAR(allow_undefined_flag, $1) \
5248     _LT_AC_TAGVAR(no_undefined_flag, $1) \
5249     _LT_AC_TAGVAR(export_symbols_cmds, $1) \
5250     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
5251     _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
5252     _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
5253     _LT_AC_TAGVAR(hardcode_automatic, $1) \
5254     _LT_AC_TAGVAR(module_cmds, $1) \
5255     _LT_AC_TAGVAR(module_expsym_cmds, $1) \
5256     _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
5257     _LT_AC_TAGVAR(exclude_expsyms, $1) \
5258     _LT_AC_TAGVAR(include_expsyms, $1); do
5259
5260     case $var in
5261     _LT_AC_TAGVAR(old_archive_cmds, $1) | \
5262     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
5263     _LT_AC_TAGVAR(archive_cmds, $1) | \
5264     _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
5265     _LT_AC_TAGVAR(module_cmds, $1) | \
5266     _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
5267     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
5268     _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
5269     extract_expsyms_cmds | reload_cmds | finish_cmds | \
5270     postinstall_cmds | postuninstall_cmds | \
5271     old_postinstall_cmds | old_postuninstall_cmds | \
5272     sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
5273       # Double-quote double-evaled strings.
5274       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
5275       ;;
5276     *)
5277       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
5278       ;;
5279     esac
5280   done
5281
5282   case $lt_echo in
5283   *'\[$]0 --fallback-echo"')
5284     lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
5285     ;;
5286   esac
5287
5288 ifelse([$1], [],
5289   [cfgfile="${ofile}T"
5290   trap "$rm \"$cfgfile\"; exit 1" 1 2 15
5291   $rm -f "$cfgfile"
5292   AC_MSG_NOTICE([creating $ofile])],
5293   [cfgfile="$ofile"])
5294
5295   cat <<__EOF__ >> "$cfgfile"
5296 ifelse([$1], [],
5297 [#! $SHELL
5298
5299 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
5300 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
5301 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
5302 #
5303 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5304 # Free Software Foundation, Inc.
5305 #
5306 # This file is part of GNU Libtool:
5307 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5308 #
5309 # This program is free software; you can redistribute it and/or modify
5310 # it under the terms of the GNU General Public License as published by
5311 # the Free Software Foundation; either version 2 of the License, or
5312 # (at your option) any later version.
5313 #
5314 # This program is distributed in the hope that it will be useful, but
5315 # WITHOUT ANY WARRANTY; without even the implied warranty of
5316 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
5317 # General Public License for more details.
5318 #
5319 # You should have received a copy of the GNU General Public License
5320 # along with this program; if not, write to the Free Software
5321 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
5322 #
5323 # As a special exception to the GNU General Public License, if you
5324 # distribute this file as part of a program that contains a
5325 # configuration script generated by Autoconf, you may include it under
5326 # the same distribution terms that you use for the rest of that program.
5327
5328 # A sed program that does not truncate output.
5329 SED=$lt_SED
5330
5331 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
5332 Xsed="$SED -e s/^X//"
5333
5334 # The HP-UX ksh and POSIX shell print the target directory to stdout
5335 # if CDPATH is set.
5336 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
5337
5338 # The names of the tagged configurations supported by this script.
5339 available_tags=
5340
5341 # ### BEGIN LIBTOOL CONFIG],
5342 [# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
5343
5344 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5345
5346 # Shell to use when invoking shell scripts.
5347 SHELL=$lt_SHELL
5348
5349 # Whether or not to build shared libraries.
5350 build_libtool_libs=$enable_shared
5351
5352 # Whether or not to build static libraries.
5353 build_old_libs=$enable_static
5354
5355 # Whether or not to add -lc for building shared libraries.
5356 build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
5357
5358 # Whether or not to disallow shared libs when runtime libs are static
5359 allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
5360
5361 # Whether or not to optimize for fast installation.
5362 fast_install=$enable_fast_install
5363
5364 # The host system.
5365 host_alias=$host_alias
5366 host=$host
5367
5368 # An echo program that does not interpret backslashes.
5369 echo=$lt_echo
5370
5371 # The archiver.
5372 AR=$lt_AR
5373 AR_FLAGS=$lt_AR_FLAGS
5374
5375 # A C compiler.
5376 LTCC=$lt_LTCC
5377
5378 # A language-specific compiler.
5379 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
5380
5381 # Is the compiler the GNU C compiler?
5382 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
5383
5384 # An ERE matcher.
5385 EGREP=$lt_EGREP
5386
5387 # The linker used to build libraries.
5388 LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
5389
5390 # Whether we need hard or soft links.
5391 LN_S=$lt_LN_S
5392
5393 # A BSD-compatible nm program.
5394 NM=$lt_NM
5395
5396 # A symbol stripping program
5397 STRIP=$lt_STRIP
5398
5399 # Used to examine libraries when file_magic_cmd begins "file"
5400 MAGIC_CMD=$MAGIC_CMD
5401
5402 # Used on cygwin: DLL creation program.
5403 DLLTOOL="$DLLTOOL"
5404
5405 # Used on cygwin: object dumper.
5406 OBJDUMP="$OBJDUMP"
5407
5408 # Used on cygwin: assembler.
5409 AS="$AS"
5410
5411 # The name of the directory that contains temporary libtool files.
5412 objdir=$objdir
5413
5414 # How to create reloadable object files.
5415 reload_flag=$lt_reload_flag
5416 reload_cmds=$lt_reload_cmds
5417
5418 # How to pass a linker flag through the compiler.
5419 wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
5420
5421 # Object file suffix (normally "o").
5422 objext="$ac_objext"
5423
5424 # Old archive suffix (normally "a").
5425 libext="$libext"
5426
5427 # Shared library suffix (normally ".so").
5428 shrext_cmds='$shrext_cmds'
5429
5430 # Executable file suffix (normally "").
5431 exeext="$exeext"
5432
5433 # Additional compiler flags for building library objects.
5434 pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
5435 pic_mode=$pic_mode
5436
5437 # What is the maximum length of a command?
5438 max_cmd_len=$lt_cv_sys_max_cmd_len
5439
5440 # Does compiler simultaneously support -c and -o options?
5441 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
5442
5443 # Must we lock files when doing compilation ?
5444 need_locks=$lt_need_locks
5445
5446 # Do we need the lib prefix for modules?
5447 need_lib_prefix=$need_lib_prefix
5448
5449 # Do we need a version for libraries?
5450 need_version=$need_version
5451
5452 # Whether dlopen is supported.
5453 dlopen_support=$enable_dlopen
5454
5455 # Whether dlopen of programs is supported.
5456 dlopen_self=$enable_dlopen_self
5457
5458 # Whether dlopen of statically linked programs is supported.
5459 dlopen_self_static=$enable_dlopen_self_static
5460
5461 # Compiler flag to prevent dynamic linking.
5462 link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
5463
5464 # Compiler flag to turn off builtin functions.
5465 no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
5466
5467 # Compiler flag to allow reflexive dlopens.
5468 export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
5469
5470 # Compiler flag to generate shared objects directly from archives.
5471 whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
5472
5473 # Compiler flag to generate thread-safe objects.
5474 thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
5475
5476 # Library versioning type.
5477 version_type=$version_type
5478
5479 # Format of library name prefix.
5480 libname_spec=$lt_libname_spec
5481
5482 # List of archive names.  First name is the real one, the rest are links.
5483 # The last name is the one that the linker finds with -lNAME.
5484 library_names_spec=$lt_library_names_spec
5485
5486 # The coded name of the library, if different from the real name.
5487 soname_spec=$lt_soname_spec
5488
5489 # Commands used to build and install an old-style archive.
5490 RANLIB=$lt_RANLIB
5491 old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
5492 old_postinstall_cmds=$lt_old_postinstall_cmds
5493 old_postuninstall_cmds=$lt_old_postuninstall_cmds
5494
5495 # Create an old-style archive from a shared archive.
5496 old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
5497
5498 # Create a temporary old-style archive to link instead of a shared archive.
5499 old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
5500
5501 # Commands used to build and install a shared archive.
5502 archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
5503 archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
5504 postinstall_cmds=$lt_postinstall_cmds
5505 postuninstall_cmds=$lt_postuninstall_cmds
5506
5507 # Commands used to build a loadable module (assumed same as above if empty)
5508 module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
5509 module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
5510
5511 # Commands to strip libraries.
5512 old_striplib=$lt_old_striplib
5513 striplib=$lt_striplib
5514
5515 # Dependencies to place before the objects being linked to create a
5516 # shared library.
5517 predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
5518
5519 # Dependencies to place after the objects being linked to create a
5520 # shared library.
5521 postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
5522
5523 # Dependencies to place before the objects being linked to create a
5524 # shared library.
5525 predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
5526
5527 # Dependencies to place after the objects being linked to create a
5528 # shared library.
5529 postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
5530
5531 # The library search path used internally by the compiler when linking
5532 # a shared library.
5533 compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
5534
5535 # Method to check whether dependent libraries are shared objects.
5536 deplibs_check_method=$lt_deplibs_check_method
5537
5538 # Command to use when deplibs_check_method == file_magic.
5539 file_magic_cmd=$lt_file_magic_cmd
5540
5541 # Flag that allows shared libraries with undefined symbols to be built.
5542 allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
5543
5544 # Flag that forces no undefined symbols.
5545 no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
5546
5547 # Commands used to finish a libtool library installation in a directory.
5548 finish_cmds=$lt_finish_cmds
5549
5550 # Same as above, but a single script fragment to be evaled but not shown.
5551 finish_eval=$lt_finish_eval
5552
5553 # Take the output of nm and produce a listing of raw symbols and C names.
5554 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
5555
5556 # Transform the output of nm in a proper C declaration
5557 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
5558
5559 # Transform the output of nm in a C name address pair
5560 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
5561
5562 # This is the shared library runtime path variable.
5563 runpath_var=$runpath_var
5564
5565 # This is the shared library path variable.
5566 shlibpath_var=$shlibpath_var
5567
5568 # Is shlibpath searched before the hard-coded library search path?
5569 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
5570
5571 # How to hardcode a shared library path into an executable.
5572 hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
5573
5574 # Whether we should hardcode library paths into libraries.
5575 hardcode_into_libs=$hardcode_into_libs
5576
5577 # Flag to hardcode \$libdir into a binary during linking.
5578 # This must work even if \$libdir does not exist.
5579 hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
5580
5581 # If ld is used when linking, flag to hardcode \$libdir into
5582 # a binary during linking. This must work even if \$libdir does
5583 # not exist.
5584 hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
5585
5586 # Whether we need a single -rpath flag with a separated argument.
5587 hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
5588
5589 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
5590 # resulting binary.
5591 hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
5592
5593 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
5594 # resulting binary.
5595 hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
5596
5597 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
5598 # the resulting binary.
5599 hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
5600
5601 # Set to yes if building a shared library automatically hardcodes DIR into the library
5602 # and all subsequent libraries and executables linked against it.
5603 hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
5604
5605 # Variables whose values should be saved in libtool wrapper scripts and
5606 # restored at relink time.
5607 variables_saved_for_relink="$variables_saved_for_relink"
5608
5609 # Whether libtool must link a program against all its dependency libraries.
5610 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
5611
5612 # Compile-time system search path for libraries
5613 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
5614
5615 # Run-time system search path for libraries
5616 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
5617
5618 # Fix the shell variable \$srcfile for the compiler.
5619 fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
5620
5621 # Set to yes if exported symbols are required.
5622 always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
5623
5624 # The commands to list exported symbols.
5625 export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
5626
5627 # The commands to extract the exported symbol list from a shared archive.
5628 extract_expsyms_cmds=$lt_extract_expsyms_cmds
5629
5630 # Symbols that should not be listed in the preloaded symbols.
5631 exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
5632
5633 # Symbols that must always be exported.
5634 include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
5635
5636 ifelse([$1],[],
5637 [# ### END LIBTOOL CONFIG],
5638 [# ### END LIBTOOL TAG CONFIG: $tagname])
5639
5640 __EOF__
5641
5642 ifelse([$1],[], [
5643   case $host_os in
5644   aix3*)
5645     cat <<\EOF >> "$cfgfile"
5646
5647 # AIX sometimes has problems with the GCC collect2 program.  For some
5648 # reason, if we set the COLLECT_NAMES environment variable, the problems
5649 # vanish in a puff of smoke.
5650 if test "X${COLLECT_NAMES+set}" != Xset; then
5651   COLLECT_NAMES=
5652   export COLLECT_NAMES
5653 fi
5654 EOF
5655     ;;
5656   esac
5657
5658   # We use sed instead of cat because bash on DJGPP gets confused if
5659   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
5660   # text mode, it properly converts lines to CR/LF.  This bash problem
5661   # is reportedly fixed, but why not run on old versions too?
5662   sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
5663
5664   mv -f "$cfgfile" "$ofile" || \
5665     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
5666   chmod +x "$ofile"
5667 ])
5668 else
5669   # If there is no Makefile yet, we rely on a make rule to execute
5670   # `config.status --recheck' to rerun these tests and create the
5671   # libtool script then.
5672   ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
5673   if test -f "$ltmain_in"; then
5674     test -f Makefile && make "$ltmain"
5675   fi
5676 fi
5677 ])# AC_LIBTOOL_CONFIG
5678
5679
5680 # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
5681 # -------------------------------------------
5682 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
5683 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
5684
5685 _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5686
5687 if test "$GCC" = yes; then
5688   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5689
5690   AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
5691     lt_cv_prog_compiler_rtti_exceptions,
5692     [-fno-rtti -fno-exceptions], [],
5693     [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
5694 fi
5695 ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
5696
5697
5698 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5699 # ---------------------------------
5700 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
5701 [AC_REQUIRE([AC_CANONICAL_HOST])
5702 AC_REQUIRE([AC_PROG_NM])
5703 AC_REQUIRE([AC_OBJEXT])
5704 # Check for command to grab the raw symbol name followed by C symbol from nm.
5705 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
5706 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
5707 [
5708 # These are sane defaults that work on at least a few old systems.
5709 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
5710
5711 # Character class describing NM global symbol codes.
5712 symcode='[[BCDEGRST]]'
5713
5714 # Regexp to match symbols that can be accessed directly from C.
5715 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
5716
5717 # Transform the above into a raw symbol and a C symbol.
5718 symxfrm='\1 \2\3 \3'
5719
5720 # Transform an extracted symbol line into a proper C declaration
5721 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
5722
5723 # Transform an extracted symbol line into symbol name and symbol address
5724 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
5725
5726 # Define system-specific variables.
5727 case $host_os in
5728 aix*)
5729   symcode='[[BCDT]]'
5730   ;;
5731 cygwin* | mingw* | pw32*)
5732   symcode='[[ABCDGISTW]]'
5733   ;;
5734 hpux*) # Its linker distinguishes data from code symbols
5735   if test "$host_cpu" = ia64; then
5736     symcode='[[ABCDEGRST]]'
5737   fi
5738   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5739   lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
5740   ;;
5741 irix* | nonstopux*)
5742   symcode='[[BCDEGRST]]'
5743   ;;
5744 osf*)
5745   symcode='[[BCDEGQRST]]'
5746   ;;
5747 solaris* | sysv5*)
5748   symcode='[[BDRT]]'
5749   ;;
5750 sysv4)
5751   symcode='[[DFNSTU]]'
5752   ;;
5753 esac
5754
5755 # Handle CRLF in mingw tool chain
5756 opt_cr=
5757 case $build_os in
5758 mingw*)
5759   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5760   ;;
5761 esac
5762
5763 # If we're using GNU nm, then use its standard symbol codes.
5764 case `$NM -V 2>&1` in
5765 *GNU* | *'with BFD'*)
5766   symcode='[[ABCDGIRSTW]]' ;;
5767 esac
5768
5769 # Try without a prefix undercore, then with it.
5770 for ac_symprfx in "" "_"; do
5771
5772   # Write the raw and C identifiers.
5773   lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[      ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
5774
5775   # Check to see that the pipe works correctly.
5776   pipe_works=no
5777
5778   rm -f conftest*
5779   cat > conftest.$ac_ext <<EOF
5780 #ifdef __cplusplus
5781 extern "C" {
5782 #endif
5783 char nm_test_var;
5784 void nm_test_func(){}
5785 #ifdef __cplusplus
5786 }
5787 #endif
5788 int main(){nm_test_var='a';nm_test_func();return(0);}
5789 EOF
5790
5791   if AC_TRY_EVAL(ac_compile); then
5792     # Now try to grab the symbols.
5793     nlist=conftest.nm
5794     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
5795       # Try sorting and uniquifying the output.
5796       if sort "$nlist" | uniq > "$nlist"T; then
5797         mv -f "$nlist"T "$nlist"
5798       else
5799         rm -f "$nlist"T
5800       fi
5801
5802       # Make sure that we snagged all the symbols we need.
5803       if grep ' nm_test_var$' "$nlist" >/dev/null; then
5804         if grep ' nm_test_func$' "$nlist" >/dev/null; then
5805           cat <<EOF > conftest.$ac_ext
5806 #ifdef __cplusplus
5807 extern "C" {
5808 #endif
5809
5810 EOF
5811           # Now generate the symbol file.
5812           eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
5813
5814           cat <<EOF >> conftest.$ac_ext
5815 #if defined (__STDC__) && __STDC__
5816 # define lt_ptr_t void *
5817 #else
5818 # define lt_ptr_t char *
5819 # define const
5820 #endif
5821
5822 /* The mapping between symbol names and symbols. */
5823 const struct {
5824   const char *name;
5825   lt_ptr_t address;
5826 }
5827 lt_preloaded_symbols[[]] =
5828 {
5829 EOF
5830           $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
5831           cat <<\EOF >> conftest.$ac_ext
5832   {0, (lt_ptr_t) 0}
5833 };
5834
5835 #ifdef __cplusplus
5836 }
5837 #endif
5838 EOF
5839           # Now try linking the two files.
5840           mv conftest.$ac_objext conftstm.$ac_objext
5841           lt_save_LIBS="$LIBS"
5842           lt_save_CFLAGS="$CFLAGS"
5843           LIBS="conftstm.$ac_objext"
5844           CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
5845           if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
5846             pipe_works=yes
5847           fi
5848           LIBS="$lt_save_LIBS"
5849           CFLAGS="$lt_save_CFLAGS"
5850         else
5851           echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
5852         fi
5853       else
5854         echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
5855       fi
5856     else
5857       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
5858     fi
5859   else
5860     echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
5861     cat conftest.$ac_ext >&5
5862   fi
5863   rm -f conftest* conftst*
5864
5865   # Do not use the global_symbol_pipe unless it works.
5866   if test "$pipe_works" = yes; then
5867     break
5868   else
5869     lt_cv_sys_global_symbol_pipe=
5870   fi
5871 done
5872 ])
5873 if test -z "$lt_cv_sys_global_symbol_pipe"; then
5874   lt_cv_sys_global_symbol_to_cdecl=
5875 fi
5876 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5877   AC_MSG_RESULT(failed)
5878 else
5879   AC_MSG_RESULT(ok)
5880 fi
5881 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5882
5883
5884 # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
5885 # ---------------------------------------
5886 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
5887 [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
5888 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5889 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
5890
5891 AC_MSG_CHECKING([for $compiler option to produce PIC])
5892  ifelse([$1],[CXX],[
5893   # C++ specific cases for pic, static, wl, etc.
5894   if test "$GXX" = yes; then
5895     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5896     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5897
5898     case $host_os in
5899     aix*)
5900       # All AIX code is PIC.
5901       if test "$host_cpu" = ia64; then
5902         # AIX 5 now supports IA64 processor
5903         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5904       fi
5905       ;;
5906     amigaos*)
5907       # FIXME: we need at least 68020 code to build shared libraries, but
5908       # adding the `-m68020' flag to GCC prevents building anything better,
5909       # like `-m68040'.
5910       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5911       ;;
5912     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5913       # PIC is the default for these OSes.
5914       ;;
5915     mingw* | os2* | pw32*)
5916       # This hack is so that the source file can tell whether it is being
5917       # built for inclusion in a dll (and should export symbols for example).
5918       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5919       ;;
5920     darwin* | rhapsody*)
5921       # PIC is the default on this platform
5922       # Common symbols not allowed in MH_DYLIB files
5923       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5924       ;;
5925     *djgpp*)
5926       # DJGPP does not support shared libraries at all
5927       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5928       ;;
5929     sysv4*MP*)
5930       if test -d /usr/nec; then
5931         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5932       fi
5933       ;;
5934     hpux*)
5935       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5936       # not for PA HP-UX.
5937       case "$host_cpu" in
5938       hppa*64*|ia64*)
5939         ;;
5940       *)
5941         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5942         ;;
5943       esac
5944       ;;
5945     *)
5946       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5947       ;;
5948     esac
5949   else
5950     case $host_os in
5951       aix4* | aix5*)
5952         # All AIX code is PIC.
5953         if test "$host_cpu" = ia64; then
5954           # AIX 5 now supports IA64 processor
5955           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5956         else
5957           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5958         fi
5959         ;;
5960       chorus*)
5961         case $cc_basename in
5962         cxch68)
5963           # Green Hills C++ Compiler
5964           # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
5965           ;;
5966         esac
5967         ;;
5968       dgux*)
5969         case $cc_basename in
5970           ec++)
5971             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5972             ;;
5973           ghcx)
5974             # Green Hills C++ Compiler
5975             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5976             ;;
5977           *)
5978             ;;
5979         esac
5980         ;;
5981       freebsd* | kfreebsd*-gnu)
5982         # FreeBSD uses GNU C++
5983         ;;
5984       hpux9* | hpux10* | hpux11*)
5985         case $cc_basename in
5986           CC)
5987             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5988             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
5989             if test "$host_cpu" != ia64; then
5990               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5991             fi
5992             ;;
5993           aCC)
5994             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5995             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
5996             case "$host_cpu" in
5997             hppa*64*|ia64*)
5998               # +Z the default
5999               ;;
6000             *)
6001               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6002               ;;
6003             esac
6004             ;;
6005           *)
6006             ;;
6007         esac
6008         ;;
6009       irix5* | irix6* | nonstopux*)
6010         case $cc_basename in
6011           CC)
6012             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6013             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6014             # CC pic flag -KPIC is the default.
6015             ;;
6016           *)
6017             ;;
6018         esac
6019         ;;
6020       linux*)
6021         case $cc_basename in
6022           KCC)
6023             # KAI C++ Compiler
6024             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6025             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6026             ;;
6027           icpc)
6028             # Intel C++
6029             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6030             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6031             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6032             ;;
6033           cxx)
6034             # Compaq C++
6035             # Make sure the PIC flag is empty.  It appears that all Alpha
6036             # Linux and Compaq Tru64 Unix objects are PIC.
6037             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6038             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6039             ;;
6040           *)
6041             ;;
6042         esac
6043         ;;
6044       lynxos*)
6045         ;;
6046       m88k*)
6047         ;;
6048       mvs*)
6049         case $cc_basename in
6050           cxx)
6051             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
6052             ;;
6053           *)
6054             ;;
6055         esac
6056         ;;
6057       netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
6058         ;;
6059       osf3* | osf4* | osf5*)
6060         case $cc_basename in
6061           KCC)
6062             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6063             ;;
6064           RCC)
6065             # Rational C++ 2.4.1
6066             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6067             ;;
6068           cxx)
6069             # Digital/Compaq C++
6070             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6071             # Make sure the PIC flag is empty.  It appears that all Alpha
6072             # Linux and Compaq Tru64 Unix objects are PIC.
6073             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6074             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6075             ;;
6076           *)
6077             ;;
6078         esac
6079         ;;
6080       psos*)
6081         ;;
6082       sco*)
6083         case $cc_basename in
6084           CC)
6085             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6086             ;;
6087           *)
6088             ;;
6089         esac
6090         ;;
6091       solaris*)
6092         case $cc_basename in
6093           CC)
6094             # Sun C++ 4.2, 5.x and Centerline C++
6095             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6096             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6097             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6098             ;;
6099           gcx)
6100             # Green Hills C++ Compiler
6101             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6102             ;;
6103           *)
6104             ;;
6105         esac
6106         ;;
6107       sunos4*)
6108         case $cc_basename in
6109           CC)
6110             # Sun C++ 4.x
6111             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6112             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6113             ;;
6114           lcc)
6115             # Lucid
6116             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6117             ;;
6118           *)
6119             ;;
6120         esac
6121         ;;
6122       tandem*)
6123         case $cc_basename in
6124           NCC)
6125             # NonStop-UX NCC 3.20
6126             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6127             ;;
6128           *)
6129             ;;
6130         esac
6131         ;;
6132       unixware*)
6133         ;;
6134       vxworks*)
6135         ;;
6136       *)
6137         _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6138         ;;
6139     esac
6140   fi
6141 ],
6142 [
6143   if test "$GCC" = yes; then
6144     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6145     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6146
6147     case $host_os in
6148       aix*)
6149       # All AIX code is PIC.
6150       if test "$host_cpu" = ia64; then
6151         # AIX 5 now supports IA64 processor
6152         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6153       fi
6154       ;;
6155
6156     amigaos*)
6157       # FIXME: we need at least 68020 code to build shared libraries, but
6158       # adding the `-m68020' flag to GCC prevents building anything better,
6159       # like `-m68040'.
6160       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
6161       ;;
6162
6163     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
6164       # PIC is the default for these OSes.
6165       ;;
6166
6167     mingw* | pw32* | os2*)
6168       # This hack is so that the source file can tell whether it is being
6169       # built for inclusion in a dll (and should export symbols for example).
6170       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
6171       ;;
6172
6173     darwin* | rhapsody*)
6174       # PIC is the default on this platform
6175       # Common symbols not allowed in MH_DYLIB files
6176       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
6177       ;;
6178
6179     msdosdjgpp*)
6180       # Just because we use GCC doesn't mean we suddenly get shared libraries
6181       # on systems that don't support them.
6182       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6183       enable_shared=no
6184       ;;
6185
6186     sysv4*MP*)
6187       if test -d /usr/nec; then
6188         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
6189       fi
6190       ;;
6191
6192     hpux*)
6193       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6194       # not for PA HP-UX.
6195       case "$host_cpu" in
6196       hppa*64*|ia64*)
6197         # +Z the default
6198         ;;
6199       *)
6200         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6201         ;;
6202       esac
6203       ;;
6204
6205     *)
6206       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6207       ;;
6208     esac
6209   else
6210     # PORTME Check for flag to pass linker flags through the system compiler.
6211     case $host_os in
6212     aix*)
6213       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6214       if test "$host_cpu" = ia64; then
6215         # AIX 5 now supports IA64 processor
6216         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6217       else
6218         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
6219       fi
6220       ;;
6221
6222     mingw* | pw32* | os2*)
6223       # This hack is so that the source file can tell whether it is being
6224       # built for inclusion in a dll (and should export symbols for example).
6225       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
6226       ;;
6227
6228     hpux9* | hpux10* | hpux11*)
6229       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6230       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6231       # not for PA HP-UX.
6232       case "$host_cpu" in
6233       hppa*64*|ia64*)
6234         # +Z the default
6235         ;;
6236       *)
6237         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6238         ;;
6239       esac
6240       # Is there a better lt_prog_compiler_static that works with the bundled CC?
6241       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6242       ;;
6243
6244     irix5* | irix6* | nonstopux*)
6245       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6246       # PIC (with -KPIC) is the default.
6247       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6248       ;;
6249
6250     newsos6)
6251       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6252       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6253       ;;
6254
6255     linux*)
6256       case $CC in
6257       icc* | ecc*)
6258         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6259         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6260         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6261         ;;
6262       ccc*)
6263         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6264         # All Alpha code is PIC.
6265         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6266         ;;
6267       esac
6268       ;;
6269
6270     osf3* | osf4* | osf5*)
6271       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6272       # All OSF/1 code is PIC.
6273       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6274       ;;
6275
6276     sco3.2v5*)
6277       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
6278       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
6279       ;;
6280
6281     solaris*)
6282       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6283       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6284       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6285       ;;
6286
6287     sunos4*)
6288       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6289       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6290       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6291       ;;
6292
6293     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6294       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6295       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6296       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6297       ;;
6298
6299     sysv4*MP*)
6300       if test -d /usr/nec ;then
6301         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
6302         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6303       fi
6304       ;;
6305
6306     uts4*)
6307       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6308       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6309       ;;
6310
6311     *)
6312       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6313       ;;
6314     esac
6315   fi
6316 ])
6317 AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
6318
6319 #
6320 # Check to make sure the PIC flag actually works.
6321 #
6322 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
6323   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
6324     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
6325     [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
6326     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
6327      "" | " "*) ;;
6328      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
6329      esac],
6330     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6331      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
6332 fi
6333 case "$host_os" in
6334   # For platforms which do not support PIC, -DPIC is meaningless:
6335   *djgpp*)
6336     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6337     ;;
6338   *)
6339     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
6340     ;;
6341 esac
6342 ])
6343
6344
6345 # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
6346 # ------------------------------------
6347 # See if the linker supports building shared libraries.
6348 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
6349 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6350 ifelse([$1],[CXX],[
6351   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6352   case $host_os in
6353   aix4* | aix5*)
6354     # If we're using GNU nm, then we don't want the "-C" option.
6355     # -C means demangle to AIX nm, but means don't demangle with GNU nm
6356     if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
6357       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
6358     else
6359       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
6360     fi
6361     ;;
6362   pw32*)
6363     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
6364   ;;
6365   cygwin* | mingw*)
6366     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
6367   ;;
6368   linux*)
6369     _LT_AC_TAGVAR(link_all_deplibs, $1)=no
6370   ;;
6371   *)
6372     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6373   ;;
6374   esac
6375 ],[
6376   runpath_var=
6377   _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6378   _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6379   _LT_AC_TAGVAR(archive_cmds, $1)=
6380   _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
6381   _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
6382   _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
6383   _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
6384   _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6385   _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
6386   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
6387   _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6388   _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6389   _LT_AC_TAGVAR(hardcode_direct, $1)=no
6390   _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
6391   _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6392   _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
6393   _LT_AC_TAGVAR(hardcode_automatic, $1)=no
6394   _LT_AC_TAGVAR(module_cmds, $1)=
6395   _LT_AC_TAGVAR(module_expsym_cmds, $1)=
6396   _LT_AC_TAGVAR(always_export_symbols, $1)=no
6397   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6398   # include_expsyms should be a list of space-separated symbols to be *always*
6399   # included in the symbol list
6400   _LT_AC_TAGVAR(include_expsyms, $1)=
6401   # exclude_expsyms can be an extended regexp of symbols to exclude
6402   # it will be wrapped by ` (' and `)$', so one must not match beginning or
6403   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
6404   # as well as any symbol that contains `d'.
6405   _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
6406   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
6407   # platforms (ab)use it in PIC code, but their linkers get confused if
6408   # the symbol is explicitly referenced.  Since portable code cannot
6409   # rely on this symbol name, it's probably fine to never include it in
6410   # preloaded symbol tables.
6411   extract_expsyms_cmds=
6412
6413   case $host_os in
6414   cygwin* | mingw* | pw32*)
6415     # FIXME: the MSVC++ port hasn't been tested in a loooong time
6416     # When not using gcc, we currently assume that we are using
6417     # Microsoft Visual C++.
6418     if test "$GCC" != yes; then
6419       with_gnu_ld=no
6420     fi
6421     ;;
6422   openbsd*)
6423     with_gnu_ld=no
6424     ;;
6425   esac
6426
6427   _LT_AC_TAGVAR(ld_shlibs, $1)=yes
6428   if test "$with_gnu_ld" = yes; then
6429     # If archive_cmds runs LD, not CC, wlarc should be empty
6430     wlarc='${wl}'
6431
6432     # See if GNU ld supports shared libraries.
6433     case $host_os in
6434     aix3* | aix4* | aix5*)
6435       # On AIX/PPC, the GNU linker is very broken
6436       if test "$host_cpu" != ia64; then
6437         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6438         cat <<EOF 1>&2
6439
6440 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
6441 *** to be unable to reliably create shared libraries on AIX.
6442 *** Therefore, libtool is disabling shared libraries support.  If you
6443 *** really care for shared libraries, you may want to modify your PATH
6444 *** so that a non-GNU linker is found, and then restart.
6445
6446 EOF
6447       fi
6448       ;;
6449
6450     amigaos*)
6451       _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
6452       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6453       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6454
6455       # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
6456       # that the semantics of dynamic libraries on AmigaOS, at least up
6457       # to version 4, is to share data among multiple programs linked
6458       # with the same dynamic library.  Since this doesn't match the
6459       # behavior of shared libraries on other platforms, we can't use
6460       # them.
6461       _LT_AC_TAGVAR(ld_shlibs, $1)=no
6462       ;;
6463
6464     beos*)
6465       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6466         _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6467         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6468         # support --undefined.  This deserves some investigation.  FIXME
6469         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6470       else
6471         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6472       fi
6473       ;;
6474
6475     cygwin* | mingw* | pw32*)
6476       # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6477       # as there is no search path for DLLs.
6478       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6479       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6480       _LT_AC_TAGVAR(always_export_symbols, $1)=no
6481       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6482       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
6483
6484       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
6485         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
6486         # If the export-symbols file already is a .def file (1st line
6487         # is EXPORTS), use it as is; otherwise, prepend...
6488         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6489           cp $export_symbols $output_objdir/$soname.def;
6490         else
6491           echo EXPORTS > $output_objdir/$soname.def;
6492           cat $export_symbols >> $output_objdir/$soname.def;
6493         fi~
6494         $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
6495       else
6496         ld_shlibs=no
6497       fi
6498       ;;
6499
6500     netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
6501       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6502         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6503         wlarc=
6504       else
6505         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6506         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6507       fi
6508       ;;
6509
6510     solaris* | sysv5*)
6511       if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
6512         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6513         cat <<EOF 1>&2
6514
6515 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
6516 *** create shared libraries on Solaris systems.  Therefore, libtool
6517 *** is disabling shared libraries support.  We urge you to upgrade GNU
6518 *** binutils to release 2.9.1 or newer.  Another option is to modify
6519 *** your PATH or compiler configuration so that the native linker is
6520 *** used, and then restart.
6521
6522 EOF
6523       elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6524         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6525         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6526       else
6527         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6528       fi
6529       ;;
6530
6531     sunos4*)
6532       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6533       wlarc=
6534       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6535       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6536       ;;
6537
6538   linux*)
6539     if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6540         tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6541         _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
6542       supports_anon_versioning=no
6543       case `$LD -v 2>/dev/null` in
6544         *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
6545         *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
6546         *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
6547         *\ 2.11.*) ;; # other 2.11 versions
6548         *) supports_anon_versioning=yes ;;
6549       esac
6550       if test $supports_anon_versioning = yes; then
6551         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
6552 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6553 $echo "local: *; };" >> $output_objdir/$libname.ver~
6554         $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6555       else
6556         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
6557       fi
6558       _LT_AC_TAGVAR(link_all_deplibs, $1)=no
6559     else
6560       _LT_AC_TAGVAR(ld_shlibs, $1)=no
6561     fi
6562     ;;
6563
6564     *)
6565       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6566         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6567         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6568       else
6569         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6570       fi
6571       ;;
6572     esac
6573
6574     if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
6575       runpath_var=LD_RUN_PATH
6576       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6577       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6578       # ancient GNU ld didn't support --whole-archive et. al.
6579       if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
6580         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6581       else
6582         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6583       fi
6584     fi
6585   else
6586     # PORTME fill in a description of your system's linker (not GNU ld)
6587     case $host_os in
6588     aix3*)
6589       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6590       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6591       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
6592       # Note: this linker hardcodes the directories in LIBPATH if there
6593       # are no directories specified by -L.
6594       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6595       if test "$GCC" = yes && test -z "$link_static_flag"; then
6596         # Neither direct hardcoding nor static linking is supported with a
6597         # broken collect2.
6598         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
6599       fi
6600       ;;
6601
6602     aix4* | aix5*)
6603       if test "$host_cpu" = ia64; then
6604         # On IA64, the linker does run time linking by default, so we don't
6605         # have to do anything special.
6606         aix_use_runtimelinking=no
6607         exp_sym_flag='-Bexport'
6608         no_entry_flag=""
6609       else
6610         # If we're using GNU nm, then we don't want the "-C" option.
6611         # -C means demangle to AIX nm, but means don't demangle with GNU nm
6612         if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
6613           _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
6614         else
6615           _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
6616         fi
6617         aix_use_runtimelinking=no
6618
6619         # Test if we are trying to use run time linking or normal
6620         # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6621         # need to do runtime linking.
6622         case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
6623           for ld_flag in $LDFLAGS; do
6624           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6625             aix_use_runtimelinking=yes
6626             break
6627           fi
6628           done
6629         esac
6630
6631         exp_sym_flag='-bexport'
6632         no_entry_flag='-bnoentry'
6633       fi
6634
6635       # When large executables or shared objects are built, AIX ld can
6636       # have problems creating the table of contents.  If linking a library
6637       # or program results in "error TOC overflow" add -mminimal-toc to
6638       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6639       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6640
6641       _LT_AC_TAGVAR(archive_cmds, $1)=''
6642       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6643       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6644       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6645
6646       if test "$GCC" = yes; then
6647         case $host_os in aix4.[012]|aix4.[012].*)
6648         # We only want to do this on AIX 4.2 and lower, the check
6649         # below for broken collect2 doesn't work under 4.3+
6650           collect2name=`${CC} -print-prog-name=collect2`
6651           if test -f "$collect2name" && \
6652            strings "$collect2name" | grep resolve_lib_name >/dev/null
6653           then
6654           # We have reworked collect2
6655           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6656           else
6657           # We have old collect2
6658           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
6659           # It fails to find uninstalled libraries when the uninstalled
6660           # path is not listed in the libpath.  Setting hardcode_minus_L
6661           # to unsupported forces relinking
6662           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6663           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6664           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6665           fi
6666         esac
6667         shared_flag='-shared'
6668       else
6669         # not using gcc
6670         if test "$host_cpu" = ia64; then
6671         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6672         # chokes on -Wl,-G. The following line is correct:
6673           shared_flag='-G'
6674         else
6675         if test "$aix_use_runtimelinking" = yes; then
6676             shared_flag='${wl}-G'
6677           else
6678             shared_flag='${wl}-bM:SRE'
6679         fi
6680         fi
6681       fi
6682
6683       # It seems that -bexpall does not export symbols beginning with
6684       # underscore (_), so it is better to generate a list of symbols to export.
6685       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6686       if test "$aix_use_runtimelinking" = yes; then
6687         # Warning - without using the other runtime loading flags (-brtl),
6688         # -berok will link without error, but may produce a broken library.
6689         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
6690        # Determine the default libpath from the value encoded in an empty executable.
6691        _LT_AC_SYS_LIBPATH_AIX
6692        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6693         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
6694        else
6695         if test "$host_cpu" = ia64; then
6696           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6697           _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6698           _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
6699         else
6700          # Determine the default libpath from the value encoded in an empty executable.
6701          _LT_AC_SYS_LIBPATH_AIX
6702          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6703           # Warning - without using the other run time loading flags,
6704           # -berok will link without error, but may produce a broken library.
6705           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6706           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6707           # -bexpall does not export symbols beginning with underscore (_)
6708           _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6709           # Exported symbols can be pulled into shared objects from archives
6710           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
6711           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6712           # This is similar to how AIX traditionally builds it's shared libraries.
6713           _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6714         fi
6715       fi
6716       ;;
6717
6718     amigaos*)
6719       _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
6720       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6721       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6722       # see comment about different semantics on the GNU ld section
6723       _LT_AC_TAGVAR(ld_shlibs, $1)=no
6724       ;;
6725
6726     bsdi4*)
6727       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6728       ;;
6729
6730     cygwin* | mingw* | pw32*)
6731       # When not using gcc, we currently assume that we are using
6732       # Microsoft Visual C++.
6733       # hardcode_libdir_flag_spec is actually meaningless, as there is
6734       # no search path for DLLs.
6735       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6736       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6737       # Tell ltmain to make .lib files, not .a files.
6738       libext=lib
6739       # Tell ltmain to make .dll files, not .so files.
6740       shrext_cmds=".dll"
6741       # FIXME: Setting linknames here is a bad hack.
6742       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
6743       # The linker will automatically build a .lib file if we build a DLL.
6744       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
6745       # FIXME: Should let the user specify the lib program.
6746       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
6747       fix_srcfile_path='`cygpath -w "$srcfile"`'
6748       _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6749       ;;
6750
6751     darwin* | rhapsody*)
6752     if test "$GXX" = yes ; then
6753       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6754       case "$host_os" in
6755       rhapsody* | darwin1.[[012]])
6756         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
6757         ;;
6758       *) # Darwin 1.3 on
6759       if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
6760         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
6761       else
6762         case ${MACOSX_DEPLOYMENT_TARGET} in
6763           10.[[012]])
6764             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
6765             ;;
6766           10.*)
6767             _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
6768             ;;
6769         esac
6770       fi
6771         ;;
6772       esac
6773         lt_int_apple_cc_single_mod=no
6774         output_verbose_link_cmd='echo'
6775         if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
6776           lt_int_apple_cc_single_mod=yes
6777         fi
6778         if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
6779           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
6780         else
6781         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
6782       fi
6783       _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
6784       # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
6785         if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
6786           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6787         else
6788           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6789         fi
6790           _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6791       _LT_AC_TAGVAR(hardcode_direct, $1)=no
6792       _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
6793       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6794       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
6795       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6796     else
6797       _LT_AC_TAGVAR(ld_shlibs, $1)=no
6798     fi
6799       ;;
6800
6801     dgux*)
6802       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6803       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6804       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6805       ;;
6806
6807     freebsd1*)
6808       _LT_AC_TAGVAR(ld_shlibs, $1)=no
6809       ;;
6810
6811     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6812     # support.  Future versions do this automatically, but an explicit c++rt0.o
6813     # does not break anything, and helps significantly (at the cost of a little
6814     # extra space).
6815     freebsd2.2*)
6816       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6817       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6818       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6819       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6820       ;;
6821
6822     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6823     freebsd2*)
6824       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6825       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6826       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6827       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6828       ;;
6829
6830     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6831     freebsd* | kfreebsd*-gnu)
6832       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
6833       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6834       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6835       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6836       ;;
6837
6838     hpux9*)
6839       if test "$GCC" = yes; then
6840         _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6841       else
6842         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
6843       fi
6844       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6845       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6846       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6847
6848       # hardcode_minus_L: Not really in the search PATH,
6849       # but as the default location of the library.
6850       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6851       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6852       ;;
6853
6854     hpux10* | hpux11*)
6855       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6856         case "$host_cpu" in
6857         hppa*64*|ia64*)
6858           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6859           ;;
6860         *)
6861           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6862           ;;
6863         esac
6864       else
6865         case "$host_cpu" in
6866         hppa*64*|ia64*)
6867           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
6868           ;;
6869         *)
6870           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6871           ;;
6872         esac
6873       fi
6874       if test "$with_gnu_ld" = no; then
6875         case "$host_cpu" in
6876         hppa*64*)
6877           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6878           _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
6879           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6880           _LT_AC_TAGVAR(hardcode_direct, $1)=no
6881           _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6882           ;;
6883         ia64*)
6884           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6885           _LT_AC_TAGVAR(hardcode_direct, $1)=no
6886           _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6887
6888           # hardcode_minus_L: Not really in the search PATH,
6889           # but as the default location of the library.
6890           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6891           ;;
6892         *)
6893           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6894           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6895           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6896           _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6897
6898           # hardcode_minus_L: Not really in the search PATH,
6899           # but as the default location of the library.
6900           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6901           ;;
6902         esac
6903       fi
6904       ;;
6905
6906     irix5* | irix6* | nonstopux*)
6907       if test "$GCC" = yes; then
6908         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
6909       else
6910         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6911         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6912       fi
6913       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6914       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6915       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6916       ;;
6917
6918     netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
6919       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6920         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6921       else
6922         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6923       fi
6924       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6925       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6926       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6927       ;;
6928
6929     newsos6)
6930       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6931       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6932       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6933       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6934       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6935       ;;
6936
6937     openbsd*)
6938       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6939       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6940       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6941         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6942         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6943         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6944       else
6945        case $host_os in
6946          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6947            _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6948            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6949            ;;
6950          *)
6951            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6952            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6953            ;;
6954        esac
6955       fi
6956       ;;
6957
6958     os2*)
6959       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6960       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6961       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6962       _LT_AC_TAGVAR(archive_cmds, $1)='$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'
6963       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6964       ;;
6965
6966     osf3*)
6967       if test "$GCC" = yes; then
6968         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6969         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
6970       else
6971         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6972         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
6973       fi
6974       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6975       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6976       ;;
6977
6978     osf4* | osf5*)      # as osf3* with the addition of -msym flag
6979       if test "$GCC" = yes; then
6980         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6981         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
6982         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6983       else
6984         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6985         _LT_AC_TAGVAR(archive_cmds, $1)='$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'
6986         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
6987         $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'
6988
6989         # Both c and cxx compiler support -rpath directly
6990         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6991       fi
6992       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6993       ;;
6994
6995     sco3.2v5*)
6996       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6997       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6998       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6999       runpath_var=LD_RUN_PATH
7000       hardcode_runpath_var=yes
7001       ;;
7002
7003     solaris*)
7004       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
7005       if test "$GCC" = yes; then
7006         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7007         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
7008           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
7009       else
7010         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
7011         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
7012         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
7013       fi
7014       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7015       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7016       case $host_os in
7017       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7018       *) # Supported since Solaris 2.6 (maybe 2.5.1?)
7019         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
7020       esac
7021       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7022       ;;
7023
7024     sunos4*)
7025       if test "x$host_vendor" = xsequent; then
7026         # Use $CC to link under sequent, because it throws in some extra .o
7027         # files that make .init and .fini sections work.
7028         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
7029       else
7030         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
7031       fi
7032       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7033       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7034       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7035       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7036       ;;
7037
7038     sysv4)
7039       case $host_vendor in
7040         sni)
7041           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7042           _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
7043         ;;
7044         siemens)
7045           ## LD is ld it makes a PLAMLIB
7046           ## CC just makes a GrossModule.
7047           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
7048           _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
7049           _LT_AC_TAGVAR(hardcode_direct, $1)=no
7050         ;;
7051         motorola)
7052           _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7053           _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
7054         ;;
7055       esac
7056       runpath_var='LD_RUN_PATH'
7057       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7058       ;;
7059
7060     sysv4.3*)
7061       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7062       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7063       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
7064       ;;
7065
7066     sysv4*MP*)
7067       if test -d /usr/nec; then
7068         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7069         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7070         runpath_var=LD_RUN_PATH
7071         hardcode_runpath_var=yes
7072         _LT_AC_TAGVAR(ld_shlibs, $1)=yes
7073       fi
7074       ;;
7075
7076     sysv4.2uw2*)
7077       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
7078       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7079       _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
7080       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7081       hardcode_runpath_var=yes
7082       runpath_var=LD_RUN_PATH
7083       ;;
7084
7085    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
7086       _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
7087       if test "$GCC" = yes; then
7088         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7089       else
7090         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7091       fi
7092       runpath_var='LD_RUN_PATH'
7093       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7094       ;;
7095
7096     sysv5*)
7097       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
7098       # $CC -shared without GNU ld will not create a library from C++
7099       # object files and a static libstdc++, better avoid it by now
7100       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
7101       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
7102                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
7103       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
7104       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7105       runpath_var='LD_RUN_PATH'
7106       ;;
7107
7108     uts4*)
7109       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7110       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7111       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7112       ;;
7113
7114     *)
7115       _LT_AC_TAGVAR(ld_shlibs, $1)=no
7116       ;;
7117     esac
7118   fi
7119 ])
7120 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
7121 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7122
7123 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
7124 if test "$GCC" = yes; then
7125   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7126 fi
7127
7128 #
7129 # Do we need to explicitly link libc?
7130 #
7131 case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
7132 x|xyes)
7133   # Assume -lc should be added
7134   _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
7135
7136   if test "$enable_shared" = yes && test "$GCC" = yes; then
7137     case $_LT_AC_TAGVAR(archive_cmds, $1) in
7138     *'~'*)
7139       # FIXME: we may have to deal with multi-command sequences.
7140       ;;
7141     '$CC '*)
7142       # Test whether the compiler implicitly links with -lc since on some
7143       # systems, -lgcc has to come before -lc. If gcc already passes -lc
7144       # to ld, don't add -lc before -lgcc.
7145       AC_MSG_CHECKING([whether -lc should be explicitly linked in])
7146       $rm conftest*
7147       printf "$lt_simple_compile_test_code" > conftest.$ac_ext
7148
7149       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
7150         soname=conftest
7151         lib=conftest
7152         libobjs=conftest.$ac_objext
7153         deplibs=
7154         wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
7155         compiler_flags=-v
7156         linker_flags=-v
7157         verstring=
7158         output_objdir=.
7159         libname=conftest
7160         lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
7161         _LT_AC_TAGVAR(allow_undefined_flag, $1)=
7162         if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
7163         then
7164           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7165         else
7166           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
7167         fi
7168         _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
7169       else
7170         cat conftest.err 1>&5
7171       fi
7172       $rm conftest*
7173       AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
7174       ;;
7175     esac
7176   fi
7177   ;;
7178 esac
7179 ])# AC_LIBTOOL_PROG_LD_SHLIBS
7180
7181
7182 # _LT_AC_FILE_LTDLL_C
7183 # -------------------
7184 # Be careful that the start marker always follows a newline.
7185 AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
7186 # /* ltdll.c starts here */
7187 # #define WIN32_LEAN_AND_MEAN
7188 # #include <windows.h>
7189 # #undef WIN32_LEAN_AND_MEAN
7190 # #include <stdio.h>
7191 #
7192 # #ifndef __CYGWIN__
7193 # #  ifdef __CYGWIN32__
7194 # #    define __CYGWIN__ __CYGWIN32__
7195 # #  endif
7196 # #endif
7197 #
7198 # #ifdef __cplusplus
7199 # extern "C" {
7200 # #endif
7201 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7202 # #ifdef __cplusplus
7203 # }
7204 # #endif
7205 #
7206 # #ifdef __CYGWIN__
7207 # #include <cygwin/cygwin_dll.h>
7208 # DECLARE_CYGWIN_DLL( DllMain );
7209 # #endif
7210 # HINSTANCE __hDllInstance_base;
7211 #
7212 # BOOL APIENTRY
7213 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7214 # {
7215 #   __hDllInstance_base = hInst;
7216 #   return TRUE;
7217 # }
7218 # /* ltdll.c ends here */
7219 ])# _LT_AC_FILE_LTDLL_C
7220
7221
7222 # _LT_AC_TAGVAR(VARNAME, [TAGNAME])
7223 # ---------------------------------
7224 AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
7225
7226
7227 # old names
7228 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
7229 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
7230 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
7231 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
7232 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7233 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
7234 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
7235
7236 # This is just to silence aclocal about the macro not being used
7237 ifelse([AC_DISABLE_FAST_INSTALL])
7238
7239 AC_DEFUN([LT_AC_PROG_GCJ],
7240 [AC_CHECK_TOOL(GCJ, gcj, no)
7241   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7242   AC_SUBST(GCJFLAGS)
7243 ])
7244
7245 AC_DEFUN([LT_AC_PROG_RC],
7246 [AC_CHECK_TOOL(RC, windres, no)
7247 ])
7248
7249 # NOTE: This macro has been submitted for inclusion into   #
7250 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7251 #  a released version of Autoconf we should remove this    #
7252 #  macro and use it instead.                               #
7253 # LT_AC_PROG_SED
7254 # --------------
7255 # Check for a fully-functional sed program, that truncates
7256 # as few characters as possible.  Prefer GNU sed if found.
7257 AC_DEFUN([LT_AC_PROG_SED],
7258 [AC_MSG_CHECKING([for a sed that does not truncate output])
7259 AC_CACHE_VAL(lt_cv_path_SED,
7260 [# Loop through the user's path and test for sed and gsed.
7261 # Then use that list of sed's as ones to test for truncation.
7262 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7263 for as_dir in $PATH
7264 do
7265   IFS=$as_save_IFS
7266   test -z "$as_dir" && as_dir=.
7267   for lt_ac_prog in sed gsed; do
7268     for ac_exec_ext in '' $ac_executable_extensions; do
7269       if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7270         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7271       fi
7272     done
7273   done
7274 done
7275 lt_ac_max=0
7276 lt_ac_count=0
7277 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
7278 # along with /bin/sed that truncates output.
7279 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7280   test ! -f $lt_ac_sed && break
7281   cat /dev/null > conftest.in
7282   lt_ac_count=0
7283   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7284   # Check for GNU sed and select it if it is found.
7285   if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7286     lt_cv_path_SED=$lt_ac_sed
7287     break
7288   fi
7289   while true; do
7290     cat conftest.in conftest.in >conftest.tmp
7291     mv conftest.tmp conftest.in
7292     cp conftest.in conftest.nl
7293     echo >>conftest.nl
7294     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7295     cmp -s conftest.out conftest.nl || break
7296     # 10000 chars as input seems more than enough
7297     test $lt_ac_count -gt 10 && break
7298     lt_ac_count=`expr $lt_ac_count + 1`
7299     if test $lt_ac_count -gt $lt_ac_max; then
7300       lt_ac_max=$lt_ac_count
7301       lt_cv_path_SED=$lt_ac_sed
7302     fi
7303   done
7304 done
7305 SED=$lt_cv_path_SED
7306 ])
7307 AC_MSG_RESULT([$SED])
7308 ])
7309
7310 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
7311 dnl The program must properly implement --version.
7312 AC_DEFUN([AM_MISSING_PROG],
7313 [AC_MSG_CHECKING(for working $2)
7314 # Run test in a subshell; some versions of sh will print an error if
7315 # an executable is not found, even if stderr is redirected.
7316 # Redirect stdin to placate older versions of autoconf.  Sigh.
7317 if ($2 --version) < /dev/null > /dev/null 2>&1; then
7318    $1=$2
7319    AC_MSG_RESULT(found)
7320 else
7321    $1="$3/missing $2"
7322    AC_MSG_RESULT(missing)
7323 fi
7324 AC_SUBST($1)])
7325