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 archive_expsym_cmds
="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
139 # -bexpall does not export symbols beginning with underscore (_)
140 always_export_symbols
=yes
141 # Exported symbols can be pulled into shared objects from archives
142 whole_archive_flag_spec
=' '
143 build_libtool_need_lc
=yes
146 case "$cc_basename" in
148 # FIXME: insert proper C++ library support
154 case "$cc_basename" in
156 # FIXME: insert proper C++ library support
160 # Green Hills C++ Compiler
161 # FIXME: insert proper C++ library support
165 # FIXME: insert proper C++ library support
171 # C++ shared libraries reported to be fairly broken before switch to ELF
175 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
180 case "$cc_basename" in
182 # FIXME: insert proper C++ library support
187 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' ;;
188 *) archive_cmds
='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
190 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
191 hardcode_libdir_separator
=:
193 hardcode_minus_L
=yes # Not in the search PATH, but as the default
194 # location of the library.
195 export_dynamic_flag_spec
='${wl}-E'
197 # Commands to make compiler produce verbose output that lists
198 # what "hidden" libraries, object files and flags are used when
199 # linking a shared library.
201 # There doesn't appear to be a way to prevent this compiler from
202 # explicitly linking system object files so we need to strip them
203 # from the output so that they don't get included in the library
205 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'
208 # FIXME: insert proper C++ library support
214 case "$cc_basename" in
217 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'
219 # Archives containing C++ object files must be created using
220 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
221 # necessary to make sure instantiated templates are included
223 old_archive_cmds
='$CC -ar -WR,-u -o $oldlib $oldobjs'
226 if test "$with_gcc" = yes; then
227 if test "$with_gnu_ld" = no
; then
228 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'
230 archive_cmds
='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
233 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
234 hardcode_libdir_separator
=:
240 case "$cc_basename" in
242 # Kuck and Associates, Inc. (KAI) C++ Compiler
244 # KCC will only create a shared library if the output file
245 # ends with ".so" (or ".sl" for HP-UX), so rename the library
246 # to its proper name (with version) after linking.
247 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'
248 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'
250 # Commands to make compiler produce verbose output that lists
251 # what "hidden" libraries, object files and flags are used when
252 # linking a shared library.
254 # There doesn't appear to be a way to prevent this compiler from
255 # explicitly linking system object files so we need to strip them
256 # from the output so that they don't get included in the library
258 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'
260 hardcode_libdir_flag_spec
='${wl}--rpath,$libdir'
261 export_dynamic_flag_spec
='${wl}--export-dynamic'
263 # Archives containing C++ object files must be created using
264 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
265 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
269 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
270 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'
272 runpath_var
=LD_RUN_PATH
273 hardcode_libdir_flag_spec
='-rpath $libdir'
274 hardcode_libdir_separator
=:
276 # Commands to make compiler produce verbose output that lists
277 # what "hidden" libraries, object files and flags are used when
278 # linking a shared library.
280 # There doesn't appear to be a way to prevent this compiler from
281 # explicitly linking system object files so we need to strip them
282 # from the output so that they don't get included in the library
284 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'
289 # FIXME: insert proper C++ library support
293 # FIXME: insert proper C++ library support
297 case "$cc_basename" in
299 # FIXME: insert proper C++ library support
303 # FIXME: insert proper C++ library support
309 # NetBSD uses g++ - do we need to do anything?
312 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
313 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
314 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'
316 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
317 hardcode_libdir_separator
=:
319 # Commands to make compiler produce verbose output that lists
320 # what "hidden" libraries, object files and flags are used when
321 # linking a shared library.
322 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
325 case "$cc_basename" in
327 # Kuck and Associates, Inc. (KAI) C++ Compiler
329 # KCC will only create a shared library if the output file
330 # ends with ".so" (or ".sl" for HP-UX), so rename the library
331 # to its proper name (with version) after linking.
332 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'
334 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
335 hardcode_libdir_separator
=:
337 # Archives containing C++ object files must be created using
338 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
339 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
344 # FIXME: insert proper C++ library support
348 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
349 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'
351 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
352 hardcode_libdir_separator
=:
354 # Commands to make compiler produce verbose output that lists
355 # what "hidden" libraries, object files and flags are used when
356 # linking a shared library.
358 # There doesn't appear to be a way to prevent this compiler from
359 # explicitly linking system object files so we need to strip them
360 # from the output so that they don't get included in the library
362 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'
365 # FIXME: insert proper C++ library support
371 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
372 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
373 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'
375 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
376 hardcode_libdir_separator
=:
378 # Commands to make compiler produce verbose output that lists
379 # what "hidden" libraries, object files and flags are used when
380 # linking a shared library.
381 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
384 case "$cc_basename" in
386 # Kuck and Associates, Inc. (KAI) C++ Compiler
388 # KCC will only create a shared library if the output file
389 # ends with ".so" (or ".sl" for HP-UX), so rename the library
390 # to its proper name (with version) after linking.
391 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'
393 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
394 hardcode_libdir_separator
=:
396 # Archives containing C++ object files must be created using
397 # the KAI C++ compiler.
398 old_archive_cmds
='$CC -o $oldlib $oldobjs'
402 # FIXME: insert proper C++ library support
406 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
407 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'
409 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
410 hardcode_libdir_separator
=:
412 # Commands to make compiler produce verbose output that lists
413 # what "hidden" libraries, object files and flags are used when
414 # linking a shared library.
416 # There doesn't appear to be a way to prevent this compiler from
417 # explicitly linking system object files so we need to strip them
418 # from the output so that they don't get included in the library
420 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'
423 # FIXME: insert proper C++ library support
429 # FIXME: insert proper C++ library support
433 case "$cc_basename" in
435 # FIXME: insert proper C++ library support
439 # FIXME: insert proper C++ library support
445 case "$cc_basename" in
448 # FIXME: insert proper C++ library support
453 # FIXME: insert proper C++ library support
457 # FIXME: insert proper C++ library support
463 case "$cc_basename" in
465 # Sun C++ 4.2, 5.x and Centerline C++
466 no_undefined_flag
=' -ztext'
467 archive_cmds
='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
468 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
469 $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'
471 hardcode_libdir_flag_spec
='-R$libdir'
472 hardcode_shlibpath_var
=no
474 solaris2.
[0-5] | solaris2.
[0-5].
*) ;;
476 # The C++ compiler is used as linker so we must use $wl
477 # flag to pass the commands to the underlying system
479 # Supported since Solaris 2.6 (maybe 2.5.1?)
480 whole_archive_flag_spec
='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
485 # Commands to make compiler produce verbose output that lists
486 # what "hidden" libraries, object files and flags are used when
487 # linking a shared library.
489 # There doesn't appear to be a way to prevent this compiler from
490 # explicitly linking system object files so we need to strip them
491 # from the output so that they don't get included in the library
493 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'
495 # Archives containing C++ object files must be created using
496 # "CC -xar", where "CC" is the Sun C++ compiler. This is
497 # necessary to make sure instantiated templates are included
499 old_archive_cmds
='$CC -xar -o $oldlib $oldobjs'
502 # Green Hills C++ Compiler
503 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
505 # The C++ compiler must be used to create the archive.
506 old_archive_cmds
='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
509 # GNU C++ compiler with Solaris linker
510 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
511 if $CC --version |
egrep -v '^2\.7' > /dev
/null
; then
512 archive_cmds
='$LD -shared -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 -shared -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 -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
521 # g++ 2.7 appears to require `-G' NOT `-shared' on this
523 archive_cmds
='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
524 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
525 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
527 # Commands to make compiler produce verbose output that lists
528 # what "hidden" libraries, object files and flags are used when
529 # linking a shared library.
530 output_verbose_link_cmds
="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
533 hardcode_libdir_flag_spec
='${wl}-R $wl$libdir'
539 case "$cc_basename" in
541 # NonStop-UX NCC 3.20
542 # FIXME: insert proper C++ library support
546 # FIXME: insert proper C++ library support
552 # FIXME: insert proper C++ library support
556 # FIXME: insert proper C++ library support
560 # FIXME: insert proper C++ library support
566 ## Compiler Characteristics: PIC flags, static flags, etc
568 # We don't use cached values here since only the C compiler
569 # characteristics should be cached.
573 ac_cv_prog_cc_static
=
574 ac_cv_prog_cc_no_builtin
=
575 ac_cv_prog_cc_can_build_shared
=$can_build_shared
577 # It is not enough to reset these cached values, they must be unset.
578 unset ac_cv_prog_cc_pic_works
579 unset ac_cv_prog_cc_static_works
581 if test "$with_gcc" = yes; then
582 ac_cv_prog_cc_wl
='-Wl,'
583 ac_cv_prog_cc_static
='-static'
586 beos
* | irix5
* | irix6
* | osf3
* | osf4
* | osf5
*)
587 # PIC is the default for these OSes.
590 # Below there is a dirty hack to force normal static linking with -ldl
591 # The problem is because libdl dynamically linked with both libc and
592 # libC (AIX C++ library), which obviously doesn't included in libraries
593 # list by gcc. This cause undefined symbols with -static flags.
594 # This hack allows C programs to be linked with "-static -ldl", but
595 # we not sure about C++ programs.
596 ac_cv_prog_cc_static
="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
599 # DJGPP does not support shared libraries at all
602 cygwin
* | mingw
* | os2
*)
603 # This hack is so that the source file can tell whether it is being
604 # built for inclusion in a dll (and should export symbols for example).
605 ac_cv_prog_cc_pic
='-DDLL_EXPORT'
608 # FIXME: we need at least 68020 code to build shared libraries, but
609 # adding the `-m68020' flag to GCC prevents building anything better,
611 ac_cv_prog_cc_pic
='-m68020 -resident32 -malways-restore-a4'
614 if test -d /usr
/nec
; then
615 ac_cv_prog_cc_pic
=-Kconform_pic
619 ac_cv_prog_cc_pic
='-fPIC'
625 # All AIX code is PIC.
628 case "$cc_basename" in
630 # Green Hills C++ Compiler
631 # 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"
636 case "$cc_basename" in
638 ac_cv_prog_cc_pic
='-KPIC'
641 # Green Hills C++ Compiler
642 ac_cv_prog_cc_pic
='-pic'
649 # FreeBSD uses GNU C++
651 hpux9
* | hpux10
* | hpux11
*)
652 case "$cc_basename" in
654 ac_cv_prog_cc_wl
='-Wl,'
655 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
656 ac_cv_prog_cc_pic
='+Z'
659 ac_cv_prog_cc_wl
='-Wl,'
660 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
661 ac_cv_prog_cc_pic
='+Z'
668 case "$cc_basename" in
670 ac_cv_prog_cc_wl
='-Wl,'
671 ac_cv_prog_cc_static
='-non_shared'
672 ac_cv_prog_cc_pic
='-KPIC'
679 case "$cc_basename" in
682 ac_cv_prog_cc_wl
='--backend -Wl,'
683 ac_cv_prog_cc_pic
='-fPIC'
687 # Make sure the PIC flag is empty. It appears that all Alpha
688 # Linux and Compaq Tru64 Unix objects are PIC.
690 ac_cv_prog_cc_static
='-non_shared'
701 case "$cc_basename" in
703 ac_cv_prog_cc_pic
='-W c,exportall'
711 osf3
* | osf4
* | osf5
*)
712 case "$cc_basename" in
714 ac_cv_prog_cc_wl
='--backend -Wl,'
718 ac_cv_prog_cc_pic
='-pic'
722 ac_cv_prog_cc_wl
='-Wl,'
723 # Make sure the PIC flag is empty. It appears that all Alpha
724 # Linux and Compaq Tru64 Unix objects are PIC.
726 ac_cv_prog_cc_static
='-non_shared'
735 case "$cc_basename" in
737 ac_cv_prog_cc_pic
='-fPIC'
744 case "$cc_basename" in
746 # Sun C++ 4.2, 5.x and Centerline C++
747 ac_cv_prog_cc_pic
='-KPIC'
748 ac_cv_prog_cc_static
='-Bstatic'
749 ac_cv_prog_cc_wl
='-Qoption ld '
752 # Green Hills C++ Compiler
753 ac_cv_prog_cc_pic
='-PIC'
760 case "$cc_basename" in
763 ac_cv_prog_cc_pic
='-pic'
764 ac_cv_prog_cc_static
='-Bstatic'
768 ac_cv_prog_cc_pic
='-pic'
775 case "$cc_basename" in
777 # NonStop-UX NCC 3.20
778 ac_cv_prog_cc_pic
='-KPIC'
789 ac_cv_prog_cc_can_build_shared
=no
795 # Platforms which do not suport PIC and -DPIC is meaningless
801 ac_cv_prog_cc_pic
="$ac_cv_prog_cc_pic -DPIC"
806 # Figure out "hidden" C++ library dependencies from verbose
807 # compiler output whening linking a shared library.
808 cat > conftest.
$ac_ext <<EOF
812 Foo (void) { a = 0; }
819 if eval $ac_compile 2>&5; then
820 # Parse the compiler output and extract the necessary
821 # objects, libraries and library flags.
823 # Sentinel used to keep track of whether or not we are before
824 # the conftest object file.
825 pre_test_object_deps_done
=no
827 for p
in `eval $output_verbose_link_cmds`; do
832 # Some compilers place space between "-{L,R}" and the path.
835 ||
test $p = "-R"; then
842 if test "$pre_test_object_deps_done" = no
; then
845 # Internal compiler library paths should come after those
846 # provided the user. The postdeps already come after the
847 # user supplied libs so there is no need to process them.
848 if test -z "$compiler_lib_search_path"; then
849 compiler_lib_search_path
="${prev}${p}"
851 compiler_lib_search_path
="${compiler_lib_search_path} ${prev}${p}"
854 # The "-l" case would never come before the object being
855 # linked, so don't bother handling this case.
858 if test -z "$postdeps"; then
859 postdeps
="${prev}${p}"
861 postdeps
="${postdeps} ${prev}${p}"
867 # This assumes that the test object file only shows up
868 # once in the compiler output.
869 if test "$p" = "conftest.$objext"; then
870 pre_test_object_deps_done
=yes
874 if test "$pre_test_object_deps_done" = no
; then
875 if test -z "$predep_objects"; then
878 predep_objects
="$predep_objects $p"
881 if test -z "$postdep_objects"; then
884 postdep_objects
="$postdep_objects $p"
889 *) ;; # Ignore the rest.
897 echo "ltcf-cxx.sh: error: problem compiling test program"
900 $rm -f confest.
$objext
902 case " $postdeps " in
903 *" -lc "*) need_lc
=no
;;