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