# HG changeset patch # User "Yann E. MORIN" # Date 1231279817 0 # Node ID cf598d70f6ea20c16b7a5e3540c3def3b8a4fce3 # Parent 8024ad97841b4d2c945b29ff5d4137d6671a11b9 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(-) diff -r 8024ad97841b -r cf598d70f6ea config/cc/gcc.in --- a/config/cc/gcc.in Tue Jan 06 21:05:33 2009 +0000 +++ b/config/cc/gcc.in Tue Jan 06 22:10:17 2009 +0000 @@ -223,3 +223,9 @@ default "" help Specify the URL that users should visit if they wish to report a bug. + +config CC_LANG_JAVA_USE_ECJ + bool + default y + depends on CC_LANG_JAVA + depends on CC_GCC_4_3_or_later diff -r 8024ad97841b -r cf598d70f6ea scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Tue Jan 06 21:05:33 2009 +0000 +++ b/scripts/build/cc/gcc.sh Tue Jan 06 22:10:17 2009 +0000 @@ -12,12 +12,24 @@ # subdirectory! You bastard! CT_GetFile "gcc-${CT_CC_VERSION}" \ {ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/gcc-${CT_CC_VERSION}} + # Starting with GCC 4.3, ecj is used for Java, and will only be + # built if the configure script finds ecj.jar at the top of the + # GCC source tree, which will not be there unless we get it and + # put it there ourselves + if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then + CT_GetFile ecj-latest .jar ftp://gcc.gnu.org/pub/java \ + ftp://sourceware.org/pub/java + fi } # Extract gcc do_cc_extract() { CT_Extract "gcc-${CT_CC_VERSION}" CT_Patch "gcc-${CT_CC_VERSION}" + # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree + if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y" ]; then + CT_DoExecLog ALL cp -v "${CT_TARBALLS_DIR}/ecj-latest.jar" "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/ecj.jar" + fi } #------------------------------------------------------------------------------ diff -r 8024ad97841b -r cf598d70f6ea scripts/crosstool.sh --- a/scripts/crosstool.sh Tue Jan 06 21:05:33 2009 +0000 +++ b/scripts/crosstool.sh Tue Jan 06 22:10:17 2009 +0000 @@ -315,7 +315,7 @@ t="${!r}-" fi - for tool in ar as dlltool gcc g++ gnatbind gnatmake ld nm objcopy objdump ranlib strip windres; do + for tool in ar as dlltool gcc g++ gcj gnatbind gnatmake ld nm objcopy objdump ranlib strip windres; do # First try with prefix + suffix # Then try with prefix only # Then try with suffix only, but only for BUILD, and HOST iff REAL_BUILD == REAL_HOST