summaryrefslogtreecommitdiff
path: root/jtools/ecj/Makefile
blob: c9e4559a74e7d9bc21fd825ee60ffdd6ebabb376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include $(TOPDIR)/rules.mk

PKG_NAME:=		ecj
PKG_VERSION:=		1
PKG_RELEASE:=		2
PKG_MD5SUM:=		63220327925ace13756ae334c55a3baa

include ../rules.mk

install: ${STAGING_JAVA_HOST_DIR}/usr/bin/ecj

${STAGING_JAVA_HOST_DIR}/usr/bin/ecj:
	env \
		DYLD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64 \
		LD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64 \
		PATH=$(STAGING_JAVA_HOST_DIR)/usr/bin:$$PATH \
	$(STAGING_JAVA_HOST_DIR)/usr/bin/gcj -O2 -findirect-dispatch \
		-o ${STAGING_JAVA_HOST_DIR}/usr/bin/ecj.native \
		--main=org.eclipse.jdt.internal.compiler.batch.Main \
		$(TOPDIR)/jtools_build/gcc-$(GCJ_VER)/ecj.jar
	#$(CP) $(TOPDIR)/jtools_build/gcc-$(GCJ_VER)/ecj.jar ${STAGING_JAVA_HOST_DIR}/usr/share/ecj.jar
	echo "env LD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64 ${STAGING_JAVA_HOST_DIR}/usr/bin/ecj.native \$$@" > \
		${STAGING_JAVA_HOST_DIR}/usr/bin/ecj
	chmod u+x ${STAGING_JAVA_HOST_DIR}/usr/bin/ecj
	# put a wrapper for java here
	mv ${STAGING_JAVA_HOST_DIR}/usr/bin/gij ${STAGING_JAVA_HOST_DIR}/usr/bin/gij.native
	echo "env LD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64 ${STAGING_JAVA_HOST_DIR}/usr/bin/gij.native \"\$$@\"" > \
		${STAGING_JAVA_HOST_DIR}/usr/bin/java
	chmod u+x ${STAGING_JAVA_HOST_DIR}/usr/bin/java
	echo "env LD_LIBRARY_PATH=$(STAGING_JAVA_HOST_DIR)/usr/lib:$(STAGING_JAVA_HOST_DIR)/usr/lib64 ${STAGING_JAVA_HOST_DIR}/usr/bin/gij.native \"\$$@\"" > \
		${STAGING_JAVA_HOST_DIR}/usr/bin/gij
	chmod u+x ${STAGING_JAVA_HOST_DIR}/usr/bin/gij
	rm ${STAGING_JAVA_HOST_DIR}/usr/lib/jvm/bin/java
	rm ${STAGING_JAVA_HOST_DIR}/usr/lib/jvm/jre/bin/java
	cp ${STAGING_JAVA_HOST_DIR}/usr/bin/java ${STAGING_JAVA_HOST_DIR}/usr/lib/jvm/bin/java
	cp ${STAGING_JAVA_HOST_DIR}/usr/bin/java ${STAGING_JAVA_HOST_DIR}/usr/lib/jvm/jre/bin/java

include $(TOPDIR)/mk/tools.mk