# HG changeset patch # User Richard Taylor # Date 1260186073 0 # Node ID 8a1eeb1a78cb8cf8a725ebd5b7eb115a49f7911a # Parent e1eecf4d390db36d5bd76d0ba16f5c782838f103# Parent d806416fc9bf98a2dbfbc88b61ac1eae7455b3f2 version 2.11.1 to default from wip diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/RELEASE-NOTES.txt --- a/sbsv2/raptor/RELEASE-NOTES.txt Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/RELEASE-NOTES.txt Mon Dec 07 11:41:13 2009 +0000 @@ -1,6 +1,35 @@ Release Notes for Symbian Build System v2 +version 2.11.1 + +Other Changes: +GCCE 4.4.1 variant added +Restored python 2.4 compatibility +Minor TOOLS2 --what corrections +Retain Linux execute permissions on unpacked :zip archives +Prototype of extended timing API added +Option --noexport added for parallel parsing +Made --noexport and --export-only mutually exclusive +SBS_PYTHONPATH insulates sbs from the global PYTHONPATH +Removed spurious bracket in e32abiv2textnotifier2 +More robust to multiple import library definitions + + +version 2.11.0 + +New Features: +Parallel parsing of meta-data +New keyword APPLY for MMP files +SAX filter plugin base-class + +Defect Fixes: +DPDEF142895 Raptor does the wrong thing with the ARMFPU keyword +DPDEF143020 The savespace variant overrides elf2e32's return code +DPDEF143046 BYTEPAIRCOMPRESSTARGET and INFLATECOMPRESSTARGET not in FLM interface +Improved error reporting for --check and --what + + version 2.10.2 Defect Fixes: diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/bin/sbs --- a/sbsv2/raptor/bin/sbs Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/bin/sbs Mon Dec 07 11:41:13 2009 +0000 @@ -68,6 +68,7 @@ __MINGW__=${SBS_MINGW:-$SBS_HOME/$HOSTPLATFORM_DIR/mingw} __CYGWIN__=${SBS_CYGWIN:-$SBS_HOME/$HOSTPLATFORM_DIR/cygwin} __PYTHON__=${SBS_PYTHON:-$SBS_HOME/$HOSTPLATFORM_DIR/python252/python.exe} + export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/python252} # Command for unifying path strings. For example, "c:\some\path" and # "/cygdrive/c/some/path" will both be converted into "c:/some/path". @@ -87,6 +88,7 @@ export CYGWIN='nontsec nosmbntsec' else + export PYTHONPATH=${SBS_PYTHONPATH:-$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib} PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/bin:$SBS_HOME/$HOSTPLATFORM_DIR/bin:$PATH LD_LIBRARY_PATH=$SBS_HOME/$HOSTPLATFORM_DIR/python262/lib:$SBS_HOME/$HOSTPLATFORM_DIR/bv/lib:$LD_LIBRARY_PATH diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/bin/sbs.bat --- a/sbsv2/raptor/bin/sbs.bat Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/bin/sbs.bat Mon Dec 07 11:41:13 2009 +0000 @@ -31,6 +31,8 @@ @REM Use the python set by the environment if possible @SET __PYTHON__=%SBS_PYTHON% @IF "%__PYTHON__%"=="" SET __PYTHON__=%SBS_HOME%\win32\python252\python.exe +@SET PYTHONPATH=%SBS_PYTHONPATH% +@IF "%PYTHONPATH%"=="" SET PYTHONPATH=%SBS_HOME%\win32\python252 @REM Use the mingw set by the environment if possible @SET __MINGW__=%SBS_MINGW% diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/bin/sbs_check_exports.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/bin/sbs_check_exports.py Mon Dec 07 11:41:13 2009 +0000 @@ -0,0 +1,101 @@ +#!/usr/bin/python + +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Symbian Foundation License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +import re +import sys + +# there are no options, so print help if any are passed +if len(sys.argv) > 1: + print "usage:", sys.argv[0], "(The log data is read from stdin)" + sys.exit(0) + +whatlogRE = re.compile(" repeat + if source == otherSource and bldinf != otherBldinf: + # only interested in the number for now + repeats += 1 + + # different source but same destination => conflict + if source != otherSource: + conflict = (source, destination, bldinf, otherSource, otherBldinf) + tcilfnoc = (otherSource, destination, otherBldinf, source, bldinf) + + if conflict in conflicts or tcilfnoc in conflicts: + # seen this conflict before + pass + else: + print "CONFLICT:", destination, \ + "FROM", source, \ + "IN", bldinf, \ + "AND FROM", otherSource, \ + "IN", otherBldinf + conflicts.append(conflict) + else: + sources[source] = [destination, bldinf] + destinations[destination] = [source, bldinf] + +# now check for destinations which were also sources => chains +for destination in destinations: + if destination in sources: + (nextDestination, inf2) = sources[destination] + (source, inf1) = destinations[destination] + print "CHAIN:", source, \ + "TO", destination, \ + "IN", inf1, \ + "THEN TO", nextDestination, \ + "IN", inf2 + chains += 1 + +# print a summary +print "Total exports = ", len(destinations.keys()) +print "Chained exports = ", chains +print "Repeated exports = ", repeats +print "Conflicting exports = ", len(conflicts) + +# return the error code +if conflicts: + sys.exit(1) +sys.exit(0) + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/bin/sbs_filter.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/bin/sbs_filter.py Mon Dec 07 11:41:13 2009 +0000 @@ -0,0 +1,83 @@ +#!/usr/bin/python + +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Symbian Foundation License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +import os +import sys +import traceback + +# intercept the -h option +if "-h" in sys.argv or "--help" in sys.argv: + print "usage:", sys.argv[0], "[sbs options]" + print " The log data is read from stdin." + print " Type 'sbs -h' for a list of sbs options." + sys.exit(0) + +# get the absolute path to this script +script = os.path.abspath(sys.argv[0]) + +# add the Raptor python directory to the PYTHONPATH +sys.path.append(os.path.join(os.path.dirname(script), "..", "python")) + +# now we should be able to find the raptor modules +import raptor +import pluginbox + +# make sure that HOSTPLATFORM is set +if not "HOSTPLATFORM" in os.environ: + sys.stderr.write("HOSTPLATFORM is not set ... try running gethost.sh\n") + sys.exit(1) + +if not "HOSTPLATFORM_DIR" in os.environ: + sys.stderr.write("HOSTPLATFORM_DIR is not set ... try running gethost.sh\n") + sys.exit(1) + +# construct a Raptor object from our command-line (less the name of this script) +the_raptor = raptor.Raptor.CreateCommandlineBuild(sys.argv[1:]) + +# from Raptor.OpenLog() +try: + # Find all the raptor plugins and put them into a pluginbox. + if not the_raptor.systemPlugins.isAbsolute(): + the_raptor.systemPlugins = the_raptor.home.Append(the_raptor.systemPlugins) + + pbox = pluginbox.PluginBox(str(the_raptor.systemPlugins)) + raptor_params = raptor.BuildStats(the_raptor) + + # Open the requested plugins using the pluginbox + the_raptor.out.open(raptor_params, the_raptor.filterList.split(','), pbox) + +except Exception, e: + sys.stderr.write("filter exception: %s\n" % str(e)) + traceback.print_ex() + sys.exit(1) + +# read stdin a line at a time and pass it to the Raptor object +line = " " +while line: + line = sys.stdin.readline() + the_raptor.out.write(line) + +# from Raptor.CloseLog() +if not the_raptor.out.summary(): + the_raptor.errorCode = 1 + +if not the_raptor.out.close(): + the_raptor.errorCode = 1 + +# return the error code +sys.exit(the_raptor.errorCode) + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/config/arm.xml --- a/sbsv2/raptor/lib/config/arm.xml Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/config/arm.xml Mon Dec 07 11:41:13 2009 +0000 @@ -65,6 +65,7 @@ + @@ -72,7 +73,8 @@ - + + @@ -84,7 +86,8 @@ - + + @@ -94,7 +97,8 @@ - + + @@ -119,6 +123,9 @@ + + + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/config/gcce.xml --- a/sbsv2/raptor/lib/config/gcce.xml Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/config/gcce.xml Mon Dec 07 11:41:13 2009 +0000 @@ -10,7 +10,7 @@ - + @@ -33,16 +33,17 @@ - + - + - + + @@ -57,8 +58,8 @@ - - + + @@ -72,24 +73,24 @@ - - + + - - + + - - - + + + - + - + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/config/locations.xml --- a/sbsv2/raptor/lib/config/locations.xml Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/config/locations.xml Mon Dec 07 11:41:13 2009 +0000 @@ -77,6 +77,7 @@ + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/config/rvct.xml --- a/sbsv2/raptor/lib/config/rvct.xml Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/config/rvct.xml Mon Dec 07 11:41:13 2009 +0000 @@ -42,7 +42,8 @@ - + + @@ -54,7 +55,7 @@ - + @@ -75,7 +76,7 @@ - + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/config/variants.xml --- a/sbsv2/raptor/lib/config/variants.xml Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/config/variants.xml Mon Dec 07 11:41:13 2009 +0000 @@ -10,6 +10,7 @@ + @@ -17,11 +18,12 @@ + + + + + - - - - @@ -33,33 +35,33 @@ - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + @@ -77,20 +79,22 @@ - - - + + - - + + + + + + - @@ -98,32 +102,23 @@ + + - - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + @@ -146,6 +141,7 @@ + @@ -172,7 +168,9 @@ + + @@ -201,7 +199,10 @@ + + + @@ -252,5 +253,18 @@ - + + + + + + + + + + + + + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/bitmap.flm --- a/sbsv2/raptor/lib/flm/bitmap.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/bitmap.flm Mon Dec 07 11:41:13 2009 +0000 @@ -60,7 +60,7 @@ BMCONVCMDFILE:=$(OUTPUTPATH)/$(BMTARGET)_bmconvcommands RELEASEABLES:=$(BITMAPHEADER) $(BITMAPFILE) -CLEANTARGETS:=$(BITMAPHEADER) $(BITMAPFILE) $(BMCONVCMDFILE) +CLEANTARGETS:=$(BMCONVCMDFILE) # The groupbmpin10 macro allows us to construct a command file, 10 # bitmap objects at a time to avoid limits on argument lengths and @@ -107,7 +107,6 @@ $(GNUCP) $$< $$@ \ $(call endrule,bitmapcopy) -CLEANTARGETS:=$(CLEANTARGETS) $(MBMCOPYFILES) endef @@ -140,8 +139,7 @@ $(call startrule,bmpfilecopy,FORCESUCCESS) \ $(GNUCP) $(1) $(2) && $(GNUCHMOD) +rw $(2) \ $(call endrule,bmpfilecopy) - -CLEANTARGETS:=$$(CLEANTARGETS) $(2) + endif BMPCOPYFILES:=$$(BMPCOPYFILES) $(2) @@ -163,8 +161,6 @@ @if [ ! -d $(EPOCROOT)/epoc32/localisation/group ]; then $(GNUMKDIR) -p $(EPOCROOT)/epoc32/localisation/group; fi @if [ ! -f $$@ ]; then echo "DATADIR: /$(BMBASENAME)" > $$@ ; fi @echo -e "\n/z$(TARGETPATH)/$(BMTARGET) : $(DEPTHBMP)" >> $$@ - -CLEANTARGETS:=$$(CLEANTARGETS) $(INFOFILE) endef $(eval $(call bmpInfo)) @@ -172,11 +168,11 @@ # end of localisation ######################################################### ## Clean up -$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS) ,$(CREATABLEPATHS))) +$(call raptor_clean,$(CLEANTARGETS)) $(call makepath,$(CREATABLEPATHS)) $(call makepathfor,$(BITMAPHEADER)) # for the abld -what target BMPRELEASEABLES:=$(RELEASEABLES) $(MBMCOPYFILES) $(BMPCOPYFILES) $(INFOFILE) -$(eval $(call whatmacro,$(BMPRELEASEABLES),WHATBITMAP)) +$(call raptor_release,$(BMPRELEASEABLES),BITMAP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/build.flm --- a/sbsv2/raptor/lib/flm/build.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/build.flm Mon Dec 07 11:41:13 2009 +0000 @@ -24,36 +24,31 @@ .PHONY:: PP_EXPORTS +ifneq ($(filter win,$(HOSTPLATFORM)),) +SBS:=$(subst \,/,$(SBS_HOME)/bin/sbs.bat) +else +SBS:=$(SBS_HOME)/bin/sbs +endif -SBS := $(subst \,/,$(SBS_HOME)/bin/sbs) define doexports PP_EXPORTS:: $(call startrule,makefile_generation_exports) \ - export TALON_DESCRAMBLE=0; \ - $(SBS) --export-only $(component_list) $(config_list) -f- -m $(SBS_BUILD_DIR)/makefiles_export.mk $(cli_options) --mo=DESCRAMBLE:= --mo=TALON_DESCRAMBLE:=0 | $(GNUSED) 's#]I*]>#XXX#' \ + $(SBS) --toolcheck=off --export-only $(component_list) $(config_list) -f- -m $(MAKEFILE_PATH).exports $(CLI_OPTIONS) \ $(call endrule,makefile_generation_exports) -CLEANTARGETS:=$$(CLEANTARGETS) $(SBS_BUILD_DIR)/makefiles_export.mk +CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH).exports endef # Generate makefiles for particular bldinf # $(1) = source target source target...... define generate_makefiles -$$(info XXX component_list=$(COMPONENT_PATHS) makefile=$(MAKEFILE_PATH)) +ALL:: $(MAKEFILE_PATH) -ifeq ($(NO_BUILD),1) -ALL:: $(MAKEFILE_PATH) -else -include $(MAKEFILE_PATH) -endif - -$(MAKEFILE_PATH): $(COMPONENT_PATHS) | PP_EXPORTS +$(MAKEFILE_PATH): $(COMPONENT_PATHS) $(if $(DOEXPORT),| PP_EXPORTS ) $(call startrule,makefile_generation) \ - export TALON_DESCRAMBLE=0; \ - $(SBS) --toolcheck=off -n $(CLI_OPTIONS) $(component_list) $(config_list) -m $$@ -f- --mo=DESCRAMBLE:= --mo=TALON_DESCRAMBLE:=0 | $(GNUSED) 's#\]\][>]#XXX#' && \ - $(MAKE) -j 8 -f $$@.resource_deps \ + $(SBS) --noexport --toolcheck=off -n $(CLI_OPTIONS) $(component_list) $(config_list) -m $$@ -f- \ $(call endrule,makefile_generation) CLEANTARGETS:=$$(CLEANTARGETS) $(MAKEFILE_PATH) @@ -63,13 +58,19 @@ # Create config list for commands config_list:=$(addprefix -c ,$(CONFIGS)) component_list:=$(addprefix -b ,$(COMPONENT_PATHS)) -$(info COMFIG_LIST: $(config_list)) + +$(if $(FLMDEBUG),$(info build.flm: configlist: $(config_list))) -$(eval $(doexports)) +# Do exports only if asked. This doesn't work brilliantly in emake +# since exports are often duplicated in some components - leads to conflicts +# and rebuilds. Better to export before trying to do parallel parsing at all. +$(if $(DOEXPORT),$(eval $(doexports)),$(if $(FLMDEBUG),$(info build.flm: Exports off ))) # Create the Makefiles $(eval $(call generate_makefiles)) +CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(MAKEFILE_PATH)) + $(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),)) $(call makepath,$(CREATABLEPATHS)) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/build.xml --- a/sbsv2/raptor/lib/flm/build.xml Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/build.xml Mon Dec 07 11:41:13 2009 +0000 @@ -9,6 +9,7 @@ + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2.flm --- a/sbsv2/raptor/lib/flm/e32abiv2.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2.flm Mon Dec 07 11:41:13 2009 +0000 @@ -141,7 +141,6 @@ ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_DSO)),) IMPORTLIBTARGET_DSO:=$(TMP_IMPORTLIBTARGET_ROOT).dso IMPORTLIBTARGETVERSIONED_DSO:=$(VER_E32IMPORTLIBBASE).dso - $(eval $(BUILDMARKER_IMPORTLIBTARGET_DSO):=1) endif # ABIv1 .lib (for specific builds, toolchains and host OS platforms only) @@ -156,7 +155,6 @@ ifeq ($($(BUILDMARKER_IMPORTLIBTARGET_LIB)),) IMPORTLIBTARGET_LIB:=$(TMP_IMPORTLIBTARGET_ROOT).lib IMPORTLIBTARGETVERSIONED_LIB:=$(VER_E32IMPORTLIBBASE).lib - $(eval $(BUILDMARKER_IMPORTLIBTARGET_LIB):=1) endif endif endif @@ -251,6 +249,10 @@ # ABIv2 .dso ifneq ($(IMPORTLIBTARGET_DSO),) # check that we haven't tried to specify this target already + # By Now we're committed to producing a target for this DSO so it's safe to + # set the marker that will prevent any further targets from being made. + $(eval $(BUILDMARKER_IMPORTLIBTARGET_DSO):=1) + ifneq ($(EXPLICITVERSION),) TARGETS:=$(strip $(TARGETS) $(IMPORTLIBTARGETVERSIONED_DSO)) @@ -279,9 +281,6 @@ $(call startrule,importlibtarget_unfrozen,FORCESUCCESS) \ $(GNUCP) $$(call dblquote,$$<) $$(call dblquote,$$@) \ $(call endrule,importlibtarget_unfrozen) - - CLEANTARGETS:=$$(CLEANTARGETS) $(IMPORTLIBTARGET_DSO) - endef define importlibtarget_unfrozen_ver @@ -289,8 +288,6 @@ $(call startrule,importlibversioned_unfrozen,FORCESUCCESS) \ $(GNUCP) "$(GENERATED_DSO)" "$$@" \ $(call endrule,importlibversioned_unfrozen) - - CLEANTARGETS:=$$(CLEANTARGETS) $(IMPORTLIBTARGET_DSO) endef ifeq ($(EXPLICITVERSION),) @@ -307,8 +304,6 @@ $(call startrule,importlibtarget,FORCESUCCESS) \ $(GNUCP) "$$<" "$$@" \ $(call endrule,importlibtarget) - - CLEANTARGETS:=$$(CLEANTARGETS) $(IMPORTLIBTARGET_DSO) endef ifeq ($(EXPLICITVERSION),) @@ -325,8 +320,6 @@ --dso=$$(call dblquote,$$@) \ --linkas=$(call dblquote,$(LINKASVERSIONED)) \ $(call endrule,importlibversioned) - - CLEANTARGETS:=$$(CLEANTARGETS) $(IMPORTLIBTARGETVERSIONED_DSO) endef $(eval $(importlibtargetversioned_func)) endif # ifneq ($(DEFFILE),) @@ -335,7 +328,10 @@ # ABIv1 .lib ifneq ($(IMPORTLIBTARGETVERSIONED_LIB),) # check that we haven't tried to specify this target already - CLEANTARGETS:=$(CLEANTARGETS) $(IMPORTLIBTARGETVERSIONED_LIB) $(IMPORTLIBTARGET_LIB) + + # By Now we're committed to producing a target for this DSO so it's safe to + # set the marker that will prevent any further targets from being made. + $(eval $(BUILDMARKER_IMPORTLIBTARGET_LIB):=1) define abiv1_generatelib @@ -534,7 +530,7 @@ endef $(eval $(artarget_func)) -CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(ARTARGET) $(if $(DUMPBCINFO),$(ARTARGET).elfdump,) +CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(DUMPBCINFO),$(ARTARGET).elfdump,) endif @@ -605,14 +601,13 @@ $(LD) $(LINKER_MISC_FLAGS) $(LINKER_DEFAULT_LIB_PATHS) $(SYMBIAN_LINK_FLAGS) $(if $(DEBUG_INFO),$(LINKER_DEBUG_OPTION),$(LINKER_NODEBUG_OPTION)) \ $(if $(ARMLIBS),$(LD_WARNINGS_SUPPRESSION_ARMLIBS),) \ $(SHARED_OBJECT_OPTION) $(SPLIT_OPTION) \ - $(RW_BASE_OPTION) 0x400000 \ + $(RW_BASE) \ $(LINKER_ARCH_OPTION) \ - $(SYMVER_OPTION) $(SO_NAME_OPTION) $(call dblquote,$(LINKASVERSIONED)) \ + $(SYMVER_OPTION) $(SO_NAME_OPTION)=$(call dblquote,$(LINKASVERSIONED)) \ $(LINKER_ENTRYPOINT_SETTING) \ -o $$(call dblquote,$$@) \ $(if $(LTCG),$(LTCG_OPTION),) \ - $(LINKER_SYMBOLS_OPTION) $(LINKER_SYMBOLS_FILE_OPTION) \ - $(call dblquote,$(MAPFILE)) \ + $(LINKER_SYMBOLS_OPTION) $(LINKER_SYMBOLS_FILE_OPTION)=$(call dblquote,$(MAPFILE)) \ $(LINKEROPTION) \ $(if $(MULTIFILE_ENABLED),$(call dblquote,$(MULTIFILEOBJECT) $(CIAFILES_LINKOBJECTS)),$(COMMANDFILE_OPTION)$(call dblquote,$(VIAFILE))) \ $(if $(GENERATELINKERFEEDBACK),$(FEEDBACK_OPTION)$(call dblquote,$(FEEDBACKFILE))) \ @@ -624,9 +619,7 @@ endef $(eval $(linktarget_func)) -CLEANTARGETS:=$(CLEANTARGETS) $(LINK_TARGET) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT)) -CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) -CLEANTARGETS:=$(CLEANTARGETS) $(MAPFILE) +CLEANTARGETS:=$(CLEANTARGETS) $(VIAFILE) $(if $(GENERATELINKERFEEDBACK),$(FEEDBACKFILE)) $(if $(MULTIFILE_ENABLED),$(MULTIFILEOBJECT)) WHATRELEASE:=$(WHATRELEASE) $(MAPFILE) endif # if TARGETTYPE lib @@ -656,7 +649,7 @@ $(EXPORT_VTBL_OPTION) $(NO_UNALIGNED_ACCESS) $(VFE_OPTION) $(AAPCS_OPTION) \ $(CPPONLYOPTION) $(INSTRUCTION_SET) \ $(if $(ALWAYS_BUILD_AS_ARM),$(ARM_INSTRUCTION_SET),$(THUMB_INSTRUCTION_SET) $(call makemacrodef,-D,$(COMPILER_THUMB_DEFINES))) \ - $(COMPILER_FPU_FLAGS) + $(COMPILER_FPU_OPTION)$(if $(ARMFPU),$(ARMFPU),$(COMPILER_FPU_DEFAULT)) ## COMPILE CPP Files ################################################################# @@ -675,7 +668,7 @@ $(EXPORT_VTBL_OPTION) $(NO_UNALIGNED_ACCESS) $(VFE_OPTION) $(AAPCS_OPTION) \ $(COMPILE_ONLY_OPTION) $(INSTRUCTION_SET) \ $(if $(ALWAYS_BUILD_AS_ARM),$(ARM_INSTRUCTION_SET),$(THUMB_INSTRUCTION_SET) $(call makemacrodef,-D,$(COMPILER_THUMB_DEFINES))) \ - $(COMPILER_FPU_FLAGS) + $(COMPILER_FPU_OPTION)$(if $(ARMFPU),$(ARMFPU),$(COMPILER_FPU_DEFAULT)) ifeq ($(STDCPP),1) SYSTEMINCLUDE:=$(SYSTEMINCLUDE) $(call concat, $(COMPILER_SYSTEM_INCLUDE_OPTION),$(call dblquote,$(STDCPP_INCLUDE))) @@ -1132,7 +1125,6 @@ PREVIOUSVARIANTTYPE:=$(VARIANTTYPE) WHATRELEASE:=$(WHATRELEASE) $(ROMFILENAME) - CLEANTARGETS:=$(CLEANTARGETS) $(ROMFILENAME) endif # Deal with test code batch files generation. @@ -1143,7 +1135,6 @@ BATCHFILE_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH):=1 TARGET_CREATED_$(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)_$(TARGET):=1 WHATRELEASE:=$(WHATRELEASE) $(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) - CLEANTARGETS:=$(CLEANTARGETS) $(EPOCROOT)/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) endif ###################### End of Build ROMFILE target ###################### @@ -1183,10 +1174,10 @@ $(call makepath,$(CREATABLEPATHS)) ## Clean up -$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS) ,$(CREATABLEPATHS),)) +$(call raptor_clean,$(CLEANTARGETS)) -# For the abld -what target -$(eval $(call whatmacro,$(filter-out %.sym,$(WHATRELEASE)),WHATARMV5)) +# For the --what option and the log file +$(call raptor_release,$(filter-out %.sym,$(WHATRELEASE))) endif # FEATUREVARIANTNAME=="" or FEATUREVARIANT==1 diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2ani.flm --- a/sbsv2/raptor/lib/flm/e32abiv2ani.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2ani.flm Mon Dec 07 11:41:13 2009 +0000 @@ -29,7 +29,7 @@ # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2defaults.mk --- a/sbsv2/raptor/lib/flm/e32abiv2defaults.mk Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2defaults.mk Mon Dec 07 11:41:13 2009 +0000 @@ -40,13 +40,17 @@ # Reset these variables as they change for every single target type # LINKER_ENTRYPOINT_ADORNMENT will be blank for GCCE; for RVCT it will look like "(uc_exe_.o)" # LINKER_ENTRYPOINT_DECORATION will be blank for RVCT; for GCCE it will look like "-u _E32Startup" +# LINKER_SEPARATOR is a comma for GCCE as g++ is used for linking; for RVCT is should be a space, but +# as make strips trailing spaces, we use the CHAR_SPACE variable. LINKER_ENTRYPOINT_ADORNMENT:= LINKER_ENTRYPOINT_DECORATION:= +LINKER_SEPARATOR:= # For GCCE ifeq ($(TOOLCHAIN),GCCE) -LINKER_ENTRYPOINT_DECORATION:=$(if $(call isoneof,$(TARGETTYPE),exexp exe),-u _E32Startup,-u _E32Dll) +LINKER_ENTRYPOINT_DECORATION:=$(if $(call isoneof,$(TARGETTYPE),exexp exe),-Wl$(CHAR_COMMA)-u$(CHAR_COMMA)_E32Startup,-Wl$(CHAR_COMMA)-u$(CHAR_COMMA)_E32Dll) +LINKER_SEPARATOR:=$(CHAR_COMMA) endif # For RVCT @@ -74,6 +78,7 @@ ifeq ($(TARGETTYPE),kdll) LINKER_ENTRYPOINT_ADORNMENT:=(L_ENTRY_.o) endif +LINKER_SEPARATOR:=$(CHAR_SPACE) endif # "OPTION" metadata from the front-end can potentially be supplied simultaneously for both GCCE and RVCT, @@ -89,3 +94,9 @@ OPTION_COMPILER:=$(OPTION_ARMCC) OPTION_REPLACE_COMPILER:=$(OPTION_REPLACE_ARMCC) endif + +# "ARMFPU" overrides for 'fpu-ness' in compiler and postlinker calls in .mmp files are currently only +# supported for RVCT-based builds, GCCE builds always make use of the interface defined defaults. +ifeq ($(TOOLCHAIN),GCCE) + ARMFPU:= +endif diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2dll.flm --- a/sbsv2/raptor/lib/flm/e32abiv2dll.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2dll.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,7 @@ # Default Linker settings for this target type LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2exe.flm --- a/sbsv2/raptor/lib/flm/e32abiv2exe.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2exe.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,7 @@ LINKER_STUB_LIBRARY:= LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/$(if $(FIRSTLIB),$(FIRSTLIB),eexe.lib) -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Startup $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/$(if $(FIRSTLIB),$(FIRSTLIB),eexe.lib)$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Startup $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/$(if $(FIRSTLIB),$(FIRSTLIB),eexe.lib)$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2exexp.flm --- a/sbsv2/raptor/lib/flm/e32abiv2exexp.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2exexp.flm Mon Dec 07 11:41:13 2009 +0000 @@ -52,10 +52,10 @@ LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/$(FIRSTLIB) ifeq ("$(TOOLCHAIN)","RVCT") -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Startup $(call dblquote,$(STATIC_RUNTIME_DIR)/$(FIRSTLIB)($(FIRSTLIB_OBJECTFILE))) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Startup $(call dblquote,$(STATIC_RUNTIME_DIR)/$(FIRSTLIB)($(FIRSTLIB_OBJECTFILE))) else # GCCE -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Startup -u _E32Startup $(call dblquote,$(STATIC_RUNTIME_DIR)/$(FIRSTLIB)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Startup -Wl,-u$(LINKER_SEPARATOR)_E32Startup$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/$(FIRSTLIB)) endif ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2fsy.flm --- a/sbsv2/raptor/lib/flm/e32abiv2fsy.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2fsy.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,7 @@ # Determine what kind of entrypoint option to set AUTOEXPORTS:=CreateFileSystem,1; LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2kdll.flm --- a/sbsv2/raptor/lib/flm/e32abiv2kdll.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2kdll.flm Mon Dec 07 11:41:13 2009 +0000 @@ -27,7 +27,7 @@ # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/ekll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/ekll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/ekll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2kext.flm --- a/sbsv2/raptor/lib/flm/e32abiv2kext.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2kext.flm Mon Dec 07 11:41:13 2009 +0000 @@ -34,7 +34,7 @@ # Default Linker settings for this target type LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/eext.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/eext.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/eext.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2ldd.flm --- a/sbsv2/raptor/lib/flm/e32abiv2ldd.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2ldd.flm Mon Dec 07 11:41:13 2009 +0000 @@ -29,7 +29,7 @@ # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edev.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edev.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edev.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2pdd.flm --- a/sbsv2/raptor/lib/flm/e32abiv2pdd.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2pdd.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,7 @@ # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edev.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edev.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edev.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2pdl.flm --- a/sbsv2/raptor/lib/flm/e32abiv2pdl.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2pdl.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,7 @@ # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2plugin.flm --- a/sbsv2/raptor/lib/flm/e32abiv2plugin.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2plugin.flm Mon Dec 07 11:41:13 2009 +0000 @@ -31,7 +31,7 @@ # Default Linker settings for this target type LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2stddll.flm --- a/sbsv2/raptor/lib/flm/e32abiv2stddll.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2stddll.flm Mon Dec 07 11:41:13 2009 +0000 @@ -29,7 +29,7 @@ # Default Linker settings for this target type LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) DEFAULT_NEWLIB:=$(DEFAULT_STDCPP_NEWLIB) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2stdexe.flm --- a/sbsv2/raptor/lib/flm/e32abiv2stdexe.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2stdexe.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,7 @@ # Determine what kind of entrypoint option to set LINKER_STUB_LIBRARY:= LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/eexe.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Startup $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/eexe.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Startup $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/eexe.lib$(LINKER_ENTRYPOINT_ADORNMENT)) DEFAULT_NEWLIB:=$(DEFAULT_STDCPP_NEWLIB) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2textnotifier2.flm --- a/sbsv2/raptor/lib/flm/e32abiv2textnotifier2.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2textnotifier2.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,7 @@ AUTOEXPORTS:=_Z13NotifierArrayv,1; # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/edll.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/edll.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2var.flm --- a/sbsv2/raptor/lib/flm/e32abiv2var.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2var.flm Mon Dec 07 11:41:13 2009 +0000 @@ -29,7 +29,7 @@ # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/evar.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/evar.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/evar.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32abiv2var2.flm --- a/sbsv2/raptor/lib/flm/e32abiv2var2.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32abiv2var2.flm Mon Dec 07 11:41:13 2009 +0000 @@ -29,7 +29,7 @@ # Determine what kind of entrypoint option to set LINKER_ENTRYPOINT_LIBDEP:=$(STATIC_RUNTIME_DIR)/evar.lib -LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION) _E32Dll $(LINKER_ENTRYPOINT_DECORATION) $(call dblquote,$(STATIC_RUNTIME_DIR)/evar.lib$(LINKER_ENTRYPOINT_ADORNMENT)) +LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRY_OPTION)=_E32Dll $(LINKER_ENTRYPOINT_DECORATION)$(LINKER_SEPARATOR)$(call dblquote,$(STATIC_RUNTIME_DIR)/evar.lib$(LINKER_ENTRYPOINT_ADORNMENT)) ifeq ("$(NEED_ENTRYPOINT_LIBRARY)","True") LINKER_ENTRYPOINT_SETTING:=$(LINKER_ENTRYPOINT_SETTING) $(LINKER_ENTRYPOINT_LIBDEP) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/e32postlink.mk --- a/sbsv2/raptor/lib/flm/e32postlink.mk Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/e32postlink.mk Mon Dec 07 11:41:13 2009 +0000 @@ -20,9 +20,11 @@ # # Metadata supplied (or deduced from) # -# BYTEPAIRCOMPRESS +# ARMFPU +# BYTEPAIRCOMPRESSTARGET # CAPABILITY -# DEBUGGABLE Can be "udeb" or "urel" or "udeb urel" or "" +# COMPRESSTARGET Not directly referenced, at least with the current approach to compression keywords +# DEBUGGABLE Can be "udeb" or "urel" or "udeb urel" or "" # E32TARGET # EPOCALLOWDLLDATA # EPOCFIXEDPROCESS @@ -31,8 +33,8 @@ # EPOCPROCESSPRIORITY # EPOCSTACKSIZE # EXPORTUNFROZEN -# INFLATECOMPRESS -# POSTLINKFPU +# INFLATECOMPRESSTARGET +# NOCOMPRESSTARGET # POSTLINKTARGETTYPE # SID # SMPSAFE @@ -44,12 +46,12 @@ # Other # # ARMLIBS -# AUTOEXPORTS Symbols that must be assumed to exist for this TARGETTYPE in the format: export,ordinal;export,ordinal;.. -# CANIGNORENONCALLABLE If the TARGETTYPE allows it, disregard non-callable exports (v-tables, type information, etc.) +# AUTOEXPORTS Symbols that must be assumed to exist for this TARGETTYPE in the format: export,ordinal;export,ordinal;.. +# CANIGNORENONCALLABLE If the TARGETTYPE allows it, disregard non-callable exports (v-tables, type information, etc.) # CANHAVEEXPORTS # CLEANTARGETS # ELF2E32 -# EPOCDATALINKADDRESS Redundant? +# EPOCDATALINKADDRESS Redundant? # EPOCROOT # EXPTARGET # GENERATED_DEFFILE @@ -58,10 +60,12 @@ # IMPORTLIBRARYREQUIRED # INTERMEDIATEPATH # LINKASVERSIONED -# LINK_TARGET Postlinker elf input +# LINK_TARGET Postlinker elf input # NAMEDSYMLKUP # PAGEDCODE_OPTION # POSTLINKDEFFILE +# POSTLINKER_COMPRESSION_DEFAULT Default compression when either COMPRESSTARGET or no compression .mmp keyword is used +# POSTLINKER_FPU_DEFAULT # POSTLINKER_SUPPORTS_WDP # RUNTIME_LIBS_PATH # SAVESPACE @@ -93,7 +97,7 @@ --version=$(VERSION) \ --capability=$(FINAL_CAPABILITIES) \ --linkas=$(call dblquote,$(LINKASVERSIONED)) \ - --fpu=$(POSTLINKFPU) \ + --fpu=$(if $(ARMFPU),$(ARMFPU),$(POSTLINKER_FPU_DEFAULT)) \ --targettype=$(POSTLINKTARGETTYPE) \ --output=$$(call dblquote,$$@) \ --elfinput=$(call dblquote,$(LINK_TARGET)) \ @@ -121,11 +125,12 @@ $(if $(POSTLINKER_SUPPORTS_WDP), \ --codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \ $(POSTLINKER_PAGEDOPTION)) \ - $(if $(NOCOMPRESSTARGET), \ - --uncompressed, \ - $(if $(INFLATECOMPRESS),--compressionmethod inflate,$(if $(BYTEPAIRCOMPRESS),--compressionmethod bytepair,))) \ + $(if $(NOCOMPRESSTARGET),--uncompressed, \ + $(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \ + $(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \ + --compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \ --libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))" \ - $(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,;$(GNURM) -rf $(INTERMEDIATEPATH); true)) \ + $(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \ $(call endrule,postlink) endef $(eval $(e32postlink)) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/gccxml.flm --- a/sbsv2/raptor/lib/flm/gccxml.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/gccxml.flm Mon Dec 07 11:41:13 2009 +0000 @@ -92,7 +92,7 @@ TEMPGXPARCHIVE:=$(VARIANTBLDPATH)/$(TARGET)$(BASE_TYPE).gxp GXPARCHIVE:=$(VARIANTRELEASEPATH)/$(TARGET)$(BASE_TYPE).gxp -CLEANTARGETS:=$(CLEANTARGETS) $(MMPXMLFILE) $(SRCXMLFILES) $(DEPFILES) $(TEMPGXPARCHIVE) $(GXPARCHIVE) +CLEANTARGETS:=$(CLEANTARGETS) $(MMPXMLFILE) $(SRCXMLFILES) $(DEPFILES) $(TEMPGXPARCHIVE) RELEASABLES:=$(RELEASABLES) $(GXPARCHIVE) # Deduce whether we should be performing a build with standard CPP characteristics @@ -252,6 +252,6 @@ TARGET:: $(RELEASABLES) # clean up -$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),)) +$(call raptor_clean,$(CLEANTARGETS)) $(call makepath, $(CREATABLEPATHS)) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/msvctools.flm --- a/sbsv2/raptor/lib/flm/msvctools.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/msvctools.flm Mon Dec 07 11:41:13 2009 +0000 @@ -28,7 +28,6 @@ $(call makepath,$(RELEASEPATH)) $(call makepath,$(BUILDPATH)) -CLEANTARGETS:=$(CLEANTARGETS) $(RELEASETARGET) RELEASEABLES:=$(RELEASEABLES) $(RELEASETARGET) GENDEBUGINFO:=$(if $(findstring deb,$(VARIANTTYPE)),1,) @@ -157,7 +156,6 @@ ifneq ($(INSTALLPATH),) INSTALLTARGET:=$(INSTALLPATH)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) - CLEANTARGETS:=$(CLEANTARGETS) $(INSTALLTARGET) RELEASEABLES:=$(RELEASEABLES) $(INSTALLTARGET) define msvctoolsinstall @@ -180,7 +178,7 @@ ifneq ($(GENDEBUGINFO),) BSCFILE:=$(RELEASEPATH)/$(TARGET).bsc BSCRESPONSEFILE:=$(BUILDPATH)/$(TARGET).brf - CLEANTARGETS:=$(CLEANTARGETS) $(BSCFILE) $(BSCRESPONSEFILE) + CLEANTARGETS:=$(CLEANTARGETS) $(BSCRESPONSEFILE) RELEASEABLES:=$(RELEASEABLES) $(BSCFILE) define msvctoolsgenbrowse @@ -207,6 +205,6 @@ endif # clean up -$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),,)) -# for the abld -what target -$(eval $(call whatmacro,$(INSTALLTARGET),WHATTOOLS)) +$(call raptor_clean,$(CLEANTARGETS)) +# for the --what option and the log file +$(call raptor_release,$(INSTALLTARGET)) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/resource.flm --- a/sbsv2/raptor/lib/flm/resource.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/resource.flm Mon Dec 07 11:41:13 2009 +0000 @@ -101,8 +101,6 @@ @if [ ! -f $$@ ]; then echo "DATADIR: /$(RSSBASENAME)" > $$@ ; fi @echo -e "\n/z$(TARGETPATH)/$(TARGET_lower).rsc : $(RSSBASENAME).rpp" >> $$@ -CLEANTARGETS:=$$(CLEANTARGETS) $(DESTRPP) $(INFOFILE) - endif endef @@ -174,7 +172,6 @@ ifeq ($(TARGET_$(call sanitise,$2)),) TARGET_$(call sanitise,$2):=1 - CLEANTARGETS:=$$(CLEANTARGETS) $2 RESOURCE:: $2 ## perform additional copies of binaries @@ -201,7 +198,6 @@ ifeq ($(TARGET_$(call sanitise,$1)),) TARGET_$(call sanitise,$1):=1 - CLEANTARGETS:=$$(CLEANTARGETS) $(1) $(if $(FLMDEBUG),$(info generateresource: $(1) from $(2) LANG:$(3)),) @@ -236,7 +232,6 @@ ifeq ($(TARGET_$(call sanitise,$1)),) TARGET_$(call sanitise,$1):=1 - CLEANTARGETS:= $$(CLEANTARGETS) $(1) $(if $(FLMDEBUG),$(info resourceheader: $(1) from $(2) LANG:$(3))) RESOURCE:: $(1) @@ -282,7 +277,6 @@ ifneq ($(RFIFILE),) RESOURCE:: $(RFIFILE) RELEASABLES:=$(RELEASABLES) $(RFIFILE) - CLEANTARGETS:=$(CLEANTARGETS) $(RFIFILE) CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(RFIFILE)) RPPFILES:=$(foreach L,$(LANGUAGES:SC=sc),$(INTERBASE)_$(L).rpp) @@ -291,11 +285,11 @@ ## Clean up -$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),)) +$(call raptor_clean,$(CLEANTARGETS)) # make the output directories while reading makefile - some build engines prefer this $(call makepath,$(CREATABLEPATHS)) -# for the abld -what target +# for the --what option and the log file RELEASABLES:=$(RELEASABLES) $(DESTRPP) $(INFOFILE) -$(eval $(call whatmacro,$(RELEASABLES),WHATRESOURCES)) +$(call raptor_release,$(RELEASABLES),RESOURCE) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/run.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/lib/flm/run.mk Mon Dec 07 11:41:13 2009 +0000 @@ -0,0 +1,39 @@ +.PHONY:: ALL +ALL:: # Default target + +HOSTPLATFORM:=win 32 +HOSTPLATFORM_DIR:=win32 +OSTYPE:=cygwin +FLMHOME:=E:/wip2/lib/flm +SHELL:=E:/wip2/win32/cygwin/bin/sh.exe + + +USE_TALON:= + + + +include E:/wip2/lib/flm/globals.mk + +# dynamic default targets + +# call E:/wip2/lib/flm/config/default.flm +SBS_SPECIFICATION:=Symbian.config.default +SBS_CONFIGURATION:=armv5_urel + +EPOCROOT:=E:/wip2/test/epocroot +ELF2E32:=E:/wip2/test/epocroot/epoc32/tools/elf2e32.exe +WHATLOG:= +include E:/wip2/lib/flm/config/default.flm + + +component_paths:=$(SBS_HOME)/test/smoke_suite/test_resources/simple/bld.inf|c:/make_test/a.mk \ +$(SBS_HOME)/test/smoke_suite/test_resources/simple_dll/bld.inf|c:/make_test/b.mk \ +$(SBS_HOME)/test/smoke_suite/test_resources/simple/always_build_as_arm_bld.inf|c:/make_test/c.mk \ +$(SBS_HOME)/test/smoke_suite/test_resources/simple/debuggable_bld.inf|c:/make_test/d.mk \ +$(SBS_HOME)/test/smoke_suite/test_resources/simple_export/bld.inf|c:/make_test/e.mk + +configs:=armv5 armv7 + +cli_options:=-d + +include build.flm diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/standard.xml --- a/sbsv2/raptor/lib/flm/standard.xml Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/standard.xml Mon Dec 07 11:41:13 2009 +0000 @@ -5,11 +5,12 @@ - - + + + @@ -20,6 +21,7 @@ + @@ -71,7 +73,6 @@ - @@ -91,8 +92,9 @@ + + - @@ -144,6 +146,8 @@ + + @@ -158,6 +162,7 @@ + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/stringtable.flm --- a/sbsv2/raptor/lib/flm/stringtable.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/stringtable.flm Mon Dec 07 11:41:13 2009 +0000 @@ -33,9 +33,7 @@ EXPORT:: - CLEANTARGETS:= -CLEANEXPORTS:= RELEASEEXPORTS:= CREATABLEPATHS:=$(OUTPUTPATH) $(EXPORTPATH) @@ -60,7 +58,6 @@ $(GNUCP) '$(STRINGTABLEHEADER)' '$$@' \ $(call endrule,exportstringtableheader) -CLEANEXPORTS:=$(EXPORTEDSTRINGTABLEHEADER) RELEASEEXPORTS:=$(EXPORTEDSTRINGTABLEHEADER) endef @@ -83,24 +80,9 @@ $(eval $(genstringtable)) -## Clean up and log releasables (using eval to avoid target specific variables) -$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),)) -$(eval $(call GenerateStandardCleanTarget,$(CLEANEXPORTS),,CLEANEXPORT)) +## Clean up and log releasables +$(call raptor_clean,$(CLEANTARGETS)) # make the output directories while reading makefile - some build engines prefer this $(call makepath,$(CREATABLEPATHS)) -$(eval $(call whatmacro,$(RELEASEEXPORTS),WHATSTRINGTABLE)) +$(call raptor_release,$(RELEASEEXPORTS),STRINGTABLE) -######################## -# SBSv1 example: -######################## -# GENERATED_FILES= \ -# $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.cpp \ -# $(EPOCROOT)epoc32\include\WspParamConstants.h -# -# $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.cpp : ..\strings\WspParamConstants.st -# perl -S ecopyfile.pl ..\strings\WspParamConstants.st $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.st -# perl $(EPOCROOT)epoc32\tools\stringtable.pl $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.st -# -# $(EPOCROOT)epoc32\include\WspParamConstants.h : $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.cpp -# perl -S ecopyfile.pl $(EPOCROOT)epoc32\build\generated\http\WspParamConstants.h $(EPOCROOT)epoc32\include\WspParamConstants.h -# diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/tools2common.flm --- a/sbsv2/raptor/lib/flm/tools2common.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/tools2common.flm Mon Dec 07 11:41:13 2009 +0000 @@ -99,9 +99,9 @@ # make the output directories while reading makefile - some build engines prefer this $(call makepath,$(CREATABLEPATHS)) -## Clean up (using eval to avoid target specific variables) -$(eval $(call GenerateStandardCleanTarget,$(TARGETS) $(OBJECTFILES),$(CREATABLEPATHS),)) -## WHAT target -$(eval $(call whatmacro,$(RELEASEABLES),WHATTOOLS2)) +## Clean up +$(call raptor_clean,$(CLEANTARGETS) $(OBJECTFILES)) +## for the --what option and the log file +$(call raptor_release,$(RELEASABLES)) ## The End diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/tools2exe.flm --- a/sbsv2/raptor/lib/flm/tools2exe.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/tools2exe.flm Mon Dec 07 11:41:13 2009 +0000 @@ -24,12 +24,13 @@ EXETARGET:=$(RELEASEPATH)/$(TARGET)$(DOTEXE) +INSTALLED:= ifneq ($(TOOLSPATH),) INSTALLED:=$(TOOLSPATH)/$(TARGET)$(DOTEXE) endif ## Target groups -RELEASEABLES:=$(INSTALLED) +RELEASABLES:=$(INSTALLED) TARGETS:=$(EXETARGET) $(INSTALLED) ## Common build steps (compiling and cleaning) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/tools2lib.flm --- a/sbsv2/raptor/lib/flm/tools2lib.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/tools2lib.flm Mon Dec 07 11:41:13 2009 +0000 @@ -19,7 +19,7 @@ LIBTARGET:=$(RELEASEPATH)/$(TARGET).a ## Target groups -RELEASEABLES:=$(LIBTARGET) +RELEASABLES:=$(LIBTARGET) TARGETS:=$(LIBTARGET) ## Common build steps (compiling) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/lib/flm/win32.flm --- a/sbsv2/raptor/lib/flm/win32.flm Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/lib/flm/win32.flm Mon Dec 07 11:41:13 2009 +0000 @@ -243,7 +243,6 @@ ifeq ($(SUPPORTS_IMPORT_LIBRARY),1) ifneq ($(NOEXPORTLIBRARY),1) ifneq ($(TARGET_$(call sanitise,$(IMPORTLIBTARGET))),1) - CLEANTARGETS:=$(CLEANTARGETS) $(if $(or $(EXPORTUNFROZEN),$(DEFFILE)),$(IMPORTLIBTARGET)) RELEASABLES:=$(RELEASABLES) $(if $(or $(EXPORTUNFROZEN),$(DEFFILE)),$(IMPORTLIBTARGET)) # import libraries are generated to the UDEB release directory @@ -290,7 +289,6 @@ BINTARGETSTATICLINK:=$(BINDIRSTATICLINK)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) endif - CLEANTARGETS:=$(CLEANTARGETS) $(BINTARGET) $(BINTARGETSTATICLINK) RELEASABLES:=$(RELEASABLES) $(BINTARGET) $(BINTARGETSTATICLINK) # work on a local source files list @@ -463,7 +461,6 @@ # link map file (urel only) ifeq ($(VARIANTTYPE),urel) MAP:=$(OPT.MAP)$(BINTARGET).map - CLEANTARGETS:=$(CLEANTARGETS) $(BINTARGET).map RELEASABLES:=$(RELEASABLES) $(BINTARGET).map endif endif @@ -677,12 +674,11 @@ BATCHFILE_CREATED_$(BATCHDIR)$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH):=1 TARGET_CREATED_$(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH)_$(TARGET):=1 RELEASABLES:=$(RELEASABLES) $(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) - CLEANTARGETS:=$(CLEANTARGETS) $(EPOCROOT)/epoc32/release/$(VARIANTPLATFORM)/$(VARIANTTYPE)/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TESTPATH) endif # clean up -$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS),$(CREATABLEPATHS),)) +$(call raptor_clean,$(CLEANTARGETS)) # make the output directories while reading makefile - some build engines prefer this $(call makepath,$(CREATABLEPATHS)) -# for the abld -what target -$(eval $(call whatmacro,$(RELEASABLES),WHATWINSCW)) +# for the --what option and the log file +$(call raptor_release,$(RELEASABLES)) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/linux-i386/bin/bash Binary file sbsv2/raptor/linux-i386/bin/bash has changed diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/linux-i386/bin/bashbug --- a/sbsv2/raptor/linux-i386/bin/bashbug Mon Nov 16 09:46:46 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -#!/bin/sh - -# -# bashbug - create a bug report and mail it to the bug address -# -# The bug address depends on the release status of the shell. Versions -# with status `devel', `alpha', `beta', or `rc' mail bug reports to -# chet@cwru.edu and, optionally, to bash-testers@cwru.edu. -# Other versions send mail to bug-bash@gnu.org. -# -# Copyright (C) 1996-2004 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -# -# configuration section: -# these variables are filled in by the make target in Makefile -# -MACHINE="i686" -OS="linux-gnu" -CC="gcc" -CFLAGS=" -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/opt/symbian/linux-i386/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -O2 -mtune=i686 -s" -RELEASE="3.2" -PATCHLEVEL="39" -RELSTATUS="release" -MACHTYPE="i686-pc-linux-gnu" - -PATH=/bin:/usr/bin:/usr/local/bin:$PATH -export PATH - -# Check if TMPDIR is set, default to /tmp -: ${TMPDIR:=/tmp} - -#Securely create a temporary directory for the temporary files -TEMPDIR=$TMPDIR/bbug.$$ -(umask 077 && mkdir $TEMPDIR) || { - echo "$0: could not create temporary directory" >&2 - exit 1 -} - -TEMPFILE1=$TEMPDIR/bbug1 -TEMPFILE2=$TEMPDIR/bbug2 - -USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]" -VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}" - -do_help= do_version= - -while [ $# -gt 0 ]; do - case "$1" in - --help) shift ; do_help=y ;; - --version) shift ; do_version=y ;; - --) shift ; break ;; - -*) echo "bashbug: ${1}: invalid option" >&2 - echo "$USAGE" >& 2 - exit 2 ;; - *) break ;; - esac -done - -if [ -n "$do_version" ]; then - echo "${VERSTR}" - exit 0 -fi - -if [ -n "$do_help" ]; then - echo "${VERSTR}" - echo "${USAGE}" - echo - cat << HERE_EOF -Bashbug is used to send mail to the Bash maintainers -for when Bash doesn't behave like you'd like, or expect. - -Bashbug will start up your editor (as defined by the shell's -EDITOR environment variable) with a preformatted bug report -template for you to fill in. The report will be mailed to the -bash maintainers by default. See the manual for details. - -If you invoke bashbug by accident, just quit your editor without -saving any changes to the template, and no bug report will be sent. -HERE_EOF - exit 0 -fi - -# Figure out how to echo a string without a trailing newline -N=`echo 'hi there\c'` -case "$N" in -*c) n=-n c= ;; -*) n= c='\c' ;; -esac - -BASHTESTERS="bash-testers@cwru.edu" - -case "$RELSTATUS" in -alpha*|beta*|devel*|rc*) BUGBASH=chet@cwru.edu ;; -*) BUGBASH=bug-bash@gnu.org ;; -esac - -case "$RELSTATUS" in -alpha*|beta*|devel*|rc*) - echo "$0: This is a testing release. Would you like your bug report" - echo "$0: to be sent to the bash-testers mailing list?" - echo $n "$0: Send to bash-testers? $c" - read ans - case "$ans" in - y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;; - esac ;; -esac - -BUGADDR="${1-$BUGBASH}" - -if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then - if [ -x /usr/bin/editor ]; then - DEFEDITOR=editor - elif [ -x /usr/local/bin/ce ]; then - DEFEDITOR=ce - elif [ -x /usr/local/bin/emacs ]; then - DEFEDITOR=emacs - elif [ -x /usr/contrib/bin/emacs ]; then - DEFEDITOR=emacs - elif [ -x /usr/bin/emacs ]; then - DEFEDITOR=emacs - elif [ -x /usr/bin/xemacs ]; then - DEFEDITOR=xemacs - elif [ -x /usr/contrib/bin/jove ]; then - DEFEDITOR=jove - elif [ -x /usr/local/bin/jove ]; then - DEFEDITOR=jove - elif [ -x /usr/bin/vi ]; then - DEFEDITOR=vi - else - echo "$0: No default editor found: attempting to use vi" >&2 - DEFEDITOR=vi - fi -fi - - -: ${EDITOR=$DEFEDITOR} - -: ${USER=${LOGNAME-`whoami`}} - -trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15 -trap 'rm -rf "$TEMPDIR"' 0 - -UN= -if (uname) >/dev/null 2>&1; then - UN=`uname -a` -fi - -if [ -f /usr/lib/sendmail ] ; then - RMAIL="/usr/lib/sendmail" - SMARGS="-i -t" -elif [ -f /usr/sbin/sendmail ] ; then - RMAIL="/usr/sbin/sendmail" - SMARGS="-i -t" -else - RMAIL=rmail - SMARGS="$BUGADDR" -fi - -INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]' - -cat > "$TEMPFILE1" <> $HOME/dead.bashbug - echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2 -} - -exit 0 diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/linux-i386/bin/make Binary file sbsv2/raptor/linux-i386/bin/make has changed diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/linux-i386/bin/sh Binary file sbsv2/raptor/linux-i386/bin/sh has changed diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/linux-i386/bin/unzip Binary file sbsv2/raptor/linux-i386/bin/unzip has changed diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/linux-i386/bin/zip Binary file sbsv2/raptor/linux-i386/bin/zip has changed diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/filter_interface.py --- a/sbsv2/raptor/python/filter_interface.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/filter_interface.py Mon Dec 07 11:41:13 2009 +0000 @@ -18,7 +18,7 @@ class Filter(object): - def open(self, raptor): + def open(self, params): return False def write(self, text): @@ -32,3 +32,89 @@ def formatError(self, message): return "sbs: error: " + message + "\n" + + def formatWarning(self, message): + return "sbs: warning: " + message + "\n" + +import sys +import xml.sax + +class FilterSAX(Filter, xml.sax.handler.ContentHandler, xml.sax.handler.ErrorHandler): + "base class for filters using a SAX parser" + + # define these methods in your subclass + + def startDocument(self): + "called once before any elements are seen" + pass + + def startElement(self, name, attributes): + "called on the opening of any element" + pass + + def characters(self, char): + "called one or more times with body text from an element" + pass + + def endElement(self, name): + "called on the closing of any element" + pass + + def endDocument(self): + "called once when all elements are closed" + pass + + def error(self, exception): + "the parse found an error which is (possibly) recoverable" + pass + + def fatalError(self, exception): + "the parser thinks an error occurred which should stop everything" + pass + + def warning(self, exception): + "the parser found something to complain about that might not matter" + pass + + # these methods are from the Filter base class + + def open(self, params): + "initialise" + + self.params = params + self.ok = True + try: + self.parser = xml.sax.make_parser(['xml.sax.expatreader']) + self.parser.setContentHandler(self) + self.parser.setErrorHandler(self) + + except Exception, ex: + sys.stderr.write(self.formatError(str(ex))) + self.ok = False + + return self.ok + + + def write(self, text): + "process some log text" + try: + self.parser.feed(text) + except Exception, ex: + sys.stderr.write(self.formatError(str(ex))) + self.ok = False + + return self.ok + + + def close(self): + "finish off" + try: + self.parser.close() + except Exception, ex: + sys.stderr.write(self.formatError(str(ex))) + self.ok = False + + return self.ok + + +# the end diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/filter_utils.py --- a/sbsv2/raptor/python/filter_utils.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/filter_utils.py Mon Dec 07 11:41:13 2009 +0000 @@ -198,12 +198,16 @@ def isError(self, aLine): """Convenience matcher for basic errors. Override in sub-classes to specialise.""" - return True if Recipe.error.match(aLine) else False + if Recipe.error.match(aLine): + return True + return False def isWarning(self, aLine): """Convenience matcher for basic warnings. Override in sub-classes to specialise.""" - return True if Recipe.warning.match(aLine) else False + if Recipe.warning.match(aLine): + return True + return False def getOutput(self): """"Return a list of all output that isn't an error or a warning. @@ -234,16 +238,17 @@ def isSuccess(self): "Convenience method to get overall recipe status." - return True if self.getDetail(Recipe.exit) == "ok" else False + return (self.getDetail(Recipe.exit) == "ok") class Win32Recipe(Recipe): "Win32 tailored recipe class." def isError(self, aLine): - return True if mwError.match(aLine) else False + if mwError.match(aLine): + return True + return False def isWarning(self, aLine): - return True if mwWarning.match(aLine) else False - - - + if mwWarning.match(aLine): + return True + return False diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/mmpparser.py --- a/sbsv2/raptor/python/mmpparser.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/mmpparser.py Mon Dec 07 11:41:13 2009 +0000 @@ -71,6 +71,7 @@ self.assignment = \ ( \ Line(CaselessKeyword('ARMFPU') + String()) ^ \ + Line(CaselessKeyword('APPLY') + String()) ^ \ Line(CaselessKeyword('ASSPLIBRARY') + StringList()) ^ \ Line(CaselessKeyword('CAPABILITY') + StringList()) ^ \ Line(CaselessKeyword('DOCUMENT') + StringList()) ^ \ diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_carbide.py --- a/sbsv2/raptor/python/plugins/filter_carbide.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/plugins/filter_carbide.py Mon Dec 07 11:41:13 2009 +0000 @@ -129,5 +129,4 @@ FilterCarbide.stdout.write("Overall Errors: %d\n" % self.__errors) FilterCarbide.stdout.write("Overall Warnings: %d\n\n" % self.__warnings) - return True if self.__errors == 0 else False - + return (self.__errors == 0) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_checksource.py --- a/sbsv2/raptor/python/plugins/filter_checksource.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/plugins/filter_checksource.py Mon Dec 07 11:41:13 2009 +0000 @@ -224,11 +224,11 @@ # Do the check for each file for dep in deplistnodups: - dep = os.path.normpath(dep).replace('\\', '/') + dep = os.path.abspath(dep).replace('\\', '/') self.checksource(dep) except Exception, e: - sys.stderr.write("sbs: could not access temporary file for FilterClean\n") + sys.stderr.write("sbs: FilterCheckSource failed: %s\n" % str(e)) if self.errors == 0: sys.stdout.write("No checksource errors found\n") @@ -263,7 +263,7 @@ def checkcase(self, path): """Checks the path matches the file system""" - path = os.path.normpath(path) + path = os.path.abspath(path) path = path.replace('\\', '/') if not os.path.exists(path): @@ -277,7 +277,7 @@ for part in parts: if not self.checkkeyignorecase(cacheItem, part): - + dirItems = os.listdir(dirBeingChecked) found = False diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_clean.py --- a/sbsv2/raptor/python/plugins/filter_clean.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/plugins/filter_clean.py Mon Dec 07 11:41:13 2009 +0000 @@ -51,17 +51,23 @@ if self.removeTargets: if line.startswith(""): - self.doFile(line) - elif line.startswith(""): - self.doDirectory(line) + self.doFile(line, "file") + elif line.startswith(""): + self.doFile(line, "build") + elif line.startswith(""): + self.doFile(line, "resource") + elif line.startswith(""): + self.doFile(line, "bitmap") + elif line.startswith(""): + self.doFile(line, "stringtable") if self.removeExports: if line.startswith(""): - self.doMember(line) + self.doFile(line, "member") elif line.startswith(""): - self.doZipMarker(line) + self.doFile(line, "zipmarker") return self.ok @@ -81,13 +87,14 @@ if os.path.isfile(path): self.removeFile(path) - - elif os.path.isdir(path): - dirs.add(path) + + directory = os.path.dirname(path) + if os.path.isdir(directory): + dirs.add(directory) self.tmp.close() # this also deletes the temporary file - except: - sys.stderr.write("sbs: could not access temporary file for FilterClean\n") + except Exception,e: + sys.stderr.write("sbs: problem reading temporary file for FilterClean: %s\n" % str(e)) self.ok = False # finally remove (empty) directories @@ -123,47 +130,20 @@ self.ok = False - def doFile(self, line): - "remove filenames in tags immediately (not .d or .dep)." - filename = line[6:-7] # line is "filename - filename = filename.strip("\"\'") # some names are quoted + def doFile(self, line, tagname): + "deal with X" - # dependency files must be deleted at the end, - # everything else can be deleted straight away. - if filename.endswith(".d") or filename.endswith(".dep"): - self.saveItem(filename) - else: - if os.path.isfile(filename): - self.removeFile(filename) - + first = len(tagname) + 2 # line is "filename + last = -(first + 1) + filename = line[first:last] + filename = filename.strip("\"\'") # some names are quoted + self.saveItem(filename) + - def doDirectory(self, line): - "save directories in tags for the end." - # assuming X - dirname = line[5:-6] - self.saveItem(dirname.strip("\"\'")) - - def doExport(self, line): - "save exported files in tags for the end." - # assuming + "deal with " filename = line[21:line.find("'", 21)] self.saveItem(filename) - - - def doMember(self, line): - "save zip exports in tags for the end." - # assuming X - filename = line[8:-9] - self.saveItem(filename) - - - def doZipMarker(self, line): - "Remove file in tags" - # assuming X - filename = line[11:-12] - if os.path.isfile(filename): - self.removeFile(filename) # the end diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_logfile.py --- a/sbsv2/raptor/python/plugins/filter_logfile.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/plugins/filter_logfile.py Mon Dec 07 11:41:13 2009 +0000 @@ -16,6 +16,7 @@ # Will ultimately do everything that scanlog does # +import errno import os import sys import raptor @@ -38,7 +39,7 @@ if dirname and not os.path.isdir(dirname): os.makedirs(dirname) except os.error, e: - if e.errno != os.errno.EEXIST: + if e.errno != errno.EEXIST: sys.stderr.write("%s : error: cannot create directory %s\n" % \ (str(raptor.name), dirname)) return False diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_splitlog.py --- a/sbsv2/raptor/python/plugins/filter_splitlog.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/plugins/filter_splitlog.py Mon Dec 07 11:41:13 2009 +0000 @@ -16,6 +16,7 @@ # Will ultimately do everything that scanlog does # +import errno import os import sys import raptor @@ -38,7 +39,7 @@ if dirname and not os.path.isdir(dirname): os.makedirs(dirname) except os.error, e: - if e.errno != os.errno.EEXIST: + if e.errno != errno.EEXIST: sys.stderr.write("%s : error: cannot create directory " + "%s\n" % (raptor.name, dirname)) return False diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_tagcount.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/python/plugins/filter_tagcount.py Mon Dec 07 11:41:13 2009 +0000 @@ -0,0 +1,74 @@ +# +# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Example of a Filter class using the SAX parser base class +# + +import filter_interface + +class FilterTagCounter(filter_interface.FilterSAX): + + def startDocument(self): + # for each element name count the number of occurences + # and the amount of body text contained. + self.names = [] + self.count = {} + self.errors = 0 + self.fatals = 0 + self.warns = 0 + + def startElement(self, name, attributes): + if name == "buildlog": + # print out the attributes of the "top" element + print "version:" + for a,v in attributes.items(): + print a, "=", v + + # push name onto the stack of names and increment the count + self.names.append(name) + if name in self.count: + self.count[name][0] += 1 + else: + self.count[name] = [1, 0] # occurs, characters + + def characters(self, char): + # these are for the current element + current = self.names[-1] + self.count[current][1] += len(char) + + def endElement(self, name): + # pop the name off the stack + self.names.pop() + + def endDocument(self): + # report + print "\nsummary:" + for name,nos in sorted(self.count.items()): + print name, nos[0], nos[1] + + print "\nparsing:" + print "errors =", self.errors + print "fatals =", self.fatals + print "warnings =", self.warns + + def error(self, exception): + self.errors += 1 + + def fatalError(self, exception): + self.fatals += 1 + + def warning(self, exception): + self.warns += 1 + +# the end diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_timing.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/python/plugins/filter_timing.py Mon Dec 07 11:41:13 2009 +0000 @@ -0,0 +1,121 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Base Class for defining filter classes +# All filter classes that get defined should derive from this base class +# + +import errno +import filter_interface +import os +import raptor +import raptor_timing +import sys + +class FilterTiming(filter_interface.Filter): + """ + Writes a logfile containing the timings for each Raptor process + """ + + def open(self, raptor_instance): + """ + Open a log file with the same name as the Raptor log file, with + '.timings' appended. This will contain only 'progress' + timing tags from the Raptor output + Parameters: + raptor_instance - Raptor + Instance of Raptor. FilterList usually passes in a cut-down + version of Raptor containing only a few attributes + """ + self.raptor = raptor_instance + self.logFileName = self.raptor.logFileName + # insert the time into the log file name + if self.logFileName: + self.path = (self.logFileName.path.replace("%TIME", + self.raptor.timestring) + ".timings") + + try: + dirname = str(self.raptor.logFileName.Dir()) + if dirname and not os.path.isdir(dirname): + os.makedirs(dirname) + except os.error, e: + if e.errno != errno.EEXIST: + sys.stderr.write("%s : error: cannot create directory " + + "%s\n" % (raptor.name, dirname)) + return False + try: + self.out = open(str(self.path), "w") + except: + self.out = None + sys.stderr.write("%s : error: cannot write log %s\n" %\ + (raptor.name, self.path)) + return False + self.start_times = {} + self.all_durations = [] + self.namespace_written = False + self.open_written = False + return True + + + def write(self, text): + """ + Write out any tags with a 'progress_' tagName + """ + if "\n") + + + def close(self): + """ + Close the logfile + """ + try: + self.out.close + return True + except: + self.out = None + return False diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/plugins/filter_what.py --- a/sbsv2/raptor/python/plugins/filter_what.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/plugins/filter_what.py Mon Dec 07 11:41:13 2009 +0000 @@ -41,6 +41,8 @@ else: self.outfile.write(filename+"\n") + self.prints += 1 + def open(self, build_parameters): "initialise" @@ -78,6 +80,7 @@ "Regex for zip exports" self.zip_export_regex = re.compile("^.*") + self.prints = 0 self.ok = True return self.ok @@ -87,6 +90,17 @@ for line in text.splitlines(): line = line.rstrip() + # we are normally the ONLY filter running so we have to pass on + # any errors and warnings that emerge + # + if line.startswith("", "]]>")) # and some general debug stuff self.Debug("Platform %s", "-".join(hostplatform)) @@ -704,9 +877,11 @@ for c in set(configNames): + self.Debug("BuildUnit: %s", c) try: x = self.GetConfig(c) - buildUnitsToBuild.update( x.GenerateBuildUnits() ) + gb = x.GenerateBuildUnits(self.cache) + buildUnitsToBuild.update( gb ) except Exception, e: self.FatalError(str(e)) @@ -770,13 +945,13 @@ systemModel.DumpLayerInfo(layer) if systemModel.IsLayerBuildable(layer): - layersToBuild.append(ComponentGroup(layer, + layersToBuild.append(Layer(layer, systemModel.GetLayerComponents(layer))) return layersToBuild - # Add bld.inf or system definition xml to command line componentGroups (depending on preference) + # Add bld.inf or system definition xml to command line layers (depending on preference) def FindSysDefIn(self, aDir = None): # Find a system definition file @@ -808,15 +983,6 @@ return None - def AttachSpecs(self, groups): - # tell the specs which Raptor object they work for (so that they can - # access the cache and issue warnings and errors) - for spec in groups: - spec.SetOwner(self) - self.Info("Buildable specification '%s'", spec.name) - if self.debugOutput: - spec.DebugPrint() - def GenerateGenericSpecs(self, configsToBuild): # if a Configuration has any config-wide interfaces # then add a Specification node to call each of them. @@ -832,7 +998,7 @@ filter.AddConfigCondition(c.name) else: # create a new node - filter = raptor_data.Filter("config_wide") + filter = raptor_data.Filter(name = "config_wide") filter.AddConfigCondition(c.name) for i in iface.split(): spec = raptor_data.Specification(i) @@ -842,50 +1008,25 @@ configWide[iface] = filter genericSpecs.append(filter) - self.AttachSpecs(genericSpecs) - return genericSpecs - def WriteMetadataDepsMakefile(self, component_group): - """ Takes a list of (filename, target) tuples that indicate where """ - # Create a Makefile that includes all the dependency information for this spec group - build_metamakefile_name = \ - os.path.abspath(sbs_build_dir).replace('\\','/').rstrip('/') + \ - '/metadata_%s.mk' % component_group.name.lower() - bmkmf = open(build_metamakefile_name, "w+") - bmkmf.write("# Build Metamakefile - Dependencies for metadata during the 'previous' build\n\n") - bmkmf.write("PARSETARGET:=%s\n" % build_metamakefile_name) - bmkmf.write("%s: \n" % build_metamakefile_name) - bmkmf.write("\t@echo -e \"\\nRE-RUNNING SBS with previous parameters\"\n") - bmkmf.write("\t@echo pretend-sbs %s\n" % " ".join(self.args)) - try: - for m in component_group.dependencies: - filename, target = m - bmkmf.write("-include %s\n\n" % filename) - finally: - bmkmf.close() - - return build_metamakefile_name - - def GetEvaluator(self, specification, configuration, gathertools=False): """ this will perform some caching later """ - return raptor_data.Evaluator(self, specification, configuration, gathertools=gathertools) - - - def areMakefilesUptodate(self): - return False + return raptor_data.Evaluator(specification, configuration, gathertools=gathertools, cache = self.cache) - def Make(self, makefile): + def Make(self, makefileset): + if not self.noBuild and makefileset is not None: + if self.maker.Make(makefileset): + self.Info("The make-engine exited successfully.") + return True + else: + self.Error("The make-engine exited with errors.") + return False + else: + self.Info("No build performed") - if self.maker.Make(makefile): - self.Info("The make-engine exited successfully.") - return True - else: - self.Error("The make-engine exited with errors.") - return False def Report(self): @@ -898,10 +1039,10 @@ self.Info("Run time %s seconds" % self.runtime) def AssertBuildOK(self): - """Raise a BuildCompleteException if no further processing is required + """Raise a BuildCannotProgressException if no further processing is required """ if self.Skip(): - raise BuildCompleteException("") + raise BuildCannotProgressException("") return True @@ -934,17 +1075,17 @@ self.out.write("\n") namespace = "http://symbian.com/xml/build/log" + progress_namespace = "http://symbian.com/xml/build/log/progress" schema = "http://symbian.com/xml/build/log/1_0.xsd" - self.out.write("\n" - % (raptor_version.Version(), namespace, namespace, schema)) + self.out.write("\n" + % (raptor_version.fullversion(), namespace, progress_namespace, namespace, schema)) self.logOpen = True except Exception,e: self.out = sys.stdout # make sure that we can actually get errors out. self.logOpen = False self.FatalError("Unable to open the output logs: %s" % str(e)) - def CloseLog(self): if self.logOpen: self.out.summary() @@ -975,6 +1116,30 @@ """ self.out.write("" + escape(format % extras) + "\n") + + def InfoDiscovery(self, object_type, count): + if self.timing: + try: + self.out.write(raptor_timing.Timing.discovery_string(object_type = object_type, + count = count)) + except Exception, exception: + Error(exception.Text, function = "InfoDiscoveryTime") + + def InfoStartTime(self, object_type, task, key): + if self.timing: + try: + self.out.write(raptor_timing.Timing.start_string(object_type = object_type, + task = task, key = key)) + except Exception, exception: + Error(exception.Text, function = "InfoStartTime") + + def InfoEndTime(self, object_type, task, key): + if self.timing: + try: + self.out.write(raptor_timing.Timing.end_string(object_type = object_type, + task = task, key = key)) + except Exception, exception: + Error(exception.Text, function = "InfoEndTime") def Debug(self, format, *extras, **attributes): "Send a debugging message to the configured channel" @@ -1019,28 +1184,11 @@ if format: self.out.write(format % extras) - - def MakeComponentGroup(self, cg): - if not self.maker: - self.maker = raptor_make.MakeEngine(self) - - if self.maker == None: - self.Error("No make engine present") - return None - - makefile = cg.CreateMakefile(self.topMakefile, self.maker, self.systemDefinitionOrderLayers) - if (not self.noBuild and makefile is not None) \ - or self.doParallelParsing: - # run the build for a single group of specs - self.Make(makefile) - else: - self.Info("No build performed for %s" % cg.name) - - def GetComponentGroupsFromCLI(self): - """Returns the list of componentGroups as specified by the + def GetLayersFromCLI(self): + """Returns the list of layers as specified by the commandline interface to Raptor e.g. parameters or the current directory""" - componentGroups=[] + layers=[] # Look for bld.infs or sysdefs in the current dir if none were specified if self.systemDefinitionFile == None and len(self.commandlineComponents) == 0: if not self.preferBuildInfoToSystemDefinition: @@ -1049,38 +1197,39 @@ if self.systemDefinitionFile == None: aComponent = self.FindComponentIn(cwd) if aComponent: - componentGroups.append(ComponentGroup('default',[aComponent])) + layers.append(Layer('default',[aComponent])) else: aComponent = self.FindComponentIn(cwd) if aComponent is None: self.systemDefinitionFile = self.FindSysDefIn(cwd) else: - componentGroups.append(ComponentGroup('default',[aComponent])) + layers.append(Layer('default',[aComponent])) - if len(componentGroups) <= 0 and self.systemDefinitionFile == None: + if len(layers) <= 0 and self.systemDefinitionFile == None: self.Warn("No default bld.inf or system definition file found in current directory (%s)", cwd) # If we now have a System Definition to parse then get the layers of components if self.systemDefinitionFile != None: systemModel = raptor_xml.SystemModel(self, self.systemDefinitionFile, self.systemDefinitionBase) - componentGroups = self.GatherSysModelLayers(systemModel, self.systemDefinitionRequestedLayers) + layers = self.GatherSysModelLayers(systemModel, self.systemDefinitionRequestedLayers) # Now get components specified on a commandline - build them after any # layers in the system definition. if len(self.commandlineComponents) > 0: - componentGroups.append(ComponentGroup('commandline',self.commandlineComponents)) + layers.append(Layer('commandline',self.commandlineComponents)) # If we aren't building components in order then flatten down # the groups if not self.systemDefinitionOrderLayers: # Flatten the layers into one group of components if # we are not required to build them in order. - newcg = ComponentGroup("all") - for cg in componentGroups: - newcg.extend(cg) - componentGroups = [newcg] + newcg = Layer("all") + for cg in layers: + for c in cg: + newcg.add(c) + layers = [newcg] - return componentGroups + return layers def Build(self): @@ -1102,20 +1251,21 @@ # find out what configurations to build self.AssertBuildOK() - buildUnitsToBuild = set() buildUnitsToBuild = self.GetBuildUnitsToBuild(self.configNames) + self.buildUnitsToBuild = buildUnitsToBuild + # find out what components to build, and in what way - componentGroups = [] + layers = [] self.AssertBuildOK() if len(buildUnitsToBuild) >= 0: - componentGroups = self.GetComponentGroupsFromCLI() + layers = self.GetLayersFromCLI() - componentCount = reduce(lambda x,y : x + y, [len(cg) for cg in componentGroups]) + componentCount = reduce(lambda x,y : x + y, [len(cg) for cg in layers]) if not componentCount > 0: - raise BuildCompleteException("No components to build.") + raise BuildCannotProgressException("No components to build.") # check the configurations (tools versions) self.AssertBuildOK() @@ -1127,31 +1277,30 @@ self.AssertBuildOK() + # Setup a make engine. + if not self.maker: + self.maker = raptor_make.MakeEngine(self) + if self.maker == None: + self.Error("No make engine present") - # if self.doParallelParsing and not (len(componentGroups) == 1 and len(componentGroups[0]) == 1): + self.AssertBuildOK() + + # if self.doParallelParsing and not (len(layers) == 1 and len(layers[0]) == 1): if self.doParallelParsing: # Create a Makefile to parse components in parallel and build them - for cg in componentGroups: - cg.GenerateMetadataSpecs(buildUnitsToBuild) - self.MakeComponentGroup(cg) - if self.noBuild: - self.Info("No build performed") + for l in layers: + l.meta_realise(self) else: # Parse components serially, creating one set of makefiles # create non-component specs - self.AssertBuildOK() - generic_specs = self.GenerateGenericSpecs(buildUnitsToBuild) + self.generic_specs = self.GenerateGenericSpecs(buildUnitsToBuild) self.AssertBuildOK() - for cg in componentGroups: + for l in layers: # create specs for a specific group of components - cg.GenerateSpecs(generic_specs, buildUnitsToBuild) - self.WriteMetadataDepsMakefile(cg) + l.realise(self) - # generate the makefiles for one group of specs - self.MakeComponentGroup(cg) - - except BuildCompleteException,b: + except BuildCannotProgressException,b: if str(b) != "": self.Info(str(b)) @@ -1212,17 +1361,7 @@ # object which represents a build b = Raptor.CreateCommandlineBuild(argv) - # allow all objects to log to the - # build they're being used in - global build - global log - build = b - log = b - - - result = b.Build() - - return result + return b.Build() def DisplayBanner(): @@ -1231,4 +1370,5 @@ + # end of the raptor module diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_buildplatform.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/python/raptor_buildplatform.py Mon Dec 07 11:41:13 2009 +0000 @@ -0,0 +1,158 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Classes, methods and regex available for use in log filters +# + +# This particular file is preliminary and under development. + +class BuildPlatform(object): + """ A build platform is a set of configurations which share + the same metadata. In other words, a set of configurations + for which the bld.inf and MMP files pre-process to exactly + the same text.""" + + def __init__(self, build): + evaluator = build.GetEvaluator(None, buildConfig) + self.selfform= evaluator.CheckedGet("TRADITIONAL_PLATFORM") + epocroot = evaluator.CheckedGet("EPOCROOT") + self.epocroot = generic_path.Path(epocroot) + + sbs_build_dir = evaluator.CheckedGet("SBS_BUILD_DIR") + self.sbs_build_dir = generic_path.Path(sbs_build_dir) + flm_export_dir = evaluator.CheckedGet("FLM_EXPORT_DIR") + self.flm_export_dir = generic_path.Path(flm_export_dir) + self.cacheid = flm_export_dir + if raptor_utilities.getOSPlatform().startswith("win"): + self.platmacros = evaluator.CheckedGet( "PLATMACROS.WINDOWS") + else: + self.platmacros = evaluator.CheckedGet( "PLATMACROS.LINUX") + + + # is this a feature variant config or an ordinary variant + fv = evaluator.Get("FEATUREVARIANTNAME") + if fv: + variantHdr = evaluator.CheckedGet("VARIANT_HRH") + variantHRH = generic_path.Path(variantHdr) + self.isfeaturevariant = True + else: + variantCfg = evaluator.CheckedGet("VARIANT_CFG") + variantCfg = generic_path.Path(variantCfg) + if not variantCfg in variantCfgs: + # get VARIANT_HRH from the variant.cfg file + varCfg = getVariantCfgDetail(self.epocroot, variantCfg) + variantCfgs[variantCfg] = varCfg['VARIANT_HRH'] + # we expect to always build ABIv2 + if not 'ENABLE_ABIV2_MODE' in varCfg: + build.Warn("missing flag ENABLE_ABIV2_MODE in %s file. ABIV1 builds are not supported.", + str(variantCfg)) + variantHRH = variantCfgs[variantCfg] + self.isfeaturevariant = False + + self.variant_hrh = variantHRH + build.Info("'%s' uses variant hrh file '%s'", buildConfig.name, variantHRH) + self.systeminclude = evaluator.CheckedGet("SYSTEMINCLUDE") + + + # find all the interface names we need + ifaceTypes = evaluator.CheckedGet("INTERFACE_TYPES") + interfaces = ifaceTypes.split() + + for iface in interfaces: + detail[iface] = evaluator.CheckedGet("INTERFACE." + iface) + + # not test code unless positively specified + self.testcode = evaluator.CheckedGet("TESTCODE", "") + + # make a key that identifies this platform uniquely + # - used to tell us whether we have done the pre-processing + # we need already using another platform with compatible values. + + key = str(self.variant_hrh) \ + + str(self.epocroot) \ + + self.systeminclude \ + + self.platform + + # Keep a short version of the key for use in filenames. + uniq = hashlib.md5() + uniq.update(key) + + plat.key = key + plat.key_md5 = "p_" + uniq.hexdigest() + del uniq + + def __hash__(self): + return hash(self.platform) + hash(self.epocroot) + hash(self.variant_hrh) + hash(self.systeminclude) + hash(self.testcode) + + def __cmp__(self,other): + return cmp(self.hash(), other.hash()) + + + @classmethod + def fromConfigs(configsToBuild, build): + """ Group the list of configurations into "build platforms".""" + platforms = Set() + + for buildConfig in configsToBuild: + # get everything we need to know about the configuration + plat = BuildPlatform(build = build) + + # compare this configuration to the ones we have already seen + + # Is this an unseen export platform? + # concatenate all the values we care about in a fixed order + # and use that as a signature for the exports. + items = ['EPOCROOT', 'VARIANT_HRH', 'SYSTEMINCLUDE', 'TESTCODE', 'export'] + export = "" + for i in items: + if i in detail: + export += i + str(detail[i]) + + if export in exports: + # add this configuration to an existing export platform + index = exports[export] + self.ExportPlatforms[index]['configs'].append(buildConfig) + else: + # create a new export platform with this configuration + exports[export] = len(self.ExportPlatforms) + exp = copy.copy(detail) + exp['PLATFORM'] = 'EXPORT' + exp['configs'] = [buildConfig] + self.ExportPlatforms.append(exp) + + # Is this an unseen build platform? + # concatenate all the values we care about in a fixed order + # and use that as a signature for the platform. + items = ['PLATFORM', 'EPOCROOT', 'VARIANT_HRH', 'SYSTEMINCLUDE', 'TESTCODE'] + if raptor_utilities.getOSPlatform().startswith("win"): + items.append('PLATMACROS.WINDOWS') + else: + items.append('PLATMACROS.LINUX') + + items.extend(interfaces) + platform = "" + for i in items: + if i in detail: + platform += i + str(detail[i]) + + if platform in platforms: + # add this configuration to an existing build platform + index = platforms[platform] + BuildPlatforms[index]['configs'].append(buildConfig) + else: + # create a new build platform with this configuration + platforms[platform] = len(self.BuildPlatforms) + plat.configs = [buildConfig] + BuildPlatforms.append(detail) + diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_cache.py --- a/sbsv2/raptor/python/raptor_cache.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/raptor_cache.py Mon Dec 07 11:41:13 2009 +0000 @@ -143,7 +143,6 @@ self.WarnDuplicate("group", self.groups[obj.name], obj) return - obj.SetOwner(self.raptor) self.groups[obj.name] = obj def FindNamedAlias(self, name): @@ -154,7 +153,6 @@ self.WarnDuplicate("alias", self.aliases[obj.name], obj) return - obj.SetOwner(self.raptor) self.aliases[obj.name] = obj @@ -176,7 +174,6 @@ self.WarnDuplicate("interface", self.interfaces[cacheID][obj.name], obj) return - obj.SetOwner(self.raptor) obj.cacheID = cacheID self.interfaces[cacheID][obj.name] = obj @@ -192,7 +189,6 @@ self.WarnDuplicate("variant", self.variants[obj.name], obj) return - obj.SetOwner(self.raptor) self.variants[obj.name] = obj diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_cli.py --- a/sbsv2/raptor/python/raptor_cli.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/raptor_cli.py Mon Dec 07 11:41:13 2009 +0000 @@ -87,6 +87,9 @@ parser.add_option("--export-only",action="store_true",dest="doExportOnly", help="Generate exports only and do not create any make files.") +parser.add_option("--noexport",action="store_true",dest="doExport", + help="Don't export any files - useful in some builds when you know exports have already been done.") + parser.add_option("-f","--logfile",action="store",dest="logfile", help="Name of the log file, or '-' for stdout.") @@ -144,10 +147,15 @@ "forced" - Check all tool versions. Don't use cached results. """) + +parser.add_option("--timing",action="store_true",dest="timing", + help="Show extra timing information for various processes in the build.") + parser.add_option("--pp",action="store",dest="parallel_parsing", help="""Controls how metadata (e.g. bld.infs) are parsed in Parallel. Possible values are: "on" - Parse bld.infs in parallel (should be faster on clusters/multicore machines) + "slave" - used internally by Raptor "off" - Parse bld.infs serially """) @@ -260,6 +268,7 @@ 'quiet' : Raptor.RunQuietly, 'debugoutput' : Raptor.SetDebugOutput, 'doExportOnly' : Raptor.SetExportOnly, + 'doExport' : Raptor.SetNoExport, 'keepgoing': Raptor.SetKeepGoing, 'nobuild' : Raptor.SetNoBuild, 'make_engine': Raptor.SetMakeEngine, @@ -273,6 +282,7 @@ 'what' : Raptor.SetWhat, 'tries' : Raptor.SetTries, 'toolcheck' : Raptor.SetToolCheck, + 'timing' : Raptor.SetTiming, 'source_target' : Raptor.AddSourceTarget, 'command_file' : CommandFile, 'parallel_parsing' : Raptor.SetParallelParsing, diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_data.py --- a/sbsv2/raptor/python/raptor_data.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/raptor_data.py Mon Dec 07 11:41:13 2009 +0000 @@ -27,8 +27,13 @@ import subprocess from tempfile import gettempdir from time import time, clock +import traceback +import raptor_cache +class MissingInterfaceError(Exception): + def __init__(self, s): + Exception.__init__(self,s) # What host platforms we recognise # This allows us to tie some variants to one host platform and some to another @@ -68,16 +73,14 @@ class Model(object): "Base class for data-model objects" + __slots__ = ('host', 'source', 'cacheID') + def __init__(self): - self.owner = None # Raptor object self.source = None # XML file - self.indent = " " # for DebugPrint self.host = None self.cacheID = "" # default set of cached objects - - - def SetOwner(self, aRaptor): - self.owner = aRaptor + # not using the cache parameter - there to make the + # init for all Model objects "standard" def SetSourceFile(self, filename): @@ -92,10 +95,6 @@ raise InvalidChildError() - def DebugPrint(self, prefix = ""): - if self.owner: - self.owner.Debug("%s", prefix) - def Valid(self): return False @@ -139,8 +138,7 @@ def Resolve(self): raise BadReferenceError() - def GetModifiers(self): - cache = self.owner.cache + def GetModifiers(self, cache): return [ cache.FindNamedVariant(m) for m in self.modifiers ] def Valid(self): @@ -154,20 +152,13 @@ self.variants = [] - def SetOwner(self, aRaptor): - Model.SetOwner(self, aRaptor) - for v in self.variants: - v.SetOwner(aRaptor) - - - def DebugPrint(self, prefix = ""): - for v in self.variants: - v.DebugPrint(prefix) + def __str__(self): + return "\n".join([str(v) for v in self.variants]) def AddVariant(self, variant): if type(variant) is types.StringTypes: - variant = VariantRef(variant) + variant = VariantRef(ref = variant) # Only add the variant if it's not in the list @@ -175,15 +166,19 @@ if not variant in self.variants: self.variants.append(variant) - def GetVariants(self): + def GetVariants(self, cache): # resolve any VariantRef objects into Variant objects + missing_variants = [] for i,var in enumerate(self.variants): if isinstance(var, Reference): try: - self.variants[i] = var.Resolve() + self.variants[i] = var.Resolve(cache=cache) except BadReferenceError: - self.owner.Error("Missing variant '%s'", var.ref) + missing_variants.append(var.ref) + + if len(missing_variants) > 0: + raise MissingVariantException("Missing variants '%s'", " ".join(missing_variants)) return self.variants @@ -199,27 +194,25 @@ self.params = [] self.paramgroups = [] - def DebugPrint(self, prefix = ""): - self.owner.Debug("%s", prefix, self.name) - self.owner.Debug("%s...", prefix) - self.owner.Debug("%s", prefix) + def __str__(self): + return "" % self.name + "" - def FindParent(self): + def FindParent(self, cache): try: - return self.owner.cache.FindNamedInterface(self.extends, self.cacheID) + return cache.FindNamedInterface(self.extends, self.cacheID) except KeyError: raise BadReferenceError("Cannot extend interface because it cannot be found: "+str(self.extends)) - def GetParams(self): + def GetParams(self, cache): if self.extends != None: - parent = self.FindParent() + parent = self.FindParent(cache) # what parameter names do we have already? names = set([x.name for x in self.params]) # pick up ones we don't have that are in our parent pp = [] - for p in parent.GetParams(): + for p in parent.GetParams(cache): if not p.name in names: pp.append(p) @@ -229,29 +222,29 @@ return self.params - def GetParamGroups(self): + def GetParamGroups(self, cache): if self.extends != None: - parent = self.FindParent() + parent = self.FindParent(cache) # what parameter names do we have already? patterns = set([x.pattern for x in self.paramgroups]) # pick up ones we don't have that are in our parent - for g in parent.GetParamGroups(): + for g in parent.GetParamGroups(cache): if not g.pattern in patterns: self.paramgroups.append(g) return self.paramgroups - def GetFLMIncludePath(self): + def GetFLMIncludePath(self, cache): "absolute path to the FLM" if self.flm == None: if self.extends != None: - parent = self.FindParent() + parent = self.FindParent(cache) - return parent.GetFLMIncludePath() + return parent.GetFLMIncludePath(cache) else: raise InvalidPropertyError() @@ -295,12 +288,12 @@ class InterfaceRef(Reference): - def DebugPrint(self, prefix = ""): - self.owner.Debug("%s", prefix, self.ref) + def __str__(self): + return "" % self.ref - def Resolve(self): + def Resolve(self, cache): try: - return self.owner.cache.FindNamedInterface(self.ref, self.cacheID) + return cache.FindNamedInterface(self.ref, self.cacheID) except KeyError: raise BadReferenceError() @@ -316,24 +309,13 @@ self.parentSpec = None - def DebugPrint(self, prefix = ""): - self.owner.Debug("%s", prefix, self.name) - if self.interface: - self.interface.DebugPrint(prefix + self.indent) - VariantContainer.DebugPrint(self, prefix + self.indent) + def __str__(self): + s = "" % str(self.name) + s += VariantContainer.__str__(self) for c in self.childSpecs: - c.DebugPrint(prefix + self.indent) - self.owner.Debug("%s", prefix) - - - def SetOwner(self, aRaptor): - VariantContainer.SetOwner(self, aRaptor) - - if self.interface != None: - self.interface.SetOwner(aRaptor) - - for s in self.childSpecs: - s.SetOwner(aRaptor) + s += str(c) + '\n' + s += "" + return s def SetProperty(self, name, value): @@ -343,10 +325,10 @@ raise InvalidPropertyError() - def Configure(self, config): + def Configure(self, config, cache): # configure all the children (some may be Filters or parents of) for spec in self.GetChildSpecs(): - spec.Configure(config) + spec.Configure(config, cache = cache) def HasInterface(self): @@ -358,10 +340,10 @@ or isinstance(interface, InterfaceRef): self.interface = interface else: - self.interface = InterfaceRef(interface) + self.interface = InterfaceRef(ref = interface) - def GetInterface(self): + def GetInterface(self, cache): """return the Interface (fetching from the cache if it was a ref) may return None""" @@ -371,13 +353,11 @@ if isinstance(self.interface, InterfaceRef): try: - self.interface = self.interface.Resolve() + self.interface = self.interface.Resolve(cache=cache) return self.interface except BadReferenceError: - self.owner.Error("Missing interface %s", self.interface.ref) - return None - + raise MissingInterfaceError("Missing interface %s" % self.interface.ref) def AddChild(self, child): if isinstance(child, Specification): @@ -409,7 +389,7 @@ return True - def GetAllVariantsRecursively(self): + def GetAllVariantsRecursively(self, cache): """Returns all variants contained in this node and in its ancestors. The returned value is a list, the structure of which is [variants-in-parent, @@ -419,11 +399,11 @@ the variants themselves. """ if self.parentSpec: - variants = self.parentSpec.GetAllVariantsRecursively() + variants = self.parentSpec.GetAllVariantsRecursively(cache = cache) else: variants = [] - variants.extend( self.GetVariants() ) + variants.extend( self.GetVariants(cache = cache) ) return variants @@ -438,22 +418,21 @@ If several Conditions are set, the test is an OR of all of them.""" def __init__(self, name = ""): - Specification.__init__(self, name) # base class constructor - self.Else = Specification(name) # same for Else part + Specification.__init__(self, name = name) # base class constructor + self.Else = Specification(name = name) # same for Else part self.isTrue = True self.configNames = set() # self.variableNames = set() # TO DO: Condition class self.variableValues = {} # - def DebugPrint(self, prefix = ""): - self.owner.Debug("%s", prefix, self.name) - self.owner.Debug("%s ", prefix, " | ".join(self.configNames)) - Specification.DebugPrint(self, prefix + self.indent) - self.owner.Debug("%s ", prefix) - self.owner.Debug("%s ", prefix) - self.Else.DebugPrint(prefix + self.indent) - self.owner.Debug("%s ", prefix) - self.owner.Debug("%s", prefix) + def __str__(self, prefix = ""): + s = "\n"% self.name + s += "\n" % " | ".join(self.configNames) + s += Specification.__str__(self) + s += "\n \n" + s += str(self.Else) + s += " \n\n" + return s def SetConfigCondition(self, configName): @@ -478,13 +457,14 @@ self.variableValues[variableName] = set([variableValues]) - def Configure(self, buildUnit): + def Configure(self, buildUnit, cache): self.isTrue = False if buildUnit.name in self.configNames: self.isTrue = True elif self.variableNames: - evaluator = self.owner.GetEvaluator(self.parentSpec, buildUnit) + + evaluator = Evaluator(self.parentSpec, buildUnit, cache=cache) for variableName in self.variableNames: variableValue = evaluator.Get(variableName) @@ -495,14 +475,7 @@ # configure all the children too for spec in self.GetChildSpecs(): - spec.Configure(buildUnit) - - - def SetOwner(self, aRaptor): - # base class method - Specification.SetOwner(self, aRaptor) - # same for Else part - self.Else.SetOwner(aRaptor) + spec.Configure(buildUnit, cache=cache) def HasInterface(self): @@ -512,18 +485,18 @@ return self.Else.HasInterface() - def GetInterface(self): + def GetInterface(self, cache): if self.isTrue: - return Specification.GetInterface(self) + return Specification.GetInterface(self, cache = cache) else: - return self.Else.GetInterface() + return self.Else.GetInterface(cache = cache) - def GetVariants(self): + def GetVariants(self, cache): if self.isTrue: - return Specification.GetVariants(self) + return Specification.GetVariants(self, cache = cache) else: - return self.Else.GetVariants() + return self.Else.GetVariants(cache = cache) def SetParentSpec(self, parent): @@ -591,18 +564,17 @@ class Operation(Model): "Base class for variant operations" + __slots__ = 'type' def __init__(self): Model.__init__(self) # base class constructor self.type = None - def Apply(self, oldValue): pass class Append(Operation): - __slots__ = ('name','value','separator','owner') - + __slots__ = ('name', 'value', 'separator') def __init__(self, name = None, value = None, separator = " "): Operation.__init__(self) # base class constructor self.name = name @@ -610,9 +582,9 @@ self.separator = separator - def DebugPrint(self, prefix = ""): + def __str__(self): attributes = "name='" + self.name + "' value='" + self.value + "' separator='" + self.separator + "'" - self.owner.Debug("%s", prefix, attributes) + return "" % attributes def Apply(self, oldValue): @@ -641,6 +613,7 @@ class Prepend(Operation): + __slots__ = ('name', 'value', 'separator') def __init__(self, name = None, value = None, separator = " "): Operation.__init__(self) # base class constructor self.name = name @@ -648,9 +621,9 @@ self.separator = separator - def DebugPrint(self, prefix = ""): + def __str__(self, prefix = ""): attributes = "name='" + self.name + "' value='" + self.value + "' separator='" + self.separator + "'" - self.owner.Debug("%s", prefix, attributes) + return "" % prefix def Apply(self, oldValue): @@ -679,8 +652,8 @@ class Set(Operation): + __slots__ = ('name', 'value', 'type', 'versionCommand', 'versionResult') """implementation of operation""" - __slots__ = ('name','value', 'type', 'versionCommand', 'versionResult', 'owner') def __init__(self, name = None, value = "", type = ""): Operation.__init__(self) # base class constructor @@ -691,12 +664,12 @@ self.versionResult = "" - def DebugPrint(self, prefix = ""): + def __str__(self): attributes = "name='" + self.name + "' value='" + self.value + "' type='" + self.type + "'" if type == "tool": attributes += " versionCommand='" + self.versionCommand + "' versionResult='" + self.versionResult - self.owner.Debug("%s", prefix, attributes) + return "" % attributes def Apply(self, oldValue): @@ -724,6 +697,8 @@ def Valid(self): return (self.name != None and self.value != None) +class BadToolValue(Exception): + pass class Env(Set): """implementation of operator""" @@ -733,7 +708,7 @@ self.default = default - def DebugPrint(self, prefix = ""): + def __str__(self): attributes = "name='" + self.name + "' type='" + self.type + "'" if default != None: attributes += " default='" + self.default + "'" @@ -741,7 +716,7 @@ if type == "tool": attributes += " versionCommand='" + self.versionCommand + "' versionResult='" + self.versionResult + "'" - self.owner.Debug("%s", prefix, attributes) + return "" % attributes def Apply(self, oldValue): @@ -755,14 +730,12 @@ path = generic_path.Path(value) value = str(path.Absolute()) except ValueError,e: - self.owner.Error("the environment variable %s is incorrect: %s" % (self.name, str(e))) - return "NO_VALUE_FOR_" + self.name + raise BadToolValue("the environment variable %s is incorrect: %s" % (self.name, str(e))) except KeyError: if self.default != None: value = self.default else: - self.owner.Error("%s is not set in the environment and has no default", self.name) - return "NO_VALUE_FOR_" + self.name + raise BadToolValue("%s is not set in the environment and has no default" % self.name) return value @@ -791,7 +764,7 @@ self.operations = [] self.variantKey = "" - def GetOperations(self): + def GetOperations(self, cache): """Return all operations related to this BuildUnit. The result is cached, and so will only be computed once per BuildUnit. @@ -800,7 +773,7 @@ if self.variantKey != key: self.variantKey = key for v in self.variants: - self.operations.extend( v.GetAllOperationsRecursively() ) + self.operations.extend( v.GetAllOperationsRecursively(cache=cache) ) return self.operations @@ -820,7 +793,7 @@ def ClearModifiers(self): self.modifiers = [] - def GenerateBuildUnits(self): + def GenerateBuildUnits(self,cache): """Returns a list of BuildUnits. This function must be overridden by derived classes. @@ -830,6 +803,8 @@ class Variant(Model, Config): + __slots__ = ('cache','name','host','extends','ops','variantRefs','allOperations') + def __init__(self, name = ""): Model.__init__(self) Config.__init__(self) @@ -868,20 +843,10 @@ def Valid(self): return self.name - def SetOwner(self, aRaptor): - - Model.SetOwner(self, aRaptor) - - for r in self.variantRefs: - r.SetOwner(aRaptor) - - for op in self.ops: - op.SetOwner(aRaptor) - def AddOperation(self, op): self.ops.append(op) - def GetAllOperationsRecursively(self): + def GetAllOperationsRecursively(self, cache): """Returns a list of all operations in this variant. The list elements are themselves lists; the overall structure of the @@ -892,16 +857,16 @@ if not self.allOperations: if self.extends: - parent = self.owner.cache.FindNamedVariant(self.extends) - self.allOperations.extend( parent.GetAllOperationsRecursively() ) + parent = cache.FindNamedVariant(self.extends) + self.allOperations.extend( parent.GetAllOperationsRecursively(cache = cache) ) for r in self.variantRefs: - for v in [ r.Resolve() ] + r.GetModifiers(): - self.allOperations.extend( v.GetAllOperationsRecursively() ) + for v in [ r.Resolve(cache = cache) ] + r.GetModifiers(cache = cache): + self.allOperations.extend( v.GetAllOperationsRecursively(cache = cache) ) self.allOperations.append(self.ops) return self.allOperations - def GenerateBuildUnits(self): + def GenerateBuildUnits(self,cache): name = self.name vars = [self] @@ -909,32 +874,32 @@ for m in self.modifiers: name = name + "." + m.name vars.append(m) - - return [ BuildUnit(name, vars) ] - - def DebugPrint(self, prefix = ""): + return [ BuildUnit(name=name, variants=vars) ] - self.owner.Debug("%s", prefix, self.name, self.extends) + def __str__(self): + s = "\n" % (self.name, self.extends) for op in self.ops: - op.DebugPrint(prefix + self.indent) + s += str(op) + '\n' + s += "" + return s - self.owner.Debug("%s", prefix) - - +import traceback class VariantRef(Reference): def __init__(self, ref=None): - Reference.__init__(self, ref) + Reference.__init__(self, ref = ref) - def DebugPrint(self, prefix = ""): - self.owner.Debug("%s", prefix, self.ref) + def __str__(self): + return "" % self.ref - def Resolve(self): + def Resolve(self, cache): try: - return self.owner.cache.FindNamedVariant(self.ref) - except KeyError: + return cache.FindNamedVariant(self.ref) + except KeyError, e: raise BadReferenceError(self.ref) +class MissingVariantException(Exception): + pass class Alias(Model, Config): @@ -946,8 +911,8 @@ self.varRefs = [] self.variants = [] - def DebugPrint(self, prefix = ""): - self.owner.Debug("%s", prefix, self.name, self.meaning) + def __str__(self): + return "" % (self.name, self.meaning) def SetProperty(self, key, val): if key == "name": @@ -956,32 +921,31 @@ self.meaning = val for u in val.split("."): - self.varRefs.append( VariantRef(u) ) + self.varRefs.append( VariantRef(ref = u) ) else: raise InvalidPropertyError() - def SetOwner(self, raptor): - Model.SetOwner(self, raptor) - for r in self.varRefs: - r.SetOwner(raptor) - def Valid(self): return self.name and self.meaning - def GenerateBuildUnits(self): + def GenerateBuildUnits(self, cache): if not self.variants: + missing_variants = [] for r in self.varRefs: try: - self.variants.append( r.Resolve() ) + self.variants.append( r.Resolve(cache=cache) ) except BadReferenceError: - self.owner.Error("Missing variant '%s'", r.ref) + missing_variants.append(r.ref) + + if len(missing_variants) > 0: + raise MissingVariantException("Missing variants '%s'", " ".join(missing_variants)) name = self.name for v in self.modifiers: name = name + "." + v.name - return [ BuildUnit(name, self.variants + self.modifiers) ] + return [ BuildUnit(name=name, variants=self.variants + self.modifiers) ] class AliasRef(Reference): @@ -989,12 +953,12 @@ def __init__(self, ref=None): Reference.__init__(self, ref) - def DebugPrint(self, prefix = ""): - self.owner.Debug("%s", prefix, self.ref) + def __str__(self): + return "" % self.ref - def Resolve(self): + def Resolve(self, cache): try: - return self.owner.cache.FindNamedAlias(self.ref) + return cache.FindNamedAlias(self.ref) except KeyError: raise BadReferenceError(self.ref) @@ -1018,41 +982,37 @@ else: raise InvalidChildError() - def SetOwner(self, raptor): - Model.SetOwner(self, raptor) - for r in self.childRefs: - r.SetOwner(raptor) - def Valid(self): return self.name and self.childRefs - def DebugPrint(self, prefix = ""): - - self.owner.Debug("", prefix, self.name) - + def __str__(self): + s = "" % self.name for r in self.childRefs: - r.DebugPrint(prefix + self.indent) + s += str(r) + s += "" + return s - self.owner.Debug("%s", prefix) - - def GenerateBuildUnits(self): - + def GenerateBuildUnits(self, cache): units = [] + missing_variants = [] for r in self.childRefs: - refMods = r.GetModifiers() + refMods = r.GetModifiers(cache) try: - obj = r.Resolve() + obj = r.Resolve(cache=cache) except BadReferenceError: - self.owner.Error("Missing variant '%s'", r.ref) + missing_variants.append(r.ref) else: obj.ClearModifiers() for m in refMods + self.modifiers: obj.AddModifier(m) - units.extend( obj.GenerateBuildUnits() ) + units.extend( obj.GenerateBuildUnits(cache) ) + + if len(missing_variants) > 0: + raise MissingVariantException("Missing variants '%s'", " ".join(missing_variants)) return units @@ -1062,19 +1022,27 @@ def __init__(self, ref=None): Reference.__init__(self, ref) - def DebugPrint(self, prefix = ""): - mod = ".".join(self.modifiers) - self.owner.Debug("%s", prefix, self.ref, mod) + def __str__(self): + return "<%s />" % (prefix, self.ref, ".".join(self.modifiers)) - def Resolve(self): + def Resolve(self, cache): try: - return self.owner.cache.FindNamedGroup(self.ref) + return cache.FindNamedGroup(self.ref) except KeyError: raise BadReferenceError(self.ref) +class ToolErrorException(Exception): + def __init__(self, s): + Exception.__init__(self,s) + class Tool(object): """Represents a tool that might be used by raptor e.g. a compiler""" + # It's difficult and expensive to give each tool a log reference but a class one + # will facilitate debugging when that is needed without being a design flaw the + # rest of the time. + log = raptor_utilities.nulllog + # For use in dealing with tools that return non-ascii version strings. nonascii = "" identity_chartable = chr(0) @@ -1084,7 +1052,7 @@ nonascii += chr(c) identity_chartable += " " - def __init__(self, name, command, versioncommand, versionresult, id="", log = raptor_utilities.nulllog): + def __init__(self, name, command, versioncommand, versionresult, id=""): self.name = name self.command = command self.versioncommand = versioncommand @@ -1097,7 +1065,6 @@ # version until someone proves that it's OK self.valid = False - self.log=log def expand(self, toolset): self.versioncommand = toolset.ExpandAll(self.versioncommand) @@ -1117,7 +1084,7 @@ # If it really is not a simple command then we won't be able to get a date and # we won't be able to tell if it is altered or updated - too bad! testfile = generic_path.Where(self.command) - self.log.Debug("toolcheck: tool '%s' was found on the path at '%s' ", self.command, testfile) + #self.log.Debug("toolcheck: tool '%s' was found on the path at '%s' ", self.command, testfile) if testfile is None: raise Exception("Can't be found in path") @@ -1127,18 +1094,20 @@ testfile_stat = os.stat(testfile) self.date = testfile_stat.st_mtime except Exception,e: - self.log.Debug("toolcheck: '%s=%s' cannot be dated - this is ok, but the toolcheck won't be able to tell when a new of the tool is installed. (%s)", self.name, self.command, str(e)) + # We really don't mind if the tool could not be dated - for any reason + Tool.log.Debug("toolcheck: '%s=%s' cannot be dated - this is ok, but the toolcheck won't be able to tell when a new version of the tool is installed. (%s)", self.name, self.command, str(e)) + pass - def check(self, shell, evaluator): + def check(self, shell, evaluator, log = raptor_utilities.nulllog): self.vre = re.compile(self.versionresult) try: self.log.Debug("Pre toolcheck: '%s' for version '%s'", self.name, self.versionresult) p = subprocess.Popen(args=[shell, "-c", self.versioncommand], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + log.Debug("Checking tool '%s' for version '%s'", self.name, self.versionresult) versionoutput,err = p.communicate() - self.log.Debug("Checking tool '%s' for version '%s'", self.name, self.versionresult) except Exception,e: versionoutput=None @@ -1148,12 +1117,11 @@ versionoutput_a = versionoutput.translate(Tool.identity_chartable,"") if versionoutput_a and self.vre.search(versionoutput_a) != None: - self.log.Debug("tool '%s' returned an acceptable version '%s' at %s", self.name, versionoutput_a, str(self.date)) + log.Debug("tool '%s' returned an acceptable version '%s'", self.name, versionoutput_a) self.valid = True else: - self.log.Error("tool '%s' from config '%s' did not return version '%s' as required.\nCommand '%s' returned:\n%s\nCheck your environment and configuration.\n", self.name, self.id, self.versionresult, self.versioncommand, versionoutput_a) self.valid = False - return self.valid + raise ToolErrorException("tool '%s' from config '%s' did not return version '%s' as required.\nCommand '%s' returned:\n%s\nCheck your environment and configuration.\n" % (self.name, self.id, self.versionresult, self.versioncommand, versionoutput_a)) def envhash(irrelevant_vars): """Determine something unique about this environment to identify it. @@ -1175,16 +1143,19 @@ write() is used to flush the cache to disc. """ # The raptor shell - this is not mutable. - hostbinaries = os.path.join(os.environ['SBS_HOME'], - os.environ['HOSTPLATFORM_DIR']) + if 'SBS_SHELL' in os.environ: + shell = os.environ['SBS_SHELL'] + else: + hostbinaries = os.path.join(os.environ['SBS_HOME'], + os.environ['HOSTPLATFORM_DIR']) - if HostPlatform.IsHost('lin*'): - shell=os.path.join(hostbinaries, 'bin/bash') - else: - if 'SBS_CYGWIN' in os.environ: - shell=os.path.join(os.environ['SBS_CYGWIN'], 'bin\\bash.exe') + if HostPlatform.IsHost('lin*'): + shell=os.path.join(hostbinaries, 'bin/bash') else: - shell=os.path.join(hostbinaries, 'cygwin\\bin\\bash.exe') + if 'SBS_CYGWIN' in os.environ: + shell=os.path.join(os.environ['SBS_CYGWIN'], 'bin\\bash.exe') + else: + shell=os.path.join(hostbinaries, 'cygwin\\bin\\bash.exe') irrelevant_vars = ['PWD','OLDPWD','PID','PPID', 'SHLVL' ] @@ -1255,7 +1226,6 @@ except Exception, e: log.Info("Ignoring garbled toolcheck cache: %s (%s)\n", self.cachefilename, str(e)) self.__toolcheckcache = {} - else: log.Info("Toolcheck cache %s ignored - environment changed\n", self.cachefilename) @@ -1316,8 +1286,11 @@ self.log.Debug("toolcheck done: %s -key: %s" % (tool.name, tool.key)) - if not tool.check(ToolSet.shell, evaluator): + try: + tool.check(ToolSet.shell, evaluator, log = self.log) + except ToolErrorException, e: self.valid = False + self.log.Error("%s\n" % str(e)) # Tool failures are cached just like successes - don't want to repeat them cache[tool.key] = { "name" : tool.name, "valid" : tool.valid, "age" : 0 , "date" : tool.date } @@ -1356,6 +1329,8 @@ self.log.Info("Could not write toolcheck cache: %s", str(e)) return self.valid +class UninitialisedVariableException(Exception): + pass class Evaluator(object): """Determine the values of variables under different Configurations. @@ -1364,11 +1339,11 @@ refRegex = re.compile("\$\((.+?)\)") - def __init__(self, Raptor, specification, buildUnit, gathertools = False): - self.raptor = Raptor + def __init__(self, specification, buildUnit, cache, gathertools = False): self.dict = {} self.tools = [] self.gathertools = gathertools + self.cache = cache specName = "none" configName = "none" @@ -1377,14 +1352,18 @@ opsLists = [] if buildUnit: - opsLists.extend( buildUnit.GetOperations() ) + ol = buildUnit.GetOperations(cache) + self.buildUnit = buildUnit + + opsLists.extend( ol ) if specification: - for v in specification.GetAllVariantsRecursively(): - opsLists.extend( v.GetAllOperationsRecursively() ) + for v in specification.GetAllVariantsRecursively(cache): + opsLists.extend( v.GetAllOperationsRecursively(cache) ) tools = {} + unfound_values = [] for opsList in opsLists: for op in opsList: # applying an Operation to a non-existent variable @@ -1394,13 +1373,20 @@ except KeyError: oldValue = "" - newValue = op.Apply(oldValue) + try: + newValue = op.Apply(oldValue) + except BadToolValue, e: + unfound_values.append(str(e)) + newValue = "NO_VALUE_FOR_" + op.name + self.dict[op.name] = newValue if self.gathertools: if op.type == "tool" and op.versionCommand and op.versionResult: - tools[op.name] = Tool(op.name, newValue, op.versionCommand, op.versionResult, configName, log = self.raptor) + tools[op.name] = Tool(op.name, newValue, op.versionCommand, op.versionResult, configName) + if len(unfound_values) > 0: + raise UninitialisedVariableException("\n".join(unfound_values)) if self.gathertools: self.tools = tools.values() @@ -1417,8 +1403,8 @@ unresolved = False for k, v in self.dict.items(): if v.find('$(' + k + ')') != -1: - self.raptor.Error("Recursion Detected in variable '%s' in configuration '%s' ",k,configName) - expanded = "RECURSIVE_INVALID_STRING" + raise RecursionException("Recursion Detected in variable '%s' in configuration '%s' " % (k,configName)) + expanded = "RECURSIVE_INVALID_STRING" else: expanded = self.ExpandAll(v, specName, configName) @@ -1466,20 +1452,24 @@ refs = Evaluator.refRegex.findall(value) + # store up all the unset variables before raising an exception + # to allow us to find them all + unset_variables = [] + for r in set(refs): expansion = None - if r in self.raptor.override: - expansion = self.raptor.override[r] - elif r in self.dict: + if r in self.dict: expansion = self.dict[r] else: # no expansion for $(r) - self.raptor.Error("Unset variable '%s' used in spec '%s' with config '%s'", - r, spec, config) + unset_variables.append("Unset variable '%s' used in spec '%s' with config '%s'" % (r, spec, config)) if expansion != None: value = value.replace("$(" + r + ")", expansion) + if len(unset_variables) > 0: # raise them all + raise UninitialisedVariableException(". ".join(unset_variables)) + return value diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_make.py --- a/sbsv2/raptor/python/raptor_make.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/raptor_make.py Mon Dec 07 11:41:13 2009 +0000 @@ -20,13 +20,16 @@ import os import random import raptor -import raptor_data +import raptor_timing import raptor_utilities import raptor_version +import raptor_data import re import subprocess import time from raptor_makefile import * +import traceback +import sys # raptor_make module classes @@ -35,7 +38,6 @@ def __init__(self, Raptor): self.raptor = Raptor self.valid = True - self.makefileset = None self.descrambler = None self.descrambler_started = False @@ -53,7 +55,7 @@ # find the variant and extract the values try: - units = avar.GenerateBuildUnits() + units = avar.GenerateBuildUnits(Raptor.cache) evaluator = Raptor.GetEvaluator( None, units[0] , gathertools=True) # shell @@ -123,7 +125,7 @@ component='$$COMPONENT_NAME'\ bldinf='$$COMPONENT_META' mmp='$$PROJECT_META'\ config='$$SBS_CONFIGURATION' platform='$$PLATFORM'\ - phase='$$MAKEFILE_GROUP' source='$$SOURCE + phase='$$MAKEFILE_GROUP' source='$$SOURCE' export TALON_RECIPEATTRIBUTES TALON_SHELL TALON_TIMEOUT USE_TALON:=%s @@ -133,9 +135,23 @@ USE_TALON:= """ - + + + timing_start = "$(info " + \ + raptor_timing.Timing.custom_string(tag = "start", + object_type = "makefile", task = "parse", + key = "$(THIS_FILENAME)", + time="$(shell date +%s.%N)").rstrip("\n") + ")" + + timing_end = "$(info " + \ + raptor_timing.Timing.custom_string(tag = "end", + object_type = "makefile", task = "parse", + key = "$(THIS_FILENAME)", + time="$(shell date +%s.%N)").rstrip("\n") + ")" + self.makefile_prologue = """ + # generated by %s %s HOSTPLATFORM:=%s @@ -143,12 +159,13 @@ OSTYPE:=%s FLMHOME:=%s SHELL:=%s +THIS_FILENAME:=$(firstword $(MAKEFILE_LIST)) %s include %s -""" % ( raptor.name, raptor_version.Version(), +""" % ( raptor.name, raptor_version.fullversion(), " ".join(raptor.hostplatform), raptor.hostplatform_dir, self.raptor.filesystem, @@ -157,8 +174,18 @@ talon_settings, self.raptor.systemFLM.Append('globals.mk') ) + # Only output timings if requested on CLI + if self.raptor.timing: + self.makefile_prologue += "\n# Print Start-time of Makefile parsing\n" \ + + timing_start + "\n\n" + + + self.makefile_epilogue = "\n\n# Print End-time of Makefile parsing\n" \ + + timing_end + "\n" + else: + self.makefile_epilogue = "" - self.makefile_epilogue = """ + self.makefile_epilogue += """ include %s @@ -168,14 +195,17 @@ """Generate a set of makefiles, or one big Makefile.""" if not self.valid: - return + return None + + self.raptor.Debug("Writing Makefile '%s'" % (str(toplevel))) self.toplevel = toplevel # create the top-level makefiles + makefileset = None try: - self.makefileset = MakefileSet(directory = str(toplevel.Dir()), + makefileset = MakefileSet(directory = str(toplevel.Dir()), selectors = self.selectors, filenamebase = str(toplevel.File()), prologue = self.makefile_prologue, @@ -190,11 +220,10 @@ self.many = not self.raptor.writeSingleMakefile # add a makefile for each spec under each config - config_makefileset = self.makefileset - + config_makefileset = makefileset for c in configs: if self.many: - config_makefileset = self.makefileset.createChild(c.name) + config_makefileset = makefileset.createChild(c.name) # make sure the config_wide spec item is put out first so that it # can affect everything. @@ -207,16 +236,22 @@ ordered_specs.append(s) if config_wide_spec is not None: - config_wide_spec.Configure(c) + config_wide_spec.Configure(c, cache = self.raptor.cache) self.WriteConfiguredSpec(config_makefileset, config_wide_spec, c, True) for s in ordered_specs: - s.Configure(c) + s.Configure(c, cache = self.raptor.cache) self.WriteConfiguredSpec(config_makefileset, s, c, False) - self.makefileset.close() + makefileset.close() except Exception,e: - self.raptor.Error("Failed to write makefile '%s': %s" % (str(toplevel),str(e))) + tb = traceback.format_exc() + if not self.raptor.debugOutput: + tb="" + self.raptor.Error("Failed to write makefile '%s': %s : %s" % (str(toplevel),str(e),tb)) + makefileset = None + + return makefileset def WriteConfiguredSpec(self, parentMakefileSet, spec, config, useAllInterfaces): @@ -233,9 +268,10 @@ guard = None if hasInterface: # find the Interface (it may be a ref) - iface = spec.GetInterface() + try: + iface = spec.GetInterface(self.raptor.cache) - if iface == None: + except raptor_data.MissingInterfaceError, e: self.raptor.Error("No interface for '%s'", spec.name) return @@ -268,12 +304,12 @@ md5hash.update(value) # parameters required by the interface - for p in iface.GetParams(): + for p in iface.GetParams(self.raptor.cache): val = evaluator.Resolve(p.name) addparam(p.name,val,p.default) # Use Patterns to fetch a group of parameters - for g in iface.GetParamGroups(): + for g in iface.GetParamGroups(self.raptor.cache): for k,v in evaluator.ResolveMatching(g.patternre): addparam(k,v,g.default) @@ -301,7 +337,7 @@ # generate the call to the FLM if iface is not None: - makefileset.addCall(spec.name, config.name, iface.name, useAllInterfaces, iface.GetFLMIncludePath(), parameters, guard) + makefileset.addCall(spec.name, config.name, iface.name, useAllInterfaces, iface.GetFLMIncludePath(self.raptor.cache), parameters, guard) # recursive includes @@ -341,7 +377,7 @@ return False # Save file names to a list, to allow the order to be reversed - fileName_list = list(self.makefileset.makefileNames()) + fileName_list = list(makefileset.makefileNames()) # Iterate through args passed to raptor, searching for CLEAN or REALLYCLEAN clean_flag = False @@ -354,6 +390,9 @@ if clean_flag: fileName_list.reverse() + # Report number of makefiles to be built + self.raptor.InfoDiscovery(object_type = "makefile", count = len(fileName_list)) + # Process each file in turn for makefile in fileName_list: if not os.path.exists(makefile): @@ -401,7 +440,7 @@ # targets go at the end, if the makefile supports them addTargets = self.raptor.targets[:] - ignoreTargets = self.makefileset.ignoreTargets(makefile) + ignoreTargets = makefileset.ignoreTargets(makefile) if addTargets and ignoreTargets: for target in self.raptor.targets: if re.match(ignoreTargets, target): @@ -410,6 +449,9 @@ if addTargets: command += " " + " ".join(addTargets) + # Substitute the makefile name for any occurrence of #MAKEFILE# + command = command.replace("#MAKEFILE#", str(makefile)) + self.raptor.Info("Executing '%s'", command) # execute the build. @@ -417,6 +459,10 @@ # bufsize=1 means "line buffered" # try: + # Time the build + self.raptor.InfoStartTime(object_type = "makefile", + task = "build", key = str(makefile)) + makeenv=os.environ.copy() if self.usetalon: makeenv['TALON_RECIPEATTRIBUTES']="none" @@ -444,6 +490,9 @@ # should be done now returncode = p.wait() + # Report end-time of the build + self.raptor.InfoEndTime(object_type = "makefile", + task = "build", key = str(makefile)) if returncode != 0 and not self.raptor.keepGoing: self.Tidy() @@ -452,6 +501,9 @@ except Exception,e: self.raptor.Error("Exception '%s' during '%s'", str(e), command) self.Tidy() + # Still report end-time of the build + self.raptor.InfoEnd(object_type = "Building", task = "Makefile", + key = str(makefile)) return False # run any shutdown script @@ -496,7 +548,7 @@ looking = (os.system(command) != 0) tries += 1 if looking: - self.raptor.Error("Failed to initilaise the talon shell for this build") + self.raptor.Error("Failed to initialise the talon shell for this build") self.talonctl = "" return False diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_makefile.py --- a/sbsv2/raptor/python/raptor_makefile.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/raptor_makefile.py Mon Dec 07 11:41:13 2009 +0000 @@ -134,6 +134,15 @@ return True + def addInclude(self, makefilename): + """ + """ + # create the directory if it does not exist + + self.open() + # now we can write the values into the makefile + self.file.write("include %s\n" % (makefilename+"."+self.selector.name)) + def close(self): if self.file is not None: if self.epilogue != None: @@ -191,6 +200,11 @@ for f in self.makefiles: f.addCall(specname, configname, ifname, useAllInterfaces, flmpath, parameters, guard) + def addInclude(self, makefilename): + """include a makefile from each of the makefiles in the set - has the selector name appended to it.""" + for f in self.makefiles: + f.addInclude(makefilename) + def makefileNames(self): for mf in self.makefiles: yield str(mf.filename) diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_meta.py --- a/sbsv2/raptor/python/raptor_meta.py Mon Nov 16 09:46:46 2009 +0000 +++ b/sbsv2/raptor/python/raptor_meta.py Mon Dec 07 11:41:13 2009 +0000 @@ -232,6 +232,19 @@ return commentDetail +def getSpecName(aFileRoot, fullPath=False): + """Returns a build spec name: this is the file root (full path + or simple file name) made safe for use as a file name.""" + + if fullPath: + specName = str(aFileRoot).replace("/","_") + specName = specName.replace(":","") + else: + specName = aFileRoot.File() + + return specName.lower() + + # Classes class MetaDataError(Exception): @@ -284,9 +297,8 @@ def call(self, aArgs, sourcefilename): """ Override call so that we can do our own error handling.""" tool = self._ExternalTool__Tool + commandline = tool + " " + aArgs + " " + str(sourcefilename) try: - commandline = tool + " " + aArgs + " " + str(sourcefilename) - # the actual call differs between Windows and Unix if raptor_utilities.getOSFileSystem() == "unix": p = subprocess.Popen(commandline, \ @@ -332,7 +344,7 @@ raise MetaDataError("Errors in %s" % str(sourcefilename)) except Exception,e: - raise MetaDataError("Preprocessor exception: %s" % str(e)) + raise MetaDataError("Preprocessor exception: '%s' : in command : '%s'" % (str(e), commandline)) return 0 # all OK @@ -398,11 +410,13 @@ on the selected build platform. This class provides a generic means of wrapping up the preprocessing of such files.""" - def __init__(self, aFilename, gnucpp, aRootLocation=None, log=None): + def __init__(self, aFilename, gnucpp, depfiles, aRootLocation=None, log=None): """ @param aFilename An MMP, bld.inf or other preprocessable build spec file @param aDefaultPlatform Default preprocessed version of this file @param aCPP location of GNU CPP + @param depfiles list to add dependency file tuples to + @param aRootLocation where the file is @param log A class with Debug(), Info() and Error() methods """ self.filename = aFilename @@ -410,6 +424,7 @@ # Dictionary with key of build platform and a text string of processed output as values self.__PreProcessedContent = {} self.log = log + self.depfiles = depfiles self.__gnucpp = gnucpp if gnucpp is None: @@ -436,7 +451,7 @@ else: metatarget = "'$(PARSETARGET)'" generateDepsOptions = "-MD -MF%s -MT%s" % (adepfilename, metatarget) - aBuildPlatform['METADEPS'].append((adepfilename, metatarget)) + self.depfiles.append((adepfilename, metatarget)) try: os.makedirs(os.path.dirname(adepfilename)) except Exception, e: @@ -515,15 +530,17 @@ on the selected build platform. This class provides a generic means of wrapping up the preprocessing of such files.""" - def __init__(self, aFilename, gnucpp, bldinf, log=None): + def __init__(self, aFilename, gnucpp, bldinf, depfiles, log=None): """ @param aFilename An MMP, bld.inf or other preprocessable build spec file @param gnucpp location of GNU CPP - @param bldinf the bldinf file that this mmp comes from - @param log A class with Debug(), Info() and Error() methods + @param bldinf the bld.inf file this mmp was specified in + @param depfiles list to fill with mmp dependency files + @param log A class with Debug(), Info() and Error() methods """ - super(MMPFile, self).__init__(aFilename, gnucpp, str(bldinf.filename.Dir()), log) + super(MMPFile, self).__init__(aFilename, gnucpp, depfiles, str(bldinf.filename.Dir()), log) self.__bldinf = bldinf + self.depfiles = depfiles self.__gnucpp = gnucpp if gnucpp is None: @@ -878,8 +895,8 @@ class BldInfFile(MetaDataFile): """Representation of a Symbian bld.inf file""" - def __init__(self, aFilename, gnucpp, log=None): - MetaDataFile.__init__(self, aFilename, gnucpp, None, log) + def __init__(self, aFilename, gnucpp, depfiles, log=None): + MetaDataFile.__init__(self, aFilename, gnucpp, depfiles, None, log) self.__Raptor = log self.testManual = 0 self.testAuto = 0 @@ -1194,7 +1211,9 @@ super(MMPRaptorBackend,self).__init__() self.platformblock = None self.__Raptor = aRaptor - self.BuildVariant = raptor_data.Variant() + self.__debug("-----+++++ %s " % aMmpfilename) + self.BuildVariant = raptor_data.Variant(name = "mmp") + self.ApplyVariants = [] self.ResourceVariants = [] self.BitmapVariants = [] self.StringTableVariants = [] @@ -1208,11 +1227,12 @@ self.__systeminclude = "" self.__bitmapSourcepath = self.__sourcepath self.__current_resource = "" - self.__capabilities = [] self.__resourceFiles = [] self.__pageConflict = [] self.__debuggable = "" + self.__compressionKeyword = "" self.sources = [] + self.capabilities = [] self.__TARGET = "" self.__TARGETEXT = "" @@ -1338,6 +1358,14 @@ elif varname == 'FEATUREVARIANT': self.BuildVariant.AddOperation(raptor_data.Set(varname,"1")) self.featureVariant = True + elif varname in ['COMPRESSTARGET', 'NOCOMPRESSTARGET', 'INFLATECOMPRESSTARGET', 'BYTEPAIRCOMPRESSTARGET']: + if self.__compressionKeyword: + self.__Raptor.Warn("%s keyword in %s overrides earlier use of %s" % (varname, self.__currentMmpFile, self.__compressionKeyword)) + self.BuildVariant.AddOperation(raptor_data.Set(self.__compressionKeyword,"")) + self.__debug( "Set switch " + varname + " OFF") + self.BuildVariant.AddOperation(raptor_data.Set(varname,"1")) + self.__debug( "Set switch " + varname + " ON") + self.__compressionKeyword = varname else: self.__debug( "Set switch "+toks[0]+" ON") self.BuildVariant.AddOperation(raptor_data.Set(prefix+varname, "1")) @@ -1423,9 +1451,8 @@ elif varname=='CAPABILITY': for cap in toks[1]: - self.BuildVariant.AddOperation(raptor_data.Append(varname,cap," ")) self.__debug("Setting "+toks[0]+": " + cap) - self.__capabilities.append(cap.lower()) + self.capabilities.append(cap) elif varname=='DEFFILE': self.__defFileRoot = self.__currentMmpFile self.deffile = toks[1] @@ -1519,7 +1546,8 @@ toks1 = re.sub("[,'\[\]]", "", toks1).replace("//","/") self.__debug("Set "+toks[0]+" to " + toks1) self.BuildVariant.AddOperation(raptor_data.Set(varname,toks1)) - + elif varname=='APPLY': + self.ApplyVariants.append(toks[1]) else: self.__debug("Set "+toks[0]+" to " + str(toks[1])) self.BuildVariant.AddOperation(raptor_data.Set(varname,"".join(toks[1]))) @@ -1767,7 +1795,7 @@ replace = "" if len(matches): replace = matches.pop() - + searchReplacePairs.append('%s<->%s' % (search, replace)) # Replace spaces to maintain word-based grouping in downstream makefile lists @@ -1886,7 +1914,7 @@ self.__currentLineNumber += 1 self.__debug("Start BITMAP "+toks[1]) - self.__currentBitmapVariant = raptor_data.Variant(toks[1].replace('.','_')) + self.__currentBitmapVariant = raptor_data.Variant(name = toks[1].replace('.','_')) # Use BMTARGET and BMTARGET_lower because that prevents # confusion with the TARGET and TARGET_lower of our parent MMP # when setting the OUTPUTPATH. This in turn allows us to @@ -1976,7 +2004,7 @@ self.__debug("stringtable: " + toks[1]) self.__debug("adjusted stringtable source=" + source) - self.__currentStringTableVariant = raptor_data.Variant(uniqname) + self.__currentStringTableVariant = raptor_data.Variant(name = uniqname) self.__currentStringTableVariant.AddOperation(raptor_data.Set("SOURCE", source)) self.__currentStringTableVariant.AddOperation(raptor_data.Set("EXPORTPATH", "")) self.__stringtableExported = False @@ -2169,11 +2197,14 @@ self.ResourceVariants[i].AddOperation(raptor_data.Set("MAIN_TARGET_lower", self.__TARGET.lower())) self.ResourceVariants[i].AddOperation(raptor_data.Set("MAIN_REQUESTEDTARGETEXT", self.__TARGETEXT.lower())) + # Create Capability variable in one SET operation (more efficient than multiple appends) + self.BuildVariant.AddOperation(raptor_data.Set("CAPABILITY"," ".join(self.capabilities))) + # Resolve combined capabilities as hex flags, for configurations that require them capabilityFlag1 = 0 capabilityFlag2 = 0 # Always 0 - for capability in self.__capabilities: + for capability in [c.lower() for c in self.capabilities]: invert = 0 if capability.startswith('-'): @@ -2285,6 +2316,32 @@ return resolvedDefFile +def CheckedGet(self, key, default = None): + """extract a value from an self and raise an exception if None. + + An optional default can be set to replace a None value. + + This function belongs in the Evaluator class logically. But + Evaluator doesn't know how to raise a Metadata error. Since + being able to raise a metadata error is the whole point of + the method, it makes sense to adapt the Evaluator class from + raptor_meta for the use of everything inside raptor_meta. + + ... so it will be added to the Evaluator class. + """ + + value = self.Get(key) + if value == None: + if default == None: + raise MetaDataError("configuration " + self.buildUnit.name + + " has no variable " + key) + else: + return default + return value + +raptor_data.Evaluator.CheckedGet = CheckedGet + + class MetaReader(object): """Entry point class for Symbian metadata processing. @@ -2301,10 +2358,10 @@ # Get the version of CPP that we are using metadata = self.__Raptor.cache.FindNamedVariant("meta") evaluator = self.__Raptor.GetEvaluator(None, raptor_data.BuildUnit(metadata.name, [metadata]) ) - self.__gnucpp = self.CheckValue(evaluator, "GNUCPP") - self.__defaultplatforms = self.CheckValue(evaluator, "DEFAULT_PLATFORMS") - self.__basedefaultplatforms = self.CheckValue(evaluator, "BASE_DEFAULT_PLATFORMS") - self.__baseuserdefaultplatforms = self.CheckValue(evaluator, "BASE_USER_DEFAULT_PLATFORMS") + self.__gnucpp = evaluator.CheckedGet("GNUCPP") + self.__defaultplatforms = evaluator.CheckedGet("DEFAULT_PLATFORMS") + self.__basedefaultplatforms = evaluator.CheckedGet("BASE_DEFAULT_PLATFORMS") + self.__baseuserdefaultplatforms = evaluator.CheckedGet("BASE_USER_DEFAULT_PLATFORMS") # Only read each variant.cfg once variantCfgs = {} @@ -2323,24 +2380,25 @@ # with the same "export platform". exports = {} + self.__Raptor.Debug("MetaReader: configsToBuild: %s", [b.name for b in configsToBuild]) for buildConfig in configsToBuild: # get everything we need to know about the configuration evaluator = self.__Raptor.GetEvaluator(None, buildConfig) detail = {} - detail['PLATFORM'] = self.CheckValue(evaluator, "TRADITIONAL_PLATFORM") - epocroot = self.CheckValue(evaluator, "EPOCROOT") + detail['PLATFORM'] = evaluator.CheckedGet("TRADITIONAL_PLATFORM") + epocroot = evaluator.CheckedGet("EPOCROOT") detail['EPOCROOT'] = generic_path.Path(epocroot) - sbs_build_dir = self.CheckValue(evaluator, "SBS_BUILD_DIR") + sbs_build_dir = evaluator.CheckedGet("SBS_BUILD_DIR") detail['SBS_BUILD_DIR'] = generic_path.Path(sbs_build_dir) - flm_export_dir = self.CheckValue(evaluator, "FLM_EXPORT_DIR") + flm_export_dir = evaluator.CheckedGet("FLM_EXPORT_DIR") detail['FLM_EXPORT_DIR'] = generic_path.Path(flm_export_dir) detail['CACHEID'] = flm_export_dir if raptor_utilities.getOSPlatform().startswith("win"): - detail['PLATMACROS'] = self.CheckValue(evaluator,"PLATMACROS.WINDOWS") + detail['PLATMACROS'] = evaluator.CheckedGet("PLATMACROS.WINDOWS") else: - detail['PLATMACROS'] = self.CheckValue(evaluator,"PLATMACROS.LINUX") + detail['PLATMACROS'] = evaluator.CheckedGet("PLATMACROS.LINUX") # Apply OS variant provided we are not ignoring this if not self.__Raptor.ignoreOsDetection: @@ -2352,11 +2410,11 @@ # is this a feature variant config or an ordinary variant fv = evaluator.Get("FEATUREVARIANTNAME") if fv: - variantHdr = self.CheckValue(evaluator, "VARIANT_HRH") + variantHdr = evaluator.CheckedGet("VARIANT_HRH") variantHRH = generic_path.Path(variantHdr) detail['ISFEATUREVARIANT'] = True else: - variantCfg = self.CheckValue(evaluator, "VARIANT_CFG") + variantCfg = evaluator.CheckedGet("VARIANT_CFG") variantCfg = generic_path.Path(variantCfg) if not variantCfg in variantCfgs: # get VARIANT_HRH from the variant.cfg file @@ -2371,19 +2429,18 @@ detail['VARIANT_HRH'] = variantHRH self.__Raptor.Info("'%s' uses variant hrh file '%s'", buildConfig.name, variantHRH) - detail['SYSTEMINCLUDE'] = self.CheckValue(evaluator, "SYSTEMINCLUDE") - - detail['METADEPS'] = [] # Dependency targets for all metadata files in this platform + detail['SYSTEMINCLUDE'] = evaluator.CheckedGet("SYSTEMINCLUDE") + # find all the interface names we need - ifaceTypes = self.CheckValue(evaluator, "INTERFACE_TYPES") + ifaceTypes = evaluator.CheckedGet("INTERFACE_TYPES") interfaces = ifaceTypes.split() for iface in interfaces: - detail[iface] = self.CheckValue(evaluator, "INTERFACE." + iface) + detail[iface] = evaluator.CheckedGet("INTERFACE." + iface) # not test code unless positively specified - detail['TESTCODE'] = self.CheckValue(evaluator, "TESTCODE", "") + detail['TESTCODE'] = evaluator.CheckedGet("TESTCODE", "") # make a key that identifies this platform uniquely # - used to tell us whether we have done the pre-processing @@ -2454,20 +2511,8 @@ # that are supposedly platform independent (e.g. PRJ_PLATFORMS) self.defaultPlatform = self.ExportPlatforms[0] - def CheckValue(self, evaluator, key, default = None): - """extract a value from an evaluator and raise an exception if None. - - An optional default can be set to replace a None value.""" - value = evaluator.Get(key) - if value == None: - if default == None: - raise MetaDataError("configuration " + evaluator.config.name + - " has no variable " + key) - else: - return default - return value - - def ReadBldInfFiles(self, aFileList, doExportOnly): + + def ReadBldInfFiles(self, aComponentList, doexport, dobuild = True): """Take a list of bld.inf files and return a list of build specs. The returned specification nodes will be suitable for all the build @@ -2477,7 +2522,7 @@ # we need a Filter node per export platform exportNodes = [] for i,ep in enumerate(self.ExportPlatforms): - filter = raptor_data.Filter("export_" + str(i)) + filter = raptor_data.Filter(name = "export_" + str(i)) # what configurations is this node active for? for config in ep['configs']: @@ -2488,7 +2533,7 @@ # we need a Filter node per build platform platformNodes = [] for i,bp in enumerate(self.BuildPlatforms): - filter = raptor_data.Filter("build_" + str(i)) + filter = raptor_data.Filter(name = "build_" + str(i)) # what configurations is this node active for? for config in bp['configs']: @@ -2504,18 +2549,18 @@ # check that each bld.inf exists and add a Specification node for it # to the nodes of the export and build platforms that it supports. - for bif in aFileList: - if bif.isFile(): - self.__Raptor.Info("Processing %s", str(bif)) + for c in aComponentList: + if c.bldinf_filename.isFile(): + self.__Raptor.Info("Processing %s", str(c.bldinf_filename)) try: - self.AddComponentNodes(bif, exportNodes, platformNodes) + self.AddComponentNodes(c, exportNodes, platformNodes) except MetaDataError, e: - self.__Raptor.Error(e.Text, bldinf=str(bif)) + self.__Raptor.Error(e.Text, bldinf=str(c.bldinf_filename)) if not self.__Raptor.keepGoing: return [] else: - self.__Raptor.Error("build info file does not exist", bldinf=str(bif)) + self.__Raptor.Error("build info file does not exist", bldinf=str(c.bldinf_filename)) if not self.__Raptor.keepGoing: return [] @@ -2547,20 +2592,23 @@ # before we can do anything else (because raptor itself must do # some exports before the MMP files that include them can be # processed). - for i,p in enumerate(exportNodes): - exportPlatform = self.ExportPlatforms[i] - for s in p.GetChildSpecs(): - try: - self.ProcessExports(s, exportPlatform) - - except MetaDataError, e: - self.__Raptor.Error("%s",e.Text) - if not self.__Raptor.keepGoing: - return [] + if doexport: + for i,p in enumerate(exportNodes): + exportPlatform = self.ExportPlatforms[i] + for s in p.GetChildSpecs(): + try: + self.ProcessExports(s, exportPlatform) + + except MetaDataError, e: + self.__Raptor.Error("%s",e.Text) + if not self.__Raptor.keepGoing: + return [] + else: + self.__Raptor.Info("Not Processing Exports (--noexport enabled)") # this is a switch to return the function at this point if export # only option is specified in the run - if (self.__Raptor.doExportOnly): + if dobuild is not True: self.__Raptor.Info("Processing Exports only") return[] @@ -2603,8 +2651,8 @@ def LeftPortionOf(pth,sep): """ Internal function to return portion of str that is to the left of sep. - The partition is case-insentive.""" - length = len((pth.lower().partition(sep.lower()))[0]) + The split is case-insensitive.""" + length = len((pth.lower().split(sep.lower()))[0]) return pth[0:length] modulePath = LeftPortionOf(LeftPortionOf(os.path.dirname(aBldInfPath), "group"), "ongoing") @@ -2617,74 +2665,78 @@ return moduleName - def AddComponentNodes(self, buildFile, exportNodes, platformNodes): + def AddComponentNodes(self, component, exportNodes, platformNodes): """Add Specification nodes for a bld.inf to the appropriate platforms.""" - bldInfFile = BldInfFile(buildFile, self.__gnucpp, self.__Raptor) - - specName = self.getSpecName(buildFile, fullPath=True) - - if isinstance(buildFile, raptor_xml.SystemModelComponent): + bldInfFile = BldInfFile(component.bldinf_filename, self.__gnucpp, component.depfiles, self.__Raptor) + component.bldinf = bldInfFile + + specName = getSpecName(component.bldinf_filename, fullPath=True) + + if isinstance(component.bldinf, raptor_xml.SystemModelComponent): # this component came from a system_definition.xml - layer = buildFile.GetContainerName("layer") - component = buildFile.GetContainerName("component") + layer = component.bldinf.GetContainerName("layer") + componentName = component.bldinf.GetContainerName("component") else: # this is a plain old bld.inf file from the command-line layer = "" - component = "" + componentName = "" # exports are independent of build platform for i,ep in enumerate(self.ExportPlatforms): - specNode = raptor_data.Specification(specName) + specNode = raptor_data.Specification(name = specName) # keep the BldInfFile object for later - specNode.bldinf = bldInfFile + specNode.component = component # add some basic data in a component-wide variant - var = raptor_data.Variant() - var.AddOperation(raptor_data.Set("COMPONENT_META", str(buildFile))) - var.AddOperation(raptor_data.Set("COMPONENT_NAME", component)) + var = raptor_data.Variant(name='component-wide') + var.AddOperation(raptor_data.Set("COMPONENT_META", str(component.bldinf_filename))) + var.AddOperation(raptor_data.Set("COMPONENT_NAME", componentName)) var.AddOperation(raptor_data.Set("COMPONENT_LAYER", layer)) specNode.AddVariant(var) # add this bld.inf Specification to the export platform exportNodes[i].AddChild(specNode) + component.exportspecs.append(specNode) # get the relevant build platforms listedPlatforms = bldInfFile.getBuildPlatforms(self.defaultPlatform) platforms = getBuildableBldInfBuildPlatforms(listedPlatforms, - self.__defaultplatforms, - self.__basedefaultplatforms, - self.__baseuserdefaultplatforms) - - - - outputDir = BldInfFile.outputPathFragment(buildFile) + self.__defaultplatforms, + self.__basedefaultplatforms, + self.__baseuserdefaultplatforms) + + + outputDir = BldInfFile.outputPathFragment(component.bldinf_filename) # Calculate "module name" - modulename = self.ModuleName(str(buildFile)) + modulename = self.ModuleName(str(component.bldinf_filename)) for i,bp in enumerate(self.BuildPlatforms): + plat = bp['PLATFORM'] if bp['PLATFORM'] in platforms: - specNode = raptor_data.Specification(specName) - - # keep the BldInfFile object for later - specNode.bldinf = bldInfFile + specNode = raptor_data.Specification(name = specName) + + # remember what component this spec node comes from for later + specNode.component = component # add some basic data in a component-wide variant - var = raptor_data.Variant() - var.AddOperation(raptor_data.Set("COMPONENT_META",str(buildFile))) - var.AddOperation(raptor_data.Set("COMPONENT_NAME", component)) + var = raptor_data.Variant(name='component-wide-settings-' + plat) + var.AddOperation(raptor_data.Set("COMPONENT_META",str(component.bldinf_filename))) + var.AddOperation(raptor_data.Set("COMPONENT_NAME", componentName)) var.AddOperation(raptor_data.Set("COMPONENT_LAYER", layer)) var.AddOperation(raptor_data.Set("MODULE", modulename)) var.AddOperation(raptor_data.Append("OUTPUTPATHOFFSET", outputDir, '/')) var.AddOperation(raptor_data.Append("OUTPUTPATH", outputDir, '/')) var.AddOperation(raptor_data.Append("BLDINF_OUTPUTPATH",outputDir, '/')) - var.AddOperation(raptor_data.Set("TEST_OPTION", specNode.bldinf.getRomTestType(bp))) + var.AddOperation(raptor_data.Set("TEST_OPTION", component.bldinf.getRomTestType(bp))) specNode.AddVariant(var) # add this bld.inf Specification to the build platform platformNodes[i].AddChild(specNode) + # also attach it into the component + component.specs.append(specNode) def ProcessExports(self, componentNode, exportPlatform): """Do the exports for a given platform and skeleton bld.inf node. @@ -2696,18 +2748,18 @@ [some MMP files #include exported .mmh files] """ if exportPlatform["TESTCODE"]: - exports = componentNode.bldinf.getTestExports(exportPlatform) + exports = componentNode.component.bldinf.getTestExports(exportPlatform) else: - exports = componentNode.bldinf.getExports(exportPlatform) + exports = componentNode.component.bldinf.getExports(exportPlatform) self.__Raptor.Debug("%i exports for %s", - len(exports), str(componentNode.bldinf.filename)) + len(exports), str(componentNode.component.bldinf.filename)) if exports: # each export is either a 'copy' or 'unzip' # maybe we should trap multiple exports to the same location here? epocroot = str(exportPlatform["EPOCROOT"]) - bldinf_filename = str(componentNode.bldinf.filename) + bldinf_filename = str(componentNode.component.bldinf.filename) exportwhatlog="\n" % bldinf_filename for export in exports: expSrc = export.getSource() @@ -2730,7 +2782,6 @@ # export the file exportwhatlog += self.CopyExport(fromFile, toFile, bldinf_filename) else: - # unzip the zip exportwhatlog += ("\n") members = self.UnzipExport(fromFile, toFile, str(exportPlatform['SBS_BUILD_DIR']), @@ -2878,6 +2929,11 @@ expfile = open(expfilename, 'wb') expfile.write(exportzip.read(file)) expfile.close() + + # Resurrect any file execution permissions present in the archived version + if (exportzip.getinfo(file).external_attr >> 16L) & 0100: + os.chmod(expfilename, stat.S_IMODE(os.stat(expfilename).st_mode) | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) + # Each file keeps its modified time the same as what it was before unzipping accesstime = time.time() datetime = exportzip.getinfo(file).date_time @@ -2917,12 +2973,12 @@ return # feature variation does not run extensions at all if buildPlatform["TESTCODE"]: - extensions = componentNode.bldinf.getTestExtensions(buildPlatform) + extensions = componentNode.component.bldinf.getTestExtensions(buildPlatform) else: - extensions = componentNode.bldinf.getExtensions(buildPlatform) + extensions = componentNode.component.bldinf.getExtensions(buildPlatform) self.__Raptor.Debug("%i template extension makefiles for %s", - len(extensions), str(componentNode.bldinf.filename)) + len(extensions), str(componentNode.component.bldinf.filename)) for i,extension in enumerate(extensions): if self.__Raptor.projects: @@ -3001,14 +3057,20 @@ gnuList = [] makefileList = [] + + component = componentNode.component + + if buildPlatform["TESTCODE"]: - MMPList = componentNode.bldinf.getTestMMPList(buildPlatform) + MMPList = component.bldinf.getTestMMPList(buildPlatform) else: - MMPList = componentNode.bldinf.getMMPList(buildPlatform) - - bldInfFile = componentNode.bldinf.filename + MMPList = component.bldinf.getMMPList(buildPlatform) + + bldInfFile = component.bldinf.filename for mmpFileEntry in MMPList['mmpFileList']: + component.AddMMP(mmpFileEntry.filename) # Tell the component another mmp is specified (for this platform) + projectname = mmpFileEntry.filename.File().lower() if self.__Raptor.projects: @@ -3026,7 +3088,8 @@ mmpFile = MMPFile(foundmmpfile, self.__gnucpp, - bldinf = componentNode.bldinf, + component.bldinf, + component.depfiles, log = self.__Raptor) mmpFilename = mmpFile.filename @@ -3060,7 +3123,7 @@ continue # now build the specification tree - mmpSpec = raptor_data.Specification(self.getSpecName(mmpFilename)) + mmpSpec = raptor_data.Specification(generic_path.Path(getSpecName(mmpFilename))) var = backend.BuildVariant var.AddOperation(raptor_data.Set("PROJECT_META", str(mmpFilename))) @@ -3096,7 +3159,7 @@ # Although not part of the MMP, some MMP-based build specs additionally require knowledge of their # container bld.inf exported headers - for export in componentNode.bldinf.getExports(buildPlatform): + for export in componentNode.component.bldinf.getExports(buildPlatform): destination = export.getDestination() if isinstance(destination, list): exportfile = str(destination[0]) @@ -3109,6 +3172,16 @@ # now we have something worth adding to the component mmpSpec.AddVariant(var) componentNode.AddChild(mmpSpec) + + # if there are APPLY variants then add them to the mmpSpec too + for applyVar in backend.ApplyVariants: + try: + mmpSpec.AddVariant(self.__Raptor.cache.FindNamedVariant(applyVar)) + except KeyError: + self.__Raptor.Error("APPLY unknown variant '%s' in %s", + applyVar, + str(mmpFileEntry.filename), + bldinf=str(bldInfFile)) # resources, stringtables and bitmaps are sub-nodes of this project # (do not add these for feature variant builds) @@ -3152,7 +3225,7 @@ self.projectList.remove(projectname) self.__Raptor.Debug("%i gnumakefile extension makefiles for %s", - len(gnuList), str(componentNode.bldinf.filename)) + len(gnuList), str(componentNode.component.bldinf.filename)) var = raptor_data.Variant() gnuSpec = raptor_data.Specification("gnumakefile " + str(g.getMakefileName())) interface = buildPlatform["ext_makefile"] @@ -3184,7 +3257,7 @@ projectList.remove(projectname) self.__Raptor.Debug("%i makefile extension makefiles for %s", - len(makefileList), str(componentNode.bldinf.filename)) + len(makefileList), str(componentNode.component.bldinf.filename)) var = raptor_data.Variant() gnuSpec = raptor_data.Specification("makefile " + str(m.getMakefileName())) interface = buildPlatform["ext_makefile"] @@ -3205,17 +3278,6 @@ gnuSpec.AddVariant(var) componentNode.AddChild(gnuSpec) - def getSpecName(self, aFileRoot, fullPath=False): - """Returns a build spec name: this is the file root (full path - or simple file name) made safe for use as a file name.""" - - if fullPath: - specName = str(aFileRoot).replace("/","_") - specName = specName.replace(":","") - else: - specName = aFileRoot.File() - - return specName.lower() def ApplyOSVariant(self, aBuildUnit, aEpocroot): # Form path to kif.xml and path to buildinfo.txt diff -r e1eecf4d390d -r 8a1eeb1a78cb sbsv2/raptor/python/raptor_timing.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbsv2/raptor/python/raptor_timing.py Mon Dec 07 11:41:13 2009 +0000 @@ -0,0 +1,168 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# timings API +# This API can be used to start and stop timings in order to measure performance +# +import time + +class Timing(object): + + @classmethod + def discovery_string(cls, object_type, count): + """ + Returns a tag that can be used to show what is about to be + "processed" + Parameters: + object_type - string + Type of object that is about to be "processed" in this task + count - int + Number of objects of input "object_type" are about to be + "processed" + Returns: + string + XML tag in the format that can be printed directly to a + Raptor log + """ + return "\n" + + + @classmethod + def start_string(cls, object_type, task, key): + """ + Returns a tag that can be used to show what is being "processed" + and the time it started + Parameters: + object_type - string + Type of object that is being "processed" in this task + task - string + What is being done with the object being "processed" + key - string + Unique identifier for the object being "processed" + Returns: + string + XML tag in the format that can be printed directly to a + Raptor log + """ + return "\n" + + + @classmethod + def end_string(cls, object_type, task, key): + """ + Returns a tag that can be used to show what was being "processed" + and the time it finished + Parameters: + object_type - string + Type of object that was being "processed" in this task + task - string + What was being done with the object being "processed" + key - string + Unique identifier for the object that was "processed" + Returns: + string + XML tag in the format that can be printed directly to a + Raptor log + """ + return "\n" + + + @classmethod + def custom_string(cls, tag = "duration", object_type = "all", task = "all", + key = "all", time = 0.0): + """ + Returns a custom tag in the 'progress' tag format + + Parameters: + tag - string + String to be used for the tag + object_type - string + Type of object that was being "processed" in this task + task - string + What was being done with the object being "processed" + key - string + Unique identifier for the object that was "processed" + time - float + The time to be included in the tag + Returns: + string + XML tag in the format that can be printed directly to a + Raptor log + """ + time_string = "time" + if tag == "duration": + time_string = "duration" + return "\n" + + + @classmethod + def extract_values(cls, source): + """ + Takes, as input, a single tag of the format returned by one of the + above progress functions. Will extract the attributes and + return them as a dictionary. Returns an empty dictionary {} + if the tag name is not recognised or there is a parse error + Parameters: + source - string + The input string from which extracted attributes are + required + Returns: + dictionary + Dictionary containing the attributes extracted from the + input string. Returns an empty dictionary {} if the + tag name is not recognised or there is a parse error + NB: This function will not work correctly if the 'source' variable + contains multiple tags + """ + import re + + attributes = {} + + try: + match = re.match(re.compile(".*object_type='(?P.*?)'"), + source) + attributes["object_type"] = match.group("object_type") + except AttributeError, e: + print e + attributes["object_type"] = "" + try: + match = re.match(re.compile(".*task='(?P.*?)'"), source) + attributes["task"] = match.group("task") + except AttributeError, e: + print e + attributes["task"] = "" + try: + match = re.match(re.compile(".*key='(?P.*?)'"), source) + attributes["key"] = match.group("key") + except AttributeError: + attributes["key"] = "" + try: + match = re.match(re.compile(".*time='(?P