#### This script is meant to be sourced by ltconfig. # ltcf-cxx.sh - Create a C++ compiler specific configuration # # Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # Original C++ support by:Gary V. Vaughan # Alexandre Oliva # Ossama Othman # Thomas Thanner # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Source file extension for C++ test sources. setglobal ac_ext = 'cc' # Object file extension for compiled C++ test sources. setglobal objext = 'o' # Code to be used in simple compile tests setglobal lt_simple_compile_test_code = '"int some_variable = 0;'" # Code to be used in simple link tests setglobal lt_simple_link_test_code = ''int main(int, char *[]) { return (0); }'' # C++ compiler setglobal CXX = $(CXX-c++) # ltmain only uses $CC for tagged configurations so make sure $CC is set. setglobal CC = $(CC-"$CXX") setglobal CFLAGS = $(CFLAGS-"$CXXFLAGS") # Allow CC to be a program name with arguments. set dummy $CC setglobal compiler = $2 setglobal cc_basename = $[$echo X"$compiler" | $Xsed -e 's%^.*/%%] # Check if we are using GNU gcc (taken/adapted from configure script) # We need to check here since "--with-gcc" is set at configure time, # not ltconfig time! cat > conftest.$ac_ext << """ #ifdef __GNUC__ yes; #endif """ if do { setglobal ac_try = ''${CC-c++} -E conftest.$ac_ext''; do { shell {eval echo '"'$ac_try'"'} 1>&5; shell {eval $ac_try} 2>&5; }; } | egrep yes >/dev/null !2 > !1 { setglobal with_gcc = 'yes' # Set up default GNU C++ configuration # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. The # assumption here is that the linker is going to be the same as that # used by the C compiler. For the purposes of GCC, this is ok, but # if someone uses g++ along with a non-GNU C compiler that doesn't # use GNU ld, we may lose. This is ok for the toolchain tree, since # the only users of ltcf-cxx.sh are libstdc++-v3 and libjava, # anyway, and those use both gcc and g++, so the settings are bound # to be the same. if test $with_gnu_ld = yes { setglobal archive_cmds = ''$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'' setglobal 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'' setglobal hardcode_libdir_flag_spec = ''${wl}--rpath ${wl}$libdir'' setglobal export_dynamic_flag_spec = ''${wl}--export-dynamic'' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) setglobal wlarc = ''${wl}'' # ancient GNU ld didn't support --whole-archive et. al. if eval "$[$CC -print-prog-name=ld] --help 2>&1" | \ egrep 'no-whole-archive' > /dev/null { setglobal whole_archive_flag_spec = ""$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive"' } else { setglobal whole_archive_flag_spec = '' } } else { setglobal wlarc = '' # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. setglobal archive_cmds = ''$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'' } # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. setglobal output_verbose_link_cmd = ''$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'' } else { setglobal with_gcc = 'no' setglobal wlarc = '' } # PORTME: fill in a description of your system's C++ link characteristics match $host_os { with aix3* # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with aix4* | aix5* setglobal archive_cmds = '''' setglobal hardcode_direct = 'yes' setglobal hardcode_libdir_separator = '':'' setglobal link_all_deplibs = 'yes' # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. if test $with_gcc = yes { match $host_os { with aix4.[012]|aix4.[012].* # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ setglobal collect2name = $[$(CC) -print-prog-name=collect2] if test -f $collect2name && \ strings $collect2name | grep resolve_lib_name >/dev/null { # We have reworked collect2 setglobal hardcode_direct = 'yes' } else { # We have old collect2 setglobal hardcode_direct = 'unsupported' # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking setglobal hardcode_minus_L = 'yes' setglobal hardcode_libdir_flag_spec = ''-L$libdir'' setglobal hardcode_libdir_separator = '' } } setglobal shared_flag = ''-shared'' } else { # not using gcc if test $host_cpu = ia64 { setglobal shared_flag = ''${wl}-G'' } else { setglobal shared_flag = ''${wl}-bM:SRE'' } } if test $host_cpu = ia64 { # On IA64, the linker does run time linking by default, so we don't # have to do anything special. setglobal aix_use_runtimelinking = 'no' if test $with_gnu_ld = no { setglobal exp_sym_flag = ''-Bexport'' setglobal no_entry_flag = ''"" } } else { # Test if we are trying to use run time linking, or normal AIX style linking. # If -brtl is somewhere in LDFLAGS, we need to do run time linking. setglobal aix_use_runtimelinking = 'no' for ld_flag in [$LDFLAGS] { if shell {test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" } { setglobal aix_use_runtimelinking = 'yes' break } } setglobal exp_sym_flag = ''-bexport'' setglobal no_entry_flag = ''-bnoentry'' } # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. setglobal always_export_symbols = 'yes' if test $aix_use_runtimelinking = yes { setglobal hardcode_libdir_flag_spec = ''${wl}-blibpath:$libdir:/usr/lib:/lib'' setglobal allow_undefined_flag = '' -Wl,-G'' setglobal 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"" } else { if test $host_cpu = ia64 { if test $with_gnu_ld = no { setglobal hardcode_libdir_flag_spec = ''${wl}-R $libdir:/usr/lib:/lib'' setglobal allow_undefined_flag = '"-z nodefs'" setglobal 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"" } } else { setglobal hardcode_libdir_flag_spec = ''${wl}-blibpath:$libdir:/usr/lib:/lib'' # Warning - without using the other run time loading flags, -berok will # link without error, but may produce a broken library. setglobal no_undefined_flag = '' ${wl}-bnoerok'' setglobal allow_undefined_flag = '' ${wl}-berok'' # -bexpall does not export symbols beginning with underscore (_) setglobal always_export_symbols = 'yes' # Exported symbols can be pulled into shared objects from archives setglobal whole_archive_flag_spec = '' '' setglobal build_libtool_need_lc = 'yes' # This is similar to how AIX traditionally builds it's shared libraries. setglobal 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"' } } with chorus* match $cc_basename { with * # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } with dgux* match $cc_basename { with ec++ # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with ghcx # Green Hills C++ Compiler # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with * # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } with freebsd[12]* # C++ shared libraries reported to be fairly broken before switch to ELF setglobal ld_shlibs = 'no' with freebsd* # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions setglobal ld_shlibs = 'yes' with gnu* with hpux* if test $with_gnu_ld = no { match $host_cpu { with ia64* setglobal hardcode_libdir_flag_spec = ''-L$libdir'' setglobal hardcode_shlibpath_var = 'no' with * setglobal hardcode_libdir_flag_spec = ''${wl}+b ${wl}$libdir'' } setglobal hardcode_direct = 'yes' setglobal hardcode_libdir_separator = ':' setglobal export_dynamic_flag_spec = ''${wl}-E'' } setglobal hardcode_minus_L = 'yes' # Not in the search PATH, but as the default # location of the library. match $cc_basename { with CC # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with aCC match $host_os { with hpux9* setglobal 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'' with * setglobal archive_cmds = ''$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'' } # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. setglobal 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'' with * if test $with_gcc = yes { if test $with_gnu_ld = no { match $host_os { with hpux9* setglobal 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'' with * match $host_cpu { with ia64* setglobal archive_cmds = ''$LD -b +h $soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'' with * setglobal 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'' } } } } else { # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } } with irix5* | irix6* match $cc_basename { with CC # SGI C++ setglobal 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'' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. setglobal old_archive_cmds = ''$CC -ar -WR,-u -o $oldlib $oldobjs'' with * if test $with_gcc = yes { if test $with_gnu_ld = no { setglobal 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'' } else { setglobal archive_cmds = ''$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'' } } setglobal hardcode_libdir_flag_spec = ''${wl}-rpath ${wl}$libdir'' setglobal hardcode_libdir_separator = ':' setglobal link_all_deplibs = 'yes' } with linux* match $cc_basename { with KCC # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. setglobal 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'' setglobal 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'' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. setglobal 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'' setglobal hardcode_libdir_flag_spec = ''${wl}--rpath,$libdir'' setglobal export_dynamic_flag_spec = ''${wl}--export-dynamic'' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. setglobal old_archive_cmds = ''$CC -Bstatic -o $oldlib $oldobjs'' with cxx # Compaq C++ setglobal archive_cmds = ''$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'' setglobal 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'' setglobal runpath_var = 'LD_RUN_PATH' setglobal hardcode_libdir_flag_spec = ''-rpath $libdir'' setglobal hardcode_libdir_separator = ':' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. setglobal 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'' } with lynxos* # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with m88k* # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with mvs* match $cc_basename { with cxx # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with * # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } with netbsd* # NetBSD uses g++ - do we need to do anything? with osf3* match $cc_basename { with KCC # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. setglobal 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'' setglobal hardcode_libdir_flag_spec = ''${wl}-rpath,$libdir'' setglobal hardcode_libdir_separator = ':' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. setglobal old_archive_cmds = ''$CC -Bstatic -o $oldlib $oldobjs'' with RCC # Rational C++ 2.4.1 # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with cxx setglobal allow_undefined_flag = '' ${wl}-expect_unresolved ${wl}\*'' setglobal 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'' setglobal hardcode_libdir_flag_spec = ''${wl}-rpath ${wl}$libdir'' setglobal hardcode_libdir_separator = ':' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. setglobal 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'' with * if test $with_gcc = yes && test $with_gnu_ld = no { setglobal allow_undefined_flag = '' ${wl}-expect_unresolved ${wl}\*'' setglobal 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'' setglobal hardcode_libdir_flag_spec = ''${wl}-rpath ${wl}$libdir'' setglobal hardcode_libdir_separator = ':' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. setglobal output_verbose_link_cmd = ''$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'' } else { # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } } with osf4* | osf5* match $cc_basename { with KCC # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. setglobal 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'' setglobal hardcode_libdir_flag_spec = ''${wl}-rpath,$libdir'' setglobal hardcode_libdir_separator = ':' # Archives containing C++ object files must be created using # the KAI C++ compiler. setglobal old_archive_cmds = ''$CC -o $oldlib $oldobjs'' with RCC # Rational C++ 2.4.1 # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with cxx setglobal allow_undefined_flag = '' -expect_unresolved \*'' setglobal 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'' setglobal archive_expsym_cmds = ''for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $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~ $rm $lib.exp'' setglobal hardcode_libdir_flag_spec = ''-rpath $libdir'' setglobal hardcode_libdir_separator = ':' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. setglobal 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'' with * if test $with_gcc = yes && test $with_gnu_ld = no { setglobal allow_undefined_flag = '' ${wl}-expect_unresolved ${wl}\*'' setglobal 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'' setglobal hardcode_libdir_flag_spec = ''${wl}-rpath ${wl}$libdir'' setglobal hardcode_libdir_separator = ':' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. setglobal output_verbose_link_cmd = ''$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'' } else { # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } } with psos* # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with sco* match $cc_basename { with CC # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with * # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } with sunos4* match $cc_basename { with CC # Sun C++ 4.x # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with lcc # Lucid # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with * # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } with solaris* match $cc_basename { with CC # Sun C++ 4.2, 5.x and Centerline C++ setglobal no_undefined_flag = '' -zdefs'' setglobal archive_cmds = ''$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'' setglobal archive_expsym_cmds = ''$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $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'' setglobal hardcode_libdir_flag_spec = ''-R$libdir'' setglobal hardcode_shlibpath_var = 'no' match $host_os { with solaris2.[0-5] | solaris2.[0-5].* with * # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) setglobal whole_archive_flag_spec = ''${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'' } setglobal link_all_deplibs = 'yes' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. setglobal 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'' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. setglobal old_archive_cmds = ''$CC -xar -o $oldlib $oldobjs'' with gcx # Green Hills C++ Compiler setglobal archive_cmds = ''$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'' # The C++ compiler must be used to create the archive. setglobal old_archive_cmds = ''$CC $LDFLAGS -archive -o $oldlib $oldobjs'' with * # GNU C++ compiler with Solaris linker if test $with_gcc = yes && test $with_gnu_ld = no { setglobal no_undefined_flag = '' ${wl}-z ${wl}defs'' if $CC --version | egrep -v '^2\.7' > /dev/null { setglobal archive_cmds = ''$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'' setglobal archive_expsym_cmds = ''$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. setglobal output_verbose_link_cmd = ""$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L"\"" } else { # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. setglobal archive_cmds = ''$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'' setglobal archive_expsym_cmds = ''$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. setglobal output_verbose_link_cmd = ""$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L"\"" } setglobal hardcode_libdir_flag_spec = ''${wl}-R $wl$libdir'' } } with tandem* match $cc_basename { with NCC # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with * # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } with unixware* # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with vxworks* # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' with * # FIXME: insert proper C++ library support setglobal ld_shlibs = 'no' } ## Compiler Characteristics: PIC flags, static flags, etc # We don't use cached values here since only the C compiler # characteristics should be cached. setglobal ac_cv_prog_cc_pic = '' setglobal ac_cv_prog_cc_shlib = '' setglobal ac_cv_prog_cc_wl = '' setglobal ac_cv_prog_cc_static = '' setglobal ac_cv_prog_cc_no_builtin = '' setglobal ac_cv_prog_cc_can_build_shared = $can_build_shared setglobal ac_cv_prog_cc_pic_works = '' setglobal ac_cv_prog_cc_static_works = '' if test $with_gcc = yes { setglobal ac_cv_prog_cc_wl = ''-Wl,'' setglobal ac_cv_prog_cc_static = ''-static'' match $host_os { with aix* # All AIX code is PIC. if test $host_cpu = ia64 { # AIX 5 now supports IA64 processor setglobal lt_cv_prog_cc_static = ''-Bstatic'' } else { setglobal lt_cv_prog_cc_static = ''-bnso -bI:/lib/syscalls.exp'' } with amigaos* # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. setglobal ac_cv_prog_cc_pic = ''-m68020 -resident32 -malways-restore-a4'' with beos* | irix5* | irix6* | osf3* | osf4* | osf5* # PIC is the default for these OSes. with cygwin* | mingw* | os2* # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). setglobal ac_cv_prog_cc_pic = ''-DDLL_EXPORT'' with darwin* | rhapsody* # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files setglobal lt_cv_prog_cc_pic = ''-fno-common'' with *djgpp* # DJGPP does not support shared libraries at all setglobal ac_cv_prog_cc_pic = '' with sysv4*MP* if test -d /usr/nec { setglobal ac_cv_prog_cc_pic = '-Kconform_pic' } with * setglobal ac_cv_prog_cc_pic = ''-fPIC'' } } else { match $host_os { with aix4* | aix5* # All AIX code is PIC. if test $host_cpu = ia64 { # AIX 5 now supports IA64 processor setglobal lt_cv_prog_cc_static = ''-Bstatic'' } else { setglobal lt_cv_prog_cc_static = ''-bnso -bI:/lib/syscalls.exp'' } with chorus* match $cc_basename { with cxch68 # Green Hills C++ Compiler # 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" } with dgux* match $cc_basename { with ec++ setglobal ac_cv_prog_cc_pic = ''-KPIC'' with ghcx # Green Hills C++ Compiler setglobal ac_cv_prog_cc_pic = ''-pic'' with * } with freebsd* # FreeBSD uses GNU C++ with gnu* with hpux9* | hpux10* | hpux11* match $cc_basename { with CC setglobal ac_cv_prog_cc_wl = ''-Wl,'' setglobal ac_cv_prog_cc_static = ""$(ac_cv_prog_cc_wl)-a $(ac_cv_prog_cc_wl)archive"" setglobal ac_cv_prog_cc_pic = ''+Z'' with aCC setglobal ac_cv_prog_cc_wl = ''-Wl,'' setglobal ac_cv_prog_cc_static = ""$(ac_cv_prog_cc_wl)-a $(ac_cv_prog_cc_wl)archive"" setglobal ac_cv_prog_cc_pic = ''+Z'' with * } with irix5* | irix6* match $cc_basename { with CC setglobal ac_cv_prog_cc_wl = ''-Wl,'' setglobal ac_cv_prog_cc_static = ''-non_shared'' setglobal ac_cv_prog_cc_pic = ''-KPIC'' with * } with linux* match $cc_basename { with KCC # KAI C++ Compiler setglobal ac_cv_prog_cc_wl = ''--backend -Wl,'' setglobal ac_cv_prog_cc_pic = ''-fPIC'' with cxx # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. setglobal ac_cv_prog_cc_pic = '' setglobal ac_cv_prog_cc_static = ''-non_shared'' with * } with lynxos* with m88k* with mvs* match $cc_basename { with cxx setglobal ac_cv_prog_cc_pic = ''-W c,exportall'' with * } with netbsd* with osf3* | osf4* | osf5* match $cc_basename { with KCC setglobal ac_cv_prog_cc_wl = ''--backend -Wl,'' with RCC # Rational C++ 2.4.1 setglobal ac_cv_prog_cc_pic = ''-pic'' with cxx # Digital/Compaq C++ setglobal ac_cv_prog_cc_wl = ''-Wl,'' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. setglobal ac_cv_prog_cc_pic = '' setglobal ac_cv_prog_cc_static = ''-non_shared'' with * } with psos* with sco* match $cc_basename { with CC setglobal ac_cv_prog_cc_pic = ''-fPIC'' with * } with solaris* match $cc_basename { with CC # Sun C++ 4.2, 5.x and Centerline C++ setglobal ac_cv_prog_cc_pic = ''-KPIC'' setglobal ac_cv_prog_cc_static = ''-Bstatic'' setglobal ac_cv_prog_cc_wl = ''-Qoption ld '' with gcx # Green Hills C++ Compiler setglobal ac_cv_prog_cc_pic = ''-PIC'' with * } with sunos4* match $cc_basename { with CC # Sun C++ 4.x setglobal ac_cv_prog_cc_pic = ''-pic'' setglobal ac_cv_prog_cc_static = ''-Bstatic'' with lcc # Lucid setglobal ac_cv_prog_cc_pic = ''-pic'' with * } with tandem* match $cc_basename { with NCC # NonStop-UX NCC 3.20 setglobal ac_cv_prog_cc_pic = ''-KPIC'' with * } with unixware* with vxworks* with * setglobal ac_cv_prog_cc_can_build_shared = 'no' } } match $host_os { # Platforms which do not suport PIC and -DPIC is meaningless # on them: with *djgpp* setglobal ac_cv_prog_cc_pic = '' with * setglobal ac_cv_prog_cc_pic = ""$ac_cv_prog_cc_pic -DPIC"" } # Figure out "hidden" C++ library dependencies from verbose # compiler output whening linking a shared library. cat > conftest.$ac_ext << """ class Foo { public: Foo (void) { a = 0; } private: int a; }; """ if shell {eval $ac_compile} 2>&5 { # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. setglobal pre_test_object_deps_done = 'no' for p in [$[eval $output_verbose_link_cmd]] { match $p { with -L* | -R* | -l* # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R" { setglobal prev = $p continue } else { setglobal prev = '' } if test $pre_test_object_deps_done = no { match $p { with -L* | -R* # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z $compiler_lib_search_path { setglobal compiler_lib_search_path = ""$(prev)$(p)"" } else { setglobal compiler_lib_search_path = ""$(compiler_lib_search_path) $(prev)$(p)"" } # The "-l" case would never come before the object being # linked, so don't bother handling this case. } } else { if test -z $postdeps { setglobal postdeps = ""$(prev)$(p)"" } else { setglobal postdeps = ""$(postdeps) $(prev)$(p)"" } } with *.$objext # This assumes that the test object file only shows up # once in the compiler output. if test $p = "conftest.$objext" { setglobal pre_test_object_deps_done = 'yes' continue } if test $pre_test_object_deps_done = no { if test -z $predep_objects { setglobal predep_objects = $p } else { setglobal predep_objects = ""$predep_objects $p"" } } else { if test -z $postdep_objects { setglobal postdep_objects = $p } else { setglobal postdep_objects = ""$postdep_objects $p"" } } with * # Ignore the rest. } } # Clean up. rm -f a.out } else { echo "ltcf-cxx.sh: error: problem compiling test program" } $rm -f confest.$objext match " $postdeps " { with *" -lc "* setglobal need_lc = 'no' with * setglobal need_lc = 'yes' }