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