1 #### This script is meant to be sourced by ltconfig.
3 # ltcf-cxx.sh - Create a C++ compiler specific configuration
5 # Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # Original C++ support by:Gary V. Vaughan <gvv@techie.com>
9 # Alexandre Oliva <oliva@lsd.ic.unicamp.br>
10 # Ossama Othman <ossama@debian.org>
11 # Thomas Thanner <tanner@gmx.de>
13 # This file is free software; you can redistribute it and/or modify it
14 # under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
33 # Source file extension for C++ test sources.
36 # Object file extension for compiled C++ test sources.
39 # Code to be used in simple compile tests
40 lt_simple_compile_test_code
="int some_variable = 0;"
42 # Code to be used in simple link tests
43 lt_simple_link_test_code
='int main(int, char *[]) { return (0); }'
48 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
50 CFLAGS
=${CFLAGS-"$CXXFLAGS"}
52 # Allow CC to be a program name with arguments.
55 cc_basename
=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
57 # Check if we are using GNU gcc (taken/adapted from configure script)
58 # We need to check here since "--with-gcc" is set at configure time,
60 cat > conftest.
$ac_ext <<EOF
65 if { ac_try
='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } |
egrep yes >/dev
/null
2>&1; then
68 # Set up default GNU C++ configuration
70 # Check if GNU C++ uses GNU ld as the underlying linker, since the
71 # archiving commands below assume that GNU ld is being used.
72 if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
73 egrep 'GNU ld' > /dev
/null
; then
76 archive_cmds
='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
77 archive_expsym_cmds
='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
79 hardcode_libdir_flag_spec
='${wl}--rpath ${wl}$libdir'
80 export_dynamic_flag_spec
='${wl}--export-dynamic'
82 # If archive_cmds runs LD, not CC, wlarc should be empty
83 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
84 # investigate it a little bit more. (MM)
87 # ancient GNU ld didn't support --whole-archive et. al.
88 if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
89 egrep 'no-whole-archive' > /dev
/null
; then
90 whole_archive_flag_spec
="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
92 whole_archive_flag_spec
=
98 # A generic and very simple default shared library creation
99 # command for GNU C++ for the case where it uses the native
100 # linker, instead of GNU ld. If possible, this setting should
101 # overridden to take advantage of the native linker features on
102 # the platform it is being used on.
103 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
106 # Commands to make compiler produce verbose output that lists
107 # what "hidden" libraries, object files and flags are used when
108 # linking a shared library.
109 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
117 # In general, the C++ compiler should always link C++ objects.
120 # AIX just has to be different, doesn't it? :-\
121 LD
=makeC
++SharedLib_r
122 LDFLAGS
="$LDFLAGS -p 0"
131 # PORTME: fill in a description of your system's C++ link characteristics
134 # FIXME: insert proper C++ library support
138 # FIXME: insert proper C++ library support
142 case "$cc_basename" in
144 # FIXME: insert proper C++ library support
150 case "$cc_basename" in
152 # FIXME: insert proper C++ library support
156 # Green Hills C++ Compiler
157 # FIXME: insert proper C++ library support
161 # FIXME: insert proper C++ library support
167 # FreeBSD uses GNU C++ and GNU ld
168 # FIXME: insert proper C++ library support
172 case "$cc_basename" in
174 # FIXME: insert proper C++ library support
179 hpux9
*) archive_cmds
='$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' ;;
180 *) archive_cmds
='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
182 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
183 hardcode_libdir_separator
=:
185 hardcode_minus_L
=yes # Not in the search PATH, but as the default
186 # location of the library.
187 export_dynamic_flag_spec
='${wl}-E'
189 # Commands to make compiler produce verbose output that lists
190 # what "hidden" libraries, object files and flags are used when
191 # linking a shared library.
193 # There doesn't appear to be a way to prevent this compiler from
194 # explicitly linking system object files so we need to strip them
195 # from the output so that they don't get included in the library
197 output_verbose_link_cmds
='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
200 # FIXME: insert proper C++ library support
206 case "$cc_basename" in
209 archive_cmds
='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
211 # Archives containing C++ object files must be created using
212 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
213 # necessary to make sure instantiated templates are included
215 old_archive_cmds
='$CC -ar -WR,-u -o $oldlib $oldobjs'
218 if test "$with_gcc" = yes; then
219 if test "$with_gnu_ld" = no
; then
220 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
222 archive_cmds
='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
225 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
226 hardcode_libdir_separator
=:
232 case "$cc_basename" in
234 # Kuck and Associates, Inc. (KAI) C++ Compiler
236 # KCC will only create a shared library if the output file
237 # ends with ".so" (or ".sl" for HP-UX), so rename the library
238 # to its proper name (with version) after linking.
239 archive_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
240 archive_expsym_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
242 # Commands to make compiler produce verbose output that lists
243 # what "hidden" libraries, object files and flags are used when
244 # linking a shared library.
246 # There doesn't appear to be a way to prevent this compiler from
247 # explicitly linking system object files so we need to strip them
248 # from the output so that they don't get included in the library
250 output_verbose_link_cmds
='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
252 hardcode_libdir_flag_spec
='${wl}--rpath,$libdir'
253 export_dynamic_flag_spec
='${wl}--export-dynamic'
255 # Archives containing C++ object files must be created using
256 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
257 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
261 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
262 archive_expsym_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
264 runpath_var
=LD_RUN_PATH
265 hardcode_libdir_flag_spec
='-rpath $libdir'
266 hardcode_libdir_separator
=:
268 # Commands to make compiler produce verbose output that lists
269 # what "hidden" libraries, object files and flags are used when
270 # linking a shared library.
272 # There doesn't appear to be a way to prevent this compiler from
273 # explicitly linking system object files so we need to strip them
274 # from the output so that they don't get included in the library
276 output_verbose_link_cmds
='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'
281 # FIXME: insert proper C++ library support
285 # FIXME: insert proper C++ library support
289 case "$cc_basename" in
291 # FIXME: insert proper C++ library support
295 # FIXME: insert proper C++ library support
301 # FIXME: insert proper C++ library support
305 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
306 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
307 archive_cmds
='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
309 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
310 hardcode_libdir_separator
=:
312 # Commands to make compiler produce verbose output that lists
313 # what "hidden" libraries, object files and flags are used when
314 # linking a shared library.
315 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
318 case "$cc_basename" in
320 # Kuck and Associates, Inc. (KAI) C++ Compiler
322 # KCC will only create a shared library if the output file
323 # ends with ".so" (or ".sl" for HP-UX), so rename the library
324 # to its proper name (with version) after linking.
325 archive_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
327 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
328 hardcode_libdir_separator
=:
330 # Archives containing C++ object files must be created using
331 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
332 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
337 # FIXME: insert proper C++ library support
341 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
342 archive_cmds
='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
344 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
345 hardcode_libdir_separator
=:
347 # Commands to make compiler produce verbose output that lists
348 # what "hidden" libraries, object files and flags are used when
349 # linking a shared library.
351 # There doesn't appear to be a way to prevent this compiler from
352 # explicitly linking system object files so we need to strip them
353 # from the output so that they don't get included in the library
355 output_verbose_link_cmds
='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'
358 # FIXME: insert proper C++ library support
364 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
365 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
366 archive_cmds
='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
368 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
369 hardcode_libdir_separator
=:
371 # Commands to make compiler produce verbose output that lists
372 # what "hidden" libraries, object files and flags are used when
373 # linking a shared library.
374 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
377 case "$cc_basename" in
379 # Kuck and Associates, Inc. (KAI) C++ Compiler
381 # KCC will only create a shared library if the output file
382 # ends with ".so" (or ".sl" for HP-UX), so rename the library
383 # to its proper name (with version) after linking.
384 archive_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
386 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
387 hardcode_libdir_separator
=:
389 # Archives containing C++ object files must be created using
390 # the KAI C++ compiler.
391 old_archive_cmds
='$CC -o $oldlib $oldobjs'
395 # FIXME: insert proper C++ library support
399 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
400 archive_cmds
='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
402 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
403 hardcode_libdir_separator
=:
405 # Commands to make compiler produce verbose output that lists
406 # what "hidden" libraries, object files and flags are used when
407 # linking a shared library.
409 # There doesn't appear to be a way to prevent this compiler from
410 # explicitly linking system object files so we need to strip them
411 # from the output so that they don't get included in the library
413 output_verbose_link_cmds
='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'
416 # FIXME: insert proper C++ library support
422 # FIXME: insert proper C++ library support
426 case "$cc_basename" in
428 # FIXME: insert proper C++ library support
432 # FIXME: insert proper C++ library support
438 case "$cc_basename" in
441 # FIXME: insert proper C++ library support
446 # FIXME: insert proper C++ library support
450 # FIXME: insert proper C++ library support
456 case "$cc_basename" in
458 # Sun C++ 4.2, 5.x and Centerline C++
459 no_undefined_flag
=' -ztext'
460 archive_cmds
='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
461 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
462 $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
464 hardcode_libdir_flag_spec
='-R$libdir'
465 hardcode_shlibpath_var
=no
467 solaris2.
[0-5] | solaris2.
[0-5].
*) ;;
469 # The C++ compiler is used as linker so we must use $wl
470 # flag to pass the commands to the underlying system
472 # Supported since Solaris 2.6 (maybe 2.5.1?)
473 whole_archive_flag_spec
='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
478 # Commands to make compiler produce verbose output that lists
479 # what "hidden" libraries, object files and flags are used when
480 # linking a shared library.
482 # There doesn't appear to be a way to prevent this compiler from
483 # explicitly linking system object files so we need to strip them
484 # from the output so that they don't get included in the library
486 output_verbose_link_cmds
='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
488 # Archives containing C++ object files must be created using
489 # "CC -xar", where "CC" is the Sun C++ compiler. This is
490 # necessary to make sure instantiated templates are included
492 old_archive_cmds
='$CC -xar -o $oldlib $oldobjs'
495 # Green Hills C++ Compiler
496 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
498 # The C++ compiler must be used to create the archive.
499 old_archive_cmds
='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
502 # GNU C++ compiler with Solaris linker
503 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
504 if $CC --version |
egrep -v '^2\.7' > /dev
/null
; then
505 archive_cmds
='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
506 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
507 $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
509 # Commands to make compiler produce verbose output that lists
510 # what "hidden" libraries, object files and flags are used when
511 # linking a shared library.
512 output_verbose_link_cmds
="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
514 # g++ 2.7 appears to require `-G' NOT `-shared' on this
516 archive_cmds
='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
517 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
518 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
520 # Commands to make compiler produce verbose output that lists
521 # what "hidden" libraries, object files and flags are used when
522 # linking a shared library.
523 output_verbose_link_cmds
="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
526 hardcode_libdir_flag_spec
='${wl}-R $wl$libdir'
532 case "$cc_basename" in
534 # NonStop-UX NCC 3.20
535 # FIXME: insert proper C++ library support
539 # FIXME: insert proper C++ library support
545 # FIXME: insert proper C++ library support
549 # FIXME: insert proper C++ library support
553 # FIXME: insert proper C++ library support
559 ## Compiler Characteristics: PIC flags, static flags, etc
561 # We don't use cached values here since only the C compiler
562 # characteristics should be cached.
566 ac_cv_prog_cc_static
=
567 ac_cv_prog_cc_no_builtin
=
568 ac_cv_prog_cc_can_build_shared
=$can_build_shared
570 # It is not enough to reset these cached values, they must be unset.
571 unset ac_cv_prog_cc_pic_works
572 unset ac_cv_prog_cc_static_works
574 if test "$with_gcc" = yes; then
575 ac_cv_prog_cc_wl
='-Wl,'
576 ac_cv_prog_cc_static
='-static'
579 beos
* | irix5
* | irix6
* | osf3
* | osf4
* | osf5
*)
580 # PIC is the default for these OSes.
583 # Below there is a dirty hack to force normal static linking with -ldl
584 # The problem is because libdl dynamically linked with both libc and
585 # libC (AIX C++ library), which obviously doesn't included in libraries
586 # list by gcc. This cause undefined symbols with -static flags.
587 # This hack allows C programs to be linked with "-static -ldl", but
588 # we not sure about C++ programs.
589 ac_cv_prog_cc_static
="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
591 cygwin
* | mingw
* | os2
*)
592 # This hack is so that the source file can tell whether it is being
593 # built for inclusion in a dll (and should export symbols for example).
594 ac_cv_prog_cc_pic
='-DDLL_EXPORT'
597 # FIXME: we need at least 68020 code to build shared libraries, but
598 # adding the `-m68020' flag to GCC prevents building anything better,
600 ac_cv_prog_cc_pic
='-m68020 -resident32 -malways-restore-a4'
603 if test -d /usr
/nec
; then
604 ac_cv_prog_cc_pic
=-Kconform_pic
608 ac_cv_prog_cc_pic
='-fPIC'
614 # All AIX code is PIC.
617 case "$cc_basename" in
619 # Green Hills C++ Compiler
620 # ac_cv_prog_cc_static="--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"
625 case "$cc_basename" in
627 ac_cv_prog_cc_pic
='-KPIC'
630 # Green Hills C++ Compiler
631 ac_cv_prog_cc_pic
='-pic'
638 # FreeBSD uses GNU C++
640 hpux9
* | hpux10
* | hpux11
*)
641 case "$cc_basename" in
643 ac_cv_prog_cc_wl
='-Wl,'
644 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
645 ac_cv_prog_cc_pic
='+Z'
648 ac_cv_prog_cc_wl
='-Wl,'
649 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
650 ac_cv_prog_cc_pic
='+Z'
657 case "$cc_basename" in
659 ac_cv_prog_cc_wl
='-Wl,'
660 ac_cv_prog_cc_static
='-non_shared'
661 ac_cv_prog_cc_pic
='-KPIC'
668 case "$cc_basename" in
671 ac_cv_prog_cc_wl
='--backend -Wl,'
672 ac_cv_prog_cc_pic
='-fPIC'
676 # Make sure the PIC flag is empty. It appears that all Alpha
677 # Linux and Compaq Tru64 Unix objects are PIC.
679 ac_cv_prog_cc_static
='-non_shared'
690 case "$cc_basename" in
692 ac_cv_prog_cc_pic
='-W c,exportall'
700 osf3
* | osf4
* | osf5
*)
701 case "$cc_basename" in
703 ac_cv_prog_cc_wl
='--backend -Wl,'
707 ac_cv_prog_cc_pic
='-pic'
711 ac_cv_prog_cc_wl
='-Wl,'
712 # Make sure the PIC flag is empty. It appears that all Alpha
713 # Linux and Compaq Tru64 Unix objects are PIC.
715 ac_cv_prog_cc_static
='-non_shared'
724 case "$cc_basename" in
726 ac_cv_prog_cc_pic
='-fPIC'
733 case "$cc_basename" in
735 # Sun C++ 4.2, 5.x and Centerline C++
736 ac_cv_prog_cc_pic
='-KPIC'
737 ac_cv_prog_cc_static
='-Bstatic'
738 ac_cv_prog_cc_wl
='-Qoption ld '
741 # Green Hills C++ Compiler
742 ac_cv_prog_cc_pic
='-PIC'
749 case "$cc_basename" in
752 ac_cv_prog_cc_pic
='-pic'
753 ac_cv_prog_cc_static
='-Bstatic'
757 ac_cv_prog_cc_pic
='-pic'
764 case "$cc_basename" in
766 # NonStop-UX NCC 3.20
767 ac_cv_prog_cc_pic
='-KPIC'
778 ac_cv_prog_cc_can_build_shared
=no
782 ac_cv_prog_cc_pic
="$ac_cv_prog_cc_pic -DPIC"
785 # Figure out "hidden" C++ library dependencies from verbose
786 # compiler output whening linking a shared library.
787 cat > conftest.
$ac_ext <<EOF
791 Foo (void) { a = 0; }
798 if eval $ac_compile 2>&5; then
799 # Parse the compiler output and extract the necessary
800 # objects, libraries and library flags.
802 # Sentinel used to keep track of whether or not we are before
803 # the conftest object file.
804 pre_test_object_deps_done
=no
806 for p
in `eval $output_verbose_link_cmds`; do
811 # Some compilers place space between "-{L,R}" and the path.
814 ||
test $p = "-R"; then
821 if test "$pre_test_object_deps_done" = no
; then
824 # Internal compiler library paths should come after those
825 # provided the user. The postdeps already come after the
826 # user supplied libs so there is no need to process them.
827 if test -z "$compiler_lib_search_path"; then
828 compiler_lib_search_path
="${prev}${p}"
830 compiler_lib_search_path
="${compiler_lib_search_path} ${prev}${p}"
833 # The "-l" case would never come before the object being
834 # linked, so don't bother handling this case.
837 if test -z "$postdeps"; then
838 postdeps
="${prev}${p}"
840 postdeps
="${postdeps} ${prev}${p}"
846 # This assumes that the test object file only shows up
847 # once in the compiler output.
848 if test "$p" = "conftest.$objext"; then
849 pre_test_object_deps_done
=yes
853 if test "$pre_test_object_deps_done" = no
; then
854 if test -z "$predep_objects"; then
857 predep_objects
="$predep_objects $p"
860 if test -z "$postdep_objects"; then
863 postdep_objects
="$postdep_objects $p"
868 *) ;; # Ignore the rest.
876 echo "ltcf-cxx.sh: error: problem compiling test program"
879 $rm -f confest.
$objext
881 case " $postdeps " in
882 *" -lc "*) need_lc
=no
;;