1 #### This script is meant to be sourced by ltconfig.
3 # $Id: ltcf-cxx.sh,v 1.1 2000/07/28 18:04:21 bkoz Exp $
5 # ltcf-cxx.sh - Create a C++ compiler specific configuration
7 # Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
8 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
10 # Original C++ support by:
11 # Alexandre Oliva <oliva@lsd.ic.unicamp.br>
12 # Ossama Othman <ossama@debian.org>
13 # Thomas Thanner <tanner@gmx.de>
15 # This file is free software; you can redistribute it and/or modify it
16 # under the terms of the GNU General Public License as published by
17 # the Free Software Foundation; either version 2 of the License, or
18 # (at your option) any later version.
20 # This program is distributed in the hope that it will be useful, but
21 # WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 # General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 # As a special exception to the GNU General Public License, if you
30 # distribute this file as part of a program that contains a
31 # configuration script generated by Autoconf, you may include it under
32 # the same distribution terms that you use for the rest of that program.
35 # Source file extension for C++ test sources.
38 # Object file extension for compiled C++ test sources.
41 # Code to be used in simple compile tests
42 lt_simple_compile_test_code
="int some_variable = 0;"
44 # Code to be used in simple link tests
45 lt_simple_link_test_code
='int main(int, char *[]) { return (0); }'
50 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
52 CFLAGS
=${CFLAGS-"$CXXFLAGS"}
54 # Allow CC to be a program name with arguments.
57 cc_basename
=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
59 # Check if we are using GNU gcc (taken/adapted from configure script)
60 # We need to check here since "--with-gcc" is set at configure time,
62 cat > conftest.
$ac_ext <<EOF
67 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
70 # Set up default GNU C++ configuration
72 # Check if GNU C++ uses GNU ld as the underlying linker, since the
73 # archiving commands below assume that GNU ld is being used.
74 if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
75 egrep 'GNU ld' > /dev
/null
; then
78 archive_cmds
='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
79 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'
81 hardcode_libdir_flag_spec
='${wl}--rpath ${wl}$libdir'
82 export_dynamic_flag_spec
='${wl}--export-dynamic'
84 # If archive_cmds runs LD, not CC, wlarc should be empty
85 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
86 # investigate it a little bit more. (MM)
89 # ancient GNU ld didn't support --whole-archive et. al.
90 if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
91 egrep 'no-whole-archive' > /dev
/null
; then
92 whole_archive_flag_spec
="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
94 whole_archive_flag_spec
=
100 # A generic and very simple default shared library creation
101 # command for GNU C++ for the case where it uses the native
102 # linker, instead of GNU ld. If possible, this setting should
103 # overridden to take advantage of the native linker features on
104 # the platform it is being used on.
105 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
108 # Commands to make compiler produce verbose output that lists
109 # what "hidden" libraries, object files and flags are used when
110 # linking a shared library.
111 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
119 # In general, the C++ compiler should always link C++ objects.
122 # AIX just has to be different, doesn't it? :-\
123 LD
=makeC
++SharedLib_r
124 LDFLAGS
="$LDFLAGS -p 0"
133 # PORTME: fill in a description of your system's C++ link characteristics
136 # FIXME: insert proper C++ library support
140 # FIXME: insert proper C++ library support
144 case "$cc_basename" in
146 # FIXME: insert proper C++ library support
152 case "$cc_basename" in
154 # FIXME: insert proper C++ library support
158 # Green Hills C++ Compiler
159 # FIXME: insert proper C++ library support
163 # FIXME: insert proper C++ library support
169 # FreeBSD uses GNU C++ and GNU ld
170 # FIXME: insert proper C++ library support
174 case "$cc_basename" in
176 # FIXME: insert proper C++ library support
181 hpux9
*) archive_cmds
='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
182 *) archive_cmds
='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ;;
184 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
185 hardcode_libdir_separator
=:
187 hardcode_minus_L
=yes # Not in the search PATH, but as the default
188 # location of the library.
189 export_dynamic_flag_spec
='${wl}-E'
191 # Commands to make compiler produce verbose output that lists
192 # what "hidden" libraries, object files and flags are used when
193 # linking a shared library.
195 # There doesn't appear to be a way to prevent this compiler from
196 # explicitly linking system object files so we need to strip them
197 # from the output so that they don't get included in the library
199 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'
202 # FIXME: insert proper C++ library support
208 case "$cc_basename" in
211 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'
214 if test "$with_gcc" = yes; then
215 if test "$with_gnu_ld" = no
; then
216 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
218 archive_cmds
='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
221 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
222 hardcode_libdir_separator
=:
228 case "$cc_basename" in
230 # Kuck and Associates, Inc. (KAI) C++ Compiler
232 # KCC will only create a shared library if the output file
233 # ends with ".so" (or ".sl" for HP-UX), so rename the library
234 # to its proper name (with version) after linking.
235 archive_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib; mv \$templib $lib'
236 archive_expsym_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
238 # Commands to make compiler produce verbose output that lists
239 # what "hidden" libraries, object files and flags are used when
240 # linking a shared library.
242 # There doesn't appear to be a way to prevent this compiler from
243 # explicitly linking system object files so we need to strip them
244 # from the output so that they don't get included in the library
246 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'
248 hardcode_libdir_flag_spec
='${wl}--rpath,$libdir'
249 export_dynamic_flag_spec
='${wl}--export-dynamic'
251 # Archives containing C++ object files must be created using
252 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
253 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
257 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname $wl$soname -o $lib'
258 archive_expsym_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
260 runpath_var
=LD_RUN_PATH
261 hardcode_libdir_flag_spec
='-rpath $libdir'
262 hardcode_libdir_separator
=:
264 # Commands to make compiler produce verbose output that lists
265 # what "hidden" libraries, object files and flags are used when
266 # linking a shared library.
268 # There doesn't appear to be a way to prevent this compiler from
269 # explicitly linking system object files so we need to strip them
270 # from the output so that they don't get included in the library
272 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'
277 # FIXME: insert proper C++ library support
281 # FIXME: insert proper C++ library support
285 case "$cc_basename" in
287 # FIXME: insert proper C++ library support
291 # FIXME: insert proper C++ library support
297 # FIXME: insert proper C++ library support
301 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
302 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
303 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'
305 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
306 hardcode_libdir_separator
=:
308 # Commands to make compiler produce verbose output that lists
309 # what "hidden" libraries, object files and flags are used when
310 # linking a shared library.
311 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
314 case "$cc_basename" in
316 # Kuck and Associates, Inc. (KAI) C++ Compiler
318 # KCC will only create a shared library if the output file
319 # ends with ".so" (or ".sl" for HP-UX), so rename the library
320 # to its proper name (with version) after linking.
321 archive_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib; mv \$templib $lib'
323 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
324 hardcode_libdir_separator
=:
326 # Archives containing C++ object files must be created using
327 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
328 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
333 # FIXME: insert proper C++ library support
337 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
338 archive_cmds
='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
340 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
341 hardcode_libdir_separator
=:
343 # Commands to make compiler produce verbose output that lists
344 # what "hidden" libraries, object files and flags are used when
345 # linking a shared library.
347 # There doesn't appear to be a way to prevent this compiler from
348 # explicitly linking system object files so we need to strip them
349 # from the output so that they don't get included in the library
351 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'
354 # FIXME: insert proper C++ library support
360 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
361 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
362 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'
364 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
365 hardcode_libdir_separator
=:
367 # Commands to make compiler produce verbose output that lists
368 # what "hidden" libraries, object files and flags are used when
369 # linking a shared library.
370 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
373 case "$cc_basename" in
375 # Kuck and Associates, Inc. (KAI) C++ Compiler
377 # KCC will only create a shared library if the output file
378 # ends with ".so" (or ".sl" for HP-UX), so rename the library
379 # to its proper name (with version) after linking.
380 archive_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $linker_flags --soname $soname -o \$templib; mv \$templib $lib'
382 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
383 hardcode_libdir_separator
=:
385 # Archives containing C++ object files must be created using
386 # the KAI C++ compiler.
387 old_archive_cmds
='$CC -o $oldlib $oldobjs'
391 # FIXME: insert proper C++ library support
395 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
396 archive_cmds
='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-msym ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
398 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
399 hardcode_libdir_separator
=:
401 # Commands to make compiler produce verbose output that lists
402 # what "hidden" libraries, object files and flags are used when
403 # linking a shared library.
405 # There doesn't appear to be a way to prevent this compiler from
406 # explicitly linking system object files so we need to strip them
407 # from the output so that they don't get included in the library
409 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'
412 # FIXME: insert proper C++ library support
418 # FIXME: insert proper C++ library support
422 case "$cc_basename" in
424 # FIXME: insert proper C++ library support
428 # FIXME: insert proper C++ library support
434 case "$cc_basename" in
437 # FIXME: insert proper C++ library support
442 # FIXME: insert proper C++ library support
446 # FIXME: insert proper C++ library support
452 case "$cc_basename" in
454 # Sun C++ 4.2, 5.x and Centerline C++
455 no_undefined_flag
=' -ztext'
456 archive_cmds
='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
457 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
458 $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
460 hardcode_libdir_flag_spec
='-R$libdir'
461 hardcode_shlibpath_var
=no
463 solaris2.
[0-5] | solaris2.
[0-5].
*) ;;
465 # The C++ compiler is used as linker so we must use $wl
466 # flag to pass the commands to the underlying system
468 # Supported since Solaris 2.6 (maybe 2.5.1?)
469 whole_archive_flag_spec
='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
474 # Commands to make compiler produce verbose output that lists
475 # what "hidden" libraries, object files and flags are used when
476 # linking a shared library.
478 # There doesn't appear to be a way to prevent this compiler from
479 # explicitly linking system object files so we need to strip them
480 # from the output so that they don't get included in the library
482 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'
484 # Archives containing C++ object files must be created using
485 # "CC -xar", where "CC" is the Sun C++ compiler. This is
486 # necessary to make sure instantiated templates are included
488 old_archive_cmds
='$CC -xar -o $oldlib $oldobjs'
491 # Green Hills C++ Compiler
492 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
494 # The C++ compiler must be used to create the archive.
495 old_archive_cmds
='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
498 # GNU C++ compiler with Solaris linker
499 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
500 if $CC --version |
egrep -v '^2\.7' > /dev
/null
; then
501 archive_cmds
='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
502 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
503 $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
505 # Commands to make compiler produce verbose output that lists
506 # what "hidden" libraries, object files and flags are used when
507 # linking a shared library.
508 output_verbose_link_cmds
="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
510 # g++ 2.7 appears to require `-G' NOT `-shared' on this
512 archive_cmds
='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
513 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
514 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
516 # Commands to make compiler produce verbose output that lists
517 # what "hidden" libraries, object files and flags are used when
518 # linking a shared library.
519 output_verbose_link_cmds
="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
522 hardcode_libdir_flag_spec
='${wl}-R $wl$libdir'
528 case "$cc_basename" in
530 # NonStop-UX NCC 3.20
531 # FIXME: insert proper C++ library support
535 # FIXME: insert proper C++ library support
541 # FIXME: insert proper C++ library support
545 # FIXME: insert proper C++ library support
549 # FIXME: insert proper C++ library support
555 ## Compiler Characteristics: PIC flags, static flags, etc
557 # We don't use cached values here since only the C compiler
558 # characteristics should be cached.
562 ac_cv_prog_cc_static
=
563 ac_cv_prog_cc_no_builtin
=
564 ac_cv_prog_cc_can_build_shared
=$can_build_shared
566 # It is not enough to reset these cached values, they must be unset.
567 unset ac_cv_prog_cc_pic_works
568 unset ac_cv_prog_cc_static_works
570 if test "$with_gcc" = yes; then
571 ac_cv_prog_cc_wl
='-Wl,'
572 ac_cv_prog_cc_static
='-static'
575 beos
* | irix5
* | irix6
* | osf3
* | osf4
* | osf5
*)
576 # PIC is the default for these OSes.
579 # Below there is a dirty hack to force normal static linking with -ldl
580 # The problem is because libdl dynamically linked with both libc and
581 # libC (AIX C++ library), which obviously doesn't included in libraries
582 # list by gcc. This cause undefined symbols with -static flags.
583 # This hack allows C programs to be linked with "-static -ldl", but
584 # we not sure about C++ programs.
585 ac_cv_prog_cc_static
="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
587 cygwin
* | mingw
* | os2
*)
588 # This hack is so that the source file can tell whether it is being
589 # built for inclusion in a dll (and should export symbols for example).
590 ac_cv_prog_cc_pic
='-DDLL_EXPORT'
593 # FIXME: we need at least 68020 code to build shared libraries, but
594 # adding the `-m68020' flag to GCC prevents building anything better,
596 ac_cv_prog_cc_pic
='-m68020 -resident32 -malways-restore-a4'
599 if test -d /usr
/nec
; then
600 ac_cv_prog_cc_pic
=-Kconform_pic
604 ac_cv_prog_cc_pic
='-fPIC'
610 # All AIX code is PIC.
613 case "$cc_basename" in
615 # Green Hills C++ Compiler
616 # 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"
621 case "$cc_basename" in
623 ac_cv_prog_cc_pic
='-KPIC'
626 # Green Hills C++ Compiler
627 ac_cv_prog_cc_pic
='-pic'
634 # FreeBSD uses GNU C++
636 hpux9
* | hpux10
* | hpux11
*)
637 case "$cc_basename" in
639 ac_cv_prog_cc_wl
='-Wl,'
640 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
641 ac_cv_prog_cc_pic
='+Z'
644 ac_cv_prog_cc_wl
='-Wl,'
645 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
646 ac_cv_prog_cc_pic
='+Z'
653 case "$cc_basename" in
655 ac_cv_prog_cc_wl
='-Wl,'
656 ac_cv_prog_cc_static
='-non_shared'
657 ac_cv_prog_cc_pic
='-KPIC'
664 case "$cc_basename" in
667 ac_cv_prog_cc_wl
='--backend -Wl,'
668 ac_cv_prog_cc_pic
='-fPIC'
672 # Make sure the PIC flag is empty. It appears that all Alpha
673 # Linux and Compaq Tru64 Unix objects are PIC.
675 ac_cv_prog_cc_static
='-non_shared'
686 case "$cc_basename" in
688 ac_cv_prog_cc_pic
='-W c,exportall'
696 osf3
* | osf4
* | osf5
*)
697 case "$cc_basename" in
699 ac_cv_prog_cc_wl
='--backend -Wl,'
703 ac_cv_prog_cc_pic
='-pic'
707 ac_cv_prog_cc_wl
='-Wl,'
708 # Make sure the PIC flag is empty. It appears that all Alpha
709 # Linux and Compaq Tru64 Unix objects are PIC.
711 ac_cv_prog_cc_static
='-non_shared'
720 case "$cc_basename" in
722 ac_cv_prog_cc_pic
='-fPIC'
729 case "$cc_basename" in
731 # Sun C++ 4.2, 5.x and Centerline C++
732 ac_cv_prog_cc_pic
='-KPIC'
733 ac_cv_prog_cc_static
='-Bstatic'
734 ac_cv_prog_cc_wl
='-Qoption ld '
737 # Green Hills C++ Compiler
738 ac_cv_prog_cc_pic
='-PIC'
745 case "$cc_basename" in
748 ac_cv_prog_cc_pic
='-pic'
749 ac_cv_prog_cc_static
='-Bstatic'
753 ac_cv_prog_cc_pic
='-pic'
760 case "$cc_basename" in
762 # NonStop-UX NCC 3.20
763 ac_cv_prog_cc_pic
='-KPIC'
774 ac_cv_prog_cc_can_build_shared
=no
778 ac_cv_prog_cc_pic
="$ac_cv_prog_cc_pic -DPIC"
781 # Figure out "hidden" C++ library dependencies from verbose
782 # compiler output whening linking a shared library.
783 cat > conftest.
$ac_ext <<EOF
787 Foo (void) { a = 0; }
794 if eval $ac_compile 2>&5; then
795 # Parse the compiler output and extract the necessary
796 # objects, libraries and library flags.
798 # Sentinel used to keep track of whether or not we are before
799 # the conftest object file.
800 pre_test_object_deps_done
=no
802 for p
in `eval $output_verbose_link_cmds`; do
807 # Some compilers place space between "-{L,R}" and the path.
810 ||
test $p = "-R"; then
817 if test "$pre_test_object_deps_done" = no
; then
820 # Internal compiler library paths should come after those
821 # provided the user. The postdeps already come after the
822 # user supplied libs so there is no need to process them.
823 if test -z "$compiler_lib_search_path"; then
824 compiler_lib_search_path
="${prev}${p}"
826 compiler_lib_search_path
="${compiler_lib_search_path} ${prev}${p}"
829 # The "-l" case would never come before the object being
830 # linked, so don't bother handling this case.
833 if test -z "$postdeps"; then
834 postdeps
="${prev}${p}"
836 postdeps
="${postdeps} ${prev}${p}"
842 # This assumes that the test object file only shows up
843 # once in the compiler output.
844 if test "$p" = "conftest.$objext"; then
845 pre_test_object_deps_done
=yes
849 if test "$pre_test_object_deps_done" = no
; then
850 if test -z "$predep_objects"; then
853 predep_objects
="$predep_objects $p"
856 if test -z "$postdep_objects"; then
859 postdep_objects
="$postdep_objects $p"
864 *) ;; # Ignore the rest.
872 echo "ltcf-cxx.sh: error: problem compiling test program"
875 $rm -f confest.
$objext
877 case " $postdeps " in
878 *" -lc "*) need_lc
=no
;;