components/python/python34/Makefile
branchs11-update
changeset 3789 137fdcb27c8e
parent 3786 fa9d2da4d216
child 3791 1504f7bde5fd
--- a/components/python/python34/Makefile	Mon Feb 02 19:25:18 2015 -0800
+++ b/components/python/python34/Makefile	Mon Feb 02 19:31:12 2015 -0800
@@ -122,6 +122,29 @@
 
 ASLR_MODE = $(ASLR_ENABLE)
 
+# Simplify the definitions of CC, CXX, CFLAGS and LDFLAGS so they hard-code
+# neither paths from our build systems nor Studio-specific options.
+COMPONENT_PRE_INSTALL_ACTION= \
+    (cd $(@D) ; \
+     $(GSED) -i -e 's/^CC=.*/CC=\t\tcc/' -e 's/^CXX=.*/CXX=\t\tCC/' \
+	-e 's/^CFLAGS=.*/CFLAGS=\t\t\$$\(BASECFLAGS) \$$\(OPT) \$$\(EXTRA_CFLAGS)/' \
+	-e 's|^LDFLAGS=.*|LDFLAGS=|' Makefile)
+
+# Because we stripped the Makefile above, we need to pass several things in the
+# environment, and use -e to tell gmake to pay attention to the environment.
+COMPONENT_INSTALL_ENV +=	CC="$(CC)"
+COMPONENT_INSTALL_ENV +=	CXX="$(CXX)"
+COMPONENT_INSTALL_ENV +=	CFLAGS="$(CFLAGS)"
+COMPONENT_INSTALL_ENV +=	LDFLAGS="$(LDFLAGS)"
+COMPONENT_INSTALL_ARGS +=	-e
+
+# Strip build machine paths from _sysconfigdata.py & config/Makefile.
+COMPONENT_POST_INSTALL_ACTION= \
+    (cd $(PROTOUSRLIBDIR)/python3.4 ; \
+     $(GSED) -i -e 's|$(SOURCE_DIR)|.|g' -e 's|$(COMPONENT_DIR)|..|g' \
+	-e 's|$(SPRO_VROOT)/bin/||g' lib-dynload/64/_sysconfigdata.py \
+	config-3.4m/Makefile)
+
 # common targets
 build:		$(BUILD_64)
 install:	$(INSTALL_64)