Ignore:
Timestamp:
Aug 16, 2003, 6:41:03 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/ltcf-gcj.sh

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r604 r605  
    33# ltcf-gcj.sh - Create a GCJ compiler specific configuration
    44#
    5 # Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
     5# Copyright (C) 1996-1999, 2000, 2001, 2003 Free Software Foundation, Inc.
    66# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    77#
     
    4242
    4343## Linker Characteristics
    44 case "$host_os" in
     44case $host_os in
    4545cygwin* | mingw*)
    4646  # FIXME: the MSVC++ port hasn't been tested in a loooong time
     
    6060
    6161  # See if GNU ld supports shared libraries.
    62   case "$host_os" in
    63   aix3* | aix4*)
    64     # On AIX, the GNU linker is very broken
    65     ld_shlibs=no
    66     cat <<EOF 1>&2
     62  case $host_os in
     63  aix3* | aix4* | aix5*)
     64    # On AIX/PPC, the GNU linker is very broken
     65    if test "$host_cpu" != ia64; then
     66      ld_shlibs=no
     67      cat <<EOF 1>&2
    6768
    6869*** Warning: the GNU linker, at least up to release 2.9.1, is reported
     
    7374
    7475EOF
     76    fi
    7577    ;;
    7678
     
    110112      sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
    111113      test -f $output_objdir/impgen.exe || (cd $output_objdir && \
    112       if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
     114      if test "x$BUILD_CC" != "x" ; then $BUILD_CC -o impgen impgen.c ; \
    113115      else $CC -o impgen impgen.c ; fi)~
    114       $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
     116      $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
    115117
    116118    old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
     
    121123    dll_entry=__cygwin_dll_entry@12
    122124    dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
    123     case "$host_os" in
     125    case $host_os in
    124126    mingw*)
    125127      # mingw values
     
    152154      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
    153155
     156    # If the export-symbols file already is a .def file (1st line
     157    # is EXPORTS), use it as is.
    154158    # If DATA tags from a recent dlltool are present, honour them!
    155     archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
    156       _lt_hint=1;
    157       cat $export_symbols | while read symbol; do
    158         set dummy \$symbol;
    159         case \$# in
    160           2) echo "     \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
    161           *) echo "     \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
    162         esac;
    163         _lt_hint=`expr 1 + \$_lt_hint`;
    164       done~
     159    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
     160        cp $export_symbols $output_objdir/$soname-def;
     161      else
     162        echo EXPORTS > $output_objdir/$soname-def;
     163        _lt_hint=1;
     164        cat $export_symbols | while read symbol; do
     165         set dummy \$symbol;
     166         case \[$]# in
     167           2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
     168           *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
     169         esac;
     170         _lt_hint=`expr 1 + \$_lt_hint`;
     171        done;
     172      fi~
    165173      '"$ltdll_cmds"'
    166       $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_gcj_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
     174      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
    167175      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
    168       $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_gcj_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
    169       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
    170       $CC $output_objdir/$soname-exp '$lt_cv_gcj_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
     176      $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
     177      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
     178      $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
    171179    ;;
    172180
     
    176184      wlarc=
    177185    else
    178       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
    179       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
     186      archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
     187      archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
    180188    fi
    181189    ;;
     
    240248else
    241249  # PORTME fill in a description of your system's linker (not GNU ld)
    242   case "$host_os" in
     250  case $host_os in
    243251  aix3*)
    244252    allow_undefined_flag=unsupported
     
    255263    ;;
    256264
    257   aix4*)
    258     hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
     265  aix4* | aix5*)
     266    hardcode_direct=yes
    259267    hardcode_libdir_separator=':'
     268    link_all_deplibs=yes
     269    # When large executables or shared objects are built, AIX ld can
     270    # have problems creating the table of contents.  If linking a library
     271    # or program results in "error TOC overflow" add -mminimal-toc to
     272    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
     273    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
    260274    if test "$with_gcc" = yes; then
    261       collect2name=`${CC} -print-prog-name=collect2`
    262       if test -f "$collect2name" && \
    263          strings "$collect2name" | grep resolve_lib_name >/dev/null
    264       then
    265         # We have reworked collect2
    266         hardcode_direct=yes
     275      case $host_os in aix4.[012]|aix4.[012].*)
     276      # We only want to do this on AIX 4.2 and lower, the check
     277      # below for broken collect2 doesn't work under 4.3+
     278        collect2name=`${CC} -print-prog-name=collect2`
     279        if test -f "$collect2name" && \
     280           strings "$collect2name" | grep resolve_lib_name >/dev/null
     281        then
     282          # We have reworked collect2
     283          hardcode_direct=yes
     284        else
     285          # We have old collect2
     286          hardcode_direct=unsupported
     287          # It fails to find uninstalled libraries when the uninstalled
     288          # path is not listed in the libpath.  Setting hardcode_minus_L
     289          # to unsupported forces relinking
     290          hardcode_minus_L=yes
     291          hardcode_libdir_flag_spec='-L$libdir'
     292          hardcode_libdir_separator=
     293        fi
     294      esac
     295      shared_flag='-shared'
     296    else
     297      # not using gcc
     298      if test "$host_cpu" = ia64; then
     299        shared_flag='${wl}-G'
    267300      else
    268         # We have old collect2
    269         hardcode_direct=unsupported
    270         # It fails to find uninstalled libraries when the uninstalled
    271         # path is not listed in the libpath.  Setting hardcode_minus_L
    272         # to unsupported forces relinking
    273         hardcode_minus_L=yes
    274         hardcode_libdir_flag_spec='-L$libdir'
    275         hardcode_libdir_separator=
     301        shared_flag='${wl}-bM:SRE'
    276302      fi
    277       shared_flag='-shared'
    278     else
    279       shared_flag='${wl}-bM:SRE'
    280       hardcode_direct=yes
    281     fi
    282     allow_undefined_flag=' ${wl}-berok'
    283     archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
    284     archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
    285     case "$host_os" in aix4.[01]|aix4.[01].*)
    286       # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
    287       always_export_symbols=yes ;;
    288     esac
    289    ;;
     303    fi
     304
     305    if test "$host_cpu" = ia64; then
     306      # On IA64, the linker does run time linking by default, so we don't
     307      # have to do anything special.
     308      aix_use_runtimelinking=no
     309      if test $with_gnu_ld = no; then
     310        exp_sym_flag='-Bexport'
     311        no_entry_flag=""
     312      fi
     313    else
     314      # Test if we are trying to use run time linking, or normal AIX style linking.
     315      # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
     316      aix_use_runtimelinking=no
     317      for ld_flag in $LDFLAGS; do
     318        if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
     319          aix_use_runtimelinking=yes
     320          break
     321        fi
     322      done
     323      exp_sym_flag='-bexport'
     324      no_entry_flag='-bnoentry'
     325    fi
     326    # -bexpall does not export symbols beginning with underscore (_)
     327    always_export_symbols=yes
     328    if test "$aix_use_runtimelinking" = yes; then
     329      # Warning - without using the other run time loading flags (-brtl), -berok will
     330      #           link without error, but may produce a broken library.
     331      allow_undefined_flag=' ${wl}-berok'
     332      hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
     333      archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
     334    else
     335      if test "$host_cpu" = ia64; then
     336        if test $with_gnu_ld = no; then
     337          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
     338          allow_undefined_flag="-z nodefs"
     339          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"
     340        fi
     341      else
     342        allow_undefined_flag=' ${wl}-berok'
     343        # -bexpall does not export symbols beginning with underscore (_)
     344        always_export_symbols=yes
     345        # Exported symbols can be pulled into shared objects from archives
     346        whole_archive_flag_spec=' '
     347        build_libtool_need_lc=yes
     348        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
     349        # This is similar to how AIX traditionally builds it's shared libraries.
     350        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'
     351      fi
     352    fi
     353  ;;
    290354
    291355  amigaos*)
     
    312376    # FIXME: Should let the user specify the lib program.
    313377    old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
    314     fix_srcfile_path='`cygpath -w $srcfile`'
     378    fix_srcfile_path='`cygpath -w "$srcfile"`'
    315379    ;;
    316380
     
    347411
    348412  hpux9* | hpux10* | hpux11*)
    349     case "$host_os" in
     413    case $host_os in
    350414    hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
    351415    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
     
    374438      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
    375439    else
    376       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
     440      archive_cmds='$LD -shared -nodefaultlibs -o $lib $libobjs $deplibs $linker_flags'      # ELF
    377441    fi
    378442    hardcode_libdir_flag_spec='${wl}-R$libdir'
     
    428492
    429493  solaris*)
    430     no_undefined_flag=' -z text'
    431     # $CC -shared without GNU ld will not create a library from C++
    432     # object files and a static libstdc++, better avoid it by now
    433     archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
     494    no_undefined_flag=' ${wl}-z ${wl}defs'
     495    archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
    434496    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
    435                 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
    436     hardcode_libdir_flag_spec='-R$libdir'
    437     hardcode_shlibpath_var=no
    438     case "$host_os" in
     497      $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
     498
     499    # Commands to make compiler produce verbose output that lists
     500    # what "hidden" libraries, object files and flags are used when
     501    # linking a shared library.
     502    output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
     503
     504    hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
     505    hardcode_shlibpath_var=no
     506    case $host_os in
    439507    solaris2.[0-5] | solaris2.[0-5].*) ;;
    440508    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
    441       whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
     509      whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
    442510    esac
    443511    link_all_deplibs=yes
     
    508576    ;;
    509577
    510   unixware7*)
    511     archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
     578  sysv5uw7* | unixware7*)
     579    no_undefined_flag='${wl}-z ${wl}text'
     580    if test "$GCC" = yes; then
     581      archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
     582    else
     583      archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
     584    fi
    512585    runpath_var='LD_RUN_PATH'
    513586    hardcode_shlibpath_var=no
     
    534607    ac_cv_prog_cc_static='-static'
    535608
    536     case "$host_os" in
     609    case $host_os in
    537610    beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
    538611      # PIC is the default for these OSes.
     
    547620      ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
    548621      ;;
     622    *djgpp*)
     623      # DJGPP does not suppot shared libraries at all
     624      ac_cv_prog_cc_pic=
     625      ;;
    549626    cygwin* | mingw* | os2*)
    550627      # This hack is so that the source file can tell whether it is being
     
    570647# GCJ did not exist at the time GCC didn't implicitly link libc in.
    571648need_lc=no
     649
     650# All existing releases of GCJ support `-c -o'.
     651lt_cv_compiler_c_o=yes
Note: See TracChangeset for help on using the changeset viewer.