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., 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. 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 # When large executables or shared objects are built, AIX ld can
132 # have problems creating the table of contents. If linking a library
133 # or program results in "error TOC overflow" add -mminimal-toc to
134 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
135 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
136 if test "$with_gcc" = yes; then
137 case $host_os in aix4.
[012]|aix4.
[012].
*)
138 # We only want to do this on AIX 4.2 and lower, the check
139 # below for broken collect2 doesn't work under 4.3+
140 collect2name
=`${CC} -print-prog-name=collect2`
141 if test -f "$collect2name" && \
142 strings "$collect2name" |
grep resolve_lib_name
>/dev
/null
144 # We have reworked collect2
147 # We have old collect2
148 hardcode_direct
=unsupported
149 # It fails to find uninstalled libraries when the uninstalled
150 # path is not listed in the libpath. Setting hardcode_minus_L
151 # to unsupported forces relinking
153 hardcode_libdir_flag_spec
='-L$libdir'
154 hardcode_libdir_separator
=
157 shared_flag
='-shared'
160 if test "$host_cpu" = ia64
; then
161 shared_flag
='${wl}-G'
163 shared_flag
='${wl}-bM:SRE'
167 if test "$host_cpu" = ia64
; then
168 # On IA64, the linker does run time linking by default, so we don't
169 # have to do anything special.
170 aix_use_runtimelinking
=no
171 if test $with_gnu_ld = no
; then
172 exp_sym_flag
='-Bexport'
176 # Test if we are trying to use run time linking, or normal AIX style linking.
177 # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
178 aix_use_runtimelinking
=no
179 for ld_flag
in $LDFLAGS; do
180 if (test $ld_flag = "-brtl" ||
test $ld_flag = "-Wl,-brtl" ); then
181 aix_use_runtimelinking
=yes
185 exp_sym_flag
='-bexport'
186 no_entry_flag
='-bnoentry'
188 # It seems that -bexpall does not export symbols beginning with
189 # underscore (_), so it is better to generate a list of symbols to export.
190 always_export_symbols
=yes
191 if test "$aix_use_runtimelinking" = yes; then
192 hardcode_libdir_flag_spec
='${wl}-blibpath:$libdir:/usr/lib:/lib'
193 allow_undefined_flag
=' -Wl,-G'
194 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"
196 if test "$host_cpu" = ia64; then
197 if test $with_gnu_ld = no; then
198 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr
/lib
:/lib
'
199 allow_undefined_flag="-z nodefs"
200 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"
203 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
204 # Warning - without using the other run time loading flags, -berok will
205 # link without error, but may produce a broken library.
206 no_undefined_flag=' ${wl}-bnoerok'
207 allow_undefined_flag=' ${wl}-berok'
208 # -bexpall does not export symbols beginning with underscore (_)
209 always_export_symbols=yes
210 # Exported symbols can be pulled into shared objects from archives
211 whole_archive_flag_spec=' '
212 build_libtool_need_lc=yes
213 # This is similar to how AIX traditionally builds it's shared libraries.
214 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'
221 # FIXME: insert proper C++ library support
229 rhapsody* | darwin1.[[012]])
230 allow_undefined_flag='-undefined suppress'
233 if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
234 allow_undefined_flag='-flat_namespace -undefined suppress'
236 case ${MACOSX_DEPLOYMENT_TARGET} in
238 allow_undefined_flag='-flat_namespace -undefined suppress'
241 allow_undefined_flag='-undefined dynamic_lookup'
247 # Disable shared library build on OS-X older than 10.3.
256 output_verbose_link_cmd='echo'
257 archive_cmds='$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'
258 module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
260 # Don't fix this by using the ld -exported_symbols_list flag,
261 # it doesn't exist in older darwin ld's
262 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}'
263 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}'
265 hardcode_automatic
=yes
266 hardcode_shlibpath_var
=unsupported
267 whole_archive_flag_spec
='-all_load $convenience'
274 # FIXME: insert proper C++ library support
278 # Green Hills C++ Compiler
279 # FIXME: insert proper C++ library support
283 # FIXME: insert proper C++ library support
289 # C++ shared libraries reported to be fairly broken before switch to ELF
292 freebsd
* | kfreebsd
*-gnu)
293 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
300 if test $with_gnu_ld = no
; then
303 hardcode_libdir_flag_spec
='-L$libdir'
304 hardcode_shlibpath_var
=no
;;
306 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir' ;;
309 hardcode_libdir_separator
=:
310 export_dynamic_flag_spec
='${wl}-E'
312 hardcode_minus_L
=yes # Not in the search PATH, but as the default
313 # location of the library.
317 # FIXME: insert proper C++ library support
322 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' ;;
323 *) archive_cmds
='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
325 # Commands to make compiler produce verbose output that lists
326 # what "hidden" libraries, object files and flags are used when
327 # linking a shared library.
329 # There doesn't appear to be a way to prevent this compiler from
330 # explicitly linking system object files so we need to strip them
331 # from the output so that they don't get included in the library
333 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'
336 if test $with_gcc = yes; then
337 if test $with_gnu_ld = no
; then
339 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' ;;
343 archive_cmds
='$LD -b +h $soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ;;
345 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' ;;
351 # FIXME: insert proper C++ library support
361 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'
363 # Archives containing C++ object files must be created using
364 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
365 # necessary to make sure instantiated templates are included
367 old_archive_cmds
='$CC -ar -WR,-u -o $oldlib $oldobjs'
370 if test "$with_gcc" = yes; then
371 if test "$with_gnu_ld" = no
; then
372 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'
374 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'
377 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
378 hardcode_libdir_separator
=:
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'
392 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'
394 # Commands to make compiler produce verbose output that lists
395 # what "hidden" libraries, object files and flags are used when
396 # linking a shared library.
398 # There doesn't appear to be a way to prevent this compiler from
399 # explicitly linking system object files so we need to strip them
400 # from the output so that they don't get included in the library
402 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'
404 hardcode_libdir_flag_spec
='${wl}--rpath,$libdir'
405 export_dynamic_flag_spec
='${wl}--export-dynamic'
407 # Archives containing C++ object files must be created using
408 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
409 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
413 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
414 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'
416 runpath_var
=LD_RUN_PATH
417 hardcode_libdir_flag_spec
='-rpath $libdir'
418 hardcode_libdir_separator
=:
420 # Commands to make compiler produce verbose output that lists
421 # what "hidden" libraries, object files and flags are used when
422 # linking a shared library.
424 # There doesn't appear to be a way to prevent this compiler from
425 # explicitly linking system object files so we need to strip them
426 # from the output so that they don't get included in the library
428 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'
433 # FIXME: insert proper C++ library support
437 # FIXME: insert proper C++ library support
443 # FIXME: insert proper C++ library support
447 # FIXME: insert proper C++ library support
452 netbsd
* | knetbsd
*-gnu)
453 # NetBSD uses g++ - do we need to do anything?
458 # Kuck and Associates, Inc. (KAI) C++ Compiler
460 # KCC will only create a shared library if the output file
461 # ends with ".so" (or ".sl" for HP-UX), so rename the library
462 # to its proper name (with version) after linking.
463 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'
465 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
466 hardcode_libdir_separator
=:
468 # Archives containing C++ object files must be created using
469 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
470 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
475 # FIXME: insert proper C++ library support
479 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
480 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'
482 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
483 hardcode_libdir_separator
=:
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_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'
496 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
497 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
498 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'
500 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
501 hardcode_libdir_separator
=:
503 # Commands to make compiler produce verbose output that lists
504 # what "hidden" libraries, object files and flags are used when
505 # linking a shared library.
506 output_verbose_link_cmd
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
508 # FIXME: insert proper C++ library support
517 # Kuck and Associates, Inc. (KAI) C++ Compiler
519 # KCC will only create a shared library if the output file
520 # ends with ".so" (or ".sl" for HP-UX), so rename the library
521 # to its proper name (with version) after linking.
522 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'
524 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
525 hardcode_libdir_separator
=:
527 # Archives containing C++ object files must be created using
528 # the KAI C++ compiler.
529 old_archive_cmds
='$CC -o $oldlib $oldobjs'
533 # FIXME: insert proper C++ library support
537 allow_undefined_flag
=' -expect_unresolved \*'
538 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'
539 archive_expsym_cmds
='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
540 echo "-hidden">> $lib.exp~
541 $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~
544 hardcode_libdir_flag_spec
='-rpath $libdir'
545 hardcode_libdir_separator
=:
547 # Commands to make compiler produce verbose output that lists
548 # what "hidden" libraries, object files and flags are used when
549 # linking a shared library.
551 # There doesn't appear to be a way to prevent this compiler from
552 # explicitly linking system object files so we need to strip them
553 # from the output so that they don't get included in the library
555 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'
558 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
559 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
560 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'
562 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
563 hardcode_libdir_separator
=:
565 # Commands to make compiler produce verbose output that lists
566 # what "hidden" libraries, object files and flags are used when
567 # linking a shared library.
568 output_verbose_link_cmd
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
570 # FIXME: insert proper C++ library support
577 # FIXME: insert proper C++ library support
583 # FIXME: insert proper C++ library support
587 # FIXME: insert proper C++ library support
596 # FIXME: insert proper C++ library support
601 # FIXME: insert proper C++ library support
605 # FIXME: insert proper C++ library support
613 # Sun C++ 4.2, 5.x and Centerline C++
614 no_undefined_flag
=' -zdefs'
615 archive_cmds
='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
616 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
617 $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'
619 hardcode_libdir_flag_spec
='-R$libdir'
620 hardcode_shlibpath_var
=no
622 solaris2.
[0-5] | solaris2.
[0-5].
*) ;;
624 # The C++ compiler is used as linker so we must use $wl
625 # flag to pass the commands to the underlying system
627 # Supported since Solaris 2.6 (maybe 2.5.1?)
628 whole_archive_flag_spec
='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
633 # Commands to make compiler produce verbose output that lists
634 # what "hidden" libraries, object files and flags are used when
635 # linking a shared library.
637 # There doesn't appear to be a way to prevent this compiler from
638 # explicitly linking system object files so we need to strip them
639 # from the output so that they don't get included in the library
641 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'
643 # Archives containing C++ object files must be created using
644 # "CC -xar", where "CC" is the Sun C++ compiler. This is
645 # necessary to make sure instantiated templates are included
647 old_archive_cmds
='$CC -xar -o $oldlib $oldobjs'
650 # Green Hills C++ Compiler
651 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
653 # The C++ compiler must be used to create the archive.
654 old_archive_cmds
='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
657 # GNU C++ compiler with Solaris linker
658 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
659 no_undefined_flag
=' ${wl}-z ${wl}defs'
660 if $CC --version |
egrep -v '^2\.7' > /dev
/null
; then
661 archive_cmds
='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
662 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
663 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
665 # Commands to make compiler produce verbose output that lists
666 # what "hidden" libraries, object files and flags are used when
667 # linking a shared library.
668 output_verbose_link_cmd
="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
670 # g++ 2.7 appears to require `-G' NOT `-shared' on this
672 archive_cmds
='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
673 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
674 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
676 # Commands to make compiler produce verbose output that lists
677 # what "hidden" libraries, object files and flags are used when
678 # linking a shared library.
679 output_verbose_link_cmd
="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
682 hardcode_libdir_flag_spec
='${wl}-R $wl$libdir'
690 # NonStop-UX NCC 3.20
691 # FIXME: insert proper C++ library support
695 # FIXME: insert proper C++ library support
701 # FIXME: insert proper C++ library support
705 # FIXME: insert proper C++ library support
709 # FIXME: insert proper C++ library support
715 ## Compiler Characteristics: PIC flags, static flags, etc
717 # We don't use cached values here since only the C compiler
718 # characteristics should be cached.
722 ac_cv_prog_cc_static
=
723 ac_cv_prog_cc_no_builtin
=
724 ac_cv_prog_cc_can_build_shared
=$can_build_shared
726 ac_cv_prog_cc_pic_works
=
727 ac_cv_prog_cc_static_works
=
729 if test "$with_gcc" = yes; then
730 ac_cv_prog_cc_wl
='-Wl,'
731 ac_cv_prog_cc_static
='-static'
735 # All AIX code is PIC.
736 if test "$host_cpu" = ia64
; then
737 # AIX 5 now supports IA64 processor
738 lt_cv_prog_cc_static
='-Bstatic'
740 lt_cv_prog_cc_static
='-bnso -bI:/lib/syscalls.exp'
744 # FIXME: we need at least 68020 code to build shared libraries, but
745 # adding the `-m68020' flag to GCC prevents building anything better,
747 ac_cv_prog_cc_pic
='-m68020 -resident32 -malways-restore-a4'
749 beos
* | irix5
* | irix6
* | osf3
* | osf4
* | osf5
*)
750 # PIC is the default for these OSes.
752 cygwin
* | mingw
* | os2
*)
753 # This hack is so that the source file can tell whether it is being
754 # built for inclusion in a dll (and should export symbols for example).
755 ac_cv_prog_cc_pic
='-DDLL_EXPORT'
758 # PIC is the default on this platform
759 # Common symbols not allowed in MH_DYLIB files
760 ac_cv_prog_cc_pic
='-fno-common'
763 # DJGPP does not support shared libraries at all
767 if test -d /usr
/nec
; then
768 ac_cv_prog_cc_pic
=-Kconform_pic
772 ac_cv_prog_cc_pic
='-fPIC'
778 # All AIX code is PIC.
779 if test "$host_cpu" = ia64
; then
780 # AIX 5 now supports IA64 processor
781 lt_cv_prog_cc_static
='-Bstatic'
783 lt_cv_prog_cc_static
='-bnso -bI:/lib/syscalls.exp'
789 # Green Hills C++ Compiler
790 # 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"
797 ac_cv_prog_cc_pic
='-KPIC'
800 # Green Hills C++ Compiler
801 ac_cv_prog_cc_pic
='-pic'
807 freebsd
* | kfreebsd
*-gnu)
808 # FreeBSD uses GNU C++
812 hpux9
* | hpux10
* | hpux11
*)
815 ac_cv_prog_cc_wl
='-Wl,'
816 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
817 ac_cv_prog_cc_pic
='+Z'
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'
831 ac_cv_prog_cc_wl
='-Wl,'
832 ac_cv_prog_cc_static
='-non_shared'
833 ac_cv_prog_cc_pic
='-KPIC'
843 ac_cv_prog_cc_wl
='--backend -Wl,'
844 ac_cv_prog_cc_pic
='-fPIC'
848 # Make sure the PIC flag is empty. It appears that all Alpha
849 # Linux and Compaq Tru64 Unix objects are PIC.
851 ac_cv_prog_cc_static
='-non_shared'
864 ac_cv_prog_cc_pic
='-W c,exportall'
872 osf3
* | osf4
* | osf5
*)
875 ac_cv_prog_cc_wl
='--backend -Wl,'
879 ac_cv_prog_cc_pic
='-pic'
883 ac_cv_prog_cc_wl
='-Wl,'
884 # Make sure the PIC flag is empty. It appears that all Alpha
885 # Linux and Compaq Tru64 Unix objects are PIC.
887 ac_cv_prog_cc_static
='-non_shared'
898 ac_cv_prog_cc_pic
='-fPIC'
907 # Sun C++ 4.2, 5.x and Centerline C++
908 ac_cv_prog_cc_pic
='-KPIC'
909 ac_cv_prog_cc_static
='-Bstatic'
910 ac_cv_prog_cc_wl
='-Qoption ld '
913 # Green Hills C++ Compiler
914 ac_cv_prog_cc_pic
='-PIC'
924 ac_cv_prog_cc_pic
='-pic'
925 ac_cv_prog_cc_static
='-Bstatic'
929 ac_cv_prog_cc_pic
='-pic'
938 # NonStop-UX NCC 3.20
939 ac_cv_prog_cc_pic
='-KPIC'
950 ac_cv_prog_cc_can_build_shared
=no
956 # Platforms which do not suport PIC and -DPIC is meaningless
962 ac_cv_prog_cc_pic
="$ac_cv_prog_cc_pic -DPIC"
967 # Figure out "hidden" C++ library dependencies from verbose
968 # compiler output whening linking a shared library.
969 cat > conftest.
$ac_ext <<EOF
973 Foo (void) { a = 0; }
980 if (eval $ac_compile) 2>&5; then
981 # Parse the compiler output and extract the necessary
982 # objects, libraries and library flags.
984 # Sentinel used to keep track of whether or not we are before
985 # the conftest object file.
986 pre_test_object_deps_done
=no
988 for p
in `eval $output_verbose_link_cmd`; do
993 # Some compilers place space between "-{L,R}" and the path.
996 ||
test $p = "-R"; then
1003 if test "$pre_test_object_deps_done" = no
; then
1006 # Internal compiler library paths should come after those
1007 # provided the user. The postdeps already come after the
1008 # user supplied libs so there is no need to process them.
1009 if test -z "$compiler_lib_search_path"; then
1010 compiler_lib_search_path
="${prev}${p}"
1012 compiler_lib_search_path
="${compiler_lib_search_path} ${prev}${p}"
1015 # The "-l" case would never come before the object being
1016 # linked, so don't bother handling this case.
1019 if test -z "$postdeps"; then
1020 postdeps
="${prev}${p}"
1022 postdeps
="${postdeps} ${prev}${p}"
1028 # This assumes that the test object file only shows up
1029 # once in the compiler output.
1030 if test "$p" = "conftest.$objext"; then
1031 pre_test_object_deps_done
=yes
1035 if test "$pre_test_object_deps_done" = no
; then
1036 if test -z "$predep_objects"; then
1039 predep_objects
="$predep_objects $p"
1042 if test -z "$postdep_objects"; then
1043 postdep_objects
="$p"
1045 postdep_objects
="$postdep_objects $p"
1050 *) ;; # Ignore the rest.
1058 echo "ltcf-cxx.sh: error: problem compiling test program"
1061 $rm -f confest.
$objext
1063 case " $postdeps " in
1064 *" -lc "*) need_lc
=no
;;