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, 2001 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
137 # We don't want to build shared libraries on unknown CPU types.
144 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'
145 # -bexpall does not export symbols beginning with underscore (_)
146 always_export_symbols
=yes
147 # Exported symbols can be pulled into shared objects from archives
148 whole_archive_flag_spec
=' '
149 build_libtool_need_lc
=yes
152 case "$cc_basename" in
154 # FIXME: insert proper C++ library support
160 case "$cc_basename" in
162 # FIXME: insert proper C++ library support
166 # Green Hills C++ Compiler
167 # FIXME: insert proper C++ library support
171 # FIXME: insert proper C++ library support
177 # FreeBSD uses GNU C++ and GNU ld
178 # FIXME: insert proper C++ library support
182 case "$cc_basename" in
184 # FIXME: insert proper C++ library support
189 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' ;;
190 *) archive_cmds
='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
192 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir'
193 hardcode_libdir_separator
=:
195 hardcode_minus_L
=yes # Not in the search PATH, but as the default
196 # location of the library.
197 export_dynamic_flag_spec
='${wl}-E'
199 # Commands to make compiler produce verbose output that lists
200 # what "hidden" libraries, object files and flags are used when
201 # linking a shared library.
203 # There doesn't appear to be a way to prevent this compiler from
204 # explicitly linking system object files so we need to strip them
205 # from the output so that they don't get included in the library
207 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'
210 # FIXME: insert proper C++ library support
216 case "$cc_basename" in
219 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'
221 # Archives containing C++ object files must be created using
222 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
223 # necessary to make sure instantiated templates are included
225 old_archive_cmds
='$CC -ar -WR,-u -o $oldlib $oldobjs'
228 if test "$with_gcc" = yes; then
229 if test "$with_gnu_ld" = no
; then
230 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'
232 archive_cmds
='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
235 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
236 hardcode_libdir_separator
=:
242 case "$cc_basename" in
244 # Kuck and Associates, Inc. (KAI) C++ Compiler
246 # KCC will only create a shared library if the output file
247 # ends with ".so" (or ".sl" for HP-UX), so rename the library
248 # to its proper name (with version) after linking.
249 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'
250 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'
252 # Commands to make compiler produce verbose output that lists
253 # what "hidden" libraries, object files and flags are used when
254 # linking a shared library.
256 # There doesn't appear to be a way to prevent this compiler from
257 # explicitly linking system object files so we need to strip them
258 # from the output so that they don't get included in the library
260 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'
262 hardcode_libdir_flag_spec
='${wl}--rpath,$libdir'
263 export_dynamic_flag_spec
='${wl}--export-dynamic'
265 # Archives containing C++ object files must be created using
266 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
267 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
271 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
272 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'
274 runpath_var
=LD_RUN_PATH
275 hardcode_libdir_flag_spec
='-rpath $libdir'
276 hardcode_libdir_separator
=:
278 # Commands to make compiler produce verbose output that lists
279 # what "hidden" libraries, object files and flags are used when
280 # linking a shared library.
282 # There doesn't appear to be a way to prevent this compiler from
283 # explicitly linking system object files so we need to strip them
284 # from the output so that they don't get included in the library
286 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'
291 # FIXME: insert proper C++ library support
295 # FIXME: insert proper C++ library support
299 case "$cc_basename" in
301 # FIXME: insert proper C++ library support
305 # FIXME: insert proper C++ library support
311 # NetBSD uses g++ - do we need to do anything?
314 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
315 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
316 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'
318 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
319 hardcode_libdir_separator
=:
321 # Commands to make compiler produce verbose output that lists
322 # what "hidden" libraries, object files and flags are used when
323 # linking a shared library.
324 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
327 case "$cc_basename" in
329 # Kuck and Associates, Inc. (KAI) C++ Compiler
331 # KCC will only create a shared library if the output file
332 # ends with ".so" (or ".sl" for HP-UX), so rename the library
333 # to its proper name (with version) after linking.
334 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'
336 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
337 hardcode_libdir_separator
=:
339 # Archives containing C++ object files must be created using
340 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
341 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
346 # FIXME: insert proper C++ library support
350 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
351 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'
353 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
354 hardcode_libdir_separator
=:
356 # Commands to make compiler produce verbose output that lists
357 # what "hidden" libraries, object files and flags are used when
358 # linking a shared library.
360 # There doesn't appear to be a way to prevent this compiler from
361 # explicitly linking system object files so we need to strip them
362 # from the output so that they don't get included in the library
364 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'
367 # FIXME: insert proper C++ library support
373 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
374 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
375 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'
377 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
378 hardcode_libdir_separator
=:
380 # Commands to make compiler produce verbose output that lists
381 # what "hidden" libraries, object files and flags are used when
382 # linking a shared library.
383 output_verbose_link_cmds
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
386 case "$cc_basename" in
388 # Kuck and Associates, Inc. (KAI) C++ Compiler
390 # KCC will only create a shared library if the output file
391 # ends with ".so" (or ".sl" for HP-UX), so rename the library
392 # to its proper name (with version) after linking.
393 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'
395 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
396 hardcode_libdir_separator
=:
398 # Archives containing C++ object files must be created using
399 # the KAI C++ compiler.
400 old_archive_cmds
='$CC -o $oldlib $oldobjs'
404 # FIXME: insert proper C++ library support
408 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
409 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'
411 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
412 hardcode_libdir_separator
=:
414 # Commands to make compiler produce verbose output that lists
415 # what "hidden" libraries, object files and flags are used when
416 # linking a shared library.
418 # There doesn't appear to be a way to prevent this compiler from
419 # explicitly linking system object files so we need to strip them
420 # from the output so that they don't get included in the library
422 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'
425 # FIXME: insert proper C++ library support
431 # FIXME: insert proper C++ library support
435 case "$cc_basename" in
437 # FIXME: insert proper C++ library support
441 # FIXME: insert proper C++ library support
447 case "$cc_basename" in
450 # FIXME: insert proper C++ library support
455 # FIXME: insert proper C++ library support
459 # FIXME: insert proper C++ library support
465 case "$cc_basename" in
467 # Sun C++ 4.2, 5.x and Centerline C++
468 no_undefined_flag
=' -ztext'
469 archive_cmds
='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
470 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
471 $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'
473 hardcode_libdir_flag_spec
='-R$libdir'
474 hardcode_shlibpath_var
=no
476 solaris2.
[0-5] | solaris2.
[0-5].
*) ;;
478 # The C++ compiler is used as linker so we must use $wl
479 # flag to pass the commands to the underlying system
481 # Supported since Solaris 2.6 (maybe 2.5.1?)
482 whole_archive_flag_spec
='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
487 # Commands to make compiler produce verbose output that lists
488 # what "hidden" libraries, object files and flags are used when
489 # linking a shared library.
491 # There doesn't appear to be a way to prevent this compiler from
492 # explicitly linking system object files so we need to strip them
493 # from the output so that they don't get included in the library
495 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'
497 # Archives containing C++ object files must be created using
498 # "CC -xar", where "CC" is the Sun C++ compiler. This is
499 # necessary to make sure instantiated templates are included
501 old_archive_cmds
='$CC -xar -o $oldlib $oldobjs'
504 # Green Hills C++ Compiler
505 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
507 # The C++ compiler must be used to create the archive.
508 old_archive_cmds
='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
511 # GNU C++ compiler with Solaris linker
512 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
513 if $CC --version |
egrep -v '^2\.7' > /dev
/null
; then
514 archive_cmds
='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
515 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
516 $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
518 # Commands to make compiler produce verbose output that lists
519 # what "hidden" libraries, object files and flags are used when
520 # linking a shared library.
521 output_verbose_link_cmds
="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
523 # g++ 2.7 appears to require `-G' NOT `-shared' on this
525 archive_cmds
='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
526 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
527 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
529 # Commands to make compiler produce verbose output that lists
530 # what "hidden" libraries, object files and flags are used when
531 # linking a shared library.
532 output_verbose_link_cmds
="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
535 hardcode_libdir_flag_spec
='${wl}-R $wl$libdir'
541 case "$cc_basename" in
543 # NonStop-UX NCC 3.20
544 # FIXME: insert proper C++ library support
548 # FIXME: insert proper C++ library support
554 # FIXME: insert proper C++ library support
558 # FIXME: insert proper C++ library support
562 # FIXME: insert proper C++ library support
568 ## Compiler Characteristics: PIC flags, static flags, etc
570 # We don't use cached values here since only the C compiler
571 # characteristics should be cached.
575 ac_cv_prog_cc_static
=
576 ac_cv_prog_cc_no_builtin
=
577 ac_cv_prog_cc_can_build_shared
=$can_build_shared
579 ac_cv_prog_cc_pic_works
=
580 ac_cv_prog_cc_static_works
=
582 if test "$with_gcc" = yes; then
583 ac_cv_prog_cc_wl
='-Wl,'
584 ac_cv_prog_cc_static
='-static'
587 beos
* | irix5
* | irix6
* | osf3
* | osf4
* | osf5
*)
588 # PIC is the default for these OSes.
591 # Below there is a dirty hack to force normal static linking with -ldl
592 # The problem is because libdl dynamically linked with both libc and
593 # libC (AIX C++ library), which obviously doesn't included in libraries
594 # list by gcc. This cause undefined symbols with -static flags.
595 # This hack allows C programs to be linked with "-static -ldl", but
596 # we not sure about C++ programs.
597 ac_cv_prog_cc_static
="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
599 cygwin
* | mingw
* | os2
*)
600 # This hack is so that the source file can tell whether it is being
601 # built for inclusion in a dll (and should export symbols for example).
602 ac_cv_prog_cc_pic
='-DDLL_EXPORT'
605 # FIXME: we need at least 68020 code to build shared libraries, but
606 # adding the `-m68020' flag to GCC prevents building anything better,
608 ac_cv_prog_cc_pic
='-m68020 -resident32 -malways-restore-a4'
611 if test -d /usr
/nec
; then
612 ac_cv_prog_cc_pic
=-Kconform_pic
616 ac_cv_prog_cc_pic
='-fPIC'
622 # All AIX code is PIC.
625 case "$cc_basename" in
627 # Green Hills C++ Compiler
628 # 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"
633 case "$cc_basename" in
635 ac_cv_prog_cc_pic
='-KPIC'
638 # Green Hills C++ Compiler
639 ac_cv_prog_cc_pic
='-pic'
646 # FreeBSD uses GNU C++
648 hpux9
* | hpux10
* | hpux11
*)
649 case "$cc_basename" in
651 ac_cv_prog_cc_wl
='-Wl,'
652 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
653 ac_cv_prog_cc_pic
='+Z'
656 ac_cv_prog_cc_wl
='-Wl,'
657 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
658 ac_cv_prog_cc_pic
='+Z'
665 case "$cc_basename" in
667 ac_cv_prog_cc_wl
='-Wl,'
668 ac_cv_prog_cc_static
='-non_shared'
669 ac_cv_prog_cc_pic
='-KPIC'
676 case "$cc_basename" in
679 ac_cv_prog_cc_wl
='--backend -Wl,'
680 ac_cv_prog_cc_pic
='-fPIC'
684 # Make sure the PIC flag is empty. It appears that all Alpha
685 # Linux and Compaq Tru64 Unix objects are PIC.
687 ac_cv_prog_cc_static
='-non_shared'
698 case "$cc_basename" in
700 ac_cv_prog_cc_pic
='-W c,exportall'
708 osf3
* | osf4
* | osf5
*)
709 case "$cc_basename" in
711 ac_cv_prog_cc_wl
='--backend -Wl,'
715 ac_cv_prog_cc_pic
='-pic'
719 ac_cv_prog_cc_wl
='-Wl,'
720 # Make sure the PIC flag is empty. It appears that all Alpha
721 # Linux and Compaq Tru64 Unix objects are PIC.
723 ac_cv_prog_cc_static
='-non_shared'
732 case "$cc_basename" in
734 ac_cv_prog_cc_pic
='-fPIC'
741 case "$cc_basename" in
743 # Sun C++ 4.2, 5.x and Centerline C++
744 ac_cv_prog_cc_pic
='-KPIC'
745 ac_cv_prog_cc_static
='-Bstatic'
746 ac_cv_prog_cc_wl
='-Qoption ld '
749 # Green Hills C++ Compiler
750 ac_cv_prog_cc_pic
='-PIC'
757 case "$cc_basename" in
760 ac_cv_prog_cc_pic
='-pic'
761 ac_cv_prog_cc_static
='-Bstatic'
765 ac_cv_prog_cc_pic
='-pic'
772 case "$cc_basename" in
774 # NonStop-UX NCC 3.20
775 ac_cv_prog_cc_pic
='-KPIC'
786 ac_cv_prog_cc_can_build_shared
=no
790 ac_cv_prog_cc_pic
="$ac_cv_prog_cc_pic -DPIC"
793 # Figure out "hidden" C++ library dependencies from verbose
794 # compiler output whening linking a shared library.
795 cat > conftest.
$ac_ext <<EOF
799 Foo (void) { a = 0; }
806 if (eval $ac_compile) 2>&5; then
807 # Parse the compiler output and extract the necessary
808 # objects, libraries and library flags.
810 # Sentinel used to keep track of whether or not we are before
811 # the conftest object file.
812 pre_test_object_deps_done
=no
814 for p
in `eval $output_verbose_link_cmds`; do
819 # Some compilers place space between "-{L,R}" and the path.
822 ||
test $p = "-R"; then
829 if test "$pre_test_object_deps_done" = no
; then
832 # Internal compiler library paths should come after those
833 # provided the user. The postdeps already come after the
834 # user supplied libs so there is no need to process them.
835 if test -z "$compiler_lib_search_path"; then
836 compiler_lib_search_path
="${prev}${p}"
838 compiler_lib_search_path
="${compiler_lib_search_path} ${prev}${p}"
841 # The "-l" case would never come before the object being
842 # linked, so don't bother handling this case.
845 if test -z "$postdeps"; then
846 postdeps
="${prev}${p}"
848 postdeps
="${postdeps} ${prev}${p}"
854 # This assumes that the test object file only shows up
855 # once in the compiler output.
856 if test "$p" = "conftest.$objext"; then
857 pre_test_object_deps_done
=yes
861 if test "$pre_test_object_deps_done" = no
; then
862 if test -z "$predep_objects"; then
865 predep_objects
="$predep_objects $p"
868 if test -z "$postdep_objects"; then
871 postdep_objects
="$postdep_objects $p"
876 *) ;; # Ignore the rest.
884 echo "ltcf-cxx.sh: error: problem compiling test program"
887 $rm -f confest.
$objext
889 case " $postdeps " in
890 *" -lc "*) need_lc
=no
;;