fix: tracecompiler - recognise old versions which do have a Main class but don't have a CLI. fix
authortimothy.murphy@nokia.com
Wed, 05 May 2010 18:53:43 +0100
branchfix
changeset 521 53251dd57e58
parent 520 e5a5f48080cc
child 522 9971c248e894
fix: tracecompiler - recognise old versions which do have a Main class but don't have a CLI.
sbsv2/raptor/lib/flm/tracecompiler.mk
sbsv2/raptor/test/smoke_suite/tracecompiler_general.py
--- a/sbsv2/raptor/lib/flm/tracecompiler.mk	Tue May 04 17:50:27 2010 +0100
+++ b/sbsv2/raptor/lib/flm/tracecompiler.mk	Wed May 05 18:53:43 2010 +0100
@@ -97,15 +97,26 @@
 JAVA_COMMAND:=$(SBS_JAVATC)
 TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools
 
-#
-#try to find TraceCompilerMain.class (the new posix-like interface)
-#
+# declare the trace_compile macro but only do it once in the build
 ifeq ($(trace_compile),)
+
+# Find out which macro to declare - the one supporting the new CLI 
+# or the old one.  First try to find TraceCompilerMain.class 
+# If it is there then it might be the new posix-like interface
+TRACE_VER:=
+TRACE_VSTR:=
+
 TCClass:=$(wildcard  $(TRACE_COMPILER_PATH)/tracecompiler/com/nokia/tracecompiler/TraceCompilerMain.class)
+ifneq ($(TCClass),) 
+# Get the version string from the TC (assume it's the new one)
+TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompilerMain
+TRACE_VSTR:=$(firstword $(subst TraceCompiler version ,,$(shell $(JAVA_COMMAND) $(TRACE_COMPILER_START) --version)))
+# check if it looks like a version that supports the new cli interface: supporting up to verion 9 in the future.
+TRACE_VER:=$(findstring new,$(foreach version,2 3 4 5 6 7 8 9,$(patsubst $(version).%,new,$(TRACE_VSTR))))
+endif
+$(if $(FLMDEBUG),$(info <debug>TRACE_VSTR=$(TRACE_VSTR) TRACE_VER=$(TRACE_VER)</debug>))
 
-ifneq ($(TCClass),) #New Interface
-TRACE_VER:=new
-TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompilerMain
+ifeq ($(TRACE_VER),new)
 define trace_compile
 $(TRACE_MARKER) : $(PROJECT_META)
 	$(call startrule,tracecompile) \
@@ -135,7 +146,6 @@
 	 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
 	$(call endrule,tracecompile)
 endef
-TRACE_VER:=old
 
 # End - new/old trace compiler
 endif
--- a/sbsv2/raptor/test/smoke_suite/tracecompiler_general.py	Tue May 04 17:50:27 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/tracecompiler_general.py	Wed May 05 18:53:43 2010 +0100
@@ -120,7 +120,7 @@
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
 		"test_/armv5/udeb/test.o",
 		"test_/armv5/urel/test.o",
-		"test_/tracecompile_test_exe_0000000.done"
+		"test_/tracecompile_test_exe_00000001.done"
 	])
 	t.run()