update dev300-m57
[ooovba.git] / applied_patches / 0189-build-java-target.diff
blob27b2313608513f02fc21b7ad38d356ad261b5eff
1 --- configure.in.old 2009-04-06 20:56:26.000000000 +0200
2 +++ configure.in 2009-04-06 20:57:09.000000000 +0200
3 @@ -575,6 +575,17 @@ AC_ARG_WITH(java,
4 no support for Java components, applets, accessibility
5 or XML filters.
6 ], if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi, WITH_JAVA=java)
7 +AC_ARG_WITH(java_target_version,
8 +[ --with-java-target-version Generate class files that will work on JVMs with
9 + the specified version. For example, use
10 + --with-java-target-version=1.4 to make sure that the
11 + application will work with JVM 1.4 even when compiled
12 + with JDK 1.5.
14 + This option is ignored when you compile with gcj/gij.
16 + Usage: --with-java-target-version=<jvm version>
17 +],,)
18 AC_ARG_ENABLE(gcjaot,
19 [ --enable-gcjaot Build with[[out]] using Ahead of Time java compilation
20 support to speed up buildsi by compiling the jars also
21 @@ -2733,6 +2744,44 @@ else
22 JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
25 +_java_target_ver="1.5"
26 +dnl ===================================================================
27 +dnl Check for target java bytecode version
28 +dnl ===================================================================
29 +if test "$SOLAR_JAVA" != ""; then
30 + AC_MSG_CHECKING([for target java bytecode version])
31 + if test "$JDK" = "gcj" -o "$JDK" = "kaffe"; then
32 + AC_MSG_RESULT([default by $JDK])
33 + if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
34 + AC_MSG_WARN([Value defined by --with-java-target-version is ignored!])
35 + fi
36 + else
37 + if test -n "$with_java_target_version" -a "$with_java_target_version" != "no" ; then
38 + _java_target_ver="$with_java_target_version"
39 + AC_MSG_RESULT([$_java_target_ver])
40 + elif test $_jdk_ver -gt 10000 ; then
41 + _java_target_ver=`echo "$_jdk_ver" | $AWK '{ maj=substr($0,1,1); min=substr($0,2,2); print int(maj)"."int(min) }'`
42 + AC_MSG_RESULT([$_java_target_ver])
43 + else
44 + AC_MSG_ERROR([Unable to guess java bytecode version from java version!])
45 + fi
46 + fi
48 + if ! test -z "$_java_target_ver" -o \
49 + "$_java_target_ver" = "1.1" -o \
50 + "$_java_target_ver" = "1.2" -o \
51 + "$_java_target_ver" = "1.3" -o \
52 + "$_java_target_ver" = "1.4" -o \
53 + "$_java_target_ver" = "1.5" -o \
54 + "$_java_target_ver" = "1.6" -o \
55 + "$_java_target_ver" = "5" ; then
56 + AC_MSG_ERROR([$_java_target_ver is not supported java bytecode version!])
57 + fi
59 + JAVA_SOURCE_VER="$_java_target_ver"
60 + JAVA_TARGET_VER="$_java_target_ver"
61 +fi
63 dnl ===================================================================
64 dnl Checks for javac
65 dnl ===================================================================
66 @@ -2793,6 +2842,17 @@ if test "$SOLAR_JAVA" != ""; then
68 AC_SUBST(JAVACISGCJ)
70 +JAVACISKAFFE=""
71 +dnl ===================================================================
72 +dnl Checks that javac is kaffe
73 +dnl ===================================================================
74 +if test "$SOLAR_JAVA" != ""; then
75 + if test `$JAVACOMPILER -version 2>&1 | grep -c "Kaffe"` -gt 0; then
76 + JAVACISKAFFE="yes"
77 + fi
78 +fi
79 +AC_SUBST(JAVACISKAFFE)
81 dnl ===================================================================
82 dnl Checks for javadoc
83 dnl ===================================================================
84 @@ -3007,6 +3067,8 @@ fi
85 AC_SUBST(JAVA_HOME)
86 AC_SUBST(JDK)
87 AC_SUBST(JAVAFLAGS)
88 +AC_SUBST(JAVA_SOURCE_VER)
89 +AC_SUBST(JAVA_TARGET_VER)
90 AC_SUBST(JAVAINTERPRETER)
91 AC_SUBST(JAVACOMPILER)
92 AC_SUBST(JAVAAOTCOMPILER)
93 --- set_soenv.in.javatarget~ 2008-07-07 19:57:41.109846862 +0200
94 +++ set_soenv.in 2008-07-07 20:04:44.665095643 +0200
95 @@ -1842,6 +1842,7 @@ ToFile( "DMAKEROOT", $DMAKEROOT,
96 if ( $JDK ne "gcj" ) {
97 ToFile( "CLASSPATH", $CLASSPATH, "e" );
98 ToFile( "XCLASSPATH", $XCLASSPATH, "e" );
99 + ToFile( "JAVACISKAFFE", '@JAVACISKAFFE@', "e" );
101 else {
102 ToFile( "JAVACISGCJ", '@JAVACISGCJ@', "e" );
103 @@ -1852,6 +1853,8 @@ if ( $GUI eq "UNX" ) {
105 ToFile( "JDK", "@JDK@", "e" );
106 ToFile( "JAVAFLAGS", "@JAVAFLAGS@", "e" );
107 + ToFile( "JAVA_SOURCE_VER", "@JAVA_SOURCE_VER@","e" );
108 + ToFile( "JAVA_TARGET_VER", "@JAVA_TARGET_VER@","e" );
109 ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" );
110 ToFile( "JAVACOMPILER", PathFormat("@JAVACOMPILER@"), "e" );
111 ToFile( "JAVAAOTCOMPILER", PathFormat("@JAVAAOTCOMPILER@"), "e" );
112 --- solenv/inc/antsettings.mk.old 2008-04-10 19:33:24.000000000 +0200
113 +++ solenv/inc/antsettings.mk 2008-08-25 13:52:31.000000000 +0200
114 @@ -44,6 +44,18 @@ PATH!:=$(ANT_HOME)$/bin$(PATH_SEPERATOR)
115 ANT*:=$(ANT_HOME)$/bin$/ant
116 ANT_BUILDFILE*=build.xml
118 +.IF "$(ANT_COMPILER_FLAGS)"==""
119 +.IF "$(JAVACISGCJ)" == "yes"
120 +ANT_COMPILER_FLAGS=-Dbuild.compiler=gcj
121 +.ENDIF
122 +.ENDIF
124 +.IF "$(ANT_JAVA_VER_FLAGS)"==""
125 +.IF "$(JDK)" != "gcj" && $(JAVACISKAFFE) != "yes"
126 +ANT_JAVA_VER_FLAGS=-Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER)
127 +.ENDIF
128 +.ENDIF
130 .IF "$(ANT_DEBUG)"==""
131 .IF "$(debug)"==""
132 ANT_DEBUG=off
133 @@ -65,21 +77,12 @@ JAVA_HOME=
134 .EXPORT : JAVA_HOME
135 .ENDIF
137 -.IF "$(JAVACISGCJ)" == "yes"
138 -ANT_FLAGS!:=-Dbuild.compiler=gcj -Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) \
139 - -Doptimize=$(ANT_OPT) -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) \
140 - -Dproext="$(PROEXT)" -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) \
141 - -Dsolar.doc=$(SOLARDOCDIR) -Dcommon.jar=$(SOLARCOMMONBINDIR) \
142 +ANT_FLAGS!:=$(ANT_COMPILER_FLAGS) -Dprj=$(PRJ) -Dprjname=$(PRJNAME) $(ANT_JAVA_VER_FLAGS) \
143 + -Ddebug=$(ANT_DEBUG) -Doptimize=$(ANT_OPT) -Dtarget=$(TARGET) -Dsolar.update=on \
144 + -Dout=$(OUT) -Dinpath=$(INPATH) -Dproext="$(PROEXT)" -Dsolar.bin=$(SOLARBINDIR) \
145 + -Dsolar.jar=$(SOLARBINDIR) -Dsolar.doc=$(SOLARDOCDIR) -Dcommon.jar=$(SOLARCOMMONBINDIR) \
146 -Dcommon.doc=$(SOLARCOMMONDOCDIR) -Dsolar.sourceversion=$(SOURCEVERSION) \
147 -Dsolar.lastminor=$(LAST_MINOR) -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs
148 -.ELSE
149 -ANT_FLAGS!:=-Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) -Doptimize=$(ANT_OPT) \
150 - -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) -Dproext="$(PROEXT)" \
151 - -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) -Dsolar.doc=$(SOLARDOCDIR) \
152 - -Dcommon.jar=$(SOLARCOMMONBINDIR) -Dcommon.doc=$(SOLARCOMMONDOCDIR) \
153 - -Dsolar.sourceversion=$(SOURCEVERSION) -Dsolar.lastminor=$(LAST_MINOR) \
154 - -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs
155 -.ENDIF
156 .ELSE # No java
157 ANT=
158 ANT_FLAGS=
159 --- solenv/inc/settings.mk.javatarget~ 2008-07-07 19:57:31.071845803 +0200
160 +++ solenv/inc/settings.mk 2008-07-07 20:04:44.669096361 +0200
161 @@ -157,6 +157,9 @@ JAVAI:=$(JAVAINTERPRETER)
162 .IF "$(JAVACISGCJ)" == "yes"
163 JAVAC+=--encoding=UTF-8 -O2 -fno-assert -Wno-deprecated -C
164 .ENDIF
165 +.IF "$(JDK)" != "gcj" && $(JAVACISKAFFE) != "yes"
166 +JAVAC+=-source $(JAVA_SOURCE_VER) -target $(JAVA_TARGET_VER)
167 +.ENDIF
169 #classpath and response
170 .IF "$(JDK)" == "J++"
171 --- hsqldb/makefile.mk.old 2008-05-14 11:31:19.000000000 +0200
172 +++ hsqldb/makefile.mk 2008-08-25 16:11:36.000000000 +0200
173 @@ -67,7 +67,7 @@ JAVA_HOME=
174 .EXPORT : JAVA_HOME
175 BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj -f $(ANT_BUILDFILE) jar
176 .ELSE
177 -BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -f $(ANT_BUILDFILE) jar
178 +BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) -f $(ANT_BUILDFILE) jar
179 .ENDIF
181 .ENDIF # $(SOLAR_JAVA)!= ""
182 --- rhino/makefile.mk.old 2008-04-11 09:01:54.000000000 +0200
183 +++ rhino/makefile.mk 2008-08-25 16:15:08.000000000 +0200
184 @@ -55,7 +55,7 @@ JAVA_HOME=
185 .EXPORT : JAVA_HOME
186 BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dbuild.compiler=gcj jar
187 .ELSE
188 -BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" jar
189 +BUILD_ACTION=$(ANT) -Dbuild.label="build-$(RSCREVISION)" -Dant.build.javac.source=$(JAVA_SOURCE_VER) -Dant.build.javac.target=$(JAVA_TARGET_VER) jar
190 .ENDIF
192 # --- Targets ------------------------------------------------------
193 --- qadevOOo/makefile.mk.old 2009-02-12 14:55:56.000000000 +0100
194 +++ qadevOOo/makefile.mk 2009-02-17 17:19:53.000000000 +0100
195 @@ -48,7 +48,7 @@ TST:
197 .IF "$(SOLAR_JAVA)"=="TRUE"
198 .IF "$(ANT_HOME)"!="NO_ANT_HOME"
199 -ANT_FLAGS+=-Dbuild.source=1.5
200 +ANT_FLAGS+=-Dbuild.source=$(JAVA_SOURCE_VER)
201 ALLTAR: ANTBUILD
202 .ENDIF
203 .ENDIF