Rework CryptoPrep.flm to make a proper fix for Bug 2121 RCL_3 PDK_3.0.h
authorWilliam Roberts <williamr@symbian.org>
Mon, 08 Mar 2010 17:28:28 +0000
branchRCL_3
changeset 13 77a4e6a1beb4
parent 12 7e4c4cbd8e5c
child 16 095c0a3c3064
child 21 656c47ca7d25
Rework CryptoPrep.flm to make a proper fix for Bug 2121
omadrm/drmengine/group/CryptoPrep.flm
omadrm/drmengine/group/DrmCrypto.mmp
--- a/omadrm/drmengine/group/CryptoPrep.flm	Tue Mar 02 16:43:46 2010 +0000
+++ b/omadrm/drmengine/group/CryptoPrep.flm	Mon Mar 08 17:28:28 2010 +0000
@@ -13,26 +13,39 @@
 # Description: DRM Crypto Library build configuration
 #
 
+ifeq ($(_CRYPTOPREP_FLM_),)
+# first instance of this FLM
+_CRYPTOPREP_FLM_:= 1
+
 TMPROOT:=$(subst \,/,$(EPOCROOT))
 EPOCROOT:=$(patsubst %/,%,$(TMPROOT))/
 
-CREATABLEPATH:=$(EXTENSION_ROOT)/../drmengine/drmcrypto/build
-CLEANTARGETS:=$(CREATABLEPATH)/cmlacrypto.cpp $(CREATABLEPATH)/omacrypto.cpp
+# NB: abspath doesn't like Windows drive letters
+CRYPTO_SOURCE_DRIVE:=$(firstword $(subst :, ,$(EXTENSION_ROOT)))
+ifeq ($(CRYPTO_SOURCE_DRIVE),$(EXTENSION_ROOT))
+CREATABLEPATH:=$(abspath $(EXTENSION_ROOT)/../drmengine/drmcrypto/build))
+else
+CRYPTO_ABSPATH:=$(abspath $(subst $(CRYPTO_SOURCE_DRIVE):,,$(EXTENSION_ROOT)/../drmengine/drmcrypto/build))
+CREATABLEPATH:=$(CRYPTO_SOURCE_DRIVE):$(CRYPTO_ABSPATH)
+endif
 
 crypto_files:=$(wildcard $(EXTENSION_ROOT)/../drmengine/drmcrypto/CMLA/*.cpp)
-
-BITMAP :: $(CREATABLEPATH)
+ifeq ($(crypto_files),)
+CMLA_CRYPTO_SOURCE:=$(CREATABLEPATH)/../stub/CmlaCryptoStub.cpp
+else
+CMLA_CRYPTO_SOURCE:=$(CREATABLEPATH)/../CMLA/CmlaCrypto.cpp
+endif
 
-ifeq ($(crypto_files),)
-	$(GNUCP) $(CREATABLEPATH)/../stub/CmlaCryptoStub.cpp $(CREATABLEPATH)/cmlacrypto.cpp
-else
-	$(GNUCP) $(CREATABLEPATH)/../CMLA/CmlaCrypto.cpp $(CREATABLEPATH)/cmlacrypto.cpp
-endif
-	$(GNUCP) $(CREATABLEPATH)/../src/OmaCrypto.cpp $(CREATABLEPATH)/omacrypto.cpp
+$(CREATABLEPATH)/cmlacrypto.cpp: $(CMLA_CRYPTO_SOURCE)
+	$(GNUCP) $< $@
 
 # Create dirs
 $(call makepath,$(CREATABLEPATH))
 
 ## Clean up
+CLEANTARGETS:=$(CREATABLEPATH)/cmlacrypto.cpp
 $(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS)))
 
+else
+# FLM already included - don't duplicate the targets
+endif
--- a/omadrm/drmengine/group/DrmCrypto.mmp	Tue Mar 02 16:43:46 2010 +0000
+++ b/omadrm/drmengine/group/DrmCrypto.mmp	Mon Mar 08 17:28:28 2010 +0000
@@ -39,14 +39,8 @@
 
 SOURCE          drmaescrypto.cpp
 
-#if 1
-#warning Workaround for Bug 2121
-SOURCEPATH      ../drmcrypto/stub
-SOURCE          CmlaCryptoStub.cpp
-#else
 SOURCEPATH      ../drmcrypto/build
 SOURCE          cmlacrypto.cpp
-#endif
 
 SOURCEPATH      ../drmcrypto/src
 SOURCE          OmaCrypto.cpp