- Only build with a native ecj on x86{,_64}

- Make /usr/bin/ecj native again as it's slow as a script with gij and the
    chances of a someone using a proprietary JDK and not seeing their javac
    alternative are slim.
This commit is contained in:
Andrew Overholt 2006-03-03 20:14:42 +00:00
parent 094a66bee2
commit 6b71c4859a
1 changed files with 34 additions and 7 deletions

View File

@ -18,6 +18,11 @@ Epoch: 1
%else
%define eclipse_arch %{_arch}
%endif
%ifarch %{ix86} x86_64
%define native_ecj 1
%else
%define native_ecj 0
%endif
Summary: %{pkg_summary}
Name: eclipse
@ -38,7 +43,6 @@ Source11: %{name}-fedora-splash-3.1.2.png
Source16: %{name}-copy-platform.sh
Source17: %{name}-efj-wrapper.sh
Source19: %{name}-filenamepatterns.txt
Source20: ecj.sh.in
Source21: rebuild-sdk-features
# Build libswt-mozilla and libswt-cairo and use O2
@ -543,7 +547,6 @@ popd
%build
env
ORIGCLASSPATH=$CLASSPATH
%if %{gcj_support}
@ -570,20 +573,25 @@ ORIGCLASSPATH=$CLASSPATH
# Delete our modified ecj and restore the backup
rm -rf ecj-bootstrap-tmp
%if %{native_ecj}
# 1b. Natively-compile it
gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic \
-o ecj-bootstrap.jar.so ecj-bootstrap.jar
gcj-dbtool -n ecj-bootstrap.db 30000
gcj-dbtool -a ecj-bootstrap.db ecj-bootstrap.jar{,.so}
%endif
# 2a. Build ecj
export CLASSPATH=ecj-bootstrap.jar:$ORIGCLASSPATH
%if %{native_ecj}
export ANT_OPTS="-Dgnu.gcj.precompiled.db.path=`pwd`/ecj-bootstrap.db"
%endif
%endif
ant -buildfile jdtcoresrc/compilejdtcorewithjavac.xml
%if %{gcj_support}
%if %{native_ecj}
# 2b. Natively-compile ecj
gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic \
-o jdtcoresrc/ecj.jar.so jdtcoresrc/ecj.jar
@ -597,12 +605,14 @@ ant -buildfile jdtcoresrc/compilejdtcorewithjavac.xml
# To enSURE we're not using any pre-compiled ecj on the build system, set this
export ANT_OPTS="-Dgnu.gcj.precompiled.db.path=`pwd`/jdtcoresrc/ecj.db"
%endif
%endif
# 3. Use this ecj to rebuild itself
export CLASSPATH=`pwd`/jdtcoresrc/ecj.jar:$ORIGCLASSPATH
ant -buildfile jdtcoresrc/compilejdtcore.xml
%if %{gcj_support}
%if %{native_ecj}
# Natively-compile it
gcj -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic \
-o ecj.jar.so ecj.jar
@ -613,6 +623,7 @@ ant -buildfile jdtcoresrc/compilejdtcore.xml
# Remove old native bits
rm jdtcoresrc/ecj.db jdtcoresrc/ecj.jar.so
%endif
%endif
# Build the rest of Eclipse
export CLASSPATH=`pwd`/ecj.jar:$ORIGCLASSPATH
@ -651,6 +662,8 @@ tar -C $RPM_BUILD_ROOT%{_datadir} -zxf \
result/linux-gtk-%{eclipse_arch}-sdk.tar.gz
pushd $RPM_BUILD_ROOT%{_datadir}/%{name}
# extract jdtCompilerAdapter.jar from org.eclipse.jdt.core_3.1.2.jar
unzip -d plugins plugins/org.eclipse.jdt.core_3.1.2.jar jdtCompilerAdapter.jar
# Extract .so files
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=90535
@ -908,13 +921,18 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/java
ln -s %{_datadir}/%{name}/plugins/org.eclipse.jdt.core_%{eclipse_majmin}.%{eclipse_micro}.jar \
$RPM_BUILD_ROOT%{_datadir}/java/eclipse-ecj.jar
# Install /usr/bin/ecj script
sed 's:@JAVADIR@:%{_javadir}:g' < %{SOURCE20} > ecj
install -m755 ecj $RPM_BUILD_ROOT%{_bindir}
rm ecj
%if %{gcj_support}
aot-compile-rpm
# Build and install ecj binary
pushd $RPM_BUILD_ROOT%{_libdir}/gcj/%{name}
gcj -g -O2 --main=org.eclipse.jdt.internal.compiler.batch.Main \
-Wl,-R,%{_libdir}/gcj/%{name} \
org.eclipse.jdt.core_3.1.2.jar.so jdtCompilerAdapter.jar.so -o \
$RPM_BUILD_ROOT%{_bindir}/ecj
popd
chmod a+x $RPM_BUILD_ROOT%{_bindir}/ecj
%endif
%clean
@ -1041,12 +1059,15 @@ fi
%dir %{_datadir}/%{name}/features
%dir %{_datadir}/%{name}/configuration
%{_datadir}/%{name}/plugins/org.eclipse.jdt.core_3.*
%{_datadir}/%{name}/plugins/jdtCompilerAdapter.jar
%{_datadir}/java/eclipse-ecj.jar
%if %{gcj_support}
# Native bits
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/org.eclipse.jdt.core_3.1.2.jar.so
%{_libdir}/gcj/%{name}/org.eclipse.jdt.core_3.1.2.jar.db
%{_libdir}/gcj/%{name}/jdtCompilerAdapter.jar.so
%{_libdir}/gcj/%{name}/jdtCompilerAdapter.jar.db
%{_bindir}/ecj
%endif
@ -1278,6 +1299,12 @@ fi
%{_datadir}/%{name}/plugins/org.eclipse.platform.source.linux.gtk.*_%{version}
%changelog
* Fri Mar 03 2006 Andrew Overholt <overholt@redhat.com> 3.1.2-1jpp_12fc
- Only build with a native ecj on x86{,_64}
- Make /usr/bin/ecj native again as it's slow as a script with gij and
the chances of a someone using a proprietary JDK and not seeing their
javac alternative are slim.
* Tue Feb 28 2006 Andrew Overholt <overholt@redhat.com> 3.1.2-1jpp_12fc
- Update to tomcat 5.5 (e.o#98371).
- Don't build on ppc64 until we get the tomcat situation straightened out.