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 # FreeBSD uses GNU C++ and GNU ld
172 # FIXME: insert proper C++ library support
176 case "$cc_basename" in
178 # FIXME: insert proper C++ library support
183 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' ;;
184 *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
186 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
187 hardcode_libdir_separator=:
189 hardcode_minus_L=yes # Not in the search PATH, but as the default
190 # location of the library.
191 export_dynamic_flag_spec='${wl}-E'
193 # Commands to make compiler produce verbose output that lists
194 # what "hidden" libraries, object files and flags are used when
195 # linking a shared library.
197 # There doesn't appear to be a way to prevent this compiler from
198 # explicitly linking system object files so we need to strip them
199 # from the output so that they don't get included in the library
201 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'
204 # FIXME: insert proper C++ library support
210 case "$cc_basename" in
213 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'
215 # Archives containing C++ object files must be created using
216 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
217 # necessary to make sure instantiated templates are included
219 old_archive_cmds='$CC -ar -WR,-u -o $oldlib $oldobjs'
222 if test "$with_gcc" = yes; then
223 if test "$with_gnu_ld" = no; then
224 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'
226 archive_cmds='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
229 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
230 hardcode_libdir_separator=:
236 case "$cc_basename" in
238 # Kuck and Associates, Inc. (KAI) C++ Compiler
240 # KCC will only create a shared library if the output file
241 # ends with ".so" (or ".sl" for HP-UX), so rename the library
242 # to its proper name (with version) after linking.
243 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'
244 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'
246 # Commands to make compiler produce verbose output that lists
247 # what "hidden" libraries, object files and flags are used when
248 # linking a shared library.
250 # There doesn't appear to be a way to prevent this compiler from
251 # explicitly linking system object files so we need to strip them
252 # from the output so that they don't get included in the library
254 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'
256 hardcode_libdir_flag_spec='${wl}--rpath,$libdir'
257 export_dynamic_flag_spec='${wl}--export-dynamic'
259 # Archives containing C++ object files must be created using
260 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
261 old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
265 archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
266 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'
268 runpath_var=LD_RUN_PATH
269 hardcode_libdir_flag_spec='-rpath $libdir'
270 hardcode_libdir_separator=:
272 # Commands to make compiler produce verbose output that lists
273 # what "hidden" libraries, object files and flags are used when
274 # linking a shared library.
276 # There doesn't appear to be a way to prevent this compiler from
277 # explicitly linking system object files so we need to strip them
278 # from the output so that they don't get included in the library
280 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'
285 # FIXME: insert proper C++ library support
289 # FIXME: insert proper C++ library support
293 case "$cc_basename" in
295 # FIXME: insert proper C++ library support
299 # FIXME: insert proper C++ library support
305 # NetBSD uses g++ - do we need to do anything?
308 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
309 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
310 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'
312 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
313 hardcode_libdir_separator=:
315 # Commands to make compiler produce verbose output that lists
316 # what "hidden" libraries, object files and flags are used when
317 # linking a shared library.
318 output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
321 case "$cc_basename" in
323 # Kuck and Associates, Inc. (KAI) C++ Compiler
325 # KCC will only create a shared library if the output file
326 # ends with ".so" (or ".sl" for HP-UX), so rename the library
327 # to its proper name (with version) after linking.
328 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'
330 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
331 hardcode_libdir_separator=:
333 # Archives containing C++ object files must be created using
334 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
335 old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
340 # FIXME: insert proper C++ library support
344 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
345 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'
347 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
348 hardcode_libdir_separator=:
350 # Commands to make compiler produce verbose output that lists
351 # what "hidden" libraries, object files and flags are used when
352 # linking a shared library.
354 # There doesn't appear to be a way to prevent this compiler from
355 # explicitly linking system object files so we need to strip them
356 # from the output so that they don't get included in the library
358 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'
361 # FIXME: insert proper C++ library support
367 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
368 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
369 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'
371 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
372 hardcode_libdir_separator=:
374 # Commands to make compiler produce verbose output that lists
375 # what "hidden" libraries, object files and flags are used when
376 # linking a shared library.
377 output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
380 case "$cc_basename" in
382 # Kuck and Associates, Inc. (KAI) C++ Compiler
384 # KCC will only create a shared library if the output file
385 # ends with ".so" (or ".sl" for HP-UX), so rename the library
386 # to its proper name (with version) after linking.
387 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'
389 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
390 hardcode_libdir_separator=:
392 # Archives containing C++ object files must be created using
393 # the KAI C++ compiler.
394 old_archive_cmds='$CC -o $oldlib $oldobjs'
398 # FIXME: insert proper C++ library support
402 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
403 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'
405 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
406 hardcode_libdir_separator=:
408 # Commands to make compiler produce verbose output that lists
409 # what "hidden" libraries, object files and flags are used when
410 # linking a shared library.
412 # There doesn't appear to be a way to prevent this compiler from
413 # explicitly linking system object files so we need to strip them
414 # from the output so that they don't get included in the library
416 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'
419 # FIXME: insert proper C++ library support
425 # FIXME: insert proper C++ library support
429 case "$cc_basename" in
431 # FIXME: insert proper C++ library support
435 # FIXME: insert proper C++ library support
441 case "$cc_basename" in
444 # FIXME: insert proper C++ library support
449 # FIXME: insert proper C++ library support
453 # FIXME: insert proper C++ library support
459 case "$cc_basename" in
461 # Sun C++ 4.2, 5.x and Centerline C++
462 no_undefined_flag=' -ztext'
463 archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
464 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
465 $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'
467 hardcode_libdir_flag_spec='-R$libdir'
468 hardcode_shlibpath_var=no
470 solaris2.[0-5] | solaris2.[0-5].*) ;;
472 # The C++ compiler is used as linker so we must use $wl
473 # flag to pass the commands to the underlying system
475 # Supported since Solaris 2.6 (maybe 2.5.1?)
476 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
481 # Commands to make compiler produce verbose output that lists
482 # what "hidden" libraries, object files and flags are used when
483 # linking a shared library.
485 # There doesn't appear to be a way to prevent this compiler from
486 # explicitly linking system object files so we need to strip them
487 # from the output so that they don't get included in the library
489 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'
491 # Archives containing C++ object files must be created using
492 # "CC -xar", where "CC" is the Sun C++ compiler. This is
493 # necessary to make sure instantiated templates are included
495 old_archive_cmds='$CC -xar -o $oldlib $oldobjs'
498 # Green Hills C++ Compiler
499 archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
501 # The C++ compiler must be used to create the archive.
502 old_archive_cmds='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
505 # GNU C++ compiler with Solaris linker
506 if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
507 if $CC --version | egrep -v '^2\.7' > /dev/null; then
508 archive_cmds='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
509 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
510 $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
512 # Commands to make compiler produce verbose output that lists
513 # what "hidden" libraries, object files and flags are used when
514 # linking a shared library.
515 output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
517 # g++ 2.7 appears to require `-G' NOT `-shared' on this
519 archive_cmds='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
520 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
521 $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
523 # Commands to make compiler produce verbose output that lists
524 # what "hidden" libraries, object files and flags are used when
525 # linking a shared library.
526 output_verbose_link_cmds="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
529 hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
535 case "$cc_basename" in
537 # NonStop-UX NCC 3.20
538 # FIXME: insert proper C++ library support
542 # FIXME: insert proper C++ library support
548 # FIXME: insert proper C++ library support
552 # FIXME: insert proper C++ library support
556 # FIXME: insert proper C++ library support
562 ## Compiler Characteristics: PIC flags, static flags, etc
564 # We don't use cached values here since only the C compiler
565 # characteristics should be cached.
569 ac_cv_prog_cc_static=
570 ac_cv_prog_cc_no_builtin=
571 ac_cv_prog_cc_can_build_shared=$can_build_shared
573 # It is not enough to reset these cached values, they must be unset.
574 unset ac_cv_prog_cc_pic_works
575 unset ac_cv_prog_cc_static_works
577 if test "$with_gcc" = yes; then
578 ac_cv_prog_cc_wl='-Wl,'
579 ac_cv_prog_cc_static='-static'
582 beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
583 # PIC is the default for these OSes.
586 # Below there is a dirty hack to force normal static linking with -ldl
587 # The problem is because libdl dynamically linked with both libc and
588 # libC (AIX C++ library), which obviously doesn't included in libraries
589 # list by gcc. This cause undefined symbols with -static flags.
590 # This hack allows C programs to be linked with "-static -ldl", but
591 # we not sure about C++ programs.
592 ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
594 cygwin* | mingw* | os2*)
595 # This hack is so that the source file can tell whether it is being
596 # built for inclusion in a dll (and should export symbols for example).
597 ac_cv_prog_cc_pic='-DDLL_EXPORT'
600 # FIXME: we need at least 68020 code to build shared libraries, but
601 # adding the `-m68020' flag to GCC prevents building anything better,
603 ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
606 if test -d /usr/nec; then
607 ac_cv_prog_cc_pic=-Kconform_pic
611 ac_cv_prog_cc_pic='-fPIC'
617 # All AIX code is PIC.
620 case "$cc_basename" in
622 # Green Hills C++ Compiler
623 # 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"
628 case "$cc_basename" in
630 ac_cv_prog_cc_pic='-KPIC'
633 # Green Hills C++ Compiler
634 ac_cv_prog_cc_pic='-pic'
641 # FreeBSD uses GNU C++
643 hpux9* | hpux10* | hpux11*)
644 case "$cc_basename" in
646 ac_cv_prog_cc_wl='-Wl,'
647 ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
648 ac_cv_prog_cc_pic='+Z'
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'
660 case "$cc_basename" in
662 ac_cv_prog_cc_wl='-Wl,'
663 ac_cv_prog_cc_static='-non_shared'
664 ac_cv_prog_cc_pic='-KPIC'
671 case "$cc_basename" in
674 ac_cv_prog_cc_wl='--backend -Wl,'
675 ac_cv_prog_cc_pic='-fPIC'
679 # Make sure the PIC flag is empty. It appears that all Alpha
680 # Linux and Compaq Tru64 Unix objects are PIC.
682 ac_cv_prog_cc_static='-non_shared'
693 case "$cc_basename" in
695 ac_cv_prog_cc_pic='-W c,exportall'
703 osf3* | osf4* | osf5*)
704 case "$cc_basename" in
706 ac_cv_prog_cc_wl='--backend -Wl,'
710 ac_cv_prog_cc_pic='-pic'
714 ac_cv_prog_cc_wl='-Wl,'
715 # Make sure the PIC flag is empty. It appears that all Alpha
716 # Linux and Compaq Tru64 Unix objects are PIC.
718 ac_cv_prog_cc_static='-non_shared'
727 case "$cc_basename" in
729 ac_cv_prog_cc_pic='-fPIC'
736 case "$cc_basename" in
738 # Sun C++ 4.2, 5.x and Centerline C++
739 ac_cv_prog_cc_pic='-KPIC'
740 ac_cv_prog_cc_static='-Bstatic'
741 ac_cv_prog_cc_wl='-Qoption ld '
744 # Green Hills C++ Compiler
745 ac_cv_prog_cc_pic='-PIC'
752 case "$cc_basename" in
755 ac_cv_prog_cc_pic='-pic'
756 ac_cv_prog_cc_static='-Bstatic'
760 ac_cv_prog_cc_pic='-pic'
767 case "$cc_basename" in
769 # NonStop-UX NCC 3.20
770 ac_cv_prog_cc_pic='-KPIC'
781 ac_cv_prog_cc_can_build_shared=no
785 ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
788 # Figure out "hidden" C++ library dependencies from verbose
789 # compiler output whening linking a shared library.
790 cat > conftest.$ac_ext <<EOF
794 Foo (void) { a = 0; }
801 if eval $ac_compile 2>&5; then
802 # Parse the compiler output and extract the necessary
803 # objects, libraries and library flags.
805 # Sentinel used to keep track of whether or not we are before
806 # the conftest object file.
807 pre_test_object_deps_done=no
809 for p in `eval $output_verbose_link_cmds`; do
814 # Some compilers place space between "-{L,R}" and the path.
817 || test $p = "-R"; then
824 if test "$pre_test_object_deps_done" = no; then
827 # Internal compiler library paths should come after those
828 # provided the user. The postdeps already come after the
829 # user supplied libs so there is no need to process them.
830 if test -z "$compiler_lib_search_path"; then
831 compiler_lib_search_path="${prev}${p}"
833 compiler_lib_search_path="${compiler_lib_search_path} ${prev}${p}"
836 # The "-l" case would never come before the object being
837 # linked, so don't bother handling this case.
840 if test -z "$postdeps"; then
841 postdeps="${prev}${p}"
843 postdeps="${postdeps} ${prev}${p}"
849 # This assumes that the test object file only shows up
850 # once in the compiler output.
851 if test "$p" = "conftest.$objext"; then
852 pre_test_object_deps_done=yes
856 if test "$pre_test_object_deps_done" = no; then
857 if test -z "$predep_objects"; then
860 predep_objects="$predep_objects $p"
863 if test -z "$postdep_objects"; then
866 postdep_objects="$postdep_objects $p"
871 *) ;; # Ignore the rest.
879 echo "ltcf-cxx.sh: error: problem compiling test program"
882 $rm -f confest.$objext
884 case " $postdeps " in
885 *" -lc "*) need_lc=no ;;