1
#### This script is meant to be sourced by ltconfig.
3
# ltcf-cxx.sh - Create a C++ compiler specific configuration
5
# Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8
# Original C++ support by:Gary V. Vaughan <gvv@techie.com>
9
# Alexandre Oliva <oliva@lsd.ic.unicamp.br>
10
# Ossama Othman <ossama@debian.org>
11
# Thomas Thanner <tanner@gmx.de>
13
# This file is free software; you can redistribute it and/or modify it
14
# under the terms of the GNU General Public License as published by
15
# the Free Software Foundation; either version 2 of the License, or
16
# (at your option) any later version.
18
# This program is distributed in the hope that it will be useful, but
19
# WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
# General Public License for more details.
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the Free Software
25
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27
# As a special exception to the GNU General Public License, if you
28
# distribute this file as part of a program that contains a
29
# configuration script generated by Autoconf, you may include it under
30
# the same distribution terms that you use for the rest of that program.
33
# Source file extension for C++ test sources.
36
# Object file extension for compiled C++ test sources.
39
# Code to be used in simple compile tests
40
lt_simple_compile_test_code="int some_variable = 0;"
42
# Code to be used in simple link tests
43
lt_simple_link_test_code='int main(int, char *[]) { return (0); }'
48
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
50
CFLAGS=${CFLAGS-"$CXXFLAGS"}
52
# Allow CC (or CXX) to be a program name with arguments.
55
cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
57
# we are optimistic. (Too optimistic if you ask me, down there we switch it
58
# off again for most platforms ;) (MM)
61
# Check if we are using GNU gcc (taken/adapted from configure script)
62
# We need to check here since "--with-gcc" is set at configure time,
64
cat > conftest.$ac_ext <<EOF
69
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
72
# Set up default GNU C++ configuration
74
# Check if GNU C++ uses GNU ld as the underlying linker, since the
75
# archiving commands below assume that GNU ld is being used.
76
if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
77
egrep 'GNU ld' > /dev/null; then
80
archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
81
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'
83
runpath_var=LD_RUN_PATH
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=
103
# A generic and very simple default shared library creation
104
# command for GNU C++ for the case where it uses the native
105
# linker, instead of GNU ld. If possible, this setting should
106
# overridden to take advantage of the native linker features on
107
# the platform it is being used on.
108
archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
111
# Commands to make compiler produce verbose output that lists
112
# what "hidden" libraries, object files and flags are used when
113
# linking a shared library.
114
output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
122
echo "ltcf-cxx: with_gcc=$with_gcc ; with_gnu_ld=$with_gnu_ld"
124
# PORTME: fill in a description of your system's C++ link characteristics
127
# FIXME: insert proper C++ library support
133
hardcode_libdir_separator=':'
135
# When large executables or shared objects are built, AIX ld can
136
# have problems creating the table of contents. If linking a library
137
# or program results in "error TOC overflow" add -mminimal-toc to
138
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
139
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
140
if test "$with_gcc" = yes; then
141
case $host_os in aix4.[012]|aix4.[012].*)
142
# We only want to do this on AIX 4.2 and lower, the check
143
# below for broken collect2 doesn't work under 4.3+
144
collect2name=`${CC} -print-prog-name=collect2`
145
if test -f "$collect2name" && \
146
strings "$collect2name" | grep resolve_lib_name >/dev/null
148
# We have reworked collect2
151
# We have old collect2
152
hardcode_direct=unsupported
153
# It fails to find uninstalled libraries when the uninstalled
154
# path is not listed in the libpath. Setting hardcode_minus_L
155
# to unsupported forces relinking
157
hardcode_libdir_flag_spec='-L$libdir'
158
hardcode_libdir_separator=
161
shared_flag='-shared'
164
if test "$host_cpu" = ia64; then
165
shared_flag='${wl}-G'
167
shared_flag='${wl}-bM:SRE'
171
if test "$host_cpu" = ia64; then
172
# On IA64, the linker does run time linking by default, so we don't
173
# have to do anything special.
174
aix_use_runtimelinking=no
175
exp_sym_flag='-Bexport'
178
# KDE requires run time linking. Make it the default.
179
aix_use_runtimelinking=yes
180
exp_sym_flag='-bexport'
181
no_entry_flag='-bnoentry'
183
# Let the compiler handle the export list.
184
always_export_symbols=no
185
if test "$aix_use_runtimelinking" = yes; then
186
allow_undefined_flag=' ${wl}-berok'
187
# The following three lines along with hardcode_into_libs=yes put the correct path into libraries.
188
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir${libdir:+:}/usr/lib:/lib'
189
archive_cmds='$CC '"$shared_flag"' $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-G '"$hardcode_libdir_flag_spec"' -o $lib'
190
archive_expsym_cmds='$CC '"$shared_flag"' $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-G '"$hardcode_libdir_flag_spec"' ${wl}'"$exp_sym_flag"':$export_symbols -o $lib'
192
if test "$host_cpu" = ia64; then
193
hardcode_libdir_flag_spec='${wl}-R $libdir${libdir:+:}/usr/lib:/lib'
194
allow_undefined_flag="-z nodefs"
195
archive_cmds='$CC '"$shared_flag"' $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags '"$hardcode_libdir_flag_spec"' -o $lib'
196
archive_expsym_cmds='$CC '"$shared_flag"' $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags '"$hardcode_libdir_flag_spec"' ${wl}'"$exp_sym_flag"':$export_symbols -o $lib'
198
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
199
# Warning - without using the other run time loading flags, -berok will
200
# link without error, but may produce a broken library.
201
no_undefined_flag='${wl}-bnoerok'
202
allow_undefined_flag='${wl}-berok"
203
# -bexpall does not export symbols beginning with underscore (_)
204
always_export_symbols=yes
205
# Exported symbols can be pulled into shared objects from archives
206
whole_archive_flag_spec=' '
207
build_libtool_need_lc=yes
208
# This is similar to how AIX traditionally builds it's shared libraries.
209
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'
216
# FIXME: insert proper C++ library support
224
# FIXME: insert proper C++ library support
228
# Green Hills C++ Compiler
229
# FIXME: insert proper C++ library support
233
# FIXME: insert proper C++ library support
239
# FreeBSD uses GNU C++ and GNU ld
240
skip_need_lc_check=yes
244
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
245
hardcode_libdir_separator=:
247
hardcode_minus_L=yes # Not in the search PATH, but as the default
248
# location of the library.
249
export_dynamic_flag_spec='${wl}-E'
253
# FIXME: insert proper C++ library support
258
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' ;;
259
*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
261
# Commands to make compiler produce verbose output that lists
262
# what "hidden" libraries, object files and flags are used when
263
# linking a shared library.
265
# There doesn't appear to be a way to prevent this compiler from
266
# explicitly linking system object files so we need to strip them
267
# from the output so that they don't get included in the library
269
output_verbose_link_cmds='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
272
if test "$with_gcc" = yes && test "$with_gnu_ld" = no ; then
273
# MM: for HP-UX and g++ -fPIC is needed to link pic objects together
275
hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -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' ;;
276
*) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
278
output_verbose_link_cmds='$CC -shared -fPIC $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
281
if test "$with_gcc" = no ; then
282
# FIXME: insert proper C++ library support
292
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'
294
# Archives containing C++ object files must be created using
295
# "CC -ar", where "CC" is the IRIX C++ compiler. This is
296
# necessary to make sure instantiated templates are included
298
old_archive_cmds='$CC -ar -WR,-u -o $oldlib $oldobjs'
301
if test "$with_gcc" = yes; then
302
if test "$with_gnu_ld" = no; then
303
archive_cmds='$CC -D_LANGUAGE_C_CPLUS_PLUS -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
305
archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
310
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
311
hardcode_libdir_separator=:
317
# Kuck and Associates, Inc. (KAI) C++ Compiler
319
# KCC will only create a shared library if the output file
320
# ends with ".so" (or ".sl" for HP-UX), so rename the library
321
# to its proper name (with version) after linking.
322
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'
323
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'
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_cmds='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
335
hardcode_libdir_flag_spec='${wl}--rpath,$libdir'
336
export_dynamic_flag_spec='${wl}--export-dynamic'
338
# Archives containing C++ object files must be created using
339
# "CC -Bstatic", where "CC" is the KAI C++ compiler.
340
old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
344
archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
345
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'
347
runpath_var=LD_RUN_PATH
348
hardcode_libdir_flag_spec='-rpath $libdir'
349
hardcode_libdir_separator=:
351
# Commands to make compiler produce verbose output that lists
352
# what "hidden" libraries, object files and flags are used when
353
# linking a shared library.
355
# There doesn't appear to be a way to prevent this compiler from
356
# explicitly linking system object files so we need to strip them
357
# from the output so that they don't get included in the library
359
output_verbose_link_cmds='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
362
if test "$with_gcc" = yes; then
363
# Insure++ together with gcc probably means also GNU ld
364
# only -whole-archive isn't supported
365
whole_archive_flag_spec=""
366
# and we can't use -nostdlib, because bloody insure has no way to
367
# output the linkline (-Zvm isn't working as documented), so we don't
368
# know the depending libs. So we hope, insure gets it right anyway.
369
archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
370
runpath_var=LD_RUN_PATH
371
hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
372
export_dynamic_flag_spec='${wl}--export-dynamic'
373
output_verbose_link_cmds=""
378
# FIXME: insert proper C++ library support
382
# FIXME: insert proper C++ library support
388
# FIXME: insert proper C++ library support
392
# FIXME: insert proper C++ library support
398
if test "$with_gcc" = no || test "$with_gnu_ld" = no; then
399
# This should only be triggered for NetBSD/a.out
400
# Add in C++ constructor/destructor support
401
if test -f /usr/pkg/lib/c++rt0/c++rt0.o.PIC; then
402
cppopts="/usr/pkg/lib/c++rt0/c++rt0.o.PIC"
403
elif test -f /usr/lib/c++rt0.o; then
404
cppopts="/usr/lib/c++rt0.o"
406
archive_cmds='ld -Bshareable -o $lib '"$cppopts"' $libobjs $deplibs $linkopts'
410
if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
411
# MM: OpenBSD 2.7 uses G++, but not GNU ld
412
archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
413
archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
414
old_archive_cmds="$old_archive_cmds~"'$RANLIB $oldlib'
415
hardcode_libdir_flag_spec='${wl}-R$libdir'
417
hardcode_shlibpath_var=no
418
whole_archive_flag_spec='${wl}-Bforcearchive'
423
if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
424
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
425
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'
427
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
428
hardcode_libdir_separator=:
430
# Commands to make compiler produce verbose output that lists
431
# what "hidden" libraries, object files and flags are used when
432
# linking a shared library.
433
output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
437
# Kuck and Associates, Inc. (KAI) C++ Compiler
439
# KCC will only create a shared library if the output file
440
# ends with ".so" (or ".sl" for HP-UX), so rename the library
441
# to its proper name (with version) after linking.
442
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'
444
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
445
hardcode_libdir_separator=:
447
# Archives containing C++ object files must be created using
448
# "CC -Bstatic", where "CC" is the KAI C++ compiler.
449
old_archive_cmds='$CC -Bstatic -o $oldlib $oldobjs'
454
# FIXME: insert proper C++ library support
458
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
459
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'
461
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
462
hardcode_libdir_separator=:
464
# Commands to make compiler produce verbose output that lists
465
# what "hidden" libraries, object files and flags are used when
466
# linking a shared library.
468
# There doesn't appear to be a way to prevent this compiler from
469
# explicitly linking system object files so we need to strip them
470
# from the output so that they don't get included in the library
472
output_verbose_link_cmds='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
475
# FIXME: insert proper C++ library support
482
if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
483
allow_undefined_flag=' -Wl,-expect_unresolved -Wl,\*'
484
no_undefined_flag=' -Wl,-expect_unresolved -Wl,\*'
485
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'
487
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
488
hardcode_libdir_separator=:
490
# Commands to make compiler produce verbose output that lists
491
# what "hidden" libraries, object files and flags are used when
492
# linking a shared library.
493
output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
497
# Kuck and Associates, Inc. (KAI) C++ Compiler
499
# KCC will only create a shared library if the output file
500
# ends with ".so" (or ".sl" for HP-UX), so rename the library
501
# to its proper name (with version) after linking.
502
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'
504
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
505
hardcode_libdir_separator=:
507
# Archives containing C++ object files must be created using
508
# the KAI C++ compiler.
509
old_archive_cmds='$CC -o $oldlib $oldobjs'
513
# FIXME: insert proper C++ library support
517
allow_undefined_flag=' -Wl,-expect_unresolved -Wl,\*'
518
no_undefined_flag=' -Wl,-expect_unresolved -Wl,\*'
519
archive_cmds='$CC -shared${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` -update_registry ${objdir}/so_locations -o $lib'
521
hardcode_libdir_flag_spec='-rpath $libdir'
522
hardcode_libdir_separator=:
524
# Commands to make compiler produce verbose output that lists
525
# what "hidden" libraries, object files and flags are used when
526
# linking a shared library.
528
# There doesn't appear to be a way to prevent this compiler from
529
# explicitly linking system object files so we need to strip them
530
# from the output so that they don't get included in the library
532
output_verbose_link_cmds='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
535
# FIXME: insert proper C++ library support
542
# FIXME: insert proper C++ library support
548
# FIXME: insert proper C++ library support
552
# FIXME: insert proper C++ library support
561
# FIXME: insert proper C++ library support
566
# FIXME: insert proper C++ library support
570
# FIXME: insert proper C++ library support
578
# Sun C++ 4.2, 5.x and Centerline C++
579
no_undefined_flag=' -ztext'
580
archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
581
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
582
$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'
584
hardcode_libdir_flag_spec='-R$libdir'
585
hardcode_shlibpath_var=no
587
solaris2.[0-5] | solaris2.[0-5].*) ;;
589
# The C++ compiler is used as linker so we must use $wl
590
# flag to pass the commands to the underlying system
592
# Supported since Solaris 2.6 (maybe 2.5.1?)
593
whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
598
# Commands to make compiler produce verbose output that lists
599
# what "hidden" libraries, object files and flags are used when
600
# linking a shared library.
602
# There doesn't appear to be a way to prevent this compiler from
603
# explicitly linking system object files so we need to strip them
604
# from the output so that they don't get included in the library
606
output_verbose_link_cmds='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
608
# Archives containing C++ object files must be created using
609
# "CC -xar", where "CC" is the Sun C++ compiler. This is
610
# necessary to make sure instantiated templates are included
612
old_archive_cmds='$CC -xar -o $oldlib $oldobjs'
615
# Green Hills C++ Compiler
616
archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
618
# The C++ compiler must be used to create the archive.
619
old_archive_cmds='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
622
# GNU C++ compiler with Solaris linker
623
if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
624
if $CC --version | egrep -v '^2\.7' > /dev/null; then
625
archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
626
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
627
$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
629
# Commands to make compiler produce verbose output that lists
630
# what "hidden" libraries, object files and flags are used when
631
# linking a shared library.
632
output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
634
# g++ 2.7 appears to require `-G' NOT `-shared' on this
636
archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
637
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
638
$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
640
# Commands to make compiler produce verbose output that lists
641
# what "hidden" libraries, object files and flags are used when
642
# linking a shared library.
643
output_verbose_link_cmds="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
646
hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
654
# NonStop-UX NCC 3.20
655
# FIXME: insert proper C++ library support
659
# FIXME: insert proper C++ library support
665
# FIXME: insert proper C++ library support
669
# FIXME: insert proper C++ library support
673
# FIXME: insert proper C++ library support
679
## Compiler Characteristics: PIC flags, static flags, etc
681
# We don't use cached values here since only the C compiler
682
# characteristics should be cached.
686
ac_cv_prog_cc_static=
687
ac_cv_prog_cc_no_builtin=
688
ac_cv_prog_cc_can_build_shared=$can_build_shared
690
ac_cv_prog_cc_pic_works=
691
ac_cv_prog_cc_static_works=
693
if test "$with_gcc" = yes; then
694
ac_cv_prog_cc_wl='-Wl,'
695
ac_cv_prog_cc_static='-static'
699
# All AIX code is PIC.
700
if test "$host_cpu" = ia64; then
701
# AIX 5 now supports IA64 processor
702
lt_cv_prog_cc_static='-Bstatic'
704
lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
708
# FIXME: we need at least 68020 code to build shared libraries, but
709
# adding the `-m68020' flag to GCC prevents building anything better,
711
ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
713
beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
714
# PIC is the default for these OSes.
716
cygwin* | mingw* | os2*)
717
# This hack is so that the source file can tell whether it is being
718
# built for inclusion in a dll (and should export symbols for example).
719
ac_cv_prog_cc_pic='-DDLL_EXPORT'
722
# PIC is the default on this platform
723
# Common symbols not allowed in MH_DYLIB files
724
lt_cv_prog_cc_pic='-fno-common'
727
# DJGPP does not support shared libraries at all
731
if test -d /usr/nec; then
732
ac_cv_prog_cc_pic=-Kconform_pic
736
ac_cv_prog_cc_pic='-fPIC'
742
# All AIX code is PIC.
743
if test "$host_cpu" = ia64; then
744
# AIX 5 now supports IA64 processor
745
lt_cv_prog_cc_static='-Bstatic'
747
lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
753
# Green Hills C++ Compiler
754
# 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"
761
ac_cv_prog_cc_pic='-KPIC'
764
# Green Hills C++ Compiler
765
ac_cv_prog_cc_pic='-pic'
772
# FreeBSD uses GNU C++
774
hpux9* | hpux10* | hpux11*)
777
ac_cv_prog_cc_wl='-Wl,'
778
ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
779
ac_cv_prog_cc_pic='+Z'
782
ac_cv_prog_cc_wl='-Wl,'
783
ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
784
ac_cv_prog_cc_pic='+Z'
793
ac_cv_prog_cc_wl='-Wl,'
794
ac_cv_prog_cc_static='-non_shared'
795
ac_cv_prog_cc_pic='-KPIC'
805
ac_cv_prog_cc_wl='--backend -Wl,'
806
ac_cv_prog_cc_pic='-fPIC'
810
# Make sure the PIC flag is empty. It appears that all Alpha
811
# Linux and Compaq Tru64 Unix objects are PIC.
813
ac_cv_prog_cc_static='-non_shared'
826
ac_cv_prog_cc_pic='-W c,exportall'
834
osf3* | osf4* | osf5*)
837
ac_cv_prog_cc_wl='--backend -Wl,'
841
ac_cv_prog_cc_pic='-pic'
845
ac_cv_prog_cc_wl='-Wl,'
846
# Make sure the PIC flag is empty. It appears that all Alpha
847
# Linux and Compaq Tru64 Unix objects are PIC.
849
ac_cv_prog_cc_static='-non_shared'
860
ac_cv_prog_cc_pic='-fPIC'
869
# Sun C++ 4.2, 5.x and Centerline C++
870
ac_cv_prog_cc_pic='-KPIC'
871
ac_cv_prog_cc_static='-Bstatic'
872
ac_cv_prog_cc_wl='-Qoption ld '
875
# Green Hills C++ Compiler
876
ac_cv_prog_cc_pic='-PIC'
886
ac_cv_prog_cc_pic='-pic'
887
ac_cv_prog_cc_static='-Bstatic'
891
ac_cv_prog_cc_pic='-pic'
900
# NonStop-UX NCC 3.20
901
ac_cv_prog_cc_pic='-KPIC'
912
ac_cv_prog_cc_can_build_shared=no
918
# Platforms which do not suport PIC and -DPIC is meaningless
924
ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
929
# Figure out "hidden" C++ library dependencies from verbose
930
# compiler output whening linking a shared library.
931
cat > conftest.$ac_ext <<EOF
935
Foo (void) { a = 0; }
942
if (eval $ac_compile) 2>&5; then
943
# Parse the compiler output and extract the necessary
944
# objects, libraries and library flags.
946
# Sentinel used to keep track of whether or not we are before
947
# the conftest object file.
948
pre_test_object_deps_done=no
950
for p in `eval $output_verbose_link_cmds`; do
955
# Some compilers place space between "-{L,R}" and the path.
958
|| test $p = "-R"; then
965
if test "$pre_test_object_deps_done" = no; then
968
# Internal compiler library paths should come after those
969
# provided the user. The postdeps already come after the
970
# user supplied libs so there is no need to process them.
971
if test -z "$compiler_lib_search_path"; then
972
compiler_lib_search_path="${prev}${p}"
974
compiler_lib_search_path="${compiler_lib_search_path} ${prev}${p}"
977
# The "-l" case would never come before the object being
978
# linked, so don't bother handling this case.
982
if test "x$remove_lgcc" = "xyes" ; then
987
if test -n "$add" ; then
988
if test -z "$postdeps"; then
991
postdeps="${postdeps} ${add}"
998
# This assumes that the test object file only shows up
999
# once in the compiler output.
1000
if test "$p" = "conftest.$objext"; then
1001
pre_test_object_deps_done=yes
1005
if test "$pre_test_object_deps_done" = no; then
1006
if test -z "$predep_objects"; then
1009
predep_objects="$predep_objects $p"
1012
if test -z "$postdep_objects"; then
1013
postdep_objects="$p"
1015
postdep_objects="$postdep_objects $p"
1020
*) ;; # Ignore the rest.
1028
echo "ltcf-cxx.sh: error: problem compiling test program"
1031
$rm -f confest.$objext
1033
if test "x$skip_need_lc_check" = "xyes" ; then
1036
case " $postdeps " in
1037
*" -lc "*) need_lc=no ;;