Add the Eclipse Java Compiler to be able to compile Java.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Jan 06 22:10:17 2009 +0000 (2009-01-06)
changeset 1129cf598d70f6ea
parent 1128 8024ad97841b
child 1130 78681fe5cdd1
Add the Eclipse Java Compiler to be able to compile Java.
Andy JOHNSON wrote:
The Java compiler for GCC versions 4.3.0 and up requires the
Eclipse compiler "ecj1" to be built as well. I added "gcj" to
the list of utilities to make the initial link.


/trunk/scripts/build/cc/gcc.sh | 12 12 0 0 ++++++++++++
/trunk/scripts/crosstool.sh | 2 1 1 0 +-
/trunk/config/cc/gcc.in | 6 6 0 0 ++++++
3 files changed, 19 insertions(+), 1 deletion(-)
config/cc/gcc.in
scripts/build/cc/gcc.sh
scripts/crosstool.sh
     1.1 --- a/config/cc/gcc.in	Tue Jan 06 21:05:33 2009 +0000
     1.2 +++ b/config/cc/gcc.in	Tue Jan 06 22:10:17 2009 +0000
     1.3 @@ -223,3 +223,9 @@
     1.4      default ""
     1.5      help
     1.6        Specify the URL that users should visit if they wish to report a bug.
     1.7 +
     1.8 +config CC_LANG_JAVA_USE_ECJ
     1.9 +    bool
    1.10 +    default y
    1.11 +    depends on CC_LANG_JAVA
    1.12 +    depends on CC_GCC_4_3_or_later
     2.1 --- a/scripts/build/cc/gcc.sh	Tue Jan 06 21:05:33 2009 +0000
     2.2 +++ b/scripts/build/cc/gcc.sh	Tue Jan 06 22:10:17 2009 +0000
     2.3 @@ -12,12 +12,24 @@
     2.4      # subdirectory! You bastard!
     2.5      CT_GetFile "gcc-${CT_CC_VERSION}"   \
     2.6                 {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}}
     2.7 +    # Starting with GCC 4.3, ecj is used for Java, and will only be
     2.8 +    # built if the configure script finds ecj.jar at the top of the
     2.9 +    # GCC source tree, which will not be there unless we get it and
    2.10 +    # put it there ourselves
    2.11 +    if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then
    2.12 +        CT_GetFile ecj-latest .jar ftp://gcc.gnu.org/pub/java   \
    2.13 +                                   ftp://sourceware.org/pub/java
    2.14 +    fi
    2.15  }
    2.16  
    2.17  # Extract gcc
    2.18  do_cc_extract() {
    2.19      CT_Extract "gcc-${CT_CC_VERSION}"
    2.20      CT_Patch "gcc-${CT_CC_VERSION}"
    2.21 +    # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
    2.22 +    if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then
    2.23 +        CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar"
    2.24 +    fi
    2.25  }
    2.26  
    2.27  #------------------------------------------------------------------------------
     3.1 --- a/scripts/crosstool.sh	Tue Jan 06 21:05:33 2009 +0000
     3.2 +++ b/scripts/crosstool.sh	Tue Jan 06 22:10:17 2009 +0000
     3.3 @@ -315,7 +315,7 @@
     3.4              t="${!r}-"
     3.5          fi
     3.6  
     3.7 -        for tool in ar as dlltool gcc g++ gnatbind gnatmake ld nm objcopy objdump ranlib strip windres; do
     3.8 +        for tool in ar as dlltool gcc g++ gcj gnatbind gnatmake ld nm objcopy objdump ranlib strip windres; do
     3.9              # First try with prefix + suffix
    3.10              # Then try with prefix only
    3.11              # Then try with suffix only, but only for BUILD, and HOST iff REAL_BUILD == REAL_HOST