PUD: fix java cross compilation
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 13 Jan 2012 13:29:53 +0000 (14:29 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 13 Jan 2012 13:58:44 +0000 (14:58 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/wireformat-java/Makefile
lib/pud/wireformat-java/resources/build.xml
lib/pud/wireformat-java/resources/jre/1.6/rt.jar [new file with mode: 0644]
lib/pud/wireformat-java/resources/jre/How_to_cross-compile_for_older_platform_versions__Joseph_D__Darc.pdf [new file with mode: 0644]
lib/pud/wireformat-java/resources/jre/New_javac_warning_for_setting_an_older_source_without_bootclassp.pdf [new file with mode: 0644]

index 47fd9ab..8b0d3e7 100644 (file)
@@ -54,6 +54,9 @@ JAVA_DIR_INSTALL = usr/share/java/olsrd
 BUILD_DIR_JNI = $(BUILD_DIR)/jni
 
 JAVASRC = src/main/java
+JAVAVERSIONSRC = 1.6
+JAVAVERSIONDST = 1.6
+JAVABOOTCLASSPATH = resources/jre/$(JAVAVERSIONSRC)/rt.jar
 JAVA_PKG = org.olsr.plugin.pud
 JAVA_PKG_DIR = $(subst .,/,$(JAVA_PKG))
 JAVA_PKG_UNDER = $(subst .,_,$(JAVA_PKG))
@@ -100,7 +103,7 @@ $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/PositionUpdate.class: $(JAVASRC)/$(JAVA_PKG_DIR
                                                        $(JAVASRC)/$(JAVA_PKG_DIR)/LibraryLoader.java \
                                                        $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java
        @echo "[JavaC] $<"
-       @javac -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
+       @javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
 
 # ClusterLeader
 $(BUILD_DIR)/$(JAVA_PKG_UNDER)_ClusterLeader.o: $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.c \
@@ -119,7 +122,7 @@ $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/ClusterLeader.class: $(JAVASRC)/$(JAVA_PKG_DIR)
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/LibraryLoader.java \
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java
        @echo "[JavaC] $<"
-       @javac -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
+       @javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
 
 # UplinkMessage
 $(BUILD_DIR)/$(JAVA_PKG_UNDER)_UplinkMessage.o: $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.c \
@@ -138,7 +141,7 @@ $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/UplinkMessage.class: $(JAVASRC)/$(JAVA_PKG_DIR)
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/LibraryLoader.java \
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java
        @echo "[JavaC] $<"
-       @javac -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
+       @javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
 
 
 #
@@ -158,6 +161,8 @@ build.xml: $(RESOURCES_DIR)/build.xml
                -e "s#BUILD_DIR#$(BUILD_DIR)#g" \
                -e "s#LIBDIR_BUILD#$(LIBDIR_BUILD)#g" \
                -e "s#JAVASRC#$(JAVASRC)#g" \
+               -e "s#JAVAVERSIONSRC#$(JAVAVERSIONSRC)#g" \
+               -e "s#JAVAVERSIONDST#$(JAVAVERSIONDST)#g" \
                -e "s#DEBUG#$(DEBUGBOOLEAN)#g" \
                "$<" > "$@"
 
index d00e2b8..dd4dd9d 100644 (file)
@@ -13,8 +13,8 @@
 
        <property name="debug" value="DEBUG" />
        <property name="debug.flags" value="lines,vars,source" />
-       <property name="source.version" value="1.6" />
-       <property name="target.version" value="1.6" />
+       <property name="source.version" value="JAVAVERSIONSRC" />
+       <property name="target.version" value="JAVAVERSIONDST" />
 
        <property name="build.dir" location="${basedir}/BUILD_DIR/classes" />
        <property name="src.dir" location="${basedir}/JAVASRC" />
@@ -23,6 +23,7 @@
        <property name="jar.file" value="${lib.dir}/${name}.jar" />
 
        <property name="javadoc.dir" location="${basedir}/doc/javadoc" />
+       <property name="javac.bootclasspath" location="${basedir}/resources/jre/${source.version}/rt.jar" />
 
        <!--
 
@@ -48,7 +49,7 @@
 
        <target name="build" description="Build plugin jar file" depends="clean,init,getgitcommit">
                <echo message="Compiling Plugin classes. (debug: ${debug})" />
-               <javac srcdir="${src.dir}" destdir="${build.dir}" source="${source.version}" target="${target.version}" debug="${debug}" debuglevel="${debug.flags}" includeantruntime="false" />
+               <javac bootclasspath="${javac.bootclasspath}" srcdir="${src.dir}" destdir="${build.dir}" source="${source.version}" target="${target.version}" debug="${debug}" debuglevel="${debug.flags}" includeantruntime="false" />
 
                <delete file="${jar.file}" />
                <jar destfile="${jar.file}">
@@ -77,7 +78,7 @@
        <target name="javadoc">
                <delete dir="${javadoc.dir}" />
                <mkdir dir="${javadoc.dir}" />
-               <javadoc destdir="${javadoc.dir}" windowtitle="${fullname}" use="yes" linksource="yes" splitindex="yes" access="private" author="true" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" version="true" source="${source.version}" sourcepath="${src.dir}" maxmemory="256M">
+               <javadoc bootclasspath="${javac.bootclasspath}" destdir="${javadoc.dir}" windowtitle="${fullname}" use="yes" linksource="yes" splitindex="yes" access="private" author="true" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" version="true" source="${source.version}" sourcepath="${src.dir}" maxmemory="256M">
                        <packageset dir="${src.dir}" defaultexcludes="yes">
                                <include name="org/olsr/**" />
                        </packageset>
diff --git a/lib/pud/wireformat-java/resources/jre/1.6/rt.jar b/lib/pud/wireformat-java/resources/jre/1.6/rt.jar
new file mode 100644 (file)
index 0000000..70e8c62
Binary files /dev/null and b/lib/pud/wireformat-java/resources/jre/1.6/rt.jar differ
diff --git a/lib/pud/wireformat-java/resources/jre/How_to_cross-compile_for_older_platform_versions__Joseph_D__Darc.pdf b/lib/pud/wireformat-java/resources/jre/How_to_cross-compile_for_older_platform_versions__Joseph_D__Darc.pdf
new file mode 100644 (file)
index 0000000..65c1ee3
Binary files /dev/null and b/lib/pud/wireformat-java/resources/jre/How_to_cross-compile_for_older_platform_versions__Joseph_D__Darc.pdf differ
diff --git a/lib/pud/wireformat-java/resources/jre/New_javac_warning_for_setting_an_older_source_without_bootclassp.pdf b/lib/pud/wireformat-java/resources/jre/New_javac_warning_for_setting_an_older_source_without_bootclassp.pdf
new file mode 100644 (file)
index 0000000..2131070
Binary files /dev/null and b/lib/pud/wireformat-java/resources/jre/New_javac_warning_for_setting_an_older_source_without_bootclassp.pdf differ