X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=ltcf-cxx.sh;h=240e40de3e90d43c0ba53be2eee228ccf24744fd;hb=fcd2418b07cdd4737eeea874b53e4b2cb92275b1;hp=c239ee1649db7a9f54cb98ff6e6dd54313500791;hpb=a4e88f7d81dde5d39a032d6b7bd9af813bc318ab;p=pf3gnuchains%2Fgcc-fork.git diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh index c239ee1649d..240e40de3e9 100644 --- a/ltcf-cxx.sh +++ b/ltcf-cxx.sh @@ -68,11 +68,16 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev # 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. - if eval "`$CC -print-prog-name=ld` --version 2>&1" | \ - egrep 'GNU ld' > /dev/null; then - with_gnu_ld=yes - + # 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; then archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' 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' @@ -92,7 +97,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev whole_archive_flag_spec= fi else - with_gnu_ld=no wlarc= # A generic and very simple default shared library creation @@ -110,7 +114,6 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev else with_gcc=no - with_gnu_ld=no wlarc= fi @@ -125,6 +128,7 @@ case $host_os in hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes + file_list_spec='${wl}-f,' # 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 @@ -220,6 +224,51 @@ case $host_os in ;; esac ;; + + darwin* | rhapsody*) + case "$host_os" in + rhapsody* | darwin1.[[012]]) + allow_undefined_flag='-undefined suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='-flat_namespace -undefined suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + allow_undefined_flag='-flat_namespace -undefined suppress' + ;; + 10.*) + allow_undefined_flag='-undefined dynamic_lookup' + ;; + esac + fi + ;; + esac + # Disable shared library build on OS-X older than 10.3. + case $host_os in + darwin[1-6]*) + can_build_shared=no + ;; + darwin7*) + can_build_shared=yes + ;; + esac + output_verbose_link_cmd='echo' + + archive_cmds='$CXX -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, + # it doesn't exist in older darwin ld's + 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}' + 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}' + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + link_all_deplibs=yes + ;; + dgux*) case $cc_basename in ec++) @@ -241,7 +290,7 @@ case $host_os in # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs=no ;; - freebsd*) + freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs=yes @@ -323,7 +372,7 @@ case $host_os in if test "$with_gnu_ld" = no; then 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 - archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' + 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' fi fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -401,7 +450,7 @@ case $host_os in ;; esac ;; - netbsd*) + netbsd* | knetbsd*-gnu) # NetBSD uses g++ - do we need to do anything? ;; osf3*) @@ -649,6 +698,9 @@ case $host_os in ;; esac ;; + tpf*) + ld_shlibs=yes + ;; unixware*) # FIXME: insert proper C++ library support ld_shlibs=no @@ -709,7 +761,7 @@ if test "$with_gcc" = yes; then darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' + ac_cv_prog_cc_pic='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all @@ -756,7 +808,7 @@ else ;; esac ;; - freebsd*) + freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; gnu*)