From 5d461fc2ac53adf24853b365cf14e972d7716bbd Mon Sep 17 00:00:00 2001 From: Norm Jacobs <Norm.Jacobs@Sun.COM> Date: Wed, 19 May 2010 07:08:03 +0200 Subject: [PATCH] Fix MACH32/MACH64 so more than one architecture can build in the same workspace --- make-rules/prep.mk | 5 +- make-rules/shared-macros.mk | 21 +++++++++- components/pycups/Makefile | 6 +-- make-rules/setup.py.mk | 8 ++-- components/lcms/Makefile | 6 +-- make-rules/configure.mk | 12 +++--- make-rules/ips.mk | 16 ++++--- components/file/Makefile | 6 +-- 8 files changed, 46 insertions(+), 34 deletions(-) diff --git a/components/file/Makefile b/components/file/Makefile index 98bd9a8..766f481 100644 --- a/components/file/Makefile +++ b/components/file/Makefile @@ -41,10 +41,8 @@ PKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/libtool-drop # common targets -build: $(COMPONENT_SRC)/build-32/.built \ - $(COMPONENT_SRC)/build-64/.built +build: $(BUILD_32_and_64) -install: $(COMPONENT_SRC)/build-32/.installed \ - $(COMPONENT_SRC)/build-64/.installed +install: $(INSTALL_32_and_64) BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) diff --git a/components/lcms/Makefile b/components/lcms/Makefile index ca17d00..1d5d6c0 100644 --- a/components/lcms/Makefile +++ b/components/lcms/Makefile @@ -44,10 +44,8 @@ COMPONENT_PREP_ACTION= $(RM) $(@D)/include/icc34.h # common targets -build: $(COMPONENT_SRC)/build-32/.built \ - $(COMPONENT_SRC)/build-64/.built +build: $(BUILD_32_and_64) -install: $(COMPONENT_SRC)/build-32/.installed \ - $(COMPONENT_SRC)/build-64/.installed +install: $(INSTALL_32_and_64) BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) diff --git a/components/pycups/Makefile b/components/pycups/Makefile index 6c2983d..e78604e 100644 --- a/components/pycups/Makefile +++ b/components/pycups/Makefile @@ -40,10 +40,8 @@ PYTHON_ENV += CFLAGS=-DVERSION=\\\"$(COMPONENT_VERSION)\\\" # common targets -build: $(COMPONENT_SRC)/build-32/.built \ - $(COMPONENT_SRC)/build-64/.built +build: $(BUILD_32_and_64) -install: $(COMPONENT_SRC)/build-32/.installed \ - $(COMPONENT_SRC)/build-64/.installed +install: $(INSTALL_32_and_64) BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) diff --git a/make-rules/configure.mk b/make-rules/configure.mk index ed22135..4c96271 100644 --- a/make-rules/configure.mk +++ b/make-rules/configure.mk @@ -31,11 +31,11 @@ # and define "build", "install" targets appropriate to building your component. # Ex: # -# build: $(COMPONENT_SRC)/build-32/.built \ -# $(COMPONENT_SRC)/build-64/.built +# build: $(COMPONENT_SRC)/build-$(MACH32)/.built \ +# $(COMPONENT_SRC)/build-$(MACH64)/.built # -# install: $(COMPONENT_SRC)/build-32/.installed \ -# $(COMPONENT_SRC)/build-64/.installed +# install: $(COMPONENT_SRC)/build-$(MACH32)/.installed \ +# $(COMPONENT_SRC)/build-$(MACH64)/.installed # # Any additional pre/post configure, build, or install actions can be specified # in your make file by setting them in on of the following macros: @@ -58,8 +58,8 @@ CONFIGURE_OPTIONS.64 = --bindir=/usr/bin/$(MACH64) CONFIGURE_OPTIONS.64 += --libdir=/usr/lib/$(MACH64) -$(COMPONENT_SRC)/build-32/.configured: BITS=32 -$(COMPONENT_SRC)/build-64/.configured: BITS=64 +$(COMPONENT_SRC)/build-$(MACH32)/.configured: BITS=32 +$(COMPONENT_SRC)/build-$(MACH64)/.configured: BITS=64 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS)) diff --git a/make-rules/ips.mk b/make-rules/ips.mk index 13d645f..d1b1956 100644 --- a/make-rules/ips.mk +++ b/make-rules/ips.mk @@ -29,8 +29,8 @@ # and define an "install" target appropriate to building your component. # Ex: # -# install: $(COMPONENT_SRC)/build-32/.installed \ -# $(COMPONENT_SRC)/build-64/.installed +# install: $(COMPONENT_SRC)/build-$(MACH32)/.installed \ +# $(COMPONENT_SRC)/build-$(MACH64)/.installed # # This set of rules makes the "publish" target the default target for make(1) # @@ -45,6 +45,8 @@ PKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/devel PKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/docs +MANIFEST = manifest-$(MACH) + .DEFAULT: publish publish: $(COMPONENT_SRC)/.published @@ -54,10 +56,10 @@ $(PROTO_DIR)/$(COPYRIGHT_FILE): $(COMPONENT_COPYRIGHT) $(CP) $< $@ -$(COMPONENT_SRC)/manifest: install +$(COMPONENT_SRC)/$(MANIFEST): install pkgsend generate $(PROTO_DIR) >$@ -$(COMPONENT_SRC)/manifest.mog: $(COMPONENT_SRC)/manifest $(PROTO_DIR)/$(COPYRIGHT_FILE) +$(COMPONENT_SRC)/$(MANIFEST).mog: $(COMPONENT_SRC)/$(MANIFEST) $(PROTO_DIR)/$(COPYRIGHT_FILE) echo "set name=pkg.fmri value=pkg:/$(PUBLISHER)/$(COMPONENT_NAME)@$(COMPONENT_VERSION),$(BUILD_VERSION)" >$@ echo "set name=pkg.description value=\"$(COMPONENT_DESCRIPTION)\"" >>$@ echo "set name=pkg.name value=\"$(COMPONENT_DESCRIPTION)\"" >>$@ @@ -65,13 +67,13 @@ echo "license $(COPYRIGHT_FILE) license=$(COPYRIGHT_FILE)" >>$@ pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) $(PKGMOGRIFY_TRANSFORMS) $< >>$@ -$(COMPONENT_SRC)/manifest.fdeps: $(COMPONENT_SRC)/manifest.mog +$(COMPONENT_SRC)/$(MANIFEST).fdeps: $(COMPONENT_SRC)/$(MANIFEST).mog pkgdepend generate -m $< $(PROTO_DIR) >$@ -$(COMPONENT_SRC)/manifest.fdeps.res: $(COMPONENT_SRC)/manifest.fdeps +$(COMPONENT_SRC)/$(MANIFEST).fdeps.res: $(COMPONENT_SRC)/$(MANIFEST).fdeps pkgdepend resolve -m $< -$(COMPONENT_SRC)/.published: $(COMPONENT_SRC)/manifest.fdeps.res +$(COMPONENT_SRC)/.published: $(COMPONENT_SRC)/$(MANIFEST).fdeps.res pkgsend -s $(PKG_REPO) publish --fmri-in-manifest \ -d $(PROTO_DIR) $< $(TOUCH) $@ diff --git a/make-rules/prep.mk b/make-rules/prep.mk index 94669b4..e40dc4e 100644 --- a/make-rules/prep.mk +++ b/make-rules/prep.mk @@ -27,12 +27,11 @@ CLEAN_PATHS += $(COMPONENT_SRC) CLOBBER_PATHS += $(COMPONENT_ARCHIVE) -#PATCHES = $(shell ls *.patch) #find . -type f -name '*.patch' PATCHES = $(shell find . -type f -name '*.patch' | \ sed -e 's;^\./;;' | sort) -STAMPS = $(PATCHES:%=$(COMPONENT_SRC)/.patched.%) +STAMPS = $(PATCHES:%=$(COMPONENT_SRC)/.%ed) -$(COMPONENT_SRC)/.patched.%: % +$(COMPONENT_SRC)/.%ed: % $(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $< $(TOUCH) $@ diff --git a/make-rules/setup.py.mk b/make-rules/setup.py.mk index 084ce57..3ecbf8d 100644 --- a/make-rules/setup.py.mk +++ b/make-rules/setup.py.mk @@ -21,10 +21,10 @@ # Copyright (c) 2010, Oracle and/or it's affiliates. All rights reserved. # -$(COMPONENT_SRC)/build-32/.built: BITS=32 -$(COMPONENT_SRC)/build-64/.built: BITS=64 -$(COMPONENT_SRC)/build-32/.installed: BITS=32 -$(COMPONENT_SRC)/build-64/.installed: BITS=64 +$(COMPONENT_SRC)/build-$(MACH32)/.built: BITS=32 +$(COMPONENT_SRC)/build-$(MACH64)/.built: BITS=32 +$(COMPONENT_SRC)/build-$(MACH32)/.installed: BITS=32 +$(COMPONENT_SRC)/build-$(MACH64)/.installed: BITS=64 # build the configured source diff --git a/make-rules/shared-macros.mk b/make-rules/shared-macros.mk index 49aa437..00140cf 100644 --- a/make-rules/shared-macros.mk +++ b/make-rules/shared-macros.mk @@ -34,11 +34,28 @@ MAKE_RULES = $(WS_TOP)/components/make-rules PKG_REPO = file://$(WS_TOP)/repo -PROTO_DIR = $(shell pwd)/$(COMPONENT_SRC)/installed-prototype +PROTO_DIR = $(shell pwd)/$(COMPONENT_SRC)/installed-prototype-$(MACH) CONSTANT_TIME = LD_PRELOAD=$(TOOLS)/time.o -MACH64 = $(shell isainfo -k) +# set MACH from uname -p to either sparc or i386 +MACH = $(shell uname -p) + +# set MACH32 from MACH to either sparcv7 or i86 +MACH32_1 = $(MACH:sparc=sparcv7) +MACH32 = $(MACH32_1:i386=i86) + +# set MACH64 from MACH to either sparcv9 or amd64 +MACH64_1 = $(MACH:sparc=sparcv9) +MACH64 = $(MACH64_1:i386=amd64) + +BUILD_32 = $(COMPONENT_SRC)/build-$(MACH32)/.built +BUILD_64 = $(COMPONENT_SRC)/build-$(MACH64)/.built +BUILD_32_and_64 = $(BUILD_32) $(BUILD_64) + +INSTALL_32 = $(COMPONENT_SRC)/build-$(MACH32)/.installed +INSTALL_64 = $(COMPONENT_SRC)/build-$(MACH64)/.installed +INSTALL_32_and_64 = $(INSTALL_32) $(INSTALL_64) SPRO_ROOT = /opt/sunstudio12.1 GCC_ROOT = /usr/gnu -- Gitblit v1.9.3