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