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