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