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, 2003 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. The
72 # assumption here is that the linker is going to be the same as that
73 # used by the C compiler. For the purposes of GCC, this is ok, but
74 # if someone uses g++ along with a non-GNU C compiler that doesn't
75 # use GNU ld, we may lose. This is ok for the toolchain tree, since
76 # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava,
77 # anyway, and those use both gcc and g++, so the settings are bound
80 if test "$with_gnu_ld" = yes; then
81 archive_cmds
='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
82 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'
84 hardcode_libdir_flag_spec
='${wl}--rpath ${wl}$libdir'
85 export_dynamic_flag_spec
='${wl}--export-dynamic'
87 # If archive_cmds runs LD, not CC, wlarc should be empty
88 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
89 # investigate it a little bit more. (MM)
92 # ancient GNU ld didn't support --whole-archive et. al.
93 if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
94 egrep 'no-whole-archive' > /dev
/null
; then
95 whole_archive_flag_spec
="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
97 whole_archive_flag_spec
=
102 # A generic and very simple default shared library creation
103 # command for GNU C++ for the case where it uses the native
104 # linker, instead of GNU ld. If possible, this setting should
105 # overridden to take advantage of the native linker features on
106 # the platform it is being used on.
107 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
110 # Commands to make compiler produce verbose output that lists
111 # what "hidden" libraries, object files and flags are used when
112 # linking a shared library.
113 output_verbose_link_cmd
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
120 # PORTME: fill in a description of your system's C++ link characteristics
123 # FIXME: insert proper C++ library support
129 hardcode_libdir_separator
=':'
131 file_list_spec
='${wl}-f,'
132 # When large executables or shared objects are built, AIX ld can
133 # have problems creating the table of contents. If linking a library
134 # or program results in "error TOC overflow" add -mminimal-toc to
135 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
136 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
137 if test "$with_gcc" = yes; then
138 case $host_os in aix4.
[012]|aix4.
[012].
*)
139 # We only want to do this on AIX 4.2 and lower, the check
140 # below for broken collect2 doesn't work under 4.3+
141 collect2name
=`${CC} -print-prog-name=collect2`
142 if test -f "$collect2name" && \
143 strings "$collect2name" |
grep resolve_lib_name
>/dev
/null
145 # We have reworked collect2
148 # We have old collect2
149 hardcode_direct
=unsupported
150 # It fails to find uninstalled libraries when the uninstalled
151 # path is not listed in the libpath. Setting hardcode_minus_L
152 # to unsupported forces relinking
154 hardcode_libdir_flag_spec
='-L$libdir'
155 hardcode_libdir_separator
=
158 shared_flag
='-shared'
161 if test "$host_cpu" = ia64
; then
162 shared_flag
='${wl}-G'
164 shared_flag
='${wl}-bM:SRE'
168 if test "$host_cpu" = ia64
; then
169 # On IA64, the linker does run time linking by default, so we don't
170 # have to do anything special.
171 aix_use_runtimelinking
=no
172 if test $with_gnu_ld = no
; then
173 exp_sym_flag
='-Bexport'
177 # Test if we are trying to use run time linking, or normal AIX style linking.
178 # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
179 aix_use_runtimelinking
=no
180 for ld_flag
in $LDFLAGS; do
181 if (test $ld_flag = "-brtl" ||
test $ld_flag = "-Wl,-brtl" ); then
182 aix_use_runtimelinking
=yes
186 exp_sym_flag
='-bexport'
187 no_entry_flag
='-bnoentry'
189 # It seems that -bexpall does not export symbols beginning with
190 # underscore (_), so it is better to generate a list of symbols to export.
191 always_export_symbols
=yes
192 if test "$aix_use_runtimelinking" = yes; then
193 hardcode_libdir_flag_spec
='${wl}-blibpath:$libdir:/usr/lib:/lib'
194 allow_undefined_flag
=' -Wl,-G'
195 archive_expsym_cmds
="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}-brtl \${wl}$exp_sym_flag:\$export_symbols"
197 if test "$host_cpu" = ia64; then
198 if test $with_gnu_ld = no; then
199 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr
/lib
:/lib
'
200 allow_undefined_flag="-z nodefs"
201 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\
$export_symbols"
204 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
205 # Warning - without using the other run time loading flags, -berok will
206 # link without error, but may produce a broken library.
207 no_undefined_flag=' ${wl}-bnoerok'
208 allow_undefined_flag=' ${wl}-berok'
209 # -bexpall does not export symbols beginning with underscore (_)
210 always_export_symbols=yes
211 # Exported symbols can be pulled into shared objects from archives
212 whole_archive_flag_spec=' '
213 build_libtool_need_lc=yes
214 # This is similar to how AIX traditionally builds it's shared libraries.
215 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'
222 # FIXME: insert proper C++ library support
230 rhapsody* | darwin1.[[012]])
231 allow_undefined_flag='-undefined suppress'
234 if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
235 allow_undefined_flag='-flat_namespace -undefined suppress'
237 case ${MACOSX_DEPLOYMENT_TARGET} in
239 allow_undefined_flag='-flat_namespace -undefined suppress'
242 allow_undefined_flag='-undefined dynamic_lookup'
248 # Disable shared library build on OS-X older than 10.3.
250 # APPLE LOCAL darwin10
258 output_verbose_link_cmd='echo'
260 archive_cmds='$CXX -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
261 module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
263 # Don't fix this by using the ld -exported_symbols_list flag,
264 # it doesn't exist in older darwin ld's
265 archive_expsym_cmds='sed -e "s
,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
266 module_expsym_cmds
='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
268 hardcode_automatic
=yes
269 hardcode_shlibpath_var
=unsupported
276 # FIXME: insert proper C++ library support
280 # Green Hills C++ Compiler
281 # FIXME: insert proper C++ library support
285 # FIXME: insert proper C++ library support
291 # C++ shared libraries reported to be fairly broken before switch to ELF
294 freebsd
* | kfreebsd
*-gnu)
295 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
302 if test $with_gnu_ld = no
; then
305 hardcode_libdir_flag_spec
='-L$libdir'
306 hardcode_shlibpath_var
=no
;;
308 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir' ;;
311 hardcode_libdir_separator
=:
312 export_dynamic_flag_spec
='${wl}-E'
314 hardcode_minus_L
=yes # Not in the search PATH, but as the default
315 # location of the library.
319 # FIXME: insert proper C++ library support
324 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' ;;
325 *) archive_cmds
='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
327 # Commands to make compiler produce verbose output that lists
328 # what "hidden" libraries, object files and flags are used when
329 # linking a shared library.
331 # There doesn't appear to be a way to prevent this compiler from
332 # explicitly linking system object files so we need to strip them
333 # from the output so that they don't get included in the library
335 output_verbose_link_cmd
='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'
338 if test $with_gcc = yes; then
339 if test $with_gnu_ld = no
; then
341 hpux9
*) archive_cmds
='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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' ;;
345 archive_cmds
='$LD -b +h $soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ;;
347 archive_cmds
='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
353 # FIXME: insert proper C++ library support
363 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'
365 # Archives containing C++ object files must be created using
366 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
367 # necessary to make sure instantiated templates are included
369 old_archive_cmds
='$CC -ar -WR,-u -o $oldlib $oldobjs'
372 if test "$with_gcc" = yes; then
373 if test "$with_gnu_ld" = no
; then
374 archive_cmds
='$CC -shared -nostdlib $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'
376 archive_cmds
='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
379 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
380 hardcode_libdir_separator
=:
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'
394 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'
396 # Commands to make compiler produce verbose output that lists
397 # what "hidden" libraries, object files and flags are used when
398 # linking a shared library.
400 # There doesn't appear to be a way to prevent this compiler from
401 # explicitly linking system object files so we need to strip them
402 # from the output so that they don't get included in the library
404 output_verbose_link_cmd
='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'
406 hardcode_libdir_flag_spec
='${wl}--rpath,$libdir'
407 export_dynamic_flag_spec
='${wl}--export-dynamic'
409 # Archives containing C++ object files must be created using
410 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
411 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
415 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
416 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'
418 runpath_var
=LD_RUN_PATH
419 hardcode_libdir_flag_spec
='-rpath $libdir'
420 hardcode_libdir_separator
=:
422 # Commands to make compiler produce verbose output that lists
423 # what "hidden" libraries, object files and flags are used when
424 # linking a shared library.
426 # There doesn't appear to be a way to prevent this compiler from
427 # explicitly linking system object files so we need to strip them
428 # from the output so that they don't get included in the library
430 output_verbose_link_cmd
='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'
435 # FIXME: insert proper C++ library support
439 # FIXME: insert proper C++ library support
445 # FIXME: insert proper C++ library support
449 # FIXME: insert proper C++ library support
454 netbsd
* | knetbsd
*-gnu)
455 # NetBSD uses g++ - do we need to do anything?
460 # Kuck and Associates, Inc. (KAI) C++ Compiler
462 # KCC will only create a shared library if the output file
463 # ends with ".so" (or ".sl" for HP-UX), so rename the library
464 # to its proper name (with version) after linking.
465 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'
467 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
468 hardcode_libdir_separator
=:
470 # Archives containing C++ object files must be created using
471 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
472 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
477 # FIXME: insert proper C++ library support
481 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
482 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'
484 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
485 hardcode_libdir_separator
=:
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_cmd
='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'
498 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
499 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
500 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'
502 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
503 hardcode_libdir_separator
=:
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_cmd
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
510 # FIXME: insert proper C++ library support
519 # Kuck and Associates, Inc. (KAI) C++ Compiler
521 # KCC will only create a shared library if the output file
522 # ends with ".so" (or ".sl" for HP-UX), so rename the library
523 # to its proper name (with version) after linking.
524 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'
526 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
527 hardcode_libdir_separator
=:
529 # Archives containing C++ object files must be created using
530 # the KAI C++ compiler.
531 old_archive_cmds
='$CC -o $oldlib $oldobjs'
535 # FIXME: insert proper C++ library support
539 allow_undefined_flag
=' -expect_unresolved \*'
540 archive_cmds
='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
541 archive_expsym_cmds
='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
542 echo "-hidden">> $lib.exp~
543 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
546 hardcode_libdir_flag_spec
='-rpath $libdir'
547 hardcode_libdir_separator
=:
549 # Commands to make compiler produce verbose output that lists
550 # what "hidden" libraries, object files and flags are used when
551 # linking a shared library.
553 # There doesn't appear to be a way to prevent this compiler from
554 # explicitly linking system object files so we need to strip them
555 # from the output so that they don't get included in the library
557 output_verbose_link_cmd
='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'
560 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
561 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
562 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'
564 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
565 hardcode_libdir_separator
=:
567 # Commands to make compiler produce verbose output that lists
568 # what "hidden" libraries, object files and flags are used when
569 # linking a shared library.
570 output_verbose_link_cmd
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
572 # FIXME: insert proper C++ library support
579 # FIXME: insert proper C++ library support
585 # FIXME: insert proper C++ library support
589 # FIXME: insert proper C++ library support
598 # FIXME: insert proper C++ library support
603 # FIXME: insert proper C++ library support
607 # FIXME: insert proper C++ library support
615 # Sun C++ 4.2, 5.x and Centerline C++
616 no_undefined_flag
=' -zdefs'
617 archive_cmds
='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
618 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
619 $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'
621 hardcode_libdir_flag_spec
='-R$libdir'
622 hardcode_shlibpath_var
=no
624 solaris2.
[0-5] | solaris2.
[0-5].
*) ;;
626 # The C++ compiler is used as linker so we must use $wl
627 # flag to pass the commands to the underlying system
629 # Supported since Solaris 2.6 (maybe 2.5.1?)
630 whole_archive_flag_spec
='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
635 # Commands to make compiler produce verbose output that lists
636 # what "hidden" libraries, object files and flags are used when
637 # linking a shared library.
639 # There doesn't appear to be a way to prevent this compiler from
640 # explicitly linking system object files so we need to strip them
641 # from the output so that they don't get included in the library
643 output_verbose_link_cmd
='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'
645 # Archives containing C++ object files must be created using
646 # "CC -xar", where "CC" is the Sun C++ compiler. This is
647 # necessary to make sure instantiated templates are included
649 old_archive_cmds
='$CC -xar -o $oldlib $oldobjs'
652 # Green Hills C++ Compiler
653 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
655 # The C++ compiler must be used to create the archive.
656 old_archive_cmds
='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
659 # GNU C++ compiler with Solaris linker
660 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
661 no_undefined_flag
=' ${wl}-z ${wl}defs'
662 if $CC --version |
egrep -v '^2\.7' > /dev
/null
; then
663 archive_cmds
='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
664 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
665 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
667 # Commands to make compiler produce verbose output that lists
668 # what "hidden" libraries, object files and flags are used when
669 # linking a shared library.
670 output_verbose_link_cmd
="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
672 # g++ 2.7 appears to require `-G' NOT `-shared' on this
674 archive_cmds
='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
675 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
676 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
678 # Commands to make compiler produce verbose output that lists
679 # what "hidden" libraries, object files and flags are used when
680 # linking a shared library.
681 output_verbose_link_cmd
="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
684 hardcode_libdir_flag_spec
='${wl}-R $wl$libdir'
692 # NonStop-UX NCC 3.20
693 # FIXME: insert proper C++ library support
697 # FIXME: insert proper C++ library support
706 # FIXME: insert proper C++ library support
710 # FIXME: insert proper C++ library support
714 # FIXME: insert proper C++ library support
720 ## Compiler Characteristics: PIC flags, static flags, etc
722 # We don't use cached values here since only the C compiler
723 # characteristics should be cached.
727 ac_cv_prog_cc_static
=
728 ac_cv_prog_cc_no_builtin
=
729 ac_cv_prog_cc_can_build_shared
=$can_build_shared
731 ac_cv_prog_cc_pic_works
=
732 ac_cv_prog_cc_static_works
=
734 if test "$with_gcc" = yes; then
735 ac_cv_prog_cc_wl
='-Wl,'
736 ac_cv_prog_cc_static
='-static'
740 # All AIX code is PIC.
741 if test "$host_cpu" = ia64
; then
742 # AIX 5 now supports IA64 processor
743 lt_cv_prog_cc_static
='-Bstatic'
745 lt_cv_prog_cc_static
='-bnso -bI:/lib/syscalls.exp'
749 # FIXME: we need at least 68020 code to build shared libraries, but
750 # adding the `-m68020' flag to GCC prevents building anything better,
752 ac_cv_prog_cc_pic
='-m68020 -resident32 -malways-restore-a4'
754 beos
* | irix5
* | irix6
* | osf3
* | osf4
* | osf5
*)
755 # PIC is the default for these OSes.
757 cygwin
* | mingw
* | os2
*)
758 # This hack is so that the source file can tell whether it is being
759 # built for inclusion in a dll (and should export symbols for example).
760 ac_cv_prog_cc_pic
='-DDLL_EXPORT'
763 # PIC is the default on this platform
764 # Common symbols not allowed in MH_DYLIB files
765 ac_cv_prog_cc_pic
='-fno-common'
768 # DJGPP does not support shared libraries at all
772 if test -d /usr
/nec
; then
773 ac_cv_prog_cc_pic
=-Kconform_pic
777 ac_cv_prog_cc_pic
='-fPIC'
783 # All AIX code is PIC.
784 if test "$host_cpu" = ia64
; then
785 # AIX 5 now supports IA64 processor
786 lt_cv_prog_cc_static
='-Bstatic'
788 lt_cv_prog_cc_static
='-bnso -bI:/lib/syscalls.exp'
794 # Green Hills C++ Compiler
795 # 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"
802 ac_cv_prog_cc_pic
='-KPIC'
805 # Green Hills C++ Compiler
806 ac_cv_prog_cc_pic
='-pic'
812 freebsd
* | kfreebsd
*-gnu)
813 # FreeBSD uses GNU C++
817 hpux9
* | hpux10
* | hpux11
*)
820 ac_cv_prog_cc_wl
='-Wl,'
821 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
822 ac_cv_prog_cc_pic
='+Z'
825 ac_cv_prog_cc_wl
='-Wl,'
826 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
827 ac_cv_prog_cc_pic
='+Z'
836 ac_cv_prog_cc_wl
='-Wl,'
837 ac_cv_prog_cc_static
='-non_shared'
838 ac_cv_prog_cc_pic
='-KPIC'
848 ac_cv_prog_cc_wl
='--backend -Wl,'
849 ac_cv_prog_cc_pic
='-fPIC'
853 # Make sure the PIC flag is empty. It appears that all Alpha
854 # Linux and Compaq Tru64 Unix objects are PIC.
856 ac_cv_prog_cc_static
='-non_shared'
869 ac_cv_prog_cc_pic
='-W c,exportall'
877 osf3
* | osf4
* | osf5
*)
880 ac_cv_prog_cc_wl
='--backend -Wl,'
884 ac_cv_prog_cc_pic
='-pic'
888 ac_cv_prog_cc_wl
='-Wl,'
889 # Make sure the PIC flag is empty. It appears that all Alpha
890 # Linux and Compaq Tru64 Unix objects are PIC.
892 ac_cv_prog_cc_static
='-non_shared'
903 ac_cv_prog_cc_pic
='-fPIC'
912 # Sun C++ 4.2, 5.x and Centerline C++
913 ac_cv_prog_cc_pic
='-KPIC'
914 ac_cv_prog_cc_static
='-Bstatic'
915 ac_cv_prog_cc_wl
='-Qoption ld '
918 # Green Hills C++ Compiler
919 ac_cv_prog_cc_pic
='-PIC'
929 ac_cv_prog_cc_pic
='-pic'
930 ac_cv_prog_cc_static
='-Bstatic'
934 ac_cv_prog_cc_pic
='-pic'
943 # NonStop-UX NCC 3.20
944 ac_cv_prog_cc_pic
='-KPIC'
955 ac_cv_prog_cc_can_build_shared
=no
961 # Platforms which do not suport PIC and -DPIC is meaningless
967 ac_cv_prog_cc_pic
="$ac_cv_prog_cc_pic -DPIC"
972 # Figure out "hidden" C++ library dependencies from verbose
973 # compiler output whening linking a shared library.
974 cat > conftest.
$ac_ext <<EOF
978 Foo (void) { a = 0; }
985 if (eval $ac_compile) 2>&5; then
986 # Parse the compiler output and extract the necessary
987 # objects, libraries and library flags.
989 # Sentinel used to keep track of whether or not we are before
990 # the conftest object file.
991 pre_test_object_deps_done
=no
993 for p
in `eval $output_verbose_link_cmd`; do
998 # Some compilers place space between "-{L,R}" and the path.
1001 ||
test $p = "-R"; then
1008 if test "$pre_test_object_deps_done" = no
; then
1011 # Internal compiler library paths should come after those
1012 # provided the user. The postdeps already come after the
1013 # user supplied libs so there is no need to process them.
1014 if test -z "$compiler_lib_search_path"; then
1015 compiler_lib_search_path
="${prev}${p}"
1017 compiler_lib_search_path
="${compiler_lib_search_path} ${prev}${p}"
1020 # The "-l" case would never come before the object being
1021 # linked, so don't bother handling this case.
1024 if test -z "$postdeps"; then
1025 postdeps
="${prev}${p}"
1027 postdeps
="${postdeps} ${prev}${p}"
1033 # This assumes that the test object file only shows up
1034 # once in the compiler output.
1035 if test "$p" = "conftest.$objext"; then
1036 pre_test_object_deps_done
=yes
1040 if test "$pre_test_object_deps_done" = no
; then
1041 if test -z "$predep_objects"; then
1044 predep_objects
="$predep_objects $p"
1047 if test -z "$postdep_objects"; then
1048 postdep_objects
="$p"
1050 postdep_objects
="$postdep_objects $p"
1055 *) ;; # Ignore the rest.
1063 echo "ltcf-cxx.sh: error: problem compiling test program"
1066 $rm -f confest.
$objext
1068 case " $postdeps " in
1069 *" -lc "*) need_lc
=no
;;