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.
257 output_verbose_link_cmd='echo'
259 archive_cmds='$CXX -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
260 module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
262 # Don't fix this by using the ld -exported_symbols_list flag,
263 # it doesn't exist in older darwin ld's
264 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}'
265 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}'
267 hardcode_automatic
=yes
268 hardcode_shlibpath_var
=unsupported
275 # FIXME: insert proper C++ library support
279 # Green Hills C++ Compiler
280 # FIXME: insert proper C++ library support
284 # FIXME: insert proper C++ library support
290 # C++ shared libraries reported to be fairly broken before switch to ELF
293 freebsd
* | kfreebsd
*-gnu)
294 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
301 if test $with_gnu_ld = no
; then
304 hardcode_libdir_flag_spec
='-L$libdir'
305 hardcode_shlibpath_var
=no
;;
307 hardcode_libdir_flag_spec
='${wl}+b ${wl}$libdir' ;;
310 hardcode_libdir_separator
=:
311 export_dynamic_flag_spec
='${wl}-E'
313 hardcode_minus_L
=yes # Not in the search PATH, but as the default
314 # location of the library.
318 # FIXME: insert proper C++ library support
323 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' ;;
324 *) archive_cmds
='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
326 # Commands to make compiler produce verbose output that lists
327 # what "hidden" libraries, object files and flags are used when
328 # linking a shared library.
330 # There doesn't appear to be a way to prevent this compiler from
331 # explicitly linking system object files so we need to strip them
332 # from the output so that they don't get included in the library
334 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'
337 if test $with_gcc = yes; then
338 if test $with_gnu_ld = no
; then
340 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' ;;
344 archive_cmds
='$LD -b +h $soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ;;
346 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' ;;
352 # FIXME: insert proper C++ library support
362 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'
364 # Archives containing C++ object files must be created using
365 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
366 # necessary to make sure instantiated templates are included
368 old_archive_cmds
='$CC -ar -WR,-u -o $oldlib $oldobjs'
371 if test "$with_gcc" = yes; then
372 if test "$with_gnu_ld" = no
; then
373 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'
375 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'
378 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
379 hardcode_libdir_separator
=:
387 # Kuck and Associates, Inc. (KAI) C++ Compiler
389 # KCC will only create a shared library if the output file
390 # ends with ".so" (or ".sl" for HP-UX), so rename the library
391 # to its proper name (with version) after linking.
392 archive_cmds
='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
393 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'
395 # Commands to make compiler produce verbose output that lists
396 # what "hidden" libraries, object files and flags are used when
397 # linking a shared library.
399 # There doesn't appear to be a way to prevent this compiler from
400 # explicitly linking system object files so we need to strip them
401 # from the output so that they don't get included in the library
403 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'
405 hardcode_libdir_flag_spec
='${wl}--rpath,$libdir'
406 export_dynamic_flag_spec
='${wl}--export-dynamic'
408 # Archives containing C++ object files must be created using
409 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
410 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
414 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
415 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'
417 runpath_var
=LD_RUN_PATH
418 hardcode_libdir_flag_spec
='-rpath $libdir'
419 hardcode_libdir_separator
=:
421 # Commands to make compiler produce verbose output that lists
422 # what "hidden" libraries, object files and flags are used when
423 # linking a shared library.
425 # There doesn't appear to be a way to prevent this compiler from
426 # explicitly linking system object files so we need to strip them
427 # from the output so that they don't get included in the library
429 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'
434 # FIXME: insert proper C++ library support
438 # FIXME: insert proper C++ library support
444 # FIXME: insert proper C++ library support
448 # FIXME: insert proper C++ library support
453 netbsd
* | knetbsd
*-gnu)
454 # NetBSD uses g++ - do we need to do anything?
459 # Kuck and Associates, Inc. (KAI) C++ Compiler
461 # KCC will only create a shared library if the output file
462 # ends with ".so" (or ".sl" for HP-UX), so rename the library
463 # to its proper name (with version) after linking.
464 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'
466 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
467 hardcode_libdir_separator
=:
469 # Archives containing C++ object files must be created using
470 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
471 old_archive_cmds
='$CC -Bstatic -o $oldlib $oldobjs'
476 # FIXME: insert proper C++ library support
480 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
481 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'
483 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
484 hardcode_libdir_separator
=:
486 # Commands to make compiler produce verbose output that lists
487 # what "hidden" libraries, object files and flags are used when
488 # linking a shared library.
490 # There doesn't appear to be a way to prevent this compiler from
491 # explicitly linking system object files so we need to strip them
492 # from the output so that they don't get included in the library
494 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'
497 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
498 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
499 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'
501 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
502 hardcode_libdir_separator
=:
504 # Commands to make compiler produce verbose output that lists
505 # what "hidden" libraries, object files and flags are used when
506 # linking a shared library.
507 output_verbose_link_cmd
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
509 # FIXME: insert proper C++ library support
518 # Kuck and Associates, Inc. (KAI) C++ Compiler
520 # KCC will only create a shared library if the output file
521 # ends with ".so" (or ".sl" for HP-UX), so rename the library
522 # to its proper name (with version) after linking.
523 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'
525 hardcode_libdir_flag_spec
='${wl}-rpath,$libdir'
526 hardcode_libdir_separator
=:
528 # Archives containing C++ object files must be created using
529 # the KAI C++ compiler.
530 old_archive_cmds
='$CC -o $oldlib $oldobjs'
534 # FIXME: insert proper C++ library support
538 allow_undefined_flag
=' -expect_unresolved \*'
539 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'
540 archive_expsym_cmds
='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
541 echo "-hidden">> $lib.exp~
542 $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~
545 hardcode_libdir_flag_spec
='-rpath $libdir'
546 hardcode_libdir_separator
=:
548 # Commands to make compiler produce verbose output that lists
549 # what "hidden" libraries, object files and flags are used when
550 # linking a shared library.
552 # There doesn't appear to be a way to prevent this compiler from
553 # explicitly linking system object files so we need to strip them
554 # from the output so that they don't get included in the library
556 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'
559 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
560 allow_undefined_flag
=' ${wl}-expect_unresolved ${wl}\*'
561 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'
563 hardcode_libdir_flag_spec
='${wl}-rpath ${wl}$libdir'
564 hardcode_libdir_separator
=:
566 # Commands to make compiler produce verbose output that lists
567 # what "hidden" libraries, object files and flags are used when
568 # linking a shared library.
569 output_verbose_link_cmd
='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
571 # FIXME: insert proper C++ library support
578 # FIXME: insert proper C++ library support
584 # FIXME: insert proper C++ library support
588 # FIXME: insert proper C++ library support
597 # FIXME: insert proper C++ library support
602 # FIXME: insert proper C++ library support
606 # FIXME: insert proper C++ library support
614 # Sun C++ 4.2, 5.x and Centerline C++
615 no_undefined_flag
=' -zdefs'
616 archive_cmds
='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
617 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
618 $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'
620 hardcode_libdir_flag_spec
='-R$libdir'
621 hardcode_shlibpath_var
=no
623 solaris2.
[0-5] | solaris2.
[0-5].
*) ;;
625 # The C++ compiler is used as linker so we must use $wl
626 # flag to pass the commands to the underlying system
628 # Supported since Solaris 2.6 (maybe 2.5.1?)
629 whole_archive_flag_spec
='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
634 # Commands to make compiler produce verbose output that lists
635 # what "hidden" libraries, object files and flags are used when
636 # linking a shared library.
638 # There doesn't appear to be a way to prevent this compiler from
639 # explicitly linking system object files so we need to strip them
640 # from the output so that they don't get included in the library
642 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'
644 # Archives containing C++ object files must be created using
645 # "CC -xar", where "CC" is the Sun C++ compiler. This is
646 # necessary to make sure instantiated templates are included
648 old_archive_cmds
='$CC -xar -o $oldlib $oldobjs'
651 # Green Hills C++ Compiler
652 archive_cmds
='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
654 # The C++ compiler must be used to create the archive.
655 old_archive_cmds
='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
658 # GNU C++ compiler with Solaris linker
659 if test "$with_gcc" = yes && test "$with_gnu_ld" = no
; then
660 no_undefined_flag
=' ${wl}-z ${wl}defs'
661 if $CC --version |
egrep -v '^2\.7' > /dev
/null
; then
662 archive_cmds
='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
663 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
664 $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
666 # Commands to make compiler produce verbose output that lists
667 # what "hidden" libraries, object files and flags are used when
668 # linking a shared library.
669 output_verbose_link_cmd
="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
671 # g++ 2.7 appears to require `-G' NOT `-shared' on this
673 archive_cmds
='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
674 archive_expsym_cmds
='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
675 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
677 # Commands to make compiler produce verbose output that lists
678 # what "hidden" libraries, object files and flags are used when
679 # linking a shared library.
680 output_verbose_link_cmd
="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
683 hardcode_libdir_flag_spec
='${wl}-R $wl$libdir'
691 # NonStop-UX NCC 3.20
692 # FIXME: insert proper C++ library support
696 # FIXME: insert proper C++ library support
705 # FIXME: insert proper C++ library support
709 # FIXME: insert proper C++ library support
713 # FIXME: insert proper C++ library support
719 ## Compiler Characteristics: PIC flags, static flags, etc
721 # We don't use cached values here since only the C compiler
722 # characteristics should be cached.
726 ac_cv_prog_cc_static
=
727 ac_cv_prog_cc_no_builtin
=
728 ac_cv_prog_cc_can_build_shared
=$can_build_shared
730 ac_cv_prog_cc_pic_works
=
731 ac_cv_prog_cc_static_works
=
733 if test "$with_gcc" = yes; then
734 ac_cv_prog_cc_wl
='-Wl,'
735 ac_cv_prog_cc_static
='-static'
739 # All AIX code is PIC.
740 if test "$host_cpu" = ia64
; then
741 # AIX 5 now supports IA64 processor
742 lt_cv_prog_cc_static
='-Bstatic'
744 lt_cv_prog_cc_static
='-bnso -bI:/lib/syscalls.exp'
748 # FIXME: we need at least 68020 code to build shared libraries, but
749 # adding the `-m68020' flag to GCC prevents building anything better,
751 ac_cv_prog_cc_pic
='-m68020 -resident32 -malways-restore-a4'
753 beos
* | irix5
* | irix6
* | osf3
* | osf4
* | osf5
*)
754 # PIC is the default for these OSes.
756 cygwin
* | mingw
* | os2
*)
757 # This hack is so that the source file can tell whether it is being
758 # built for inclusion in a dll (and should export symbols for example).
759 ac_cv_prog_cc_pic
='-DDLL_EXPORT'
762 # PIC is the default on this platform
763 # Common symbols not allowed in MH_DYLIB files
764 ac_cv_prog_cc_pic
='-fno-common'
767 # DJGPP does not support shared libraries at all
771 if test -d /usr
/nec
; then
772 ac_cv_prog_cc_pic
=-Kconform_pic
776 ac_cv_prog_cc_pic
='-fPIC'
782 # All AIX code is PIC.
783 if test "$host_cpu" = ia64
; then
784 # AIX 5 now supports IA64 processor
785 lt_cv_prog_cc_static
='-Bstatic'
787 lt_cv_prog_cc_static
='-bnso -bI:/lib/syscalls.exp'
793 # Green Hills C++ Compiler
794 # 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"
801 ac_cv_prog_cc_pic
='-KPIC'
804 # Green Hills C++ Compiler
805 ac_cv_prog_cc_pic
='-pic'
811 freebsd
* | kfreebsd
*-gnu)
812 # FreeBSD uses GNU C++
816 hpux9
* | hpux10
* | hpux11
*)
819 ac_cv_prog_cc_wl
='-Wl,'
820 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
821 ac_cv_prog_cc_pic
='+Z'
824 ac_cv_prog_cc_wl
='-Wl,'
825 ac_cv_prog_cc_static
="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
826 ac_cv_prog_cc_pic
='+Z'
835 ac_cv_prog_cc_wl
='-Wl,'
836 ac_cv_prog_cc_static
='-non_shared'
837 ac_cv_prog_cc_pic
='-KPIC'
847 ac_cv_prog_cc_wl
='--backend -Wl,'
848 ac_cv_prog_cc_pic
='-fPIC'
852 # Make sure the PIC flag is empty. It appears that all Alpha
853 # Linux and Compaq Tru64 Unix objects are PIC.
855 ac_cv_prog_cc_static
='-non_shared'
868 ac_cv_prog_cc_pic
='-W c,exportall'
876 osf3
* | osf4
* | osf5
*)
879 ac_cv_prog_cc_wl
='--backend -Wl,'
883 ac_cv_prog_cc_pic
='-pic'
887 ac_cv_prog_cc_wl
='-Wl,'
888 # Make sure the PIC flag is empty. It appears that all Alpha
889 # Linux and Compaq Tru64 Unix objects are PIC.
891 ac_cv_prog_cc_static
='-non_shared'
902 ac_cv_prog_cc_pic
='-fPIC'
911 # Sun C++ 4.2, 5.x and Centerline C++
912 ac_cv_prog_cc_pic
='-KPIC'
913 ac_cv_prog_cc_static
='-Bstatic'
914 ac_cv_prog_cc_wl
='-Qoption ld '
917 # Green Hills C++ Compiler
918 ac_cv_prog_cc_pic
='-PIC'
928 ac_cv_prog_cc_pic
='-pic'
929 ac_cv_prog_cc_static
='-Bstatic'
933 ac_cv_prog_cc_pic
='-pic'
942 # NonStop-UX NCC 3.20
943 ac_cv_prog_cc_pic
='-KPIC'
954 ac_cv_prog_cc_can_build_shared
=no
960 # Platforms which do not suport PIC and -DPIC is meaningless
966 ac_cv_prog_cc_pic
="$ac_cv_prog_cc_pic -DPIC"
971 # Figure out "hidden" C++ library dependencies from verbose
972 # compiler output whening linking a shared library.
973 cat > conftest.
$ac_ext <<EOF
977 Foo (void) { a = 0; }
984 if (eval $ac_compile) 2>&5; then
985 # Parse the compiler output and extract the necessary
986 # objects, libraries and library flags.
988 # Sentinel used to keep track of whether or not we are before
989 # the conftest object file.
990 pre_test_object_deps_done
=no
992 for p
in `eval $output_verbose_link_cmd`; do
997 # Some compilers place space between "-{L,R}" and the path.
1000 ||
test $p = "-R"; then
1007 if test "$pre_test_object_deps_done" = no
; then
1010 # Internal compiler library paths should come after those
1011 # provided the user. The postdeps already come after the
1012 # user supplied libs so there is no need to process them.
1013 if test -z "$compiler_lib_search_path"; then
1014 compiler_lib_search_path
="${prev}${p}"
1016 compiler_lib_search_path
="${compiler_lib_search_path} ${prev}${p}"
1019 # The "-l" case would never come before the object being
1020 # linked, so don't bother handling this case.
1023 if test -z "$postdeps"; then
1024 postdeps
="${prev}${p}"
1026 postdeps
="${postdeps} ${prev}${p}"
1032 # This assumes that the test object file only shows up
1033 # once in the compiler output.
1034 if test "$p" = "conftest.$objext"; then
1035 pre_test_object_deps_done
=yes
1039 if test "$pre_test_object_deps_done" = no
; then
1040 if test -z "$predep_objects"; then
1043 predep_objects
="$predep_objects $p"
1046 if test -z "$postdep_objects"; then
1047 postdep_objects
="$p"
1049 postdep_objects
="$postdep_objects $p"
1054 *) ;; # Ignore the rest.
1062 echo "ltcf-cxx.sh: error: problem compiling test program"
1065 $rm -f confest.
$objext
1067 case " $postdeps " in
1068 *" -lc "*) need_lc
=no
;;