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