[ooo-build-commit] .: configure.in set_soenv.in solenv/inc
Fridrich Strba
fridrich at kemper.freedesktop.org
Fri Sep 17 05:08:17 PDT 2010
configure.in | 62 ++++++++++++++++++++++++++++++++++++++++++++++
set_soenv.in | 3 ++
solenv/inc/antsettings.mk | 29 +++++++++++----------
solenv/inc/settings.mk | 3 ++
4 files changed, 84 insertions(+), 13 deletions(-)
New commits:
commit 5f57ebe6265d7b27148ca4e0cc99f5007e1bfb1b
Author: Petr Mladek <pmladek at suse.cz>
Date: Fri Sep 17 13:51:40 2010 +0200
build-java-target.diff: allow to define java target
i#93115
allow to define java target, so the build is usable with the JVM 1.5
even when it is built with JDK 1.6
diff --git a/configure.in b/configure.in
index 06b8262..e18c46f 100644
--- a/configure.in
+++ b/configure.in
@@ -611,6 +611,17 @@ AC_ARG_WITH(java,
no support for Java components, applets, accessibility
or XML filters.
], if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi, WITH_JAVA=java)
+AC_ARG_WITH(java_target_version,
+[ --with-java-target-version Generate class files that will work on JVMs with
+ the specified version. For example, use
+ --with-java-target-version=1.4 to make sure that the
+ application will work with JVM 1.4 even when compiled
+ with JDK 1.5.
+
+ This option is ignored when you compile with gcj/gij.
+
+ Usage: --with-java-target-version=<jvm version>
+],,)
AC_ARG_ENABLE(gcjaot,
[ --enable-gcjaot Build with[[out]] using Ahead of Time java compilation
support to speed up buildsi by compiling the jars also
@@ -2985,6 +2996,44 @@ else
JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
fi
+_java_target_ver="1.5"
+dnl ===================================================================
+dnl Check for target java bytecode version
+dnl ===================================================================
+if test "$SOLAR_JAVA" != ""; then
+ AC_MSG_CHECKING([for target java bytecode version])
+ if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then
+ AC_MSG_RESULT([default by $JDK])
+ if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
+ AC_MSG_WARN([Value defined by --with-java-target-version is ignored!])
+ fi
+ else
+ if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
+ _java_target_ver="$with_java_target_version"
+ AC_MSG_RESULT([$_java_target_ver])
+ elif test $_jdk_ver -gt 10000 ; then
+ _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'`
+ AC_MSG_RESULT([$_java_target_ver])
+ else
+ AC_MSG_ERROR([Unable to guess java bytecode version from java version!])
+ fi
+ fi
+
+ if ! test -z "$_java_target_ver" -o \
+ "$_java_target_ver" = "1.1" -o \
+ "$_java_target_ver" = "1.2" -o \
+ "$_java_target_ver" = "1.3" -o \
+ "$_java_target_ver" = "1.4" -o \
+ "$_java_target_ver" = "1.5" -o \
+ "$_java_target_ver" = "1.6" -o \
+ "$_java_target_ver" = "5" ; then
+ AC_MSG_ERROR([$_java_target_ver is not supported java bytecode version!])
+ fi
+
+ JAVA_SOURCE_VER="$_java_target_ver"
+ JAVA_TARGET_VER="$_java_target_ver"
+fi
+
dnl ===================================================================
dnl Checks for javac
dnl ===================================================================
@@ -3045,6 +3094,17 @@ if test "$SOLAR_JAVA" != ""; then
fi
AC_SUBST(JAVACISGCJ)
+JAVACISKAFFE=""
+dnl ===================================================================
+dnl Checks that javac is kaffe
+dnl ===================================================================
+if test "$SOLAR_JAVA" != ""; then
+ if test `$JAVACOMPILER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
+ JAVACISKAFFE="yes"
+ fi
+fi
+AC_SUBST(JAVACISKAFFE)
+
dnl ===================================================================
dnl Checks for javadoc
dnl ===================================================================
@@ -3259,6 +3319,8 @@ fi
AC_SUBST(JAVA_HOME)
AC_SUBST(JDK)
AC_SUBST(JAVAFLAGS)
+AC_SUBST(JAVA_SOURCE_VER)
+AC_SUBST(JAVA_TARGET_VER)
AC_SUBST(JAVAINTERPRETER)
AC_SUBST(JAVAIFLAGS)
AC_SUBST(JAVACOMPILER)
diff --git a/set_soenv.in b/set_soenv.in
index 27de833..5b5ab4b 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1747,6 +1747,7 @@ ToFile( "DMAKEROOT", $DMAKEROOT, "e" );
if ( $JDK ne "gcj" ) {
ToFile( "CLASSPATH", $CLASSPATH, "e" );
ToFile( "XCLASSPATH", $XCLASSPATH, "e" );
+ ToFile( "JAVACISKAFFE", '@JAVACISKAFFE@', "e" );
}
else {
ToFile( "JAVACISGCJ", '@JAVACISGCJ@', "e" );
@@ -1758,6 +1759,8 @@ if ( '@JDK@' ne '' )
{
ToFile( "JDK", "@JDK@", "e" );
ToFile( "JAVAFLAGS", "@JAVAFLAGS@", "e" );
+ ToFile( "JAVA_SOURCE_VER", "@JAVA_SOURCE_VER@","e" );
+ ToFile( "JAVA_TARGET_VER", "@JAVA_TARGET_VER@","e" );
ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" );
ToFile( "JAVAIFLAGS", "@JAVAIFLAGS@", "e" );
ToFile( "JAVACOMPILER", PathFormat("@JAVACOMPILER@"), "e" );
diff --git a/solenv/inc/antsettings.mk b/solenv/inc/antsettings.mk
index 5a28b24..a06d7c9 100644
--- a/solenv/inc/antsettings.mk
+++ b/solenv/inc/antsettings.mk
@@ -40,6 +40,18 @@ PATH!:=$(ANT_HOME)/bin:$(PATH)
ANT*:=$(ANT_HOME)/bin/ant
ANT_BUILDFILE*=build.xml
+.IF "$(ANT_COMPILER_FLAGS)"==""
+.IF "$(JAVACISGCJ)" == "yes"
+ANT_COMPILER_FLAGS=-Dbuild.compiler=gcj
+.ENDIF
+.ENDIF
+
+.IF "$(ANT_JAVA_VER_FLAGS)"==""
+.IF "$(JDK)" != "gcj" && $(JAVACISKAFFE) != "yes"
+ANT_JAVA_VER_FLAGS=-Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER)
+.ENDIF
+.ENDIF
+
.IF "$(ANT_DEBUG)"==""
.IF "$(debug)"==""
ANT_DEBUG=off
@@ -61,21 +73,12 @@ JAVA_HOME=
.EXPORT : JAVA_HOME
.ENDIF
-.IF "$(JAVACISGCJ)" == "yes"
-ANT_FLAGS!:=-Dbuild.compiler=gcj -Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) \
- -Doptimize=$(ANT_OPT) -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) \
- -Dproext="$(PROEXT)" -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) \
- -Dsolar.doc=$(SOLARDOCDIR) -Dcommon.jar=$(SOLARCOMMONBINDIR) \
+ANT_FLAGS!:=$(ANT_COMPILER_FLAGS) -Dprj=$(PRJ) -Dprjname=$(PRJNAME) $(ANT_JAVA_VER_FLAGS) \
+ -Ddebug=$(ANT_DEBUG) -Doptimize=$(ANT_OPT) -Dtarget=$(TARGET) -Dsolar.update=on \
+ -Dout=$(OUT) -Dinpath=$(INPATH) -Dproext="$(PROEXT)" -Dsolar.bin=$(SOLARBINDIR) \
+ -Dsolar.jar=$(SOLARBINDIR) -Dsolar.doc=$(SOLARDOCDIR) -Dcommon.jar=$(SOLARCOMMONBINDIR) \
-Dcommon.doc=$(SOLARCOMMONDOCDIR) -Dsolar.sourceversion=$(SOURCEVERSION) \
-Dsolar.lastminor=$(LAST_MINOR) -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs
-.ELSE
-ANT_FLAGS!:=-Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) -Doptimize=$(ANT_OPT) \
- -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) -Dproext="$(PROEXT)" \
- -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) -Dsolar.doc=$(SOLARDOCDIR) \
- -Dcommon.jar=$(SOLARCOMMONBINDIR) -Dcommon.doc=$(SOLARCOMMONDOCDIR) \
- -Dsolar.sourceversion=$(SOURCEVERSION) -Dsolar.lastminor=$(LAST_MINOR) \
- -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs
-.ENDIF
.ELSE # No java
ANT=
ANT_FLAGS=
diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk
index dbf2ad5..e2cf990 100644
--- a/solenv/inc/settings.mk
+++ b/solenv/inc/settings.mk
@@ -147,6 +147,9 @@ JAVAI:=$(JAVAINTERPRETER)
.IF "$(JAVACISGCJ)" == "yes"
JAVAC+=--encoding=UTF-8 -O2 -fno-assert -Wno-deprecated -C
.ENDIF
+.IF "$(JDK)" != "gcj" && $(JAVACISKAFFE) != "yes"
+JAVAC+=-source $(JAVA_SOURCE_VER) -target $(JAVA_TARGET_VER)
+.ENDIF
#classpath and response
.IF "$(JDK)" == "J++"
More information about the ooo-build-commit
mailing list