Changed atom type renumbering to merge types with identical nonbonded
[gromacs.git] / acinclude.m4
blob21e89a99cead9de8051e04ac5ad35f40cedb4d59
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         if test "$enable_ppc_altivec" = "yes"; then
788           # And try to add -fvec or -faltivec to get altivec extensions!
789           ACX_CHECK_CC_FLAGS(-fvec,fvec,xCFLAGS="$xCFLAGS -fvec",
790                 ACX_CHECK_CC_FLAGS(-faltivec,faltivec,xCFLAGS="$xCFLAGS -faltivec"))
791         fi
792       cputype=`(grep cpu /proc/cpuinfo | head -1 | cut -d: -f2 | sed 's/ //g') 2> /dev/null`
793       is60x=`echo $cputype | egrep "^60[0-9]e?$"`
794       if test -n "$is60x"; then
795         ACX_CHECK_CC_FLAGS(-mcpu=$cputype,m_cpu_60x,CPU_FLAGS=-mcpu=$cputype)
796       elif test "$cputype" = 750; then
797         ACX_CHECK_CC_FLAGS(-mcpu=750,m_cpu_750,CPU_FLAGS=-mcpu=750)
798       fi
799       if test -z "$CPU_FLAGS"; then
800         ACX_CHECK_CC_FLAGS(-mcpu=powerpc,m_cpu_powerpc,CPU_FLAGS=-mcpu=powerpc)
801       fi
802       if test -z "$CPU_FLAGS"; then
803         ACX_CHECK_CC_FLAGS(-mpowerpc,m_powerpc,CPU_FLAGS=-mpowerpc)
804       fi
805       ;;
806    *)
807         # -funroll-all-loops exposes a bug in altivec-enabled gcc-2.95.3
808         # on powerpc, so we only enable it on other platforms.
809         ACX_CHECK_CC_FLAGS(-funroll-all-loops,funroll_all_loops,xCFLAGS="$xCFLAGS -funroll-all-loops")
810       ;;
811    esac
814 if test -n "$CPU_FLAGS"; then
815   xCFLAGS="$xCFLAGS $CPU_FLAGS"
816   xFFLAGS="$xFFLAGS $CPU_FLAGS"
817   xASFLAGS="$xASFLAGS $CPU_FLAGS"
820 # Now check if the user provided anything special for C or fortran...
821 # Not nice to have checked everything then, but otherwise we would have
822 # to use entirely separate checks for C and fortran flags, doubling the code.
823 if test "$ac_test_CFLAGS" != "set"; then
824   CFLAGS="$xCFLAGS"
825   # Use the extra link optimization flags on e.g. irix only when
826   # we are using our own C compiler flags
827   LDFLAGS="$LDFLAGS $xLDFLAGS"
828   
829   if test -z "$CFLAGS"; then
830     echo "********************************************************************"
831     echo "* Note: We have not optimized the C compiler flags on your target  *"
832     echo "* yet, but the default CFLAGS=-O3 should be OK in most cases.      *"
833     echo "* You can override this by setting the CFLAGS environment variable.*"
834     echo "*******************************************************************"
835     CFLAGS="-O3"
836   fi
837   ACX_CHECK_CC_FLAGS(${CFLAGS}, guessed_cflags, , [
838     echo "*******************************************************************"
839     echo "* Sorry, these optimization settings don't seem to work for       *"
840     echo "* your C compiler. Use make CFLAGS=..., or edit the top Makefile. *"
841     echo "*******************************************************************"
842     CFLAGS=""
843   ])
844 else
845   echo "******************************************"
846   echo "* Using CFLAGS from environment variable *"
847   echo "******************************************"
850 if test "$enable_fortran" = "yes"; then 
851   if test "$ac_test_FFLAGS" != "set"; then
852     FFLAGS="$xFFLAGS"
853     if test -z "$FFLAGS"; then
854     echo "********************************************************************"
855     echo "* Note: We have not optimized the Fortran compiler flags on your   *"
856     echo "* target, but the default FFLAGS=-O3 should be OK in most cases.   *"
857     echo "* You can override this by setting the CFLAGS environment variable.*"
858     echo "********************************************************************"
859       FFLAGS="-O3"
860     fi
861     ACX_CHECK_F77_FLAGS(${FFLAGS}, guessed_fflags, , [
862       echo "*******************************************************************"
863       echo "* Sorry, these optimization settings don't seem to work for       *"
864       echo "* your f77 compiler. Use make FFLAGS=.., or edit the top Makefile.*"
865       echo "*******************************************************************"
866       FFLAGS=""
867     ])
868   else
869     echo "******************************************"
870     echo "* Using FFLAGS from environment variable *"
871     echo "******************************************"
872   fi
874 # Be silent for assembly flags, they are usually not important anyway
875 if test "${ASFLAGS+set}" != set; then
876   if test "${xASFLAGS+set}" != set; then
877     xASFLAGS="$CFLAGS"
878   fi
879   ASFLAGS="$xASFLAGS"
887 # Below, we include our patched version of libtool.m4, from 
888 # the libtool-1.4e beta distribution.
889 # See admin/README.patches for a list of changes!
891 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
892 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
893 ## Free Software Foundation, Inc.
894 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
896 ## This program is free software; you can redistribute it and/or modify
897 ## it under the terms of the GNU General Public License as published by
898 ## the Free Software Foundation; either version 2 of the License, or
899 ## (at your option) any later version.
901 ## This program is distributed in the hope that it will be useful, but
902 ## WITHOUT ANY WARRANTY; without even the implied warranty of
903 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
904 ## General Public License for more details.
906 ## You should have received a copy of the GNU General Public License
907 ## along with this program; if not, write to the Free Software
908 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
910 ## As a special exception to the GNU General Public License, if you
911 ## distribute this file as part of a program that contains a
912 ## configuration script generated by Autoconf, you may include it under
913 ## the same distribution terms that you use for the rest of that program.
915 # serial 47 AC_PROG_LIBTOOL
917 # AC_PROG_LIBTOOL
918 # ---------------
919 AC_DEFUN([AC_PROG_LIBTOOL],
920 [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
921 dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
922 dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
923   AC_PROVIDE_IFELSE([AC_PROG_CXX],
924     [AC_LIBTOOL_CXX],
925     [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
926   ])])
927 dnl And a similar setup for Fortran 77 support
928   AC_PROVIDE_IFELSE([AC_PROG_F77],
929     [AC_LIBTOOL_F77],
930     [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
931 ])])
933 dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
934 dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
935 dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
936   AC_PROVIDE_IFELSE([AC_PROG_GCJ],
937     [AC_LIBTOOL_GCJ],
938     [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
939       [AC_LIBTOOL_GCJ],
940       [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
941         [AC_LIBTOOL_GCJ],
942       [ifdef([AC_PROG_GCJ],
943              [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
944        ifdef([A][M_PROG_GCJ],
945              [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
946        ifdef([LT_AC_PROG_GCJ],
947              [define([LT_AC_PROG_GCJ],
948                 defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
949 ])])# AC_PROG_LIBTOOL
952 # _AC_PROG_LIBTOOL
953 # ----------------
954 AC_DEFUN([_AC_PROG_LIBTOOL],
955 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
956 AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
957 AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
958 AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
960 # This can be used to rebuild libtool when needed
961 LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
963 # Always use our own libtool.
964 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
965 AC_SUBST(LIBTOOL)dnl
967 # Prevent multiple expansion
968 define([AC_PROG_LIBTOOL], [])
969 ])# _AC_PROG_LIBTOOL
972 # AC_LIBTOOL_SETUP
973 # ----------------
974 AC_DEFUN([AC_LIBTOOL_SETUP],
975 [AC_PREREQ(2.50)dnl
976 AC_REQUIRE([AC_ENABLE_SHARED])dnl
977 AC_REQUIRE([AC_ENABLE_STATIC])dnl
978 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
979 AC_REQUIRE([AC_CANONICAL_HOST])dnl
980 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
981 AC_REQUIRE([AC_PROG_CC])dnl
982 AC_REQUIRE([AC_PROG_LD])dnl
983 AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
984 AC_REQUIRE([AC_PROG_NM])dnl
985 AC_REQUIRE([AC_PROG_LN_S])dnl
986 AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
987 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
988 AC_REQUIRE([AC_OBJEXT])dnl
989 AC_REQUIRE([AC_EXEEXT])dnl
992 AC_LIBTOOL_SYS_MAX_CMD_LEN
993 AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
994 AC_LIBTOOL_OBJDIR
996 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
997 _LT_AC_PROG_ECHO_BACKSLASH
999 case $host_os in
1000 aix3*)
1001   # AIX sometimes has problems with the GCC collect2 program.  For some
1002   # reason, if we set the COLLECT_NAMES environment variable, the problems
1003   # vanish in a puff of smoke.
1004   if test "X${COLLECT_NAMES+set}" != Xset; then
1005     COLLECT_NAMES=
1006     export COLLECT_NAMES
1007   fi
1008   ;;
1009 esac
1011 # Sed substitution that helps us do robust quoting.  It backslashifies
1012 # metacharacters that are still active within double-quoted strings.
1013 Xsed='sed -e s/^X//'
1014 [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
1016 # Same as above, but do not quote variable references.
1017 [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
1019 # Sed substitution to delay expansion of an escaped shell variable in a
1020 # double_quote_subst'ed string.
1021 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1023 # Sed substitution to avoid accidental globbing in evaled expressions
1024 no_glob_subst='s/\*/\\\*/g'
1026 # Constants:
1027 rm="rm -f"
1029 # Global variables:
1030 default_ofile=libtool
1031 can_build_shared=yes
1033 # All known linkers require a `.a' archive for static linking (except M$VC,
1034 # which needs '.lib').
1035 libext=a
1036 ltmain="$ac_aux_dir/ltmain.sh"
1037 ofile="$default_ofile"
1038 with_gnu_ld="$lt_cv_prog_gnu_ld"
1040 AC_CHECK_TOOL(RANLIB, ranlib, :)
1041 AC_CHECK_TOOL(STRIP, strip, :)
1043 old_CC="$CC"
1044 old_CFLAGS="$CFLAGS"
1046 # Set sane defaults for various variables
1047 test -z "$AR" && AR=ar
1048 test -z "$AR_FLAGS" && AR_FLAGS=cru
1049 test -z "$AS" && AS=as
1050 test -z "$CC" && CC=cc
1051 test -z "$LTCC" && LTCC=$CC
1052 test -z "$DLLTOOL" && DLLTOOL=dlltool
1053 test -z "$LD" && LD=ld
1054 test -z "$LN_S" && LN_S="ln -s"
1055 test -z "$MAGIC_CMD" && MAGIC_CMD=file
1056 test -z "$NM" && NM=nm
1057 test -z "$OBJDUMP" && OBJDUMP=objdump
1058 test -z "$RANLIB" && RANLIB=:
1059 test -z "$STRIP" && STRIP=:
1060 test -z "$ac_objext" && ac_objext=o
1062 # Determine commands to create old-style static archives.
1063 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1064 old_postinstall_cmds='chmod 644 $oldlib'
1065 old_postuninstall_cmds=
1067 if test -n "$RANLIB"; then
1068   case $host_os in
1069   openbsd*)
1070     old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
1071     ;;
1072   *)
1073     old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1074     ;;
1075   esac
1076   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1079 # Only perform the check for file, if the check method requires it
1080 case $deplibs_check_method in
1081 file_magic*)
1082   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1083     AC_PATH_MAGIC
1084   fi
1085   ;;
1086 esac
1088 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1089 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1090 enable_win32_dll=yes, enable_win32_dll=no)
1092 AC_ARG_ENABLE([libtool-lock],
1093     [AC_HELP_STRING([--disable-libtool-lock],
1094         [avoid locking (might break parallel builds)])])
1095 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1097 AC_ARG_WITH([pic],
1098     [AC_HELP_STRING([--with-pic],
1099         [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
1100     [pic_mode="$withval"],
1101     [pic_mode=default])
1102 test -z "$pic_mode" && pic_mode=default
1104 # Use C for the default configuration in the libtool script
1105 tagname=
1106 AC_LIBTOOL_LANG_C_CONFIG
1107 _LT_AC_TAGCONFIG
1108 ])# AC_LIBTOOL_SETUP
1111 # _LT_AC_SYS_COMPILER
1112 # -------------------
1113 AC_DEFUN([_LT_AC_SYS_COMPILER],
1114 [AC_REQUIRE([AC_PROG_CC])dnl
1116 # If no C compiler was specified, use CC.
1117 LTCC=${LTCC-"$CC"}
1119 # Allow CC to be a program name with arguments.
1120 set dummy $CC
1121 compiler="[$]2"
1122 ])# _LT_AC_SYS_COMPILER
1125 # _LT_AC_SYS_LIBPATH_AIX
1126 # ----------------------
1127 # Links a minimal program and checks the executable
1128 # for the system default hardcoded library path. In most cases,
1129 # this is /usr/lib:/lib, but when the MPI compilers are used
1130 # the location of the communication and MPI libs are included too.
1131 # If we don't find anything, use the default library path according
1132 # to the aix ld manual.
1133 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
1134 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1135 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
1137 # Check for a 64-bit object if we didn't find anything.
1138 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; }
1139 }'`; fi],[])
1140 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1141 ])# _LT_AC_SYS_LIBPATH_AIX
1144 # _LT_AC_PROG_ECHO_BACKSLASH
1145 # --------------------------
1146 # Add some code to the start of the generated configure script which
1147 # will find an echo command which doesn't interpret backslashes.
1148 AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
1149 [ifdef([AC_DIVERSION_NOTICE],
1150              [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1151          [AC_DIVERT_PUSH(NOTICE)])
1153 # Check that we are running under the correct shell.
1154 SHELL=${CONFIG_SHELL-/bin/sh}
1156 case X$ECHO in
1157 X*--fallback-echo)
1158   # Remove one level of quotation (which was required for Make).
1159   ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1160   ;;
1161 esac
1163 echo=${ECHO-echo}
1164 if test "X[$]1" = X--no-reexec; then
1165   # Discard the --no-reexec flag, and continue.
1166   shift
1167 elif test "X[$]1" = X--fallback-echo; then
1168   # Avoid inline document here, it may be left over
1169   :
1170 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
1171   # Yippee, $echo works!
1172   :
1173 else
1174   # Restart under the correct shell.
1175   exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1178 if test "X[$]1" = X--fallback-echo; then
1179   # used as fallback echo
1180   shift
1181   cat <<EOF
1182 [$]*
1184   exit 0
1187 # The HP-UX ksh and POSIX shell print the target directory to stdout
1188 # if CDPATH is set.
1189 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
1191 if test -z "$ECHO"; then
1192 if test "X${echo_test_string+set}" != Xset; then
1193 # find a string as large as possible, as long as the shell can cope with it
1194   for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1195     # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1196     if (echo_test_string="`eval $cmd`") 2>/dev/null &&
1197        echo_test_string="`eval $cmd`" &&
1198        (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
1199     then
1200       break
1201     fi
1202   done
1205 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1206    echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1207    test "X$echo_testing_string" = "X$echo_test_string"; then
1208   :
1209 else
1210   # The Solaris, AIX, and Digital Unix default echo programs unquote
1211   # backslashes.  This makes it impossible to quote backslashes using
1212   #   echo "$something" | sed 's/\\/\\\\/g'
1213   #
1214   # So, first we look for a working echo in the user's PATH.
1216   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1217   for dir in $PATH /usr/ucb; do
1218     IFS="$lt_save_ifs"
1219     if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1220        test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1221        echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1222        test "X$echo_testing_string" = "X$echo_test_string"; then
1223       echo="$dir/echo"
1224       break
1225     fi
1226   done
1227   IFS="$lt_save_ifs"
1229   if test "X$echo" = Xecho; then
1230     # We didn't find a better echo, so look for alternatives.
1231     if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
1232        echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
1233        test "X$echo_testing_string" = "X$echo_test_string"; then
1234       # This shell has a builtin print -r that does the trick.
1235       echo='print -r'
1236     elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
1237          test "X$CONFIG_SHELL" != X/bin/ksh; then
1238       # If we have ksh, try running configure again with it.
1239       ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1240       export ORIGINAL_CONFIG_SHELL
1241       CONFIG_SHELL=/bin/ksh
1242       export CONFIG_SHELL
1243       exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1244     else
1245       # Try using printf.
1246       echo='printf %s\n'
1247       if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1248          echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1249          test "X$echo_testing_string" = "X$echo_test_string"; then
1250         # Cool, printf works
1251         :
1252       elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1253            test "X$echo_testing_string" = 'X\t' &&
1254            echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1255            test "X$echo_testing_string" = "X$echo_test_string"; then
1256         CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1257         export CONFIG_SHELL
1258         SHELL="$CONFIG_SHELL"
1259         export SHELL
1260         echo="$CONFIG_SHELL [$]0 --fallback-echo"
1261       elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1262            test "X$echo_testing_string" = 'X\t' &&
1263            echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1264            test "X$echo_testing_string" = "X$echo_test_string"; then
1265         echo="$CONFIG_SHELL [$]0 --fallback-echo"
1266       else
1267         # maybe with a smaller string...
1268         prev=:
1270         for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1271           if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
1272           then
1273             break
1274           fi
1275           prev="$cmd"
1276         done
1278         if test "$prev" != 'sed 50q "[$]0"'; then
1279           echo_test_string=`eval $prev`
1280           export echo_test_string
1281           exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1282         else
1283           # Oops.  We lost completely, so just stick with echo.
1284           echo=echo
1285         fi
1286       fi
1287     fi
1288   fi
1292 # Copy echo and quote the copy suitably for passing to libtool from
1293 # the Makefile, instead of quoting the original, which is used later.
1294 ECHO=$echo
1295 if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1296    ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1299 AC_SUBST(ECHO)
1300 AC_DIVERT_POP
1301 ])# _LT_AC_PROG_ECHO_BACKSLASH
1304 # _LT_AC_LOCK
1305 # -----------
1306 AC_DEFUN([_LT_AC_LOCK],
1307 [AC_ARG_ENABLE([libtool-lock],
1308     [AC_HELP_STRING([--disable-libtool-lock],
1309         [avoid locking (might break parallel builds)])])
1310 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1312 # Some flags need to be propagated to the compiler or linker for good
1313 # libtool support.
1314 case $host in
1315 ia64-*-hpux*)
1316   # Find out which ABI we are using.
1317   echo 'int i;' > conftest.$ac_ext
1318   if AC_TRY_EVAL(ac_compile); then
1319     case `/usr/bin/file conftest.$ac_objext` in
1320     *ELF-32*)
1321       HPUX_IA64_MODE="32"
1322       ;;
1323     *ELF-64*)
1324       HPUX_IA64_MODE="64"
1325       ;;
1326     esac
1327   fi
1328   rm -rf conftest*
1329   ;;
1330 *-*-irix6*)
1331   # Find out which ABI we are using.
1332   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1333   if AC_TRY_EVAL(ac_compile); then
1334     case `/usr/bin/file conftest.$ac_objext` in
1335     *32-bit*)
1336       LD="${LD-ld} -32"
1337       ;;
1338     *N32*)
1339       LD="${LD-ld} -n32"
1340       ;;
1341     *64-bit*)
1342       LD="${LD-ld} -64"
1343       ;;
1344     esac
1345   fi
1346   rm -rf conftest*
1347   ;;
1349 *-*-sco3.2v5*)
1350   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1351   SAVE_CFLAGS="$CFLAGS"
1352   CFLAGS="$CFLAGS -belf"
1353   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1354     [AC_LANG_PUSH(C)
1355      AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1356      AC_LANG_POP])
1357   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1358     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1359     CFLAGS="$SAVE_CFLAGS"
1360   fi
1361   ;;
1362 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1363 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1364   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1365   AC_CHECK_TOOL(AS, as, false)
1366   AC_CHECK_TOOL(OBJDUMP, objdump, false)
1368   # recent cygwin and mingw systems supply a stub DllMain which the user
1369   # can override, but on older systems we have to supply one
1370   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
1371     [AC_TRY_LINK([],
1372       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
1373       DllMain (0, 0, 0);],
1374       [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
1376   case $host/$CC in
1377   *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
1378     # old mingw systems require "-dll" to link a DLL, while more recent ones
1379     # require "-mdll"
1380     SAVE_CFLAGS="$CFLAGS"
1381     CFLAGS="$CFLAGS -mdll"
1382     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
1383       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
1384     CFLAGS="$SAVE_CFLAGS" ;;
1385   *-*-cygwin* | *-*-pw32*)
1386     # cygwin systems need to pass --dll to the linker, and not link
1387     # crt.o which will require a WinMain@16 definition.
1388     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
1389   esac
1390   ;;
1391   ])
1392 esac
1394 need_locks="$enable_libtool_lock"
1396 ])# _LT_AC_LOCK
1399 # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1400 #               [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1401 # ----------------------------------------------------------------
1402 # Check whether the given compiler option works
1403 AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
1404 [AC_CACHE_CHECK([$1], [$2],
1405   [$2=no
1406   ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1407    save_CFLAGS="$CFLAGS"
1408    CFLAGS="$CFLAGS $3"
1409    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1410    if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then 
1411      # Modified by Erik Lindahl:
1412      # Some compilers (icc, pgcc) echo stupid stuff to stderr.
1413      # To avoid this being interpreted as errors we check the output
1414      # and only fail the test if the option is present, or one of the
1415      # words 'option' or 'flag'.
1416      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
1417         # Append any errors to the config.log.
1418         cat conftest.err 1>&AS_MESSAGE_LOG_FD
1419      else
1420        $2=yes
1421      fi
1422    fi
1423    $rm conftest*
1424    CFLAGS="$save_CFLAGS"
1427 if test x"[$]$2" = xyes; then
1428     ifelse([$5], , :, [$5])
1429 else
1430     ifelse([$6], , :, [$6])
1432 ])# AC_LIBTOOL_COMPILER_OPTION
1435 # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1436 #                          [ACTION-SUCCESS], [ACTION-FAILURE])
1437 # ------------------------------------------------------------
1438 # Check whether the given compiler option works
1439 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
1440 [AC_CACHE_CHECK([$1], [$2],
1441   [$2=no
1442    save_LDFLAGS="$LDFLAGS"
1443    LDFLAGS="$LDFLAGS $3"
1444    printf "$lt_simple_link_test_code" > conftest.$ac_ext
1445    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1446      # The compiler can only warn and ignore the option if not recognized
1447      # So say no if there are warnings
1448      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
1449        # Append any errors to the config.log.
1450        cat conftest.err 1>&AS_MESSAGE_LOG_FD
1451      else
1452        $2=yes
1453      fi
1454    fi
1455    $rm conftest*
1456    LDFLAGS="$save_LDFLAGS"
1459 if test x"[$]$2" = xyes; then
1460     ifelse([$4], , :, [$4])
1461 else
1462     ifelse([$5], , :, [$5])
1464 ])# AC_LIBTOOL_LINKER_OPTION
1467 # AC_LIBTOOL_SYS_MAX_CMD_LEN
1468 # --------------------------
1469 AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
1470 [# find the maximum length of command line arguments
1471 AC_MSG_CHECKING([the maximum length of command line arguments])
1472 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1473   i=0
1474   testring="ABCD"
1476   case $host_os in
1477   msdosdjgpp*)
1478     # On DJGPP, this test can blow up pretty badly due to problems in libc
1479     # (any single argument exceeding 2000 bytes causes a buffer overrun
1480     # during glob expansion).  Even if it were fixed, the result of this
1481     # check would be larger than it should be.
1482     lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1483     ;;
1485   gnu*)
1486     # Under GNU Hurd, this test is not required because there is
1487     # no limit to the length of command line arguments.
1488     # Libtool will interpret -1 as no limit whatsoever
1489     lt_cv_sys_max_cmd_len=-1;
1490     ;;
1492   *)
1493     # If test is not a shell built-in, we'll probably end up computing a
1494     # maximum length that is only half of the actual maximum length, but
1495     # we can't tell.
1496     while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
1497                = "XX$testring") >/dev/null 2>&1 &&
1498             new_result=`expr "X$testring" : ".*" 2>&1` &&
1499             lt_cv_sys_max_cmd_len=$new_result &&
1500             test $i != 17 # 1/2 MB should be enough
1501     do
1502       i=`expr $i + 1`
1503       testring=$testring$testring
1504     done
1505     testring=
1506     # Add a significant safety factor because C++ compilers can tack on massive
1507     # amounts of additional arguments before passing them to the linker.
1508     # It appears as though 1/2 is a usable value.
1509     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1510     ;;
1511   esac
1513 if test -n $lt_cv_sys_max_cmd_len ; then
1514   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1515 else
1516   AC_MSG_RESULT(none)
1518 ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
1521 # _LT_AC_CHECK_DLFCN
1522 # --------------------
1523 AC_DEFUN([_LT_AC_CHECK_DLFCN],
1524 [AC_CHECK_HEADERS(dlfcn.h)dnl
1525 ])# _LT_AC_CHECK_DLFCN
1528 # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1529 #                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1530 # ------------------------------------------------------------------
1531 AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
1532 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1533 if test "$cross_compiling" = yes; then :
1534   [$4]
1535 else
1536   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1537   lt_status=$lt_dlunknown
1538   cat > conftest.$ac_ext <<EOF
1539 [#line __oline__ "configure"
1540 #include "confdefs.h"
1542 #if HAVE_DLFCN_H
1543 #include <dlfcn.h>
1544 #endif
1546 #include <stdio.h>
1548 #ifdef RTLD_GLOBAL
1549 #  define LT_DLGLOBAL           RTLD_GLOBAL
1550 #else
1551 #  ifdef DL_GLOBAL
1552 #    define LT_DLGLOBAL         DL_GLOBAL
1553 #  else
1554 #    define LT_DLGLOBAL         0
1555 #  endif
1556 #endif
1558 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1559    find out it does not work in some platform. */
1560 #ifndef LT_DLLAZY_OR_NOW
1561 #  ifdef RTLD_LAZY
1562 #    define LT_DLLAZY_OR_NOW            RTLD_LAZY
1563 #  else
1564 #    ifdef DL_LAZY
1565 #      define LT_DLLAZY_OR_NOW          DL_LAZY
1566 #    else
1567 #      ifdef RTLD_NOW
1568 #        define LT_DLLAZY_OR_NOW        RTLD_NOW
1569 #      else
1570 #        ifdef DL_NOW
1571 #          define LT_DLLAZY_OR_NOW      DL_NOW
1572 #        else
1573 #          define LT_DLLAZY_OR_NOW      0
1574 #        endif
1575 #      endif
1576 #    endif
1577 #  endif
1578 #endif
1580 #ifdef __cplusplus
1581 extern "C" void exit (int);
1582 #endif
1584 void fnord() { int i=42;}
1585 int main ()
1587   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1588   int status = $lt_dlunknown;
1590   if (self)
1591     {
1592       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1593       else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1594       /* dlclose (self); */
1595     }
1597     exit (status);
1600   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1601     (./conftest; exit; ) 2>/dev/null
1602     lt_status=$?
1603     case x$lt_status in
1604       x$lt_dlno_uscore) $1 ;;
1605       x$lt_dlneed_uscore) $2 ;;
1606       x$lt_unknown|x*) $3 ;;
1607     esac
1608   else :
1609     # compilation failed
1610     $3
1611   fi
1613 rm -fr conftest*
1614 ])# _LT_AC_TRY_DLOPEN_SELF
1617 # AC_LIBTOOL_DLOPEN_SELF
1618 # -------------------
1619 AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
1620 [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1621 if test "x$enable_dlopen" != xyes; then
1622   enable_dlopen=unknown
1623   enable_dlopen_self=unknown
1624   enable_dlopen_self_static=unknown
1625 else
1626   lt_cv_dlopen=no
1627   lt_cv_dlopen_libs=
1629   case $host_os in
1630   beos*)
1631     lt_cv_dlopen="load_add_on"
1632     lt_cv_dlopen_libs=
1633     lt_cv_dlopen_self=yes
1634     ;;
1636   cygwin* | mingw* | pw32*)
1637     lt_cv_dlopen="LoadLibrary"
1638     lt_cv_dlopen_libs=
1639    ;;
1641   *)
1642     AC_CHECK_FUNC([shl_load],
1643           [lt_cv_dlopen="shl_load"],
1644       [AC_CHECK_LIB([dld], [shl_load],
1645             [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
1646         [AC_CHECK_FUNC([dlopen],
1647               [lt_cv_dlopen="dlopen"],
1648           [AC_CHECK_LIB([dl], [dlopen],
1649                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1650             [AC_CHECK_LIB([svld], [dlopen],
1651                   [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1652               [AC_CHECK_LIB([dld], [dld_link],
1653                     [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
1654               ])
1655             ])
1656           ])
1657         ])
1658       ])
1659     ;;
1660   esac
1662   if test "x$lt_cv_dlopen" != xno; then
1663     enable_dlopen=yes
1664   else
1665     enable_dlopen=no
1666   fi
1668   case $lt_cv_dlopen in
1669   dlopen)
1670     save_CPPFLAGS="$CPPFLAGS"
1671     test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1673     save_LDFLAGS="$LDFLAGS"
1674     eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1676     save_LIBS="$LIBS"
1677     LIBS="$lt_cv_dlopen_libs $LIBS"
1679     AC_CACHE_CHECK([whether a program can dlopen itself],
1680           lt_cv_dlopen_self, [dnl
1681           _LT_AC_TRY_DLOPEN_SELF(
1682             lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1683             lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1684     ])
1686     if test "x$lt_cv_dlopen_self" = xyes; then
1687       LDFLAGS="$LDFLAGS $link_static_flag"
1688       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1689           lt_cv_dlopen_self_static, [dnl
1690           _LT_AC_TRY_DLOPEN_SELF(
1691             lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1692             lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1693       ])
1694     fi
1696     CPPFLAGS="$save_CPPFLAGS"
1697     LDFLAGS="$save_LDFLAGS"
1698     LIBS="$save_LIBS"
1699     ;;
1700   esac
1702   case $lt_cv_dlopen_self in
1703   yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1704   *) enable_dlopen_self=unknown ;;
1705   esac
1707   case $lt_cv_dlopen_self_static in
1708   yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1709   *) enable_dlopen_self_static=unknown ;;
1710   esac
1712 ])# AC_LIBTOOL_DLOPEN_SELF
1715 # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
1716 # ---------------------------------
1717 # Check to see if options -c and -o are simultaneously supported by compiler
1718 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1719 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1720 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1721   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1722   [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1723    $rm -r conftest 2>/dev/null
1724    mkdir conftest
1725    cd conftest
1726    mkdir out
1727    ifelse([$1],[],[save_CFLAGS="$CFLAGS"
1728                    CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"],
1729           [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS"
1730                    CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"],
1731           [$1],[F77],[save_FFLAGS="$FFLAGS"
1732                    FFLAGS="$FFLAGS -o out/conftest2.$ac_objext"],
1733           [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS"
1734                    GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"])
1735    printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1737    # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
1738    # that will create temporary files in the current directory regardless of
1739    # the output directory.  Thus, making CWD read-only will cause this test
1740    # to fail, enabling locking or at least warning the user not to do parallel
1741    # builds.
1742    chmod -w .
1744    if (eval $ac_compile 2>out/conftest.err) && test -s out/conftest2.$ac_objext
1745    then
1746      # The compiler can only warn and ignore the option if not recognized
1747      # So say no if there are warnings
1748      if test -s out/conftest.err; then
1749        # Append any errors to the config.log.
1750        cat out/conftest.err 1>&AS_MESSAGE_LOG_FD
1751      else
1752        _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1753      fi
1754    fi
1755    ifelse([$1],[],[CFLAGS="$save_CFLAGS"],
1756           [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"],
1757           [$1],[F77],[FFLAGS="$save_FFLAGS"],
1758           [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"])
1759    chmod u+w .
1760    $rm conftest* out/*
1761    rmdir out
1762    cd ..
1763    rmdir conftest
1764    $rm conftest*
1766 ])# AC_LIBTOOL_PROG_CC_C_O
1769 # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
1770 # -----------------------------------------
1771 # Check to see if we can do hard links to lock some files if needed
1772 AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
1773 [AC_REQUIRE([_LT_AC_LOCK])dnl
1775 hard_links="nottested"
1776 if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1777   # do not overwrite the value of need_locks provided by the user
1778   AC_MSG_CHECKING([if we can lock with hard links])
1779   hard_links=yes
1780   $rm conftest*
1781   ln conftest.a conftest.b 2>/dev/null && hard_links=no
1782   touch conftest.a
1783   ln conftest.a conftest.b 2>&5 || hard_links=no
1784   ln conftest.a conftest.b 2>/dev/null && hard_links=no
1785   AC_MSG_RESULT([$hard_links])
1786   if test "$hard_links" = no; then
1787     AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1788     need_locks=warn
1789   fi
1790 else
1791   need_locks=no
1793 ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
1796 # AC_LIBTOOL_OBJDIR
1797 # -----------------
1798 AC_DEFUN([AC_LIBTOOL_OBJDIR],
1799 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1800 [rm -f .libs 2>/dev/null
1801 mkdir .libs 2>/dev/null
1802 if test -d .libs; then
1803   lt_cv_objdir=.libs
1804 else
1805   # MS-DOS does not allow filenames that begin with a dot.
1806   lt_cv_objdir=_libs
1808 rmdir .libs 2>/dev/null])
1809 objdir=$lt_cv_objdir
1810 ])# AC_LIBTOOL_OBJDIR
1813 # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
1814 # ----------------------------------------------
1815 # Check hardcoding attributes.
1816 AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
1817 [AC_MSG_CHECKING([how to hardcode library paths into programs])
1818 _LT_AC_TAGVAR(hardcode_action, $1)=
1819 if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
1820    test -n "$_LT_AC_TAGVAR(runpath_var $1)"; then
1822   # We can hardcode non-existant directories.
1823   if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
1824      # If the only mechanism to avoid hardcoding is shlibpath_var, we
1825      # have to relink, otherwise we might link with an installed library
1826      # when we should be linking with a yet-to-be-installed one
1827      ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1828      test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
1829     # Linking always hardcodes the temporary library directory.
1830     _LT_AC_TAGVAR(hardcode_action, $1)=relink
1831   else
1832     # We can link without hardcoding, and we can hardcode nonexisting dirs.
1833     _LT_AC_TAGVAR(hardcode_action, $1)=immediate
1834   fi
1835 else
1836   # We cannot hardcode anything, or else we can only hardcode existing
1837   # directories.
1838   _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
1840 AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
1842 if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
1843   # Fast installation is not supported
1844   enable_fast_install=no
1845 elif test "$shlibpath_overrides_runpath" = yes ||
1846      test "$enable_shared" = no; then
1847   # Fast installation is not necessary
1848   enable_fast_install=needless
1850 ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
1853 # AC_LIBTOOL_SYS_LIB_STRIP
1854 # ------------------------
1855 AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
1856 [striplib=
1857 old_striplib=
1858 AC_MSG_CHECKING([whether stripping libraries is possible])
1859 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
1860   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1861   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1862   AC_MSG_RESULT([yes])
1863 else
1864   AC_MSG_RESULT([no])
1866 ])# AC_LIBTOOL_SYS_LIB_STRIP
1869 # AC_LIBTOOL_SYS_DYNAMIC_LINKER
1870 # -----------------------------
1871 # PORTME Fill in your ld.so characteristics
1872 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1873 [AC_MSG_CHECKING([dynamic linker characteristics])
1874 library_names_spec=
1875 libname_spec='lib$name'
1876 soname_spec=
1877 postinstall_cmds=
1878 postuninstall_cmds=
1879 finish_cmds=
1880 finish_eval=
1881 shlibpath_var=
1882 shlibpath_overrides_runpath=unknown
1883 version_type=none
1884 dynamic_linker="$host_os ld.so"
1885 sys_lib_dlsearch_path_spec="/lib /usr/lib"
1886 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1887 need_lib_prefix=unknown
1888 hardcode_into_libs=no
1890 # when you set need_version to no, make sure it does not cause -set_version
1891 # flags to be left without arguments
1892 need_version=unknown
1894 case $host_os in
1895 aix3*)
1896   version_type=linux
1897   library_names_spec='${libname}${release}.so$versuffix $libname.a'
1898   shlibpath_var=LIBPATH
1900   # AIX 3 has no versioning support, so we append a major version to the name.
1901   soname_spec='${libname}${release}.so$major'
1902   ;;
1904 aix4* | aix5*)
1905   version_type=linux
1906   if test "$host_cpu" = ia64; then
1907     # AIX 5 supports IA64
1908     library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
1909     shlibpath_var=LD_LIBRARY_PATH
1910   else
1911     # With GCC up to 2.95.x, collect2 would create an import file
1912     # for dependence libraries.  The import file would start with
1913     # the line `#! .'.  This would cause the generated library to
1914     # depend on `.', always an invalid library.  This was fixed in
1915     # development snapshots of GCC prior to 3.0.
1916     case $host_os in
1917       aix4 | aix4.[[01]] | aix4.[[01]].*)
1918       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
1919            echo ' yes '
1920            echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
1921         :
1922       else
1923         can_build_shared=no
1924       fi
1925       ;;
1926     esac
1927     # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
1928     # soname into executable. Probably we can add versioning support to
1929     # collect2, so additional links can be useful in future.
1930     if test "$aix_use_runtimelinking" = yes; then
1931       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
1932       # instead of lib<name>.a to let people know that these are not
1933       # typical AIX shared libraries.
1934       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1935     else
1936       # We preserve .a as extension for shared libraries through AIX4.2
1937       # and later when we are not doing run time linking.
1938       library_names_spec='${libname}${release}.a $libname.a'
1939       soname_spec='${libname}${release}.so$major'
1940     fi
1941     shlibpath_var=LIBPATH
1942   fi
1943   ;;
1945 amigaos*)
1946   library_names_spec='$libname.ixlibrary $libname.a'
1947   # Create ${libname}_ixlibrary.a entries in /sys/libs.
1948   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'
1949   ;;
1951 beos*)
1952   library_names_spec='${libname}.so'
1953   dynamic_linker="$host_os ld.so"
1954   shlibpath_var=LIBRARY_PATH
1955   ;;
1957 bsdi4*)
1958   version_type=linux
1959   need_version=no
1960   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1961   soname_spec='${libname}${release}.so$major'
1962   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
1963   shlibpath_var=LD_LIBRARY_PATH
1964   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
1965   sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
1966   # the default ld.so.conf also contains /usr/contrib/lib and
1967   # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
1968   # libtool to hard-code these into programs
1969   ;;
1971 cygwin* | mingw* | pw32*)
1972   version_type=windows
1973   need_version=no
1974   need_lib_prefix=no
1975   case $GCC,$host_os in
1976   yes,cygwin*)
1977     library_names_spec='$libname.dll.a'
1978     sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
1979     soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
1980     postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
1981       dldir=$destdir/`dirname \$dlpath`~
1982       test -d \$dldir || mkdir -p \$dldir~
1983       $install_prog .libs/$dlname \$dldir/$dlname'
1984     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
1985       dlpath=$dir/\$dldll~
1986        $rm \$dlpath'
1987     ;;
1988   yes,mingw*)
1989     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
1990     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"`
1991     if echo "$sys_lib_search_path_spec" | [egrep ';[C-Z]:/' >/dev/null]; then
1992       # It is most probably a Windows format PATH printed by
1993       # mingw gcc, but we are running on Cygwin. Gcc prints its search
1994       # path with ; separators, and with drive letters. We can handle the
1995       # drive letters (cygwin fileutils understands them), so leave them,
1996       # especially as we might pass files found there to a mingw objdump,
1997       # which wouldn't understand a cygwinified path. Ahh.
1998       sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'`
1999     else
2000       sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed  -e "s/$PATH_SEPARATOR/ /g"`
2001     fi
2002     ;;
2003   yes,pw32*)
2004     library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
2005     ;;
2006   *)
2007     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
2008     ;;
2009   esac
2010   dynamic_linker='Win32 ld.exe'
2011   # FIXME: first we should search . and the directory the executable is in
2012   shlibpath_var=PATH
2013   ;;
2015 darwin* | rhapsody*)
2016   dynamic_linker="$host_os dyld"
2017   version_type=darwin
2018   need_lib_prefix=no
2019   need_version=no
2020   # FIXME: Relying on posixy $() will cause problems for
2021   #        cross-compilation, but unfortunately the echo tests do not
2022   #        yet detect zsh echo's removal of \ escapes.
2023   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)'
2024   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
2025   shlibpath_overrides_runpath=yes
2026   shlibpath_var=DYLD_LIBRARY_PATH
2027   ;;
2029 dgux*)
2030   version_type=linux
2031   need_lib_prefix=no
2032   need_version=no
2033   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2034   soname_spec='${libname}${release}.so$major'
2035   shlibpath_var=LD_LIBRARY_PATH
2036   ;;
2038 freebsd1*)
2039   dynamic_linker=no
2040   ;;
2042 freebsd*)
2043   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
2044   version_type=freebsd-$objformat
2045   case $version_type in
2046     freebsd-elf*)
2047       library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2048       need_version=no
2049       need_lib_prefix=no
2050       ;;
2051     freebsd-*)
2052       library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
2053       need_version=yes
2054       ;;
2055   esac
2056   shlibpath_var=LD_LIBRARY_PATH
2057   case $host_os in
2058   freebsd2*)
2059     shlibpath_overrides_runpath=yes
2060     ;;
2061   freebsd3.[01]* | freebsdelf3.[01]*)
2062     shlibpath_overrides_runpath=yes
2063     hardcode_into_libs=yes
2064     ;;
2065   *) # from 3.2 on
2066     shlibpath_overrides_runpath=no
2067     hardcode_into_libs=yes
2068     ;;
2069   esac
2070   ;;
2072 gnu*)
2073   version_type=linux
2074   need_lib_prefix=no
2075   need_version=no
2076   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
2077   soname_spec='${libname}${release}.so$major'
2078   shlibpath_var=LD_LIBRARY_PATH
2079   hardcode_into_libs=yes
2080   ;;
2082 hpux9* | hpux10* | hpux11*)
2083   # Give a soname corresponding to the major version so that dld.sl refuses to
2084   # link against other versions.
2085   version_type=sunos
2086   need_lib_prefix=no
2087   need_version=no
2088   if test "$host_cpu" = ia64; then
2089     hardcode_into_libs=yes
2090     dynamic_linker="$host_os dld.so"
2091     shlibpath_var=LD_LIBRARY_PATH
2092     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2093     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2094     soname_spec='${libname}${release}.so$major'
2095     if test "X$HPUX_IA64_MODE" = X32; then
2096       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2097     else
2098       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2099     fi
2100     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2101   else
2102     dynamic_linker="$host_os dld.sl"
2103     shlibpath_var=SHLIB_PATH
2104     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2105     library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
2106     soname_spec='${libname}${release}.sl$major'
2107   fi
2108   # HP-UX runs *really* slowly unless shared libraries are mode 555.
2109   postinstall_cmds='chmod 555 $lib'
2110   ;;
2112 irix5* | irix6* | nonstopux*)
2113   case $host_os in
2114     nonstopux*) version_type=nonstopux ;;
2115     *)          version_type=irix ;;
2116   esac
2117   need_lib_prefix=no
2118   need_version=no
2119   soname_spec='${libname}${release}.so$major'
2120   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
2121   case $host_os in
2122   irix5* | nonstopux*)
2123     libsuff= shlibsuff=
2124     ;;
2125   *)
2126     case $LD in # libtool.m4 will add one of these switches to LD
2127     *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
2128     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
2129     *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
2130     *) libsuff= shlibsuff= libmagic=never-match;;
2131     esac
2132     ;;
2133   esac
2134   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2135   shlibpath_overrides_runpath=no
2136   sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2137   sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2138   ;;
2140 # No shared lib support for Linux oldld, aout, or coff.
2141 linux*oldld* | linux*aout* | linux*coff*)
2142   dynamic_linker=no
2143   ;;
2145 # This must be Linux ELF.
2146 linux*)
2147   version_type=linux
2148   need_lib_prefix=no
2149   need_version=no
2150   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2151   soname_spec='${libname}${release}.so$major'
2152   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2153   shlibpath_var=LD_LIBRARY_PATH
2154   shlibpath_overrides_runpath=no
2155   # This implies no fast_install, which is unacceptable.
2156   # Some rework will be needed to allow for fast_install
2157   # before this can be enabled.
2158   hardcode_into_libs=yes
2160   # We used to test for /lib/ld.so.1 and disable shared libraries on
2161   # powerpc, because MkLinux only supported shared libraries with the
2162   # GNU dynamic linker.  Since this was broken with cross compilers,
2163   # most powerpc-linux boxes support dynamic linking these days and
2164   # people can always --disable-shared, the test was removed, and we
2165   # assume the GNU/Linux dynamic linker is in use.
2166   dynamic_linker='GNU/Linux ld.so'
2167   ;;
2169 netbsd*)
2170   version_type=sunos
2171   need_lib_prefix=no
2172   need_version=no
2173   if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2174     library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2175     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2176     dynamic_linker='NetBSD (a.out) ld.so'
2177   else
2178     library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
2179     soname_spec='${libname}${release}.so$major'
2180     dynamic_linker='NetBSD ld.elf_so'
2181   fi
2182   shlibpath_var=LD_LIBRARY_PATH
2183   shlibpath_overrides_runpath=yes
2184   hardcode_into_libs=yes
2185   ;;
2187 newsos6)
2188   version_type=linux
2189   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2190   shlibpath_var=LD_LIBRARY_PATH
2191   shlibpath_overrides_runpath=yes
2192   ;;
2194 nto-qnx)
2195   version_type=linux
2196   need_lib_prefix=no
2197   need_version=no
2198   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2199   soname_spec='${libname}${release}.so$major'
2200   shlibpath_var=LD_LIBRARY_PATH
2201   shlibpath_overrides_runpath=yes
2202   ;;
2204 openbsd*)
2205   version_type=sunos
2206   need_lib_prefix=no
2207   need_version=no
2208   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2209   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2210   shlibpath_var=LD_LIBRARY_PATH
2211   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2212     case $host_os in
2213       openbsd2.[[89]] | openbsd2.[[89]].*)
2214         shlibpath_overrides_runpath=no
2215         ;;
2216       *)
2217         shlibpath_overrides_runpath=yes
2218         ;;
2219       esac
2220   else
2221     shlibpath_overrides_runpath=yes
2222   fi
2223   ;;
2225 os2*)
2226   libname_spec='$name'
2227   need_lib_prefix=no
2228   library_names_spec='$libname.dll $libname.a'
2229   dynamic_linker='OS/2 ld.exe'
2230   shlibpath_var=LIBPATH
2231   ;;
2233 osf3* | osf4* | osf5*)
2234   version_type=osf
2235   need_lib_prefix=no
2236   need_version=no
2237   soname_spec='${libname}${release}.so'
2238   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
2239   shlibpath_var=LD_LIBRARY_PATH
2240   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2241   sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2242   ;;
2244 sco3.2v5*)
2245   version_type=osf
2246   soname_spec='${libname}${release}.so$major'
2247   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2248   shlibpath_var=LD_LIBRARY_PATH
2249   ;;
2251 solaris*)
2252   version_type=linux
2253   need_lib_prefix=no
2254   need_version=no
2255   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2256   soname_spec='${libname}${release}.so$major'
2257   shlibpath_var=LD_LIBRARY_PATH
2258   shlibpath_overrides_runpath=yes
2259   hardcode_into_libs=yes
2260   # ldd complains unless libraries are executable
2261   postinstall_cmds='chmod +x $lib'
2262   ;;
2264 sunos4*)
2265   version_type=sunos
2266   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
2267   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2268   shlibpath_var=LD_LIBRARY_PATH
2269   shlibpath_overrides_runpath=yes
2270   if test "$with_gnu_ld" = yes; then
2271     need_lib_prefix=no
2272   fi
2273   need_version=yes
2274   ;;
2276 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2277   version_type=linux
2278   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2279   soname_spec='${libname}${release}.so$major'
2280   shlibpath_var=LD_LIBRARY_PATH
2281   case $host_vendor in
2282     sni)
2283       shlibpath_overrides_runpath=no
2284       ;;
2285     motorola)
2286       need_lib_prefix=no
2287       need_version=no
2288       shlibpath_overrides_runpath=no
2289       sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2290       ;;
2291   esac
2292   ;;
2294 sysv4*MP*)
2295   if test -d /usr/nec ;then
2296     version_type=linux
2297     library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
2298     soname_spec='$libname.so.$major'
2299     shlibpath_var=LD_LIBRARY_PATH
2300   fi
2301   ;;
2303 uts4*)
2304   version_type=linux
2305   library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
2306   soname_spec='${libname}${release}.so$major'
2307   shlibpath_var=LD_LIBRARY_PATH
2308   ;;
2311   dynamic_linker=no
2312   ;;
2313 esac
2314 AC_MSG_RESULT([$dynamic_linker])
2315 test "$dynamic_linker" = no && can_build_shared=no
2316 ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
2321 # _LT_AC_TAGCONFIG
2322 # ----------------
2323 AC_DEFUN([_LT_AC_TAGCONFIG],
2325 tagnames=
2326 if test "${ac_cv_prog_cxx_g+set}" = set; then
2327   tagnames="CXX"
2329 if test "${ac_cv_prog_f77_g+set}" = set; then
2330   if test -n "$tagnames"; then
2331     tagnames="$tagnames,F77"
2332   else
2333     tagnames="F77"
2334   fi
2338 if test -f "$ltmain" && test -n "$tagnames"; then
2339   if test ! -f "${ofile}"; then
2340     AC_MSG_WARN([output file `$ofile' does not exist])
2341   fi
2343   if test -z "$LTCC"; then
2344     eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
2345     if test -z "$LTCC"; then
2346       AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
2347     else
2348       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
2349     fi
2350   fi
2352   # Extract list of available tagged configurations in $ofile.
2353   # Note that this assumes the entire list is on one line.
2354   available_tags=`grep "^available_tags=" "${ofile}" | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
2356   lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2357   for tagname in $tagnames; do
2358     IFS="$lt_save_ifs"
2359     # Check whether tagname contains only valid characters
2360     case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
2361     "") ;;
2362     *)  AC_MSG_ERROR([invalid tag name: $tagname])
2363         ;;
2364     esac
2366     if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
2367     then
2368       AC_MSG_ERROR([tag name \"$tagname\" already exists])
2369     fi
2371     # Update the list of available tags.
2372     if test -n "$tagname"; then
2373       echo appending configuration tag \"$tagname\" to $ofile
2375       case $tagname in
2376       CXX)
2377         AC_LIBTOOL_LANG_CXX_CONFIG
2378         ;;
2380       F77) 
2381         AC_LIBTOOL_LANG_F77_CONFIG
2382         ;;
2384       GCJ)
2385         AC_LIBTOOL_LANG_GCJ_CONFIG
2386         ;;
2388       RC)
2389         AC_LIBTOOL_LANG_RC_CONFIG
2390         ;;
2392       *)
2393         AC_MSG_ERROR([Unsupported tag name: $tagname])
2394         ;;
2395       esac
2397       # Append the new tag name to the list of available tags.
2398       available_tags="$available_tags $tagname"
2399     fi
2400   done
2401   IFS="$lt_save_ifs"
2403   # Now substitute the updated list of available tags.
2404   if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
2405     mv "${ofile}T" "$ofile"
2406     chmod +x "$ofile"
2407   else
2408     rm -f "${ofile}T"
2409     AC_MSG_ERROR([unable to update list of available tagged configurations.])
2410   fi
2412 ])# _LT_AC_TAGCONFIG
2415 # AC_LIBTOOL_DLOPEN
2416 # ----------------- 
2417 # enable checks for dlopen support
2418 AC_DEFUN([AC_LIBTOOL_DLOPEN],
2419  [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
2420 ])# AC_LIBTOOL_DLOPEN
2423 # AC_LIBTOOL_WIN32_DLL
2424 # --------------------
2425 # declare package support for building win32 dll's
2426 AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
2427 [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
2428 ])# AC_LIBTOOL_WIN32_DLL
2431 # AC_ENABLE_SHARED([DEFAULT])
2432 # ---------------------------
2433 # implement the --enable-shared flag
2434 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2435 AC_DEFUN([AC_ENABLE_SHARED],
2436 [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2437 AC_ARG_ENABLE([shared],
2438     [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
2439         [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
2440     [p=${PACKAGE-default}
2441     case $enableval in
2442     yes) enable_shared=yes ;;
2443     no) enable_shared=no ;;
2444     *)
2445       enable_shared=no
2446       # Look at the argument we got.  We use all the common list separators.
2447       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2448       for pkg in $enableval; do
2449         IFS="$lt_save_ifs"
2450         if test "X$pkg" = "X$p"; then
2451           enable_shared=yes
2452         fi
2453       done
2454       IFS="$lt_save_ifs"
2455       ;;
2456     esac],
2457     [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
2458 ])# AC_ENABLE_SHARED
2461 # AC_DISABLE_SHARED
2462 # -----------------
2463 #- set the default shared flag to --disable-shared
2464 AC_DEFUN([AC_DISABLE_SHARED],
2465 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2466 AC_ENABLE_SHARED(no)
2467 ])# AC_DISABLE_SHARED
2470 # AC_ENABLE_STATIC([DEFAULT])
2471 # ---------------------------
2472 # implement the --enable-static flag
2473 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2474 AC_DEFUN([AC_ENABLE_STATIC],
2475 [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2476 AC_ARG_ENABLE([static],
2477     [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2478         [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
2479     [p=${PACKAGE-default}
2480     case $enableval in
2481     yes) enable_static=yes ;;
2482     no) enable_static=no ;;
2483     *)
2484      enable_static=no
2485       # Look at the argument we got.  We use all the common list separators.
2486       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2487       for pkg in $enableval; do
2488         IFS="$lt_save_ifs"
2489         if test "X$pkg" = "X$p"; then
2490           enable_static=yes
2491         fi
2492       done
2493       IFS="$lt_save_ifs"
2494       ;;
2495     esac],
2496     [enable_static=]AC_ENABLE_STATIC_DEFAULT)
2497 ])# AC_ENABLE_STATIC
2500 # AC_DISABLE_STATIC
2501 # -----------------
2502 # set the default static flag to --disable-static
2503 AC_DEFUN([AC_DISABLE_STATIC],
2504 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2505 AC_ENABLE_STATIC(no)
2506 ])# AC_DISABLE_STATIC
2509 # AC_ENABLE_FAST_INSTALL([DEFAULT])
2510 # ---------------------------------
2511 # implement the --enable-fast-install flag
2512 # DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2513 AC_DEFUN([AC_ENABLE_FAST_INSTALL],
2514 [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
2515 AC_ARG_ENABLE([fast-install],
2516     [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2517     [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2518     [p=${PACKAGE-default}
2519     case $enableval in
2520     yes) enable_fast_install=yes ;;
2521     no) enable_fast_install=no ;;
2522     *)
2523       enable_fast_install=no
2524       # Look at the argument we got.  We use all the common list separators.
2525       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2526       for pkg in $enableval; do
2527         IFS="$lt_save_ifs"
2528         if test "X$pkg" = "X$p"; then
2529           enable_fast_install=yes
2530         fi
2531       done
2532       IFS="$lt_save_ifs"
2533       ;;
2534     esac],
2535     [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
2536 ])# AC_ENABLE_FAST_INSTALL
2539 # AC_DISABLE_FAST_INSTALL
2540 # -----------------------
2541 # set the default to --disable-fast-install
2542 AC_DEFUN([AC_DISABLE_FAST_INSTALL],
2543 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2544 AC_ENABLE_FAST_INSTALL(no)
2545 ])# AC_DISABLE_FAST_INSTALL
2548 # AC_LIBTOOL_PICMODE([MODE])
2549 # --------------------------
2550 # implement the --with-pic flag
2551 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
2552 AC_DEFUN([AC_LIBTOOL_PICMODE],
2553 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2554 pic_mode=ifelse($#,1,$1,default)
2555 ])# AC_LIBTOOL_PICMODE
2558 # AC_PATH_TOOL_PREFIX
2559 # -------------------
2560 # find a file program which can recognise shared library
2561 AC_DEFUN([AC_PATH_TOOL_PREFIX],
2562 [AC_MSG_CHECKING([for $1])
2563 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2564 [case $MAGIC_CMD in
2565 [[\\/*] |  ?:[\\/]*])
2566   lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2567   ;;
2569   lt_save_MAGIC_CMD="$MAGIC_CMD"
2570   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2571 dnl $ac_dummy forces splitting on constant user-supplied paths.
2572 dnl POSIX.2 word splitting is done only on the output of word expansions,
2573 dnl not every word.  This closes a longstanding sh security hole.
2574   ac_dummy="ifelse([$2], , $PATH, [$2])"
2575   for ac_dir in $ac_dummy; do
2576     IFS="$lt_save_ifs"
2577     test -z "$ac_dir" && ac_dir=.
2578     if test -f $ac_dir/$1; then
2579       lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2580       if test -n "$file_magic_test_file"; then
2581         case $deplibs_check_method in
2582         "file_magic "*)
2583           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
2584           MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2585           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2586             egrep "$file_magic_regex" > /dev/null; then
2587             :
2588           else
2589             cat <<EOF 1>&2
2591 *** Warning: the command libtool uses to detect shared libraries,
2592 *** $file_magic_cmd, produces output that libtool cannot recognize.
2593 *** The result is that libtool may fail to recognize shared libraries
2594 *** as such.  This will affect the creation of libtool libraries that
2595 *** depend on shared libraries, but programs linked with such libtool
2596 *** libraries will work regardless of this problem.  Nevertheless, you
2597 *** may want to report the problem to your system manager and/or to
2598 *** bug-libtool@gnu.org
2601           fi ;;
2602         esac
2603       fi
2604       break
2605     fi
2606   done
2607   IFS="$lt_save_ifs"
2608   MAGIC_CMD="$lt_save_MAGIC_CMD"
2609   ;;
2610 esac])
2611 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2612 if test -n "$MAGIC_CMD"; then
2613   AC_MSG_RESULT($MAGIC_CMD)
2614 else
2615   AC_MSG_RESULT(no)
2617 ])# AC_PATH_TOOL_PREFIX
2620 # AC_PATH_MAGIC
2621 # -------------
2622 # find a file program which can recognise a shared library
2623 AC_DEFUN([AC_PATH_MAGIC],
2624 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2625 if test -z "$lt_cv_path_MAGIC_CMD"; then
2626   if test -n "$ac_tool_prefix"; then
2627     AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2628   else
2629     MAGIC_CMD=:
2630   fi
2632 ])# AC_PATH_MAGIC
2635 # AC_PROG_LD
2636 # ----------
2637 # find the path to the GNU or non-GNU linker
2638 AC_DEFUN([AC_PROG_LD],
2639 [AC_ARG_WITH([gnu-ld],
2640     [AC_HELP_STRING([--with-gnu-ld],
2641         [assume the C compiler uses GNU ld @<:@default=no@:>@])],
2642     [test "$withval" = no || with_gnu_ld=yes],
2643     [with_gnu_ld=no])
2644 AC_REQUIRE([AC_PROG_CC])dnl
2645 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2646 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2647 ac_prog=ld
2648 if test "$GCC" = yes; then
2649   # Check if gcc -print-prog-name=ld gives a path.
2650   AC_MSG_CHECKING([for ld used by GCC])
2651   case $host in
2652   *-*-mingw*)
2653     # gcc leaves a trailing carriage return which upsets mingw
2654     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2655   *)
2656     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2657   esac
2658   case $ac_prog in
2659     # Accept absolute paths.
2660     [[\\/]]* | ?:[[\\/]]*)
2661       re_direlt='/[[^/]][[^/]]*/\.\./'
2662       # Canonicalize the path of ld
2663       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2664       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2665         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2666       done
2667       test -z "$LD" && LD="$ac_prog"
2668       ;;
2669   "")
2670     # If it fails, then pretend we aren't using GCC.
2671     ac_prog=ld
2672     ;;
2673   *)
2674     # If it is relative, then search for the first ld in PATH.
2675     with_gnu_ld=unknown
2676     ;;
2677   esac
2678 elif test "$with_gnu_ld" = yes; then
2679   AC_MSG_CHECKING([for GNU ld])
2680 else
2681   AC_MSG_CHECKING([for non-GNU ld])
2683 AC_CACHE_VAL(lt_cv_path_LD,
2684 [if test -z "$LD"; then
2685   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2686   for ac_dir in $PATH; do
2687     IFS="$lt_save_ifs"
2688     test -z "$ac_dir" && ac_dir=.
2689     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2690       lt_cv_path_LD="$ac_dir/$ac_prog"
2691       # Check to see if the program is GNU ld.  I'd rather use --version,
2692       # but apparently some GNU ld's only accept -v.
2693       # Break only if it was the GNU/non-GNU ld that we prefer.
2694       if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2695         test "$with_gnu_ld" != no && break
2696       else
2697         test "$with_gnu_ld" != yes && break
2698       fi
2699     fi
2700   done
2701   IFS="$lt_save_ifs"
2702 else
2703   lt_cv_path_LD="$LD" # Let the user override the test with a path.
2704 fi])
2705 LD="$lt_cv_path_LD"
2706 if test -n "$LD"; then
2707   AC_MSG_RESULT($LD)
2708 else
2709   AC_MSG_RESULT(no)
2711 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2712 AC_PROG_LD_GNU
2713 ])# AC_PROG_LD
2716 # AC_PROG_LD_GNU
2717 # --------------
2718 AC_DEFUN([AC_PROG_LD_GNU],
2719 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2720 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2721 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2722   lt_cv_prog_gnu_ld=yes
2723 else
2724   lt_cv_prog_gnu_ld=no
2725 fi])
2726 with_gnu_ld=$lt_cv_prog_gnu_ld
2727 ])# AC_PROG_LD_GNU
2730 # AC_PROG_LD_RELOAD_FLAG
2731 # ----------------------
2732 # find reload flag for linker
2733 #   -- PORTME Some linkers may need a different reload flag.
2734 AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
2735 [AC_CACHE_CHECK([for $LD option to reload object files],
2736   lt_cv_ld_reload_flag,
2737   [lt_cv_ld_reload_flag='-r'])
2738 reload_flag=$lt_cv_ld_reload_flag
2739 case $reload_flag in
2740 "" | " "*) ;;
2741 *) reload_flag=" $reload_flag" ;;
2742 esac
2743 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2744 ])# AC_PROG_LD_RELOAD_FLAG
2747 # AC_DEPLIBS_CHECK_METHOD
2748 # -----------------------
2749 # how to check for library dependencies
2750 #  -- PORTME fill in with the dynamic library characteristics
2751 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2752 [AC_CACHE_CHECK([how to recognise dependant libraries],
2753 lt_cv_deplibs_check_method,
2754 [lt_cv_file_magic_cmd='$MAGIC_CMD'
2755 lt_cv_file_magic_test_file=
2756 lt_cv_deplibs_check_method='unknown'
2757 # Need to set the preceding variable on all platforms that support
2758 # interlibrary dependencies.
2759 # 'none' -- dependencies not supported.
2760 # `unknown' -- same as none, but documents that we really don't know.
2761 # 'pass_all' -- all dependencies passed with no checks.
2762 # 'test_compile' -- check by making test program.
2763 # 'file_magic [[regex]]' -- check by looking for files in library path
2764 # which responds to the $file_magic_cmd with a given egrep regex.
2765 # If you have `file' or equivalent on your system and you're not sure
2766 # whether `pass_all' will *always* work, you probably want this one.
2768 case $host_os in
2769 aix4* | aix5*)
2770   lt_cv_deplibs_check_method=pass_all
2771   ;;
2773 beos*)
2774   lt_cv_deplibs_check_method=pass_all
2775   ;;
2777 bsdi4*)
2778   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2779   lt_cv_file_magic_cmd='/usr/bin/file -L'
2780   lt_cv_file_magic_test_file=/shlib/libc.so
2781   ;;
2783 cygwin* | mingw* | pw32*)
2784   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2785   lt_cv_file_magic_cmd='$OBJDUMP -f'
2786   ;;
2788 darwin* | rhapsody*)
2789   lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
2790   lt_cv_file_magic_cmd='/usr/bin/file -L'
2791   case "$host_os" in
2792   rhapsody* | darwin1.[[012]])
2793     lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
2794     ;;
2795   *) # Darwin 1.3 on
2796     lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
2797     ;;
2798   esac
2799   ;;
2801 freebsd*)
2802   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2803     case $host_cpu in
2804     i*86 )
2805       # Not sure whether the presence of OpenBSD here was a mistake.
2806       # Let's accept both of them until this is cleared up.
2807       lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
2808       lt_cv_file_magic_cmd=/usr/bin/file
2809       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
2810       ;;
2811     esac
2812   else
2813     lt_cv_deplibs_check_method=pass_all
2814   fi
2815   ;;
2817 gnu*)
2818   lt_cv_deplibs_check_method=pass_all
2819   ;;
2821 hpux10.20* | hpux11*)
2822   lt_cv_file_magic_cmd=/usr/bin/file
2823   if test "$host_cpu" = ia64; then
2824     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
2825     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
2826   else
2827     lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
2828     lt_cv_file_magic_test_file=/usr/lib/libc.sl
2829   fi
2830   ;;
2832 irix5* | irix6* | nonstopux*)
2833   case $host_os in
2834   irix5* | nonstopux*)
2835     # this will be overridden with pass_all, but let us keep it just in case
2836     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
2837     ;;
2838   *)
2839     case $LD in
2840     *-32|*"-32 ") libmagic=32-bit;;
2841     *-n32|*"-n32 ") libmagic=N32;;
2842     *-64|*"-64 ") libmagic=64-bit;;
2843     *) libmagic=never-match;;
2844     esac
2845     # this will be overridden with pass_all, but let us keep it just in case
2846     lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
2847     ;;
2848   esac
2849   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
2850   lt_cv_deplibs_check_method=pass_all
2851   ;;
2853 # This must be Linux ELF.
2854 linux*)
2855   case $host_cpu in
2856   alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
2857     lt_cv_deplibs_check_method=pass_all ;;
2858   *)
2859     # glibc up to 2.1.1 does not perform some relocations on ARM
2860     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
2861   esac
2862   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
2863   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
2864   ;;
2866 netbsd*)
2867   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2868     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
2869   else
2870     lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
2871   fi
2872   ;;
2874 newos6*)
2875   lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
2876   lt_cv_file_magic_cmd=/usr/bin/file
2877   lt_cv_file_magic_test_file=/usr/lib/libnls.so
2878   ;;
2880 nto-qnx)
2881   lt_cv_deplibs_check_method=unknown
2882   ;;
2884 openbsd*)
2885   lt_cv_file_magic_cmd=/usr/bin/file
2886   lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
2887   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2888     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
2889   else
2890     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
2891   fi
2892   ;;
2894 osf3* | osf4* | osf5*)
2895   # this will be overridden with pass_all, but let us keep it just in case
2896   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
2897   lt_cv_file_magic_test_file=/shlib/libc.so
2898   lt_cv_deplibs_check_method=pass_all
2899   ;;
2901 sco3.2v5*)
2902   lt_cv_deplibs_check_method=pass_all
2903   ;;
2905 solaris*)
2906   lt_cv_deplibs_check_method=pass_all
2907   lt_cv_file_magic_test_file=/lib/libc.so
2908   ;;
2910 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
2911   case $host_vendor in
2912   motorola)
2913     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]]'
2914     lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
2915     ;;
2916   ncr)
2917     lt_cv_deplibs_check_method=pass_all
2918     ;;
2919   sequent)
2920     lt_cv_file_magic_cmd='/bin/file'
2921     lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
2922     ;;
2923   sni)
2924     lt_cv_file_magic_cmd='/bin/file'
2925     lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
2926     lt_cv_file_magic_test_file=/lib/libc.so
2927     ;;
2928   esac
2929   ;;
2931 sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
2932   lt_cv_deplibs_check_method=pass_all
2933   ;;
2934 esac
2936 file_magic_cmd=$lt_cv_file_magic_cmd
2937 deplibs_check_method=$lt_cv_deplibs_check_method
2938 test -z "$deplibs_check_method" && deplibs_check_method=unknown
2939 ])# AC_DEPLIBS_CHECK_METHOD
2942 # AC_PROG_NM
2943 # ----------
2944 # find the path to a BSD-compatible name lister
2945 AC_DEFUN([AC_PROG_NM],
2946 [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
2947 [if test -n "$NM"; then
2948   # Let the user override the test.
2949   lt_cv_path_NM="$NM"
2950 else
2951   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2952   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2953     IFS="$lt_save_ifs"
2954     test -z "$ac_dir" && ac_dir=.
2955     tmp_nm="$ac_dir/${ac_tool_prefix}nm"
2956     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
2957       # Check to see if the nm accepts a BSD-compat flag.
2958       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2959       #   nm: unknown option "B" ignored
2960       # Tru64's nm complains that /dev/null is an invalid object file
2961       if ("$tmp_nm" -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
2962         lt_cv_path_NM="$tmp_nm -B"
2963         break
2964       elif ("$tmp_nm" -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2965         lt_cv_path_NM="$tmp_nm -p"
2966         break
2967       else
2968         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
2969         continue # so that we can try to find one that supports BSD flags
2970       fi
2971     fi
2972   done
2973   IFS="$lt_save_ifs"
2974   test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
2975 fi])
2976 NM="$lt_cv_path_NM"
2977 ])# AC_PROG_NM
2980 # AC_CHECK_LIBM
2981 # -------------
2982 # check for math library
2983 AC_DEFUN([AC_CHECK_LIBM],
2984 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2985 LIBM=
2986 case $host in
2987 *-*-beos* | *-*-cygwin* | *-*-pw32*)
2988   # These system don't have libm
2989   ;;
2990 *-ncr-sysv4.3*)
2991   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
2992   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
2993   ;;
2995   AC_CHECK_LIB(m, main, LIBM="-lm")
2996   ;;
2997 esac
2998 ])# AC_CHECK_LIBM
3001 # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
3002 # -----------------------------------
3003 # sets LIBLTDL to the link flags for the libltdl convenience library and
3004 # LTDLINCL to the include flags for the libltdl header and adds
3005 # --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL
3006 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
3007 # DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will
3008 # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
3009 # '${top_srcdir}/' (note the single quotes!).  If your package is not
3010 # flat and you're not using automake, define top_builddir and
3011 # top_srcdir appropriately in the Makefiles.
3012 AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3013 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3014   case $enable_ltdl_convenience in
3015   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3016   "") enable_ltdl_convenience=yes
3017       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3018   esac
3019   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3020   LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3021   # For backwards non-gettext consistent compatibility...
3022   INCLTDL="$LTDLINCL"
3023 ])# AC_LIBLTDL_CONVENIENCE
3026 # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
3027 # -----------------------------------
3028 # sets LIBLTDL to the link flags for the libltdl installable library and
3029 # LTDLINCL to the include flags for the libltdl header and adds
3030 # --enable-ltdl-install to the configure arguments.  Note that LIBLTDL
3031 # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If
3032 # DIRECTORY is not provided and an installed libltdl is not found, it is
3033 # assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'
3034 # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
3035 # quotes!).  If your package is not flat and you're not using automake,
3036 # define top_builddir and top_srcdir appropriately in the Makefiles.
3037 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3038 AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3039 [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3040   AC_CHECK_LIB(ltdl, main,
3041   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3042   [if test x"$enable_ltdl_install" = xno; then
3043      AC_MSG_WARN([libltdl not installed, but installation disabled])
3044    else
3045      enable_ltdl_install=yes
3046    fi
3047   ])
3048   if test x"$enable_ltdl_install" = x"yes"; then
3049     ac_configure_args="$ac_configure_args --enable-ltdl-install"
3050     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3051     LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3052   else
3053     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3054     LIBLTDL="-lltdl"
3055     LTDLINCL=
3056   fi
3057   # For backwards non-gettext consistent compatibility...
3058   INCLTDL="$LTDLINCL"
3059 ])# AC_LIBLTDL_INSTALLABLE
3062 # If this macro is not defined by Autoconf, define it here.
3063 ifdef([AC_PROVIDE_IFELSE],
3064       [],
3065       [define([AC_PROVIDE_IFELSE],
3066               [ifdef([AC_PROVIDE_$1],
3067                      [$2], [$3])])])
3070 # AC_LIBTOOL_CXX
3071 # --------------
3072 # enable support for C++ libraries
3073 AC_DEFUN([AC_LIBTOOL_CXX],
3074 [AC_REQUIRE([_LT_AC_LANG_CXX])
3075 ])# AC_LIBTOOL_CXX
3078 # _LT_AC_LANG_CXX
3079 # ---------------
3080 AC_DEFUN([_LT_AC_LANG_CXX],
3081 [AC_REQUIRE([AC_PROG_CXX])
3082 AC_REQUIRE([AC_PROG_CXXCPP])
3083 ])# _LT_AC_LANG_CXX
3086 # AC_LIBTOOL_F77
3087 # --------------
3088 # enable support for Fortran 77 libraries
3089 AC_DEFUN([AC_LIBTOOL_F77],
3090 [AC_REQUIRE([_LT_AC_LANG_F77])
3091 ])# AC_LIBTOOL_F77
3094 # _LT_AC_LANG_F77
3095 # ---------------
3096 AC_DEFUN([_LT_AC_LANG_F77],
3097 [AC_REQUIRE([AC_PROG_F77])
3098 ])# _LT_AC_LANG_F77
3101 # AC_LIBTOOL_GCJ
3102 # --------------
3103 # enable support for GCJ libraries
3104 AC_DEFUN([AC_LIBTOOL_GCJ],
3105 [AC_REQUIRE([_LT_AC_LANG_GCJ])
3106 ])# AC_LIBTOOL_GCJ
3109 # _LT_AC_LANG_GCJ
3110 # ---------------
3111 AC_DEFUN([_LT_AC_LANG_GCJ],
3112 [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
3113   [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
3114     [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
3115       [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
3116          [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
3117            [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
3118 ])# _LT_AC_LANG_GCJ
3121 # AC_LIBTOOL_RC
3122 # --------------
3123 # enable support for Windows resource files
3124 AC_DEFUN([AC_LIBTOOL_RC],
3125 [AC_REQUIRE([AC_PROG_RC])
3126 ])# AC_LIBTOOL_RC
3129 # AC_LIBTOOL_LANG_C_CONFIG
3130 # ------------------------
3131 # Ensure that the configuration vars for the C compiler are
3132 # suitably defined.  Those variables are subsequently used by
3133 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3134 AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
3135 AC_DEFUN([_LT_AC_LANG_C_CONFIG],
3136 [lt_save_CC="$CC"
3137 AC_LANG_PUSH(C)
3139 # Source file extension for C test sources.
3140 ac_ext=c
3142 # Object file extension for compiled C test sources.
3143 objext=o
3144 _LT_AC_TAGVAR(objext, $1)=$objext
3146 # Code to be used in simple compile tests
3147 lt_simple_compile_test_code="int some_variable = 0;\n"
3149 # Code to be used in simple link tests
3150 lt_simple_link_test_code='main(){return(0);}\n'
3152 _LT_AC_SYS_COMPILER
3155 # Check for any special shared library compilation flags.
3157 _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
3158 if test "$GCC" = no; then
3159   case $host_os in
3160   sco3.2v5*)
3161     _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
3162     ;;
3163   esac
3165 if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
3166   AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
3167   if echo "$old_CC $old_CFLAGS " | egrep -e "[[         ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[      ]]" >/dev/null; then :
3168   else
3169     AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
3170     _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
3171   fi
3176 # Check to make sure the static flag actually works.
3178 AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
3179   _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
3180   $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
3181   [],
3182   [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
3185 ## CAVEAT EMPTOR:
3186 ## There is no encapsulation within the following macros, do not change
3187 ## the running order or otherwise move them around unless you know exactly
3188 ## what you are doing...
3189 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
3190 AC_LIBTOOL_PROG_COMPILER_PIC($1)
3191 AC_LIBTOOL_PROG_CC_C_O($1)
3192 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3193 AC_LIBTOOL_PROG_LD_SHLIBS($1)
3194 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3195 AC_LIBTOOL_SYS_LIB_STRIP
3196 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3197 AC_LIBTOOL_DLOPEN_SELF($1)
3199 # Report which librarie types wil actually be built
3200 AC_MSG_CHECKING([if libtool supports shared libraries])
3201 AC_MSG_RESULT([$can_build_shared])
3203 AC_MSG_CHECKING([whether to build shared libraries])
3204 test "$can_build_shared" = "no" && enable_shared=no
3206 # On AIX, shared libraries and static libraries use the same namespace, and
3207 # are all built from PIC.
3208 case "$host_os" in
3209 aix3*)
3210   test "$enable_shared" = yes && enable_static=no
3211   if test -n "$RANLIB"; then
3212     archive_cmds="$archive_cmds~\$RANLIB \$lib"
3213     postinstall_cmds='$RANLIB $lib'
3214   fi
3215   ;;
3217 aix4*)
3218   if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3219     test "$enable_shared" = yes && enable_static=no
3220   fi
3221   ;;
3222 esac
3223 AC_MSG_RESULT([$enable_shared])
3225 AC_MSG_CHECKING([whether to build static libraries])
3226 # Make sure either enable_shared or enable_static is yes.
3227 test "$enable_shared" = yes || enable_static=yes
3228 AC_MSG_RESULT([$enable_static])
3230 AC_LIBTOOL_CONFIG($1)
3232 AC_LANG_POP
3233 CC="$lt_save_CC"
3234 ])# AC_LIBTOOL_LANG_C_CONFIG
3237 # AC_LIBTOOL_LANG_CXX_CONFIG
3238 # --------------------------
3239 # Ensure that the configuration vars for the C compiler are
3240 # suitably defined.  Those variables are subsequently used by
3241 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3242 AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
3243 AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
3244 [AC_LANG_PUSH(C++)
3245 AC_REQUIRE([AC_PROG_CXX])
3246 AC_REQUIRE([AC_PROG_CXXCPP])
3248 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3249 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
3250 _LT_AC_TAGVAR(always_export_symbols, $1)=no
3251 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
3252 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
3253 _LT_AC_TAGVAR(hardcode_direct, $1)=no
3254 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
3255 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3256 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
3257 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
3258 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
3259 _LT_AC_TAGVAR(no_undefined_flag, $1)=
3260 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3262 # Dependencies to place before and after the object being linked:
3263 _LT_AC_TAGVAR(predep_objects, $1)=
3264 _LT_AC_TAGVAR(postdep_objects, $1)=
3265 _LT_AC_TAGVAR(predeps, $1)=
3266 _LT_AC_TAGVAR(postdeps, $1)=
3267 _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
3269 # Source file extension for C test sources.
3270 ac_ext=cc
3272 # Object file extension for compiled C test sources.
3273 objext=o
3274 _LT_AC_TAGVAR(objext, $1)=$objext
3276 # Code to be used in simple compile tests
3277 lt_simple_compile_test_code="int some_variable = 0;\n"
3279 # Code to be used in simple link tests
3280 lt_simple_link_test_code='int main(int char *[]) { return(0); }\n'
3282 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
3283 _LT_AC_SYS_COMPILER
3285 # Allow CC to be a program name with arguments.
3286 lt_save_CC="$CC"
3287 CC=${CXX-"c++"}
3288 set dummy $CC
3289 compiler="[$]2"
3290 _LT_AC_TAGVAR(compiler, $1)=$CC
3291 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
3293 # We don't want -fno-exception wen compiling C++ code, so set the
3294 # no_builtin_flag separately
3295 if test "$GXX" = yes; then
3296   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3297 else
3298   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3301 if test "$GXX" = yes; then
3302   # Set up default GNU C++ configuration
3304   # Check if GNU C++ uses GNU ld as the underlying linker, since the
3305   # archiving commands below assume that GNU ld is being used.
3306   if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
3307       egrep 'GNU ld' > /dev/null; then
3308     with_gnu_ld=yes
3310     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3311     _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'
3313     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3314     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3316     # If archive_cmds runs LD, not CC, wlarc should be empty
3317     # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
3318     #     investigate it a little bit more. (MM)
3319     wlarc='${wl}'
3321     # ancient GNU ld didn't support --whole-archive et. al.
3322     if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
3323         egrep 'no-whole-archive' > /dev/null; then
3324       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3325     else
3326       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3327     fi
3328   else
3329     with_gnu_ld=no
3330     wlarc=
3332     # A generic and very simple default shared library creation
3333     # command for GNU C++ for the case where it uses the native
3334     # linker, instead of GNU ld.  If possible, this setting should
3335     # overridden to take advantage of the native linker features on
3336     # the platform it is being used on.
3337     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3338   fi
3340   # Commands to make compiler produce verbose output that lists
3341   # what "hidden" libraries, object files and flags are used when
3342   # linking a shared library.
3343   output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
3345 else
3346   GXX=no
3347   with_gnu_ld=no
3348   wlarc=
3351 # PORTME: fill in a description of your system's C++ link characteristics
3352 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
3353 _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3354 case $host_os in
3355   aix3*)
3356     # FIXME: insert proper C++ library support
3357     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3358     ;;
3359   aix4* | aix5*)
3360     if test "$host_cpu" = ia64; then
3361       # On IA64, the linker does run time linking by default, so we don't
3362       # have to do anything special.
3363       aix_use_runtimelinking=no
3364       exp_sym_flag='-Bexport'
3365       no_entry_flag=""
3366     else
3367       aix_use_runtimelinking=no
3369       # Test if we are trying to use run time linking or normal
3370       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
3371       # need to do runtime linking.
3372       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
3373         for ld_flag in $LDFLAGS; do
3374           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
3375             aix_use_runtimelinking=yes
3376             break
3377           fi
3378         done
3379       esac
3381       exp_sym_flag='-bexport'
3382       no_entry_flag='-bnoentry'
3383     fi
3385     # When large executables or shared objects are built, AIX ld can
3386     # have problems creating the table of contents.  If linking a library
3387     # or program results in "error TOC overflow" add -mminimal-toc to
3388     # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
3389     # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
3391     _LT_AC_TAGVAR(archive_cmds, $1)=''
3392     _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3393     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3394     _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3396     if test "$GXX" = yes; then
3397       case $host_os in aix4.[012]|aix4.[012].*)
3398       # We only want to do this on AIX 4.2 and lower, the check
3399       # below for broken collect2 doesn't work under 4.3+
3400         collect2name=`${CC} -print-prog-name=collect2`
3401         if test -f "$collect2name" && \
3402            strings "$collect2name" | grep resolve_lib_name >/dev/null
3403         then
3404           # We have reworked collect2
3405           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3406         else
3407           # We have old collect2
3408           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
3409           # It fails to find uninstalled libraries when the uninstalled
3410           # path is not listed in the libpath.  Setting hardcode_minus_L
3411           # to unsupported forces relinking
3412           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
3413           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3414           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3415         fi
3416       esac
3417       shared_flag='-shared'
3418     else
3419       # not using gcc
3420       if test "$host_cpu" = ia64; then
3421         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
3422         # chokes on -Wl,-G. The following line is correct:
3423         shared_flag='-G'
3424       else
3425         if test "$aix_use_runtimelinking" = yes; then
3426           shared_flag='${wl}-G'
3427         else
3428           shared_flag='${wl}-bM:SRE'
3429         fi
3430       fi
3431     fi
3433     # It seems that -bexpall does not export symbols beginning with
3434     # underscore (_), so it is better to generate a list of symbols to export.
3435     _LT_AC_TAGVAR(always_export_symbols, $1)=yes
3436     if test "$aix_use_runtimelinking" = yes; then
3437       # Warning - without using the other runtime loading flags (-brtl),
3438       # -berok will link without error, but may produce a broken library.
3439       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
3440       # Determine the default libpath from the value encoded in an empty executable.
3441       _LT_AC_SYS_LIBPATH_AIX
3442       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3444       _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"
3445      else
3446       if test "$host_cpu" = ia64; then
3447         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
3448         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
3449         _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"
3450       else
3451         # Determine the default libpath from the value encoded in an empty executable.
3452         _LT_AC_SYS_LIBPATH_AIX
3453         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3454         # Warning - without using the other run time loading flags,
3455         # -berok will link without error, but may produce a broken library.
3456         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
3457         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
3458         # -bexpall does not export symbols beginning with underscore (_)
3459         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
3460         # Exported symbols can be pulled into shared objects from archives
3461         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
3462         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
3463         # This is similar to how AIX traditionally builds it's shared libraries.
3464         _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'
3465       fi
3466     fi
3467     ;;
3468   chorus*)
3469     case $cc_basename in
3470       *)
3471         # FIXME: insert proper C++ library support
3472         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3473         ;;
3474     esac
3475     ;;
3476   dgux*)
3477     case $cc_basename in
3478       ec++)
3479         # FIXME: insert proper C++ library support
3480         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3481         ;;
3482       ghcx)
3483         # Green Hills C++ Compiler
3484         # FIXME: insert proper C++ library support
3485         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3486         ;;
3487       *)
3488         # FIXME: insert proper C++ library support
3489         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3490         ;;
3491     esac
3492     ;;
3493   freebsd[12]*)
3494     # C++ shared libraries reported to be fairly broken before switch to ELF
3495     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3496     ;;
3497   freebsd-elf*)
3498     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3499     ;;
3500   freebsd*)
3501     # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
3502     # conventions
3503     _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3504     ;;
3505   gnu*)
3506     ;;
3507   hpux*)
3508     if test $with_gnu_ld = no; then
3509       if test "$host_cpu" = ia64; then
3510         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3511       else
3512         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3513         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3514         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3515       fi
3516     fi
3517     if test "$host_cpu" = ia64; then
3518       _LT_AC_TAGVAR(hardcode_direct, $1)=no
3519       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3520     else
3521       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3522     fi
3523     _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3524                                             # but as the default
3525                                             # location of the library.
3527     case $cc_basename in
3528       CC)
3529         # FIXME: insert proper C++ library support
3530         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3531         ;;
3532       aCC)
3533         case $host_os in
3534         hpux9*)
3535           _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'
3536           ;;
3537         *)
3538           if test "$host_cpu" = ia64; then
3539             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
3540           else
3541             _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'
3542           fi
3543           ;;
3544         esac
3545         # Commands to make compiler produce verbose output that lists
3546         # what "hidden" libraries, object files and flags are used when
3547         # linking a shared library.
3548         #
3549         # There doesn't appear to be a way to prevent this compiler from
3550         # explicitly linking system object files so we need to strip them
3551         # from the output so that they don't get included in the library
3552         # dependencies.
3553         output_verbose_link_cmd='templist=`($CC -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'
3554         ;;
3555       *)
3556         if test "$GXX" = yes; then
3557           if test $with_gnu_ld = no; then
3558             case $host_os in
3559             hpux9*)
3560               _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'
3561               ;;
3562             *)
3563               if test "$host_cpu" = ia64; then
3564                 _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
3565               else
3566                 _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'
3567               fi
3568               ;;
3569             esac
3570           fi
3571         else
3572           # FIXME: insert proper C++ library support
3573           _LT_AC_TAGVAR(ld_shlibs, $1)=no
3574         fi
3575         ;;
3576     esac
3577     ;;
3578   irix5* | irix6*)
3579     case $cc_basename in
3580       CC)
3581         # SGI C++
3582         _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'
3584         # Archives containing C++ object files must be created using
3585         # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
3586         # necessary to make sure instantiated templates are included
3587         # in the archive.
3588         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
3589         ;;
3590       *)
3591         if test "$GXX" = yes; then
3592           if test "$with_gnu_ld" = no; then
3593             _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'
3594           else
3595             _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'
3596           fi
3597         fi
3598         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3599         ;;
3600     esac
3601     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3602     _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3603     ;;
3604   linux*)
3605     case $cc_basename in
3606       KCC)
3607         # Kuck and Associates, Inc. (KAI) C++ Compiler
3609         # KCC will only create a shared library if the output file
3610         # ends with ".so" (or ".sl" for HP-UX), so rename the library
3611         # to its proper name (with version) after linking.
3612         _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'
3613         _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'
3615         # Commands to make compiler produce verbose output that lists
3616         # what "hidden" libraries, object files and flags are used when
3617         # linking a shared library.
3618         #
3619         # There doesn't appear to be a way to prevent this compiler from
3620         # explicitly linking system object files so we need to strip them
3621         # from the output so that they don't get included in the library
3622         # dependencies.
3623         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'
3625         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
3626         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3628         # Archives containing C++ object files must be created using
3629         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
3630         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3631         ;;
3632       cxx)
3633         # Compaq C++
3634         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3635         _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'
3637         runpath_var=LD_RUN_PATH
3638         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3639         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3641         # Commands to make compiler produce verbose output that lists
3642         # what "hidden" libraries, object files and flags are used when
3643         # linking a shared library.
3644         #
3645         # There doesn't appear to be a way to prevent this compiler from
3646         # explicitly linking system object files so we need to strip them
3647         # from the output so that they don't get included in the library
3648         # dependencies.
3649         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'
3650         ;;
3651     esac
3652     ;;
3653   lynxos*)
3654     # FIXME: insert proper C++ library support
3655     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3656     ;;
3657   m88k*)
3658     # FIXME: insert proper C++ library support
3659     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3660     ;;
3661   mvs*)
3662     case $cc_basename in
3663       cxx)
3664         # FIXME: insert proper C++ library support
3665         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3666         ;;
3667       *)
3668         # FIXME: insert proper C++ library support
3669         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3670         ;;
3671     esac
3672     ;;
3673   netbsd*)
3674     # NetBSD uses g++ - do we need to do anything?
3675     ;;
3676   osf3*)
3677     case $cc_basename in
3678       KCC)
3679         # Kuck and Associates, Inc. (KAI) C++ Compiler
3681         # KCC will only create a shared library if the output file
3682         # ends with ".so" (or ".sl" for HP-UX), so rename the library
3683         # to its proper name (with version) after linking.
3684         _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'
3686         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3687         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3689         # Archives containing C++ object files must be created using
3690         # "CC -Bstatic", where "CC" is the KAI C++ compiler.
3691         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3693         ;;
3694       RCC)
3695         # Rational C++ 2.4.1
3696         # FIXME: insert proper C++ library support
3697         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3698         ;;
3699       cxx)
3700         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3701         _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'
3703         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3704         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3706         # Commands to make compiler produce verbose output that lists
3707         # what "hidden" libraries, object files and flags are used when
3708         # linking a shared library.
3709         #
3710         # There doesn't appear to be a way to prevent this compiler from
3711         # explicitly linking system object files so we need to strip them
3712         # from the output so that they don't get included in the library
3713         # dependencies.
3714         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'
3715         ;;
3716       *)
3717         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3718           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3719           _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'
3721           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3722           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3724           # Commands to make compiler produce verbose output that lists
3725           # what "hidden" libraries, object files and flags are used when
3726           # linking a shared library.
3727           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
3729         else
3730           # FIXME: insert proper C++ library support
3731           _LT_AC_TAGVAR(ld_shlibs, $1)=no
3732         fi
3733         ;;
3734     esac
3735     ;;
3736   osf4* | osf5*)
3737     case $cc_basename in
3738       KCC)
3739         # Kuck and Associates, Inc. (KAI) C++ Compiler
3741         # KCC will only create a shared library if the output file
3742         # ends with ".so" (or ".sl" for HP-UX), so rename the library
3743         # to its proper name (with version) after linking.
3744         _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'
3746         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3747         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3749         # Archives containing C++ object files must be created using
3750         # the KAI C++ compiler.
3751         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
3752         ;;
3753       RCC)
3754         # Rational C++ 2.4.1
3755         # FIXME: insert proper C++ library support
3756         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3757         ;;
3758       cxx)
3759         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
3760         _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'
3761         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
3762           echo "-hidden">> $lib.exp~
3763           $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~
3764           $rm $lib.exp'
3766         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3767         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3769         # Commands to make compiler produce verbose output that lists
3770         # what "hidden" libraries, object files and flags are used when
3771         # linking a shared library.
3772         #
3773         # There doesn't appear to be a way to prevent this compiler from
3774         # explicitly linking system object files so we need to strip them
3775         # from the output so that they don't get included in the library
3776         # dependencies.
3777         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'
3778         ;;
3779       *)
3780         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3781           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3782          _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'
3784           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3785           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3787           # Commands to make compiler produce verbose output that lists
3788           # what "hidden" libraries, object files and flags are used when
3789           # linking a shared library.
3790           output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
3792         else
3793           # FIXME: insert proper C++ library support
3794           _LT_AC_TAGVAR(ld_shlibs, $1)=no
3795         fi
3796         ;;
3797     esac
3798     ;;
3799   psos*)
3800     # FIXME: insert proper C++ library support
3801     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3802     ;;
3803   sco*)
3804     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3805     case $cc_basename in
3806       CC)
3807         # FIXME: insert proper C++ library support
3808         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3809         ;;
3810       *)
3811         # FIXME: insert proper C++ library support
3812         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3813         ;;
3814     esac
3815     ;;
3816   sunos4*)
3817     case $cc_basename in
3818       CC)
3819         # Sun C++ 4.x
3820         # FIXME: insert proper C++ library support
3821         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3822         ;;
3823       lcc)
3824         # Lucid
3825         # FIXME: insert proper C++ library support
3826         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3827         ;;
3828       *)
3829         # FIXME: insert proper C++ library support
3830         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3831         ;;
3832     esac
3833     ;;
3834   solaris*)
3835     case $cc_basename in
3836       CC)
3837         # Sun C++ 4.2, 5.x and Centerline C++
3838         _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3839         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3840         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3841         $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'
3843         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3844         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3845         case $host_os in
3846           solaris2.[0-5] | solaris2.[0-5].*) ;;
3847           *)
3848             # The C++ compiler is used as linker so we must use $wl
3849             # flag to pass the commands to the underlying system
3850             # linker.
3851             # Supported since Solaris 2.6 (maybe 2.5.1?)
3852             _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3853             ;;
3854         esac
3855         _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3857         # Commands to make compiler produce verbose output that lists
3858         # what "hidden" libraries, object files and flags are used when
3859         # linking a shared library.
3860         #
3861         # There doesn't appear to be a way to prevent this compiler from
3862         # explicitly linking system object files so we need to strip them
3863         # from the output so that they don't get included in the library
3864         # dependencies.
3865         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'
3867         # Archives containing C++ object files must be created using
3868         # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3869         # necessary to make sure instantiated templates are included
3870         # in the archive.
3871         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3872         ;;
3873       gcx)
3874         # Green Hills C++ Compiler
3875         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3877         # The C++ compiler must be used to create the archive.
3878         _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
3879         ;;
3880       *)
3881         # GNU C++ compiler with Solaris linker
3882         if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3883           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
3884           if $CC --version | egrep -v '^2\.7' > /dev/null; then
3885             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
3886             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3887                 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
3889             # Commands to make compiler produce verbose output that lists
3890             # what "hidden" libraries, object files and flags are used when
3891             # linking a shared library.
3892             output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
3893           else
3894             # g++ 2.7 appears to require `-G' NOT `-shared' on this
3895             # platform.
3896             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
3897             _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3898                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
3900             # Commands to make compiler produce verbose output that lists
3901             # what "hidden" libraries, object files and flags are used when
3902             # linking a shared library.
3903             output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
3904           fi
3906           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3907         fi
3908         ;;
3909     esac
3910     ;;
3911   sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
3912     _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3913     ;;
3914   tandem*)
3915     case $cc_basename in
3916       NCC)
3917         # NonStop-UX NCC 3.20
3918         # FIXME: insert proper C++ library support
3919         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3920         ;;
3921       *)
3922         # FIXME: insert proper C++ library support
3923         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3924         ;;
3925     esac
3926     ;;
3927   vxworks*)
3928     # FIXME: insert proper C++ library support
3929     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3930     ;;
3931   *)
3932     # FIXME: insert proper C++ library support
3933     _LT_AC_TAGVAR(ld_shlibs, $1)=no
3934     ;;
3935 esac
3936 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
3937 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
3939 # Figure out "hidden" C++ library dependencies from verbose
3940 # compiler output whening linking a shared library.
3941 cat > conftest.$ac_ext <<EOF
3942 class Foo
3944 public:
3945   Foo (void) { a = 0; }
3946 private:
3947   int a;
3952 if AC_TRY_EVAL(ac_compile); then
3953   # Parse the compiler output and extract the necessary
3954   # objects, libraries and library flags.
3956   # Sentinel used to keep track of whether or not we are before
3957   # the conftest object file.
3958   pre_test_object_deps_done=no
3960   # The `*' in the case matches for architectures that use `case' in
3961   # $output_verbose_cmd can trigger glob expansion during the loop
3962   # eval without this substitution.
3963   output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
3965   for p in `eval $output_verbose_link_cmd`; do
3966     case $p in
3968     -L* | -R* | -l*)
3969        # Some compilers place space between "-{L,R}" and the path.
3970        # Remove the space.
3971        if test $p = "-L" \
3972           || test $p = "-R"; then
3973          prev=$p
3974          continue
3975        else
3976          prev=
3977        fi
3979        if test "$pre_test_object_deps_done" = no; then
3980          case $p in
3981          -L* | -R*)
3982            # Internal compiler library paths should come after those
3983            # provided the user.  The postdeps already come after the
3984            # user supplied libs so there is no need to process them.
3985            if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
3986              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
3987            else
3988              _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
3989            fi
3990            ;;
3991          # The "-l" case would never come before the object being
3992          # linked, so don't bother handling this case.
3993          esac
3994        else
3995          if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
3996            _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
3997          else
3998            _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
3999          fi
4000        fi
4001        ;;
4003     *.$objext)
4004        # This assumes that the test object file only shows up
4005        # once in the compiler output.
4006        if test "$p" = "conftest.$objext"; then
4007          pre_test_object_deps_done=yes
4008          continue
4009        fi
4011        if test "$pre_test_object_deps_done" = no; then
4012          if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
4013            _LT_AC_TAGVAR(predep_objects, $1)="$p"
4014          else
4015            _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
4016          fi
4017        else
4018          if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
4019            _LT_AC_TAGVAR(postdep_objects, $1)="$p"
4020          else
4021            _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
4022          fi
4023        fi
4024        ;;
4026     *) ;; # Ignore the rest.
4028     esac
4029   done
4031   # Clean up.
4032   rm -f a.out
4033 else
4034   echo "libtool.m4: error: problem compiling C++ test program"
4037 $rm -f confest.$objext
4039 case " $_LT_AC_TAGVAR(postdeps, $1) " in
4040 *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
4041 *) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes ;;
4042 esac
4044 _LT_AC_TAGVAR(GCC, $1)="$GXX"
4045 _LT_AC_TAGVAR(LD, $1)="$LD"
4047 ## CAVEAT EMPTOR:
4048 ## There is no encapsulation within the following macros, do not change
4049 ## the running order or otherwise move them around unless you know exactly
4050 ## what you are doing...
4051 AC_LIBTOOL_PROG_COMPILER_PIC($1)
4052 AC_LIBTOOL_PROG_CC_C_O($1)
4053 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4054 AC_LIBTOOL_PROG_LD_SHLIBS($1)
4055 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4056 AC_LIBTOOL_SYS_LIB_STRIP
4057 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4058 AC_LIBTOOL_DLOPEN_SELF($1)
4060 AC_LIBTOOL_CONFIG($1)
4062 AC_LANG_POP
4063 CC="$lt_save_CC"
4064 ])# AC_LIBTOOL_LANG_CXX_CONFIG
4067 # AC_LIBTOOL_LANG_F77_CONFIG
4068 # ------------------------
4069 # Ensure that the configuration vars for the C compiler are
4070 # suitably defined.  Those variables are subsequently used by
4071 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4072 AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
4073 AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
4074 [AC_REQUIRE([AC_PROG_F77])
4075 AC_LANG_PUSH(Fortran 77)
4077 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4078 _LT_AC_TAGVAR(allow_undefined_flag, $1)=
4079 _LT_AC_TAGVAR(always_export_symbols, $1)=no
4080 _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
4081 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
4082 _LT_AC_TAGVAR(hardcode_direct, $1)=no
4083 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
4084 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4085 _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
4086 _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
4087 _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4088 _LT_AC_TAGVAR(no_undefined_flag, $1)=
4089 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4091 # Source file extension for f77 test sources.
4092 ac_ext=f
4094 # Object file extension for compiled f77 test sources.
4095 objext=o
4096 _LT_AC_TAGVAR(objext, $1)=$objext
4098 # Code to be used in simple compile tests
4099 lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"    
4101 # Code to be used in simple link tests
4102 lt_simple_link_test_code="      program t\n      end\n"
4104 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
4105 _LT_AC_SYS_COMPILER
4107 # Allow CC to be a program name with arguments.
4108 lt_save_CC="$CC"
4109 CC=${F77-"f77"}
4110 set dummy $CC
4111 compiler="[$]2"
4112 _LT_AC_TAGVAR(compiler, $1)=$CC
4113 cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
4115 AC_MSG_CHECKING([if libtool supports shared libraries])
4116 AC_MSG_RESULT([$can_build_shared])
4118 AC_MSG_CHECKING([whether to build shared libraries])
4119 test "$can_build_shared" = "no" && enable_shared=no
4121 # On AIX, shared libraries and static libraries use the same namespace, and
4122 # are all built from PIC.
4123 case "$host_os" in
4124 aix3*)
4125   test "$enable_shared" = yes && enable_static=no
4126   if test -n "$RANLIB"; then
4127     archive_cmds="$archive_cmds~\$RANLIB \$lib"
4128     postinstall_cmds='$RANLIB $lib'
4129   fi
4130   ;;
4131 aix4*)
4132   test "$enable_shared" = yes && enable_static=no
4133   ;;
4134 esac
4135 AC_MSG_RESULT([$enable_shared])
4137 AC_MSG_CHECKING([whether to build static libraries])
4138 # Make sure either enable_shared or enable_static is yes.
4139 test "$enable_shared" = yes || enable_static=yes
4140 AC_MSG_RESULT([$enable_static])
4142 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
4144 _LT_AC_TAGVAR(GCC, $1)="$G77"
4145 _LT_AC_TAGVAR(LD, $1)="$LD"
4147 AC_LIBTOOL_PROG_COMPILER_PIC($1)
4148 AC_LIBTOOL_PROG_CC_C_O($1)
4149 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4150 AC_LIBTOOL_PROG_LD_SHLIBS($1)
4151 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4152 AC_LIBTOOL_SYS_LIB_STRIP
4153 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4155 AC_LIBTOOL_CONFIG($1)
4157 AC_LANG_POP
4158 CC="$lt_save_CC"
4159 ])# AC_LIBTOOL_LANG_F77_CONFIG
4162 # AC_LIBTOOL_LANG_GCJ_CONFIG
4163 # --------------------------
4164 # Ensure that the configuration vars for the C compiler are
4165 # suitably defined.  Those variables are subsequently used by
4166 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4167 AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
4168 AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
4169 [AC_LANG_SAVE
4171 # Source file extension for C test sources.
4172 ac_ext=java
4174 # Object file extension for compiled C test sources.
4175 objext=o
4176 _LT_AC_TAGVAR(objext, $1)=$objext
4178 # Code to be used in simple compile tests
4179 lt_simple_compile_test_code="class foo {}\n"
4181 # Code to be used in simple link tests
4182 lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
4184 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
4185 _LT_AC_SYS_COMPILER
4187 # Allow CC to be a program name with arguments.
4188 lt_save_CC="$CC"
4189 CC=${GCJ-"gcj"}
4190 set dummy $CC
4191 compiler="[$]2"
4192 _LT_AC_TAGVAR(compiler, $1)=$CC
4194 # GCJ did not exist at the time GCC didn't implicitly link libc in.
4195 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4197 ## CAVEAT EMPTOR:
4198 ## There is no encapsulation within the following macros, do not change
4199 ## the running order or otherwise move them around unless you know exactly
4200 ## what you are doing...
4201 AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
4202 AC_LIBTOOL_PROG_COMPILER_PIC($1)
4203 AC_LIBTOOL_PROG_CC_C_O($1)
4204 AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4205 AC_LIBTOOL_PROG_LD_SHLIBS($1)
4206 AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4207 AC_LIBTOOL_SYS_LIB_STRIP
4208 AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4209 AC_LIBTOOL_DLOPEN_SELF($1)
4211 AC_LIBTOOL_CONFIG($1)
4213 AC_LANG_RESTORE
4214 CC="$lt_save_CC"
4215 ])# AC_LIBTOOL_LANG_GCJ_CONFIG
4218 # AC_LIBTOOL_LANG_RC_CONFIG
4219 # --------------------------
4220 # Ensure that the configuration vars for the Windows resource compiler are
4221 # suitably defined.  Those variables are subsequently used by
4222 # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4223 AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
4224 AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
4225 [AC_LANG_SAVE
4227 # Source file extension for RC test sources.
4228 ac_ext=rc
4230 # Object file extension for compiled RC test sources.
4231 objext=o
4232 _LT_AC_TAGVAR(objext, $1)=$objext
4234 # Code to be used in simple compile tests
4235 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
4237 # Code to be used in simple link tests
4238 lt_simple_link_test_code="$lt_simple_compile_test_code"
4240 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
4241 _LT_AC_SYS_COMPILER
4243 # Allow CC to be a program name with arguments.
4244 lt_save_CC="$CC"
4245 CC=${RC-"windres"}
4246 set dummy $CC
4247 compiler="[$]2"
4248 _LT_AC_TAGVAR(compiler, $1)=$CC
4249 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
4251 AC_LIBTOOL_CONFIG($1)
4253 AC_LANG_RESTORE
4254 CC="$lt_save_CC"
4255 ])# AC_LIBTOOL_LANG_RC_CONFIG
4258 # AC_LIBTOOL_CONFIG([TAGNAME])
4259 # ----------------------------
4260 # If TAGNAME is not passed, then create an initial libtool script
4261 # with a default configuration from the untagged config vars.  Otherwise
4262 # add code to config.status for appending the configuration named by
4263 # TAGNAME from the matching tagged config vars.
4264 AC_DEFUN([AC_LIBTOOL_CONFIG],
4265 [# The else clause should only fire when bootstrapping the
4266 # libtool distribution, otherwise you forgot to ship ltmain.sh
4267 # with your package, and you will get complaints that there are
4268 # no rules to generate ltmain.sh.
4269 if test -f "$ltmain"; then
4270   # Now quote all the things that may contain metacharacters while being
4271   # careful not to overquote the AC_SUBSTed values.  We take copies of the
4272   # variables and quote the copies for generation of the libtool script.
4273   for var in echo old_CC old_CFLAGS AR AR_FLAGS RANLIB LN_S LTCC NM SHELL \
4274     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
4275     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
4276     deplibs_check_method reload_flag reload_cmds need_locks \
4277     lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
4278     lt_cv_sys_global_symbol_to_c_name_address \
4279     sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4280     old_postinstall_cmds old_postuninstall_cmds \
4281     _LT_AC_TAGVAR(compiler, $1) \
4282     _LT_AC_TAGVAR(CC, $1) \
4283     _LT_AC_TAGVAR(LD, $1) \
4284     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
4285     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
4286     _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
4287     _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
4288     _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
4289     _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
4290     _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
4291     _LT_AC_TAGVAR(old_archive_cmds, $1) \
4292     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
4293     _LT_AC_TAGVAR(predep_objects, $1) \
4294     _LT_AC_TAGVAR(postdep_objects, $1) \
4295     _LT_AC_TAGVAR(predeps, $1) \
4296     _LT_AC_TAGVAR(postdeps, $1) \
4297     _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
4298     _LT_AC_TAGVAR(archive_cmds, $1) \
4299     _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
4300     _LT_AC_TAGVAR(postinstall_cmds, $1) \
4301     _LT_AC_TAGVAR(postuninstall_cmds, $1) \
4302     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
4303     _LT_AC_TAGVAR(allow_undefined_flag, $1) \
4304     _LT_AC_TAGVAR(no_undefined_flag, $1) \
4305     _LT_AC_TAGVAR(export_symbols_cmds, $1) \
4306     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
4307     _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
4308     _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4309     _LT_AC_TAGVAR(exclude_expsyms, $1) \
4310     _LT_AC_TAGVAR(include_expsyms, $1); do
4312     case $var in
4313     _LT_AC_TAGVAR(old_archive_cmds, $1) | \
4314     _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
4315     _LT_AC_TAGVAR(archive_cmds, $1) | \
4316     _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
4317     _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
4318     _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
4319     extract_expsyms_cmds | reload_cmds | finish_cmds | \
4320     postinstall_cmds | postuninstall_cmds | \
4321     old_postinstall_cmds | old_postuninstall_cmds | \
4322     sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4323       # Double-quote double-evaled strings.
4324       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
4325       ;;
4326     *)
4327       eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4328       ;;
4329     esac
4330   done
4332   case $lt_echo in
4333   *'\[$]0 --fallback-echo"')
4334     lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
4335     ;;
4336   esac
4338 ifelse([$1], [],
4339   [cfgfile="${ofile}T"
4340   trap "$rm \"$cfgfile\"; exit 1" 1 2 15
4341   $rm -f "$cfgfile"
4342   AC_MSG_NOTICE([creating $ofile])],
4343   [cfgfile="$ofile"])
4345   cat <<__EOF__ >> "$cfgfile"
4346 ifelse([$1], [],
4347 [#! $SHELL
4349 # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4350 # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4351 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
4353 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
4354 # Free Software Foundation, Inc.
4356 # This file is part of GNU Libtool:
4357 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4359 # This program is free software; you can redistribute it and/or modify
4360 # it under the terms of the GNU General Public License as published by
4361 # the Free Software Foundation; either version 2 of the License, or
4362 # (at your option) any later version.
4364 # This program is distributed in the hope that it will be useful, but
4365 # WITHOUT ANY WARRANTY; without even the implied warranty of
4366 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4367 # General Public License for more details.
4369 # You should have received a copy of the GNU General Public License
4370 # along with this program; if not, write to the Free Software
4371 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4373 # As a special exception to the GNU General Public License, if you
4374 # distribute this file as part of a program that contains a
4375 # configuration script generated by Autoconf, you may include it under
4376 # the same distribution terms that you use for the rest of that program.
4378 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
4379 Xsed="sed -e s/^X//"
4381 # The HP-UX ksh and POSIX shell print the target directory to stdout
4382 # if CDPATH is set.
4383 if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
4385 # The names of the tagged configurations supported by this script.
4386 available_tags=
4388 # ### BEGIN LIBTOOL CONFIG],
4389 [# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
4391 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4393 # Shell to use when invoking shell scripts.
4394 SHELL=$lt_SHELL
4396 # Whether or not to build shared libraries.
4397 build_libtool_libs=$enable_shared
4399 # Whether or not to build static libraries.
4400 build_old_libs=$enable_static
4402 # Whether or not to add -lc for building shared libraries.
4403 build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
4405 # Whether or not to optimize for fast installation.
4406 fast_install=$enable_fast_install
4408 # The host system.
4409 host_alias=$host_alias
4410 host=$host
4412 # An echo program that does not interpret backslashes.
4413 echo=$lt_echo
4415 # The archiver.
4416 AR=$lt_AR
4417 AR_FLAGS=$lt_AR_FLAGS
4419 # A C compiler.
4420 LTCC=$lt_LTCC
4422 # A language-specific compiler.
4423 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
4425 # Is the compiler the GNU C compiler?
4426 with_gcc=$_LT_AC_TAGVAR(GCC, $1)
4428 # The linker used to build libraries.
4429 LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
4431 # Whether we need hard or soft links.
4432 LN_S=$lt_LN_S
4434 # A BSD-compatible nm program.
4435 NM=$lt_NM
4437 # A symbol stripping program
4438 STRIP=$STRIP
4440 # Used to examine libraries when file_magic_cmd begins "file"
4441 MAGIC_CMD=$MAGIC_CMD
4443 # Used on cygwin: DLL creation program.
4444 DLLTOOL="$DLLTOOL"
4446 # Used on cygwin: object dumper.
4447 OBJDUMP="$OBJDUMP"
4449 # Used on cygwin: assembler.
4450 AS="$AS"
4452 # The name of the directory that contains temporary libtool files.
4453 objdir=$objdir
4455 # How to create reloadable object files.
4456 reload_flag=$lt_reload_flag
4457 reload_cmds=$lt_reload_cmds
4459 # How to pass a linker flag through the compiler.
4460 wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
4462 # Object file suffix (normally "o").
4463 objext="$ac_objext"
4465 # Old archive suffix (normally "a").
4466 libext="$libext"
4468 # Executable file suffix (normally "").
4469 exeext="$exeext"
4471 # Additional compiler flags for building library objects.
4472 pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
4473 pic_mode=$pic_mode
4475 # What is the maximum length of a command?
4476 max_cmd_len=$lt_cv_sys_max_cmd_len
4478 # Does compiler simultaneously support -c and -o options?
4479 compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
4481 # Must we lock files when doing compilation ?
4482 need_locks=$lt_need_locks
4484 # Do we need the lib prefix for modules?
4485 need_lib_prefix=$need_lib_prefix
4487 # Do we need a version for libraries?
4488 need_version=$need_version
4490 # Whether dlopen is supported.
4491 dlopen_support=$enable_dlopen
4493 # Whether dlopen of programs is supported.
4494 dlopen_self=$enable_dlopen_self
4496 # Whether dlopen of statically linked programs is supported.
4497 dlopen_self_static=$enable_dlopen_self_static
4499 # Compiler flag to prevent dynamic linking.
4500 link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
4502 # Compiler flag to turn off builtin functions.
4503 no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
4505 # Compiler flag to allow reflexive dlopens.
4506 export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
4508 # Compiler flag to generate shared objects directly from archives.
4509 whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
4511 # Compiler flag to generate thread-safe objects.
4512 thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
4514 # Library versioning type.
4515 version_type=$version_type
4517 # Format of library name prefix.
4518 libname_spec=$lt_libname_spec
4520 # List of archive names.  First name is the real one, the rest are links.
4521 # The last name is the one that the linker finds with -lNAME.
4522 library_names_spec=$lt_library_names_spec
4524 # The coded name of the library, if different from the real name.
4525 soname_spec=$lt_soname_spec
4527 # Commands used to build and install an old-style archive.
4528 RANLIB=$lt_RANLIB
4529 old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
4530 old_postinstall_cmds=$lt_old_postinstall_cmds
4531 old_postuninstall_cmds=$lt_old_postuninstall_cmds
4533 # Create an old-style archive from a shared archive.
4534 old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
4536 # Create a temporary old-style archive to link instead of a shared archive.
4537 old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
4539 # Commands used to build and install a shared archive.
4540 archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
4541 archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
4542 postinstall_cmds=$lt_postinstall_cmds
4543 postuninstall_cmds=$lt_postuninstall_cmds
4545 # Commands to strip libraries.
4546 old_striplib=$lt_old_striplib
4547 striplib=$lt_striplib
4549 # Dependencies to place before the objects being linked to create a
4550 # shared library.
4551 predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
4553 # Dependencies to place after the objects being linked to create a
4554 # shared library.
4555 postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
4557 # Dependencies to place before the objects being linked to create a
4558 # shared library.
4559 predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
4561 # Dependencies to place after the objects being linked to create a
4562 # shared library.
4563 postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
4565 # The library search path used internally by the compiler when linking
4566 # a shared library.
4567 compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
4569 # Method to check whether dependent libraries are shared objects.
4570 deplibs_check_method=$lt_deplibs_check_method
4572 # Command to use when deplibs_check_method == file_magic.
4573 file_magic_cmd=$lt_file_magic_cmd
4575 # Flag that allows shared libraries with undefined symbols to be built.
4576 allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
4578 # Flag that forces no undefined symbols.
4579 no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
4581 # Commands used to finish a libtool library installation in a directory.
4582 finish_cmds=$lt_finish_cmds
4584 # Same as above, but a single script fragment to be evaled but not shown.
4585 finish_eval=$lt_finish_eval
4587 # Take the output of nm and produce a listing of raw symbols and C names.
4588 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
4590 # Transform the output of nm in a proper C declaration
4591 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
4593 # Transform the output of nm in a C name address pair
4594 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
4596 # This is the shared library runtime path variable.
4597 runpath_var=$runpath_var
4599 # This is the shared library path variable.
4600 shlibpath_var=$shlibpath_var
4602 # Is shlibpath searched before the hard-coded library search path?
4603 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
4605 # How to hardcode a shared library path into an executable.
4606 hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
4608 # Whether we should hardcode library paths into libraries.
4609 hardcode_into_libs=$hardcode_into_libs
4611 # Flag to hardcode \$libdir into a binary during linking.
4612 # This must work even if \$libdir does not exist.
4613 hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
4615 # Whether we need a single -rpath flag with a separated argument.
4616 hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
4618 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
4619 # resulting binary.
4620 hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
4622 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4623 # resulting binary.
4624 hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
4626 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4627 # the resulting binary.
4628 hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
4630 # Variables whose values should be saved in libtool wrapper scripts and
4631 # restored at relink time.
4632 variables_saved_for_relink="$variables_saved_for_relink"
4634 # Whether libtool must link a program against all its dependency libraries.
4635 link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
4637 # Compile-time system search path for libraries
4638 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
4640 # Run-time system search path for libraries
4641 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
4643 # Fix the shell variable \$srcfile for the compiler.
4644 fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
4646 # Set to yes if exported symbols are required.
4647 always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
4649 # The commands to list exported symbols.
4650 export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
4652 # The commands to extract the exported symbol list from a shared archive.
4653 extract_expsyms_cmds=$lt_extract_expsyms_cmds
4655 # Symbols that should not be listed in the preloaded symbols.
4656 exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
4658 # Symbols that must always be exported.
4659 include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
4661 ifelse([$1],[],
4662 [# ### END LIBTOOL CONFIG],
4663 [# ### END LIBTOOL TAG CONFIG: $tagname])
4665 __EOF__
4667 ifelse([$1],[], [
4668   case $host_os in
4669   aix3*)
4670     cat <<\EOF >> "$cfgfile"
4672 # AIX sometimes has problems with the GCC collect2 program.  For some
4673 # reason, if we set the COLLECT_NAMES environment variable, the problems
4674 # vanish in a puff of smoke.
4675 if test "X${COLLECT_NAMES+set}" != Xset; then
4676   COLLECT_NAMES=
4677   export COLLECT_NAMES
4680     ;;
4682   cygwin* | mingw* | pw32* | os2*)
4683     cat <<'EOF' >> "$cfgfile"
4684     # This is a source program that is used to create dlls on Windows
4685     # Don't remove nor modify the starting and closing comments
4686     _LT_AC_FILE_LTDLL_C
4687     # This is a source program that is used to create import libraries
4688     # on Windows for dlls which lack them. Don't remove nor modify the
4689     # starting and closing comments
4690     _LT_AC_FILE_IMPGEN_C
4692     ;;
4693   esac
4695   # We use sed instead of cat because bash on DJGPP gets confused if
4696   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4697   # text mode, it properly converts lines to CR/LF.  This bash problem
4698   # is reportedly fixed, but why not run on old versions too?
4699   sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
4701   mv -f "$cfgfile" "$ofile" || \
4702     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4703   chmod +x "$ofile"
4705 else
4706   # If there is no Makefile yet, we rely on a make rule to execute
4707   # `config.status --recheck' to rerun these tests and create the
4708   # libtool script then.
4709   test -f Makefile && make "$ltmain"
4711 ])# AC_LIBTOOL_CONFIG
4714 # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
4715 # -------------------------------------------
4716 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
4717 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
4719 _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4721 if test "$GCC" = yes; then
4722   _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
4724   AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4725     lt_cv_prog_compiler_rtti_exceptions,
4726     [-fno-rtti -fno-exceptions -c conftest.$ac_ext], [],
4727     [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4729 ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
4732 # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4733 # ---------------------------------
4734 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4735 [AC_REQUIRE([AC_CANONICAL_HOST])
4736 AC_REQUIRE([AC_PROG_NM])
4737 AC_REQUIRE([AC_OBJEXT])
4738 # Check for command to grab the raw symbol name followed by C symbol from nm.
4739 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4740 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4742 # These are sane defaults that work on at least a few old systems.
4743 # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4745 # Character class describing NM global symbol codes.
4746 symcode='[[BCDEGRST]]'
4748 # Regexp to match symbols that can be accessed directly from C.
4749 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4751 # Transform the above into a raw symbol and a C symbol.
4752 symxfrm='\1 \2\3 \3'
4754 # Transform an extracted symbol line into a proper C declaration
4755 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
4757 # Transform an extracted symbol line into symbol name and symbol address
4758 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'"
4760 # Define system-specific variables.
4761 case $host_os in
4762 aix*)
4763   symcode='[[BCDT]]'
4764   ;;
4765 cygwin* | mingw* | pw32*)
4766   symcode='[[ABCDGISTW]]'
4767   ;;
4768 hpux*) # Its linker distinguishes data from code symbols
4769   if test "$host_cpu" = ia64; then
4770     symcode='[[ABCDEGRST]]'
4771   fi
4772   lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4773   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'"
4774   ;;
4775 irix* | nonstopux*)
4776   symcode='[[BCDEGRST]]'
4777   ;;
4778 solaris* | sysv5*)
4779   symcode='[[BDT]]'
4780   ;;
4781 sysv4)
4782   symcode='[[DFNSTU]]'
4783   ;;
4784 esac
4786 # Handle CRLF in mingw tool chain
4787 opt_cr=
4788 case $host_os in
4789 mingw*)
4790   opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4791   ;;
4792 esac
4794 # If we're using GNU nm, then use its standard symbol codes.
4795 if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
4796   symcode='[[ABCDGISTW]]'
4799 # Try without a prefix undercore, then with it.
4800 for ac_symprfx in "" "_"; do
4802   # Write the raw and C identifiers.
4803   lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[      ]]\($symcode$symcode*\)[[       ]][[    ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
4805   # Check to see that the pipe works correctly.
4806   pipe_works=no
4808   rm -f conftest*
4809   cat > conftest.$ac_ext <<EOF
4810 #ifdef __cplusplus
4811 extern "C" {
4812 #endif
4813 char nm_test_var;
4814 void nm_test_func(){}
4815 #ifdef __cplusplus
4817 #endif
4818 int main(){nm_test_var='a';nm_test_func();return(0);}
4821   if AC_TRY_EVAL(ac_compile); then
4822     # Now try to grab the symbols.
4823     nlist=conftest.nm
4824     if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
4825       # Try sorting and uniquifying the output.
4826       if sort "$nlist" | uniq > "$nlist"T; then
4827         mv -f "$nlist"T "$nlist"
4828       else
4829         rm -f "$nlist"T
4830       fi
4832       # Make sure that we snagged all the symbols we need.
4833       if egrep ' nm_test_var$' "$nlist" >/dev/null; then
4834         if egrep ' nm_test_func$' "$nlist" >/dev/null; then
4835           cat <<EOF > conftest.$ac_ext
4836 #ifdef __cplusplus
4837 extern "C" {
4838 #endif
4841           # Now generate the symbol file.
4842           eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
4844           cat <<EOF >> conftest.$ac_ext
4845 #if defined (__STDC__) && __STDC__
4846 # define lt_ptr_t void *
4847 #else
4848 # define lt_ptr_t char *
4849 # define const
4850 #endif
4852 /* The mapping between symbol names and symbols. */
4853 const struct {
4854   const char *name;
4855   lt_ptr_t address;
4857 lt_preloaded_symbols[[]] =
4860           sed "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
4861           cat <<\EOF >> conftest.$ac_ext
4862   {0, (lt_ptr_t) 0}
4865 #ifdef __cplusplus
4867 #endif
4869           # Now try linking the two files.
4870           mv conftest.$ac_objext conftstm.$ac_objext
4871           lt_save_LIBS="$LIBS"
4872           lt_save_CFLAGS="$CFLAGS"
4873           LIBS="conftstm.$ac_objext"
4874           CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4875           if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4876             pipe_works=yes
4877           fi
4878           LIBS="$lt_save_LIBS"
4879           CFLAGS="$lt_save_CFLAGS"
4880         else
4881           echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4882         fi
4883       else
4884         echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4885       fi
4886     else
4887       echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4888     fi
4889   else
4890     echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4891     cat conftest.$ac_ext >&5
4892   fi
4893   rm -f conftest* conftst*
4895   # Do not use the global_symbol_pipe unless it works.
4896   if test "$pipe_works" = yes; then
4897     break
4898   else
4899     lt_cv_sys_global_symbol_pipe=
4900   fi
4901 done
4903 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4904   lt_cv_sys_global_symbol_to_cdecl=
4906 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4907   AC_MSG_RESULT(failed)
4908 else
4909   AC_MSG_RESULT(ok)
4911 ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4914 # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
4915 # ---------------------------------------
4916 AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
4917 [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
4918 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4919 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
4921 AC_MSG_CHECKING([for $compiler option to produce PIC])
4922  ifelse([$1],[CXX],[
4923   # C++ specific cases for pic, static, wl, etc.
4924   if test "$GXX" = yes; then
4925     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4926     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
4928     case $host_os in
4929     aix*)
4930       # All AIX code is PIC.
4931       if test "$host_cpu" = ia64; then
4932         # AIX 5 now supports IA64 processor
4933         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4934       fi
4935       ;;
4936     amigaos*)
4937       # FIXME: we need at least 68020 code to build shared libraries, but
4938       # adding the `-m68020' flag to GCC prevents building anything better,
4939       # like `-m68040'.
4940       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4941       ;;
4942     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4943       # PIC is the default for these OSes.
4944       ;;
4945     cygwin* | mingw* | os2*)
4946       # This hack is so that the source file can tell whether it is being
4947       # built for inclusion in a dll (and should export symbols for example).
4948       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
4949       ;;
4950     darwin* | rhapsody*)
4951       # PIC is the default on this platform
4952       # Common symbols not allowed in MH_DYLIB files
4953       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4954       ;;
4955     *djgpp*)
4956       # DJGPP does not support shared libraries at all
4957       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4958       ;;
4959     sysv4*MP*)
4960       if test -d /usr/nec; then
4961         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4962       fi
4963       ;;
4964     hpux*)
4965       # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
4966       if test "$host_cpu" != ia64; then
4967         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4968       fi
4969       ;;
4970     *)
4971       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4972       ;;
4973     esac
4974   else
4975     case $host_os in
4976       aix4* | aix5*)
4977         # All AIX code is PIC.
4978         if test "$host_cpu" = ia64; then
4979           # AIX 5 now supports IA64 processor
4980           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4981         else
4982           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4983         fi
4984         ;;
4985       chorus*)
4986         case $cc_basename in
4987         cxch68)
4988           # Green Hills C++ Compiler
4989           # _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"
4990           ;;
4991         esac
4992         ;;
4993       dgux*)
4994         case $cc_basename in
4995           ec++)
4996             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4997             ;;
4998           ghcx)
4999             # Green Hills C++ Compiler
5000             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5001             ;;
5002           *)
5003             ;;
5004         esac
5005         ;;
5006       freebsd*)
5007         # FreeBSD uses GNU C++
5008         ;;
5009       hpux9* | hpux10* | hpux11*)
5010         case $cc_basename in
5011           CC)
5012             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5013             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
5014             if test "$host_cpu" != ia64; then
5015               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5016             fi
5017             ;;
5018           aCC)
5019             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5020             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
5021             if test "$host_cpu" != ia64; then
5022               _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5023             fi
5024             ;;
5025           *)
5026             ;;
5027         esac
5028         ;;
5029       irix5* | irix6* | nonstopux*)
5030         case $cc_basename in
5031           CC)
5032             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5033             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5034             # CC pic flag -KPIC is the default.
5035             ;;
5036           *)
5037             ;;
5038         esac
5039         ;;
5040       linux*)
5041         case $cc_basename in
5042           KCC)
5043             # KAI C++ Compiler
5044             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5045             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5046             ;;
5047           cxx)
5048             # Compaq C++
5049             # Make sure the PIC flag is empty.  It appears that all Alpha
5050             # Linux and Compaq Tru64 Unix objects are PIC.
5051             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5052             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5053             ;;
5054           *)
5055             ;;
5056         esac
5057         ;;
5058       lynxos*)
5059         ;;
5060       m88k*)
5061         ;;
5062       mvs*)
5063         case $cc_basename in
5064           cxx)
5065             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5066             ;;
5067           *)
5068             ;;
5069         esac
5070         ;;
5071       netbsd*)
5072         ;;
5073       osf3* | osf4* | osf5*)
5074         case $cc_basename in
5075           KCC)
5076             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5077             ;;
5078           RCC)
5079             # Rational C++ 2.4.1
5080             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5081             ;;
5082           cxx)
5083             # Digital/Compaq C++
5084             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5085             # Make sure the PIC flag is empty.  It appears that all Alpha
5086             # Linux and Compaq Tru64 Unix objects are PIC.
5087             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5088             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5089             ;;
5090           *)
5091             ;;
5092         esac
5093         ;;
5094       psos*)
5095         ;;
5096       sco*)
5097         case $cc_basename in
5098           CC)
5099             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5100             ;;
5101           *)
5102             ;;
5103         esac
5104         ;;
5105       solaris*)
5106         case $cc_basename in
5107           CC)
5108             # Sun C++ 4.2, 5.x and Centerline C++
5109             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5110             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5111             _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5112             ;;
5113           gcx)
5114             # Green Hills C++ Compiler
5115             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5116             ;;
5117           *)
5118             ;;
5119         esac
5120         ;;
5121       sunos4*)
5122         case $cc_basename in
5123           CC)
5124             # Sun C++ 4.x
5125             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5126             _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5127             ;;
5128           lcc)
5129             # Lucid
5130             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5131             ;;
5132           *)
5133             ;;
5134         esac
5135         ;;
5136       tandem*)
5137         case $cc_basename in
5138           NCC)
5139             # NonStop-UX NCC 3.20
5140             _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5141             ;;
5142           *)
5143             ;;
5144         esac
5145         ;;
5146       unixware*)
5147         ;;
5148       vxworks*)
5149         ;;
5150       *)
5151         _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5152         ;;
5153     esac
5154   fi
5157   if test "$GCC" = yes; then
5158     _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5159     _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5161     case $host_os in
5162       aix*)
5163       # All AIX code is PIC.
5164       if test "$host_cpu" = ia64; then
5165         # AIX 5 now supports IA64 processor
5166         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5167       fi
5168       ;;
5170     amigaos*)
5171       # FIXME: we need at least 68020 code to build shared libraries, but
5172       # adding the `-m68020' flag to GCC prevents building anything better,
5173       # like `-m68040'.
5174       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5175       ;;
5177     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5178       # PIC is the default for these OSes.
5179       ;;
5181     cygwin* | mingw* | pw32* | os2*)
5182       # This hack is so that the source file can tell whether it is being
5183       # built for inclusion in a dll (and should export symbols for example).
5184       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5185       ;;
5187     darwin* | rhapsody*)
5188       # PIC is the default on this platform
5189       # Common symbols not allowed in MH_DYLIB files
5190       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5191       ;;
5193     msdosdjgpp*)
5194       # Just because we use GCC doesn't mean we suddenly get shared libraries
5195       # on systems that don't support them.
5196       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5197       enable_shared=no
5198       ;;
5200     sysv4*MP*)
5201       if test -d /usr/nec; then
5202         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5203       fi
5204       ;;
5206     hpux*)
5207       # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
5208       if test "$host_cpu" != ia64; then
5209         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5210       fi
5211       ;;
5213     *)
5214       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5215       ;;
5216     esac
5217   else
5218     # PORTME Check for flag to pass linker flags through the system compiler.
5219     case $host_os in
5220     aix*)
5221       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5222       if test "$host_cpu" = ia64; then
5223         # AIX 5 now supports IA64 processor
5224         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5225       else
5226         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5227       fi
5228       ;;
5230     cygwin* | mingw* | pw32* | os2*)
5231       # This hack is so that the source file can tell whether it is being
5232       # built for inclusion in a dll (and should export symbols for example).
5233       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5234       ;;
5236     hpux9* | hpux10* | hpux11*)
5237       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5238       if test "$host_cpu" != ia64; then
5239         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5240       fi
5241       # Is there a better lt_prog_compiler_static that works with the bundled CC?
5242       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5243       ;;
5245     irix5* | irix6* | nonstopux*)
5246       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5247       # PIC (with -KPIC) is the default.
5248       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5249       ;;
5251     linux*)
5252       # Check flags for non-gnu compilers on Linux. We check
5253       # the architectures too and not only the compiler names,
5254       # since they are often linked to cc.
5255       case "$host_cpu" in
5256       alpha*)
5257         # The only non-gnu compiler on Linux/Alpha is the Compaq one:
5258         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5259         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5260         ;;
5262       i?86)
5263         # Intel icc compiler
5264         if $CC -V 2>&1 | grep 'Intel' > /dev/null 2>&1; then
5265           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption,link,'
5266           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5267         else
5268           _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5269         fi     
5270         ;;
5271         
5272       ia64)
5273         # Intel icc compiler
5274         if $CC -V 2>&1 | grep 'Intel' > /dev/null 2>&1; then
5275           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption,link,'
5276           _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5277         else
5278           _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5279         fi     
5280         ;;
5282       *)
5283         _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5284         ;;
5286       esac
5287       ;;
5289     newsos6)
5290       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5291       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5292       ;;
5294     osf3* | osf4* | osf5*)
5295       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5296       # All OSF/1 code is PIC.
5297       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5298       ;;
5300     sco3.2v5*)
5301       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
5302       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
5303       ;;
5305     solaris*)
5306       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5307       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5308       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5309       ;;
5311     sunos4*)
5312       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5313       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5314       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5315       ;;
5317     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5318       if test "x$host_vendor" = xsni; then
5319         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-LD'
5320       else
5321         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5322       fi
5323       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5324       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5325       ;;
5327     sysv4*MP*)
5328       if test -d /usr/nec ;then
5329         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5330         _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5331       fi
5332       ;;
5334     uts4*)
5335       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5336       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5337       ;;
5339     *)
5340       _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5341       ;;
5342     esac
5343   fi
5345 AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
5348 # Check to make sure the PIC flag actually works.
5350 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
5351   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
5352     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
5353     [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)], [],
5354     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
5355      "" | " "*) ;;
5356      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5357      esac],
5358     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5359      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5361 case "$host_os" in
5362   # For platforms which do not support PIC, -DPIC is meaningless:
5363   *djgpp*)
5364     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5365     ;;
5366   *)
5367     AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC define -DPIC works],
5368     _LT_AC_TAGVAR(lt_prog_compiler_picdef_works, $1),
5369     [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
5370     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC"],
5371     [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"])
5372     ;;
5373 esac
5377 # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
5378 # ------------------------------------
5379 # See if the linker supports building shared libraries.
5380 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5381 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5382 ifelse([$1],[CXX],[
5383   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5384   case $host_os in
5385   aix4* | aix5*)
5386     # If we're using GNU nm, then we don't want the "-C" option.
5387     # -C means demangle to AIX nm, but means don't demangle with GNU nm
5388     if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
5389       _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'
5390     else
5391       _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'
5392     fi
5393     ;;
5394   cygwin* | mingw* | pw32*)
5395     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5396   ;;
5397   *)
5398     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5399   ;;
5400   esac
5402   runpath_var=
5403   _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5405   _LT_AC_TAGVAR(archive_cmds, $1)=
5406   _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=
5407   _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5408   _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
5409   _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5410   _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5411   _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5412   _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
5413   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5414   _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5415   _LT_AC_TAGVAR(hardcode_direct, $1)=no
5416   _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5417   _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5418   _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5419   _LT_AC_TAGVAR(always_export_symbols, $1)=no
5420   _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
5421   # include_expsyms should be a list of space-separated symbols to be *always*
5422   # included in the symbol list
5423   _LT_AC_TAGVAR(include_expsyms, $1)=
5424   # exclude_expsyms can be an egrep regular expression of symbols to exclude
5425   # it will be wrapped by ` (' and `)$', so one must not match beginning or
5426   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5427   # as well as any symbol that contains `d'.
5428   _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
5429   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5430   # platforms (ab)use it in PIC code, but their linkers get confused if
5431   # the symbol is explicitly referenced.  Since portable code cannot
5432   # rely on this symbol name, it's probably fine to never include it in
5433   # preloaded symbol tables.
5434   extract_expsyms_cmds=
5436   case $host_os in
5437   cygwin* | mingw* | pw32*)
5438     # FIXME: the MSVC++ port hasn't been tested in a loooong time
5439     # When not using gcc, we currently assume that we are using
5440     # Microsoft Visual C++.
5441     if test "$GCC" != yes; then
5442       with_gnu_ld=no
5443     fi
5444     ;;
5445   openbsd*)
5446     with_gnu_ld=no
5447     ;;
5448   esac
5450   _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5451   if test "$with_gnu_ld" = yes; then
5452     # If archive_cmds runs LD, not CC, wlarc should be empty
5453     wlarc='${wl}'
5455     # See if GNU ld supports shared libraries.
5456     case $host_os in
5457     aix3* | aix4* | aix5*)
5458       # On AIX/PPC, the GNU linker is very broken
5459       if test "$host_cpu" != ia64; then
5460         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5461         cat <<EOF 1>&2
5463 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
5464 *** to be unable to reliably create shared libraries on AIX.
5465 *** Therefore, libtool is disabling shared libraries support.  If you
5466 *** really care for shared libraries, you may want to modify your PATH
5467 *** so that a non-GNU linker is found, and then restart.
5470       fi
5471       ;;
5473     amigaos*)
5474       _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)'
5475       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5476       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5478       # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5479       # that the semantics of dynamic libraries on AmigaOS, at least up
5480       # to version 4, is to share data among multiple programs linked
5481       # with the same dynamic library.  Since this doesn't match the
5482       # behavior of shared libraries on other platforms, we can't use
5483       # them.
5484       _LT_AC_TAGVAR(ld_shlibs, $1)=no
5485       ;;
5487     beos*)
5488       if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5489         _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5490         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5491         # support --undefined.  This deserves some investigation.  FIXME
5492         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5493       else
5494         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5495       fi
5496       ;;
5498     cygwin* | mingw* | pw32*)
5499       # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is
5500       # no search path for DLLs.
5501       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5502       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5503       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5505       extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
5506         sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
5507         test -f $output_objdir/impgen.exe || (cd $output_objdir && \
5508         if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
5509         else $CC -o impgen impgen.c ; fi)~
5510         $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
5512       _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
5514       # cygwin and mingw dlls have different entry points and sets of symbols
5515       # to exclude.
5516       # FIXME: what about values for MSVC?
5517       dll_entry=__cygwin_dll_entry@12
5518       dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
5519       case $host_os in
5520       mingw*)
5521         # mingw values
5522         dll_entry=_DllMainCRTStartup@12
5523         dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
5524         ;;
5525       esac
5527       # mingw and cygwin differ, and it's simplest to just exclude the union
5528       # of the two symbol sets.
5529       dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
5531       # recent cygwin and mingw systems supply a stub DllMain which the user
5532       # can override, but on older systems we have to supply one (in ltdll.c)
5533       if test "x$lt_cv_need_dllmain" = "xyes"; then
5534         ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
5535         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~
5536         test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
5537       else
5538         ltdll_obj=
5539         ltdll_cmds=
5540       fi
5542       # Extract the symbol export list from an `--export-all' def file,
5543       # then regenerate the def file from the symbol export list, so that
5544       # the compiled dll only exports the symbol export list.
5545       # Be careful not to strip the DATA tag left by newer dlltools.
5546       _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"'
5547         $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
5548         sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
5550       # If the export-symbols file already is a .def file (1st line
5551       # is EXPORTS), use it as is.
5552       # If DATA tags from a recent dlltool are present, honour them!
5553       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then
5554           cp $export_symbols $output_objdir/$soname-def;
5555         else
5556           echo EXPORTS > $output_objdir/$soname-def;
5557           _lt_hint=1;
5558           cat $export_symbols | while read symbol; do
5559            set dummy \$symbol;
5560            case \[$]# in
5561              2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
5562              *) echo "   \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
5563            esac;
5564            _lt_hint=`expr 1 + \$_lt_hint`;
5565           done;
5566         fi~
5567         '"$ltdll_cmds"'
5568         $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~
5569         $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~
5570         $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~
5571         $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~
5572         $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
5573       ;;
5575     netbsd*)
5576       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5577         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5578         wlarc=
5579       else
5580         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5581         _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'
5582       fi
5583       ;;
5585     solaris* | sysv5*)
5586       if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
5587         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5588         cat <<EOF 1>&2
5590 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5591 *** create shared libraries on Solaris systems.  Therefore, libtool
5592 *** is disabling shared libraries support.  We urge you to upgrade GNU
5593 *** binutils to release 2.9.1 or newer.  Another option is to modify
5594 *** your PATH or compiler configuration so that the native linker is
5595 *** used, and then restart.
5598       elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5599         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5600         _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'
5601       else
5602         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5603       fi
5604       ;;
5606     sunos4*)
5607       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5608       wlarc=
5609       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5610       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5611       ;;
5613     *)
5614       if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
5615         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5616         _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'
5617       else
5618         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5619       fi
5620       ;;
5621     esac
5623     if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
5624       runpath_var=LD_RUN_PATH
5625       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5626       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5627       case $host_os in
5628       cygwin* | mingw* | pw32*)
5629         # dlltool doesn't understand --whole-archive et. al.
5630         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5631         ;;
5632       *)
5633         # ancient GNU ld didn't support --whole-archive et. al.
5634         if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
5635         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5636         else
5637         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5638         fi
5639         ;;
5640       esac
5641     fi
5642   else
5643     # PORTME fill in a description of your system's linker (not GNU ld)
5644     case $host_os in
5645     aix3*)
5646       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5647       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5648       _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'
5649       # Note: this linker hardcodes the directories in LIBPATH if there
5650       # are no directories specified by -L.
5651       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5652       if test "$GCC" = yes && test -z "$link_static_flag"; then
5653         # Neither direct hardcoding nor static linking is supported with a
5654         # broken collect2.
5655         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5656       fi
5657       ;;
5659     aix4* | aix5*)
5660       if test "$host_cpu" = ia64; then
5661         # On IA64, the linker does run time linking by default, so we don't
5662         # have to do anything special.
5663         aix_use_runtimelinking=no
5664         exp_sym_flag='-Bexport'
5665         no_entry_flag=""
5666       else
5667         # If we're using GNU nm, then we don't want the "-C" option.
5668         # -C means demangle to AIX nm, but means don't demangle with GNU nm
5669         if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
5670           _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'
5671         else
5672           _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'
5673         fi
5674         aix_use_runtimelinking=no
5676         # Test if we are trying to use run time linking or normal
5677         # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5678         # need to do runtime linking.
5679         case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
5680           for ld_flag in $LDFLAGS; do
5681           if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5682             aix_use_runtimelinking=yes
5683             break
5684           fi
5685           done
5686         esac
5688         exp_sym_flag='-bexport'
5689         no_entry_flag='-bnoentry'
5690       fi
5692       # When large executables or shared objects are built, AIX ld can
5693       # have problems creating the table of contents.  If linking a library
5694       # or program results in "error TOC overflow" add -mminimal-toc to
5695       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5696       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5698       _LT_AC_TAGVAR(archive_cmds, $1)=''
5699       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5700       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5701       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5703       if test "$GCC" = yes; then
5704         case $host_os in aix4.[012]|aix4.[012].*)
5705         # We only want to do this on AIX 4.2 and lower, the check
5706         # below for broken collect2 doesn't work under 4.3+
5707           collect2name=`${CC} -print-prog-name=collect2`
5708           if test -f "$collect2name" && \
5709            strings "$collect2name" | grep resolve_lib_name >/dev/null
5710           then
5711           # We have reworked collect2
5712           _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5713           else
5714           # We have old collect2
5715           _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5716           # It fails to find uninstalled libraries when the uninstalled
5717           # path is not listed in the libpath.  Setting hardcode_minus_L
5718           # to unsupported forces relinking
5719           _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5720           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5721           _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5722           fi
5723         esac
5724         shared_flag='-shared'
5725       else
5726         # not using gcc
5727         if test "$host_cpu" = ia64; then
5728         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5729         # chokes on -Wl,-G. The following line is correct:
5730           shared_flag='-G'
5731         else
5732         if test "$aix_use_runtimelinking" = yes; then
5733             shared_flag='${wl}-G'
5734           else
5735             shared_flag='${wl}-bM:SRE'
5736         fi
5737         fi
5738       fi
5740       # It seems that -bexpall does not export symbols beginning with
5741       # underscore (_), so it is better to generate a list of symbols to export.
5742       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5743       if test "$aix_use_runtimelinking" = yes; then
5744         # Warning - without using the other runtime loading flags (-brtl),
5745         # -berok will link without error, but may produce a broken library.
5746         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
5747        # Determine the default libpath from the value encoded in an empty executable.
5748        _LT_AC_SYS_LIBPATH_AIX
5749        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5750         _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"
5751        else
5752         if test "$host_cpu" = ia64; then
5753           _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5754           _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5755           _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"
5756         else
5757          # Determine the default libpath from the value encoded in an empty executable.
5758          _LT_AC_SYS_LIBPATH_AIX
5759          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5760           # Warning - without using the other run time loading flags,
5761           # -berok will link without error, but may produce a broken library.
5762           _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5763           _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5764           # -bexpall does not export symbols beginning with underscore (_)
5765           _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5766           # Exported symbols can be pulled into shared objects from archives
5767           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
5768           _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
5769           # This is similar to how AIX traditionally builds it's shared libraries.
5770           _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'
5771         fi
5772       fi
5773       ;;
5775     amigaos*)
5776       _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)'
5777       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5778       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5779       # see comment about different semantics on the GNU ld section
5780       _LT_AC_TAGVAR(ld_shlibs, $1)=no
5781       ;;
5783     bsdi4*)
5784       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5785       ;;
5787     cygwin* | mingw* | pw32*)
5788       # When not using gcc, we currently assume that we are using
5789       # Microsoft Visual C++.
5790       # hardcode_libdir_flag_spec is actually meaningless, as there is
5791       # no search path for DLLs.
5792       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5793       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5794       # Tell ltmain to make .lib files, not .a files.
5795       libext=lib
5796       # FIXME: Setting linknames here is a bad hack.
5797       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
5798       # The linker will automatically build a .lib file if we build a DLL.
5799       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
5800       # FIXME: Should let the user specify the lib program.
5801       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
5802       fix_srcfile_path='`cygpath -w "$srcfile"`'
5803       ;;
5805     darwin* | rhapsody*)
5806       case "$host_os" in
5807       rhapsody* | darwin1.[[012]])
5808         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
5809         ;;
5810       *) # Darwin 1.3 on
5811         _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
5812         ;;
5813       esac
5815       # FIXME: Relying on posixy $() will cause problems for
5816       #        cross-compilation, but unfortunately the echo tests do not
5817       #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
5818       #        `"' quotes if we put them in here... so don't!
5819       _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'
5820       # We need to add '_' to the symbols in $export_symbols first
5821       #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols'
5822       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5823       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5824       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
5825       ;;
5827     dgux*)
5828       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5829       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5830       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5831       ;;
5833     freebsd1*)
5834       _LT_AC_TAGVAR(ld_shlibs, $1)=no
5835       ;;
5837     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5838     # support.  Future versions do this automatically, but an explicit c++rt0.o
5839     # does not break anything, and helps significantly (at the cost of a little
5840     # extra space).
5841     freebsd2.2*)
5842       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5843       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5844       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5845       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5846       ;;
5848     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5849     freebsd2*)
5850       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5851       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5852       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5853       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5854       ;;
5856     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5857     freebsd*)
5858       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
5859       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5860       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5861       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5862       ;;
5864     hpux9* | hpux10* | hpux11*)
5865       if test "$GCC" = yes; then
5866         case $host_os in
5867           hpux9*)
5868             _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'
5869             ;;
5870           *)
5871             if test "$host_cpu" = ia64; then
5872               _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5873             else
5874               _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5875             fi
5876             ;;
5877         esac
5878       else
5879         case $host_os in
5880           hpux9*)
5881             _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'
5882             ;;
5883           *)
5884             if test "$host_cpu" = ia64; then
5885               _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
5886             else
5887               _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5888             fi
5889             ;;
5890         esac
5891       fi
5892       if test "$host_cpu" = ia64; then
5893         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5894         _LT_AC_TAGVAR(hardcode_direct, $1)=no
5895         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5896       else
5897         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5898         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5899         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5900       fi
5901       # hardcode_minus_L: Not really in the search PATH,
5902       # but as the default location of the library.
5903       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5904       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5905       ;;
5907     irix5* | irix6* | nonstopux*)
5908       if test "$GCC" = yes; then
5909         _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'
5910       else
5911         _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'
5912       fi
5913       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5914       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5915       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5916       ;;
5918     netbsd*)
5919       if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5920         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5921       else
5922         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5923       fi
5924       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5925       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5926       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5927       ;;
5929     newsos6)
5930       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5931       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5932       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5933       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5934       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5935       ;;
5937     openbsd*)
5938       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5939       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5941       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5942         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
5943         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5944         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5945       else
5946        case $host_os in
5947          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5948            _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5949            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5950            ;;
5951          *)
5952            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
5953            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5954            ;;
5955        esac
5956       fi
5957       ;;
5959     os2*)
5960       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5961       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5962       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5963       _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'
5964       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5965       ;;
5967     osf3*)
5968       if test "$GCC" = yes; then
5969         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5970         _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'
5971       else
5972         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5973         _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'
5974       fi
5975       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5976       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5977       ;;
5979     osf4* | osf5*)      # as osf3* with the addition of -msym flag
5980       if test "$GCC" = yes; then
5981         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5982         _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'
5983         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5984       else
5985         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5986         _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'
5987         _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~
5988         $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'
5990         # Both c and cxx compiler support -rpath directly
5991         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5992       fi
5993       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5994       ;;
5996     sco3.2v5*)
5997       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5998       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5999       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6000       runpath_var=LD_RUN_PATH
6001       hardcode_runpath_var=yes
6002       ;;
6004     solaris*)
6005       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
6006       if test "$GCC" = yes; then
6007         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6008         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6009           $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
6010       else
6011         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6012         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6013         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6014       fi
6015       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6016       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6017       case $host_os in
6018       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6019       *) # Supported since Solaris 2.6 (maybe 2.5.1?)
6020         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
6021       esac
6022       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6023       ;;
6025     sunos4*)
6026       if test "x$host_vendor" = xsequent; then
6027         # Use $CC to link under sequent, because it throws in some extra .o
6028         # files that make .init and .fini sections work.
6029         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6030       else
6031         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6032       fi
6033       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6034       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6035       _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6036       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6037       ;;
6039     sysv4)
6040       if test "x$host_vendor" = xsni; then
6041         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
6042         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6043       else
6044         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6045         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6046       fi
6047       runpath_var='LD_RUN_PATH'
6048       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6049       ;;
6051     sysv4.3*)
6052       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6053       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6054       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6055       ;;
6057     sysv4*MP*)
6058       if test -d /usr/nec; then
6059         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6060         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6061         runpath_var=LD_RUN_PATH
6062         hardcode_runpath_var=yes
6063         _LT_AC_TAGVAR(ld_shlibs, $1)=yes
6064       fi
6065       ;;
6067     sysv4.2uw2*)
6068       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6069       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6070       _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
6071       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6072       hardcode_runpath_var=yes
6073       runpath_var=LD_RUN_PATH
6074       ;;
6076    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
6077       _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
6078       if test "$GCC" = yes; then
6079         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6080       else
6081         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6082       fi
6083       runpath_var='LD_RUN_PATH'
6084       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6085       ;;
6087     sysv5*)
6088       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
6089       # $CC -shared without GNU ld will not create a library from C++
6090       # object files and a static libstdc++, better avoid it by now
6091       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6092       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6093                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6094       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
6095       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6096       runpath_var='LD_RUN_PATH'
6097       ;;
6099     uts4*)
6100       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6101       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6102       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6103       ;;
6105     *)
6106       _LT_AC_TAGVAR(ld_shlibs, $1)=no
6107       ;;
6108     esac
6109   fi
6111 AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
6112 test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6114 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
6115 if test "$GCC" = yes; then
6116   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6120 # Do we need to explicitly link libc?
6122 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6123 if test "$enable_shared" = yes && test "$GCC" = yes; then
6124   case $_LT_AC_TAGVAR(archive_cmds, $1) in
6125   *'~'*)
6126     # FIXME: we may have to deal with multi-command sequences.
6127     ;;
6128   '$CC '*)
6129     # Test whether the compiler implicitly links with -lc since on some
6130     # systems, -lgcc has to come before -lc. If gcc already passes -lc
6131     # to ld, don't add -lc before -lgcc.
6132     AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6133     $rm conftest*
6134     echo 'static int dummy;' > conftest.$ac_ext
6136     if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6137       soname=conftest
6138       lib=conftest
6139       libobjs=conftest.$ac_objext
6140       deplibs=
6141       wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6142       compiler_flags=-v
6143       linker_flags=-v
6144       verstring=
6145       output_objdir=.
6146       libname=conftest
6147       lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
6148       _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6149       if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
6150       then
6151         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6152       else
6153         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6154       fi
6155       _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6156     else
6157       cat conftest.err 1>&5
6158     fi
6159     $rm conftest*
6160     AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
6161     ;;
6162   esac
6164 ])# AC_LIBTOOL_PROG_LD_SHLIBS
6167 # _LT_AC_FILE_LTDLL_C
6168 # -------------------
6169 # Be careful that the start marker always follows a newline.
6170 AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
6171 # /* ltdll.c starts here */
6172 # #define WIN32_LEAN_AND_MEAN
6173 # #include <windows.h>
6174 # #undef WIN32_LEAN_AND_MEAN
6175 # #include <stdio.h>
6177 # #ifndef __CYGWIN__
6178 # #  ifdef __CYGWIN32__
6179 # #    define __CYGWIN__ __CYGWIN32__
6180 # #  endif
6181 # #endif
6183 # #ifdef __cplusplus
6184 # extern "C" {
6185 # #endif
6186 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
6187 # #ifdef __cplusplus
6188 # }
6189 # #endif
6191 # #ifdef __CYGWIN__
6192 # #include <cygwin/cygwin_dll.h>
6193 # DECLARE_CYGWIN_DLL( DllMain );
6194 # #endif
6195 # HINSTANCE __hDllInstance_base;
6197 # BOOL APIENTRY
6198 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
6199 # {
6200 #   __hDllInstance_base = hInst;
6201 #   return TRUE;
6202 # }
6203 # /* ltdll.c ends here */
6204 ])# _LT_AC_FILE_LTDLL_C
6207 # _LT_AC_FILE_IMPGEN_C
6208 # --------------------
6209 # Be careful that the start marker always follows a newline.
6210 AC_DEFUN([_LT_AC_FILE_IMPGEN_C], [
6211 # /* impgen.c starts here */
6212 # /*   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
6214 #  This file is part of GNU libtool.
6216 #  This program is free software; you can redistribute it and/or modify
6217 #  it under the terms of the GNU General Public License as published by
6218 #  the Free Software Foundation; either version 2 of the License, or
6219 #  (at your option) any later version.
6221 #  This program is distributed in the hope that it will be useful,
6222 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
6223 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6224 #  GNU General Public License for more details.
6226 #  You should have received a copy of the GNU General Public License
6227 #  along with this program; if not, write to the Free Software
6228 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6229 #  */
6231 # #include <stdio.h>            /* for printf() */
6232 # #include <unistd.h>           /* for open(), lseek(), read() */
6233 # #include <fcntl.h>            /* for O_RDONLY, O_BINARY */
6234 # #include <string.h>           /* for strdup() */
6236 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
6237 # #ifndef O_BINARY
6238 # #define O_BINARY 0
6239 # #endif
6241 # static unsigned int
6242 # pe_get16 (fd, offset)
6243 #      int fd;
6244 #      int offset;
6245 # {
6246 #   unsigned char b[2];
6247 #   lseek (fd, offset, SEEK_SET);
6248 #   read (fd, b, 2);
6249 #   return b[0] + (b[1]<<8);
6250 # }
6252 # static unsigned int
6253 # pe_get32 (fd, offset)
6254 #     int fd;
6255 #     int offset;
6256 # {
6257 #   unsigned char b[4];
6258 #   lseek (fd, offset, SEEK_SET);
6259 #   read (fd, b, 4);
6260 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
6261 # }
6263 # static unsigned int
6264 # pe_as32 (ptr)
6265 #      void *ptr;
6266 # {
6267 #   unsigned char *b = ptr;
6268 #   return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
6269 # }
6271 # int
6272 # main (argc, argv)
6273 #     int argc;
6274 #     char *argv[];
6275 # {
6276 #     int dll;
6277 #     unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
6278 #     unsigned long export_rva, export_size, nsections, secptr, expptr;
6279 #     unsigned long name_rvas, nexp;
6280 #     unsigned char *expdata, *erva;
6281 #     char *filename, *dll_name;
6283 #     filename = argv[1];
6285 #     dll = open(filename, O_RDONLY|O_BINARY);
6286 #     if (dll < 1)
6287 #       return 1;
6289 #     dll_name = filename;
6291 #     for (i=0; filename[i]; i++)
6292 #       if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
6293 #           dll_name = filename + i +1;
6295 #     pe_header_offset = pe_get32 (dll, 0x3c);
6296 #     opthdr_ofs = pe_header_offset + 4 + 20;
6297 #     num_entries = pe_get32 (dll, opthdr_ofs + 92);
6299 #     if (num_entries < 1) /* no exports */
6300 #       return 1;
6302 #     export_rva = pe_get32 (dll, opthdr_ofs + 96);
6303 #     export_size = pe_get32 (dll, opthdr_ofs + 100);
6304 #     nsections = pe_get16 (dll, pe_header_offset + 4 +2);
6305 #     secptr = (pe_header_offset + 4 + 20 +
6306 #             pe_get16 (dll, pe_header_offset + 4 + 16));
6308 #     expptr = 0;
6309 #     for (i = 0; i < nsections; i++)
6310 #     {
6311 #       char sname[8];
6312 #       unsigned long secptr1 = secptr + 40 * i;
6313 #       unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
6314 #       unsigned long vsize = pe_get32 (dll, secptr1 + 16);
6315 #       unsigned long fptr = pe_get32 (dll, secptr1 + 20);
6316 #       lseek(dll, secptr1, SEEK_SET);
6317 #       read(dll, sname, 8);
6318 #       if (vaddr <= export_rva && vaddr+vsize > export_rva)
6319 #       {
6320 #           expptr = fptr + (export_rva - vaddr);
6321 #           if (export_rva + export_size > vaddr + vsize)
6322 #               export_size = vsize - (export_rva - vaddr);
6323 #           break;
6324 #       }
6325 #     }
6327 #     expdata = (unsigned char*)malloc(export_size);
6328 #     lseek (dll, expptr, SEEK_SET);
6329 #     read (dll, expdata, export_size);
6330 #     erva = expdata - export_rva;
6332 #     nexp = pe_as32 (expdata+24);
6333 #     name_rvas = pe_as32 (expdata+32);
6335 #     printf ("EXPORTS\n");
6336 #     for (i = 0; i<nexp; i++)
6337 #     {
6338 #       unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
6339 #       printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
6340 #     }
6342 #     return 0;
6343 # }
6344 # /* impgen.c ends here */
6345 ])# _LT_AC_FILE_IMPGEN_C
6347 # _LT_AC_TAGVAR(VARNAME, [TAGNAME])
6348 # ---------------------------------
6349 AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
6352 # old names
6353 AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
6354 AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
6355 AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
6356 AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
6357 AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
6358 AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
6359 AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
6361 # This is just to silence aclocal about the macro not being used
6362 ifelse([AC_DISABLE_FAST_INSTALL])
6364 AC_DEFUN([LT_AC_PROG_GCJ],
6365 [AC_CHECK_TOOL(GCJ, gcj, no)
6366   test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6367   AC_SUBST(GCJFLAGS)
6370 AC_DEFUN([LT_AC_PROG_RC],
6371 [AC_CHECK_TOOL(RC, windres, no)