summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2011-12-09 14:31:53 +0200
committerTor Lillqvist <tlillqvist@suse.com>2011-12-09 14:45:59 +0200
commit91af205a93440b82ff1730528e98e6355092e02c (patch)
tree4ccb2748796a0278c06f4809fe8c517349a9381f
parent6e407a58872c0bef1be1cdf825cffb7902cb5699 (diff)
Don't misuse CLASSPATH for what goes into the -cp option to javac
CLASSPATH is supposed to show where to find the classes needed by Java programs running at build time. The -cp switch to javac tells where to find classes referenced by the code being compiled. These are different things. (But it doesn't seem to have mattered much in our build system.) So use T_CP instead, named in the same fashion as T_CXXFLAGS etc. But... for some reason this change, which as such should be just more or less cosmetic, also fixes a build problem in the "scripting" module on Windows, seen by Noel Grandin (http://comments.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/19016 ) and me.
-rw-r--r--solenv/gbuild/JavaClassSet.mk10
-rw-r--r--solenv/gbuild/JunitTest.mk8
2 files changed, 9 insertions, 9 deletions
diff --git a/solenv/gbuild/JavaClassSet.mk b/solenv/gbuild/JavaClassSet.mk
index cea27c061982..16d914aa66d4 100644
--- a/solenv/gbuild/JavaClassSet.mk
+++ b/solenv/gbuild/JavaClassSet.mk
@@ -43,7 +43,7 @@ $(call gb_Helper_abbreviate_dirs_native,\
$(filter-out $(JARDEPS),$(4))))) && \
$(if $(3),$(gb_JavaClassSet_JAVACCOMMAND) \
$(gb_JavaClassSet_JAVACDEBUG) \
- -cp "$(CLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \
+ -cp "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \
-d $(call gb_JavaClassSet_get_classdir,$(2)) \
@$$RESPONSEFILE &&) \
rm -f $$RESPONSEFILE && \
@@ -60,8 +60,8 @@ $(call gb_JavaClassSet_get_clean_target,%) :
$(call gb_Helper_abbreviate_dirs,\
rm -rf $(dir $(call gb_JavaClassSet_get_target,$*)))
-# no initialization of scoped variable CLASSPATH as it is "inherited" from controlling instance (e.g. JUnitTest, Jar)
# UGLY: cannot use target local variable for REPO because it's needed in prereq
+# No idea what above comment means, and whether still relevant
define gb_JavaClassSet_JavaClassSet
$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS :=
endef
@@ -81,7 +81,7 @@ $(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_sourcefile,$(1),$(sourcefil
endef
define gb_JavaClassSet_set_classpath
-$(eval $(call gb_JavaClassSet_get_target,$(1)) : CLASSPATH := $(2))
+$(eval $(call gb_JavaClassSet_get_target,$(1)) : T_CP := $(2))
endef
@@ -89,13 +89,13 @@ endef
# build order dependency is a hack to get these prerequisites out of the way in the build command
define gb_JavaClassSet_add_jar
$(eval $(call gb_JavaClassSet_get_target,$(1)) : $(2))
-$(eval $(call gb_JavaClassSet_get_target,$(1)) : CLASSPATH := $$(CLASSPATH)$(gb_CLASSPATHSEP)$(strip $(2)))
+$(eval $(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(T_CP)$(gb_CLASSPATHSEP)$(strip $(2)))
$(eval $(call gb_JavaClassSet_get_target,$(1)) : JARDEPS += $(2))
endef
# this does not generate dependency on the jar
define gb_JavaClassSet_add_system_jar
-$(eval $(call gb_JavaClassSet_get_target,$(1)) : CLASSPATH := $$(CLASSPATH)$(gb_CLASSPATHSEP)$(strip $(2)))
+$(eval $(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(T_CP)$(gb_CLASSPATHSEP)$(strip $(2)))
$(eval $(call gb_JavaClassSet_get_target,$(1)) : JARDEPS += $(2))
endef
diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 5afe59580bb9..177cad6f7e2b 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -47,7 +47,7 @@ $(call gb_JunitTest_get_target,%) :
rm -rf $(call gb_JunitTest_get_userdir,$*) && \
mkdir -p $(call gb_JunitTest_get_userdir,$*) && \
(DBGSV_ERROR_OUT=shell $(gb_JunitTest_JAVACOMMAND) \
- -cp "$(CLASSPATH)" \
+ -cp "$(T_CP)" \
$(DEFS) \
org.junit.runner.JUnitCore \
$(CLASSES) > $@.log 2>&1 || \
@@ -69,7 +69,7 @@ $(call gb_JunitTest_get_target,%) :
$(CLEAN_CMD)
define gb_JunitTest_JunitTest
-$(call gb_JunitTest_get_target,$(1)) : CLASSPATH := $(value XCLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib
+$(call gb_JunitTest_get_target,$(1)) : T_CP := $(value XCLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib
$(call gb_JunitTest_get_target,$(1)) : CLASSES :=
$(call gb_JunitTest_JunitTest_platform,$(1))
@@ -105,12 +105,12 @@ $(foreach sourcefile,$(2),$(call gb_JunitTest_add_sourcefile,$(1),$(sourcefile))
endef
define gb_JunitTest_set_classpath
-$(call gb_JunitTest_get_target,$(1)) : CLASSPATH := $(2)
+$(call gb_JunitTest_get_target,$(1)) : T_CP := $(2)
endef
define gb_JunitTest_add_jar
-$(call gb_JunitTest_get_target,$(1)) : CLASSPATH := $$(CLASSPATH)$(gb_CLASSPATHSEP)$(2)
+$(call gb_JunitTest_get_target,$(1)) : T_CP := $$(T_CP)$(gb_CLASSPATHSEP)$(2)
$(call gb_JunitTest_get_target,$(1)) : $(2)
endef