Bug 545085 - Allow MozMill (and the app version) to work with relative topsrcdirs. r=Standard8
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Thu, 04 Mar 2010 19:50:46 +0530
changeset 5072 a982d92e7565e0c16166d206a6046c48aaa2bef5
parent 5071 81f63cd13545810fa019364a9753ae2b65d48979
child 5073 7e4acb72afe43277869e67c47f99468f82fb327f
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs545085
Bug 545085 - Allow MozMill (and the app version) to work with relative topsrcdirs. r=Standard8
calendar/installer/Makefile.in
calendar/lightning/Makefile.in
config/autoconf.mk.in
config/config.mk
config/rules.mk
configure.in
mail/base/Makefile.in
mail/build.mk
mail/installer/Makefile.in
mail/jquery/Makefile.in
mail/locales/Makefile.in
suite/installer/Makefile.in
suite/locales/Makefile.in
--- a/calendar/installer/Makefile.in
+++ b/calendar/installer/Makefile.in
@@ -92,21 +92,16 @@ MOZ_PKG_MANIFEST = packages-static
 endif
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 MOZ_PKG_MAC_DSSTORE=branding/dsstore
 MOZ_PKG_MAC_BACKGROUND=branding/background.png
 MOZ_PKG_MAC_ICON=branding/disk.icns
 endif
 
-
-# On mozilla-central, packager.mk uses core_abspath to redefine DIST
-# As the comm-central config.mk doesn't set it, do it ourselves instead
-core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
-
 include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
 
 ifeq (WINNT,$(OS_ARCH))
 PKGCOMP_FIND_OPTS = 
 else
 PKGCOMP_FIND_OPTS = -L
 endif
 
--- a/calendar/lightning/Makefile.in
+++ b/calendar/lightning/Makefile.in
@@ -91,18 +91,16 @@ DIRS = ../libical \
        ../base \
        ../providers \
        ../import-export \
        ../itip \
        components \
        locales \
        $(NULL)
 
-PWD := $(shell pwd)
-
 # Select a theme from which to pull our skin goodness
 # OS X: pinstripe
 # Others: winstripe
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 THEME=pinstripe
 else
 THEME=winstripe
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -49,17 +49,16 @@ MOZILLA_1_9_2_BRANCH = @MOZILLA_1_9_2_BR
 THUNDERBIRD_VERSION	= @THUNDERBIRD_VERSION@
 SUNBIRD_VERSION = @SUNBIRD_VERSION@
 SEAMONKEY_VERSION	= @SEAMONKEY_VERSION@
 
 MOZ_BUILD_APP = @MOZ_BUILD_APP@
 MOZ_APP_NAME	= @MOZ_APP_NAME@
 MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
 MOZ_APP_VERSION = @MOZ_APP_VERSION@
-MOZ_APP_VERSION_TXT = @MOZ_APP_VERSION_TXT@
 
 MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
 
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
 includedir	= @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 libdir		= @libdir@
--- a/config/config.mk
+++ b/config/config.mk
@@ -76,16 +76,18 @@ CHECK_VARS := \
  $(NULL)
 
 # checks for internal spaces or trailing spaces in the variable
 # named by $x
 check-variable = $(if $(filter-out 0 1,$(words $($(x))z)),$(error Spaces are not allowed in $(x)))
 
 $(foreach x,$(CHECK_VARS),$(check-variable))
 
+core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
+
 # FINAL_TARGET specifies the location into which we copy end-user-shipped
 # build products (typelibs, components, chrome).
 #
 # It will usually be the well-loved $(DIST)/bin, today, but can also be an
 # XPI-contents staging directory for ambitious and right-thinking extensions.
 FINAL_TARGET = $(if $(XPI_NAME),$(DIST)/xpi-stage/$(XPI_NAME),$(DIST)/bin)
 
 # MAKE_JARS_TARGET is a staging area for make-jars.pl.  When packaging in
@@ -749,17 +751,17 @@ endif
 ######################################################################
 
 GARBAGE		+= $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildcard core.[0-9]*) $(wildcard *.err) $(wildcard *.pure) $(wildcard *_pure_*.o) Templates.DB
 
 ifeq ($(OS_ARCH),Darwin)
 ifndef NSDISTMODE
 NSDISTMODE=absolute_symlink
 endif
-PWD := $(shell pwd)
+PWD := $(CURDIR)
 endif
 
 ifdef NSINSTALL_BIN
 NSINSTALL	= $(CYGWIN_WRAPPER) $(NSINSTALL_BIN)
 else
 ifeq (OS2,$(CROSS_COMPILE)$(OS_ARCH))
 NSINSTALL	= $(MOZ_TOOLS_DIR)/nsinstall
 else
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -71,17 +71,17 @@ endif
 
 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
 ifndef GNU_CC
 _LIBNAME_RELATIVE_PATHS=1
 endif
 endif
 
 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
-PWD := $(shell pwd)
+PWD := $(CURDIR)
 _VPATH_SRCS = $(if $(filter /%,$<),$<,$(PWD)/$<)
 else
 _VPATH_SRCS = $<
 endif
 
 # Add $(DIST)/lib to VPATH so that -lfoo dependencies are followed
 VPATH += $(DIST)/lib
 ifdef LIBXUL_SDK
--- a/configure.in
+++ b/configure.in
@@ -7056,17 +7056,16 @@ AC_SUBST(MOZ_OS2_USE_DECLSPEC)
 
 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
 AC_SUBST(MOZ_TIMELINE)
 
 AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
 AC_SUBST(MOZ_APP_VERSION)
-AC_SUBST(MOZ_APP_VERSION_TXT)
 AC_SUBST(FIREFOX_VERSION)
 AC_SUBST(THUNDERBIRD_VERSION)
 AC_SUBST(SUNBIRD_VERSION)
 AC_SUBST(SEAMONKEY_VERSION)
 
 AC_SUBST(MOZ_PKG_SPECIAL)
 
 AC_SUBST(MAIL_PKG_SHARED)
--- a/mail/base/Makefile.in
+++ b/mail/base/Makefile.in
@@ -40,17 +40,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 DIRS = modules
 
 PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/mozilla/config/printprereleasesuffix.py \
-                      $(shell cat $(MOZ_APP_VERSION_TXT) ))
+                      $(MOZ_APP_VERSION))
 
 DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
            -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DOFFICIAL_BUILD=1
 endif
 
@@ -61,16 +61,16 @@ endif
 ifdef MOZ_UPDATER
 DEFINES += -DMOZ_UPDATER=1
 endif
 
 ifdef ENABLE_TESTS
 DIRS += test
 endif
 
-abs_srcdir = $(shell cd $(srcdir) && pwd)
+abs_srcdir = $(call core_abspath,$(srcdir))
 
 CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
 
 DEFINES += -DAPP_LICENSE_BLOCK=$(abs_srcdir)/content/overrides/app-license.html
 
 include $(topsrcdir)/config/rules.mk
 
--- a/mail/build.mk
+++ b/mail/build.mk
@@ -118,20 +118,20 @@ else
 # Non-mac options
 PROGRAM_LOCATION = ../../../$(DIST)/bin/
 PROGRAM = $(PROGRAM_LOCATION)thunderbird$(BIN_SUFFIX)
 endif
 
 mozmill::
 	cd $(MOZMILLDIR) && MACOSX_DEPLOYMENT_TARGET= $(PYTHON) \
 	runtestlist.py --list=mozmilltests.list --binary=$(PROGRAM) \
-	--dir=$(topsrcdir)/mail/test/mozmill \
+	--dir=$(call core_abspath,$(topsrcdir))/mail/test/mozmill \
 	--symbols-path=$(DIST)/crashreporter-symbols \
 	$(MOZMILL_EXTRA)
 
 mozmill-one::
 	cd $(MOZMILLDIR) && MACOSX_DEPLOYMENT_TARGET= $(PYTHON) runtest.py \
-	--test=$(topsrcdir)/mail/test/mozmill/$(SOLO_TEST) --binary=$(PROGRAM) \
-	--symbols-path=$(DIST)/crashreporter-symbols \
+	--test=$(call core_abspath,$(topsrcdir))/mail/test/mozmill/$(SOLO_TEST) \
+	--binary=$(PROGRAM) --symbols-path=$(DIST)/crashreporter-symbols \
 	$(MOZMILL_EXTRA)
 endif # ENABLE_TESTS
 
 endif # COMM_BUILD
--- a/mail/installer/Makefile.in
+++ b/mail/installer/Makefile.in
@@ -91,20 +91,16 @@ endif
 # package, install, or build an installer, build with --enable-static in your
 # mozconfig instead.
 ifndef MAIL_PKG_SHARED
 ifndef BUILD_STATIC_LIBS
 $(error you need an "--enable-static" build to package a build)
 endif
 endif
 
-# On mozilla-central, packager.mk uses core_abspath to redefine DIST
-# As the comm-central config.mk doesn't set it, do it ourselves instead
-core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
-
 include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
 
 ifeq (Darwin, $(OS_ARCH))
 BINPATH = $(_BINPATH)
 DEFINES += -DAPPNAME=$(_APPNAME)
 else
 BINPATH = bin
 endif
--- a/mail/jquery/Makefile.in
+++ b/mail/jquery/Makefile.in
@@ -40,17 +40,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 DIRS =
 
 include $(DEPTH)/config/autoconf.mk
 
 PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/mozilla/config/printprereleasesuffix.py \
-                      $(shell cat $(MOZ_APP_VERSION_TXT) ))
+                      $(MOZ_APP_VERSION))
 
 DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
            -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DOFFICIAL_BUILD=1
 endif
 
--- a/mail/locales/Makefile.in
+++ b/mail/locales/Makefile.in
@@ -56,20 +56,16 @@ SUBMAKEFILES += \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
 	$(NULL)
 
 # This makefile uses variable overrides from the libs-% target to
 # build non-default locales to non-default dist/ locations. Be aware!
 
 AB = $(firstword $(subst -, ,$(AB_CD)))
 
-# On mozilla-central, packager.mk uses core_abspath to redefine _ABS_DIST on Mac
-# As the comm-central config.mk doesn't set it, do it ourselves instead
-core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
-
 # These are defaulted to be compatible with the files the wget-en-US target
 # pulls. You may override them if you provide your own files. You _must_
 # override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
 # work in that case.
 ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
 WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 RETRIEVE_WINDOWS_INSTALLER = 1
 
--- a/suite/installer/Makefile.in
+++ b/suite/installer/Makefile.in
@@ -112,20 +112,16 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 MOZ_PKG_MAC_DSSTORE=branding/dsstore
 MOZ_PKG_MAC_BACKGROUND=branding/background.png
 MOZ_PKG_MAC_ICON=branding/disk.icns
 MOZ_PKG_MAC_EXTRA=--format UDBZ \
                   --symlink "/Applications: " \
                   --copy "$(call EXPAND_LOCALE_SRCDIR,suite/locales)/installer/mac/README.txt"
 endif
 
-# On mozilla-central, packager.mk uses core_abspath to redefine DIST
-# As the comm-central config.mk doesn't set it, do it ourselves instead
-core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
-
 include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
 
 ifeq (Darwin, $(OS_ARCH))
 BINPATH = $(_BINPATH)
 DEFINES += -DAPPNAME=$(_APPNAME)
 else
 BINPATH = bin
 endif
--- a/suite/locales/Makefile.in
+++ b/suite/locales/Makefile.in
@@ -49,18 +49,17 @@ vpath %.png @srcdir@/en-US/searchplugins
 vpath %.src $(LOCALE_SRCDIR)/searchplugins
 vpath %.png $(LOCALE_SRCDIR)/searchplugins
 
 run_for_effects := $(shell if ! test -d $(DIST); then $(NSINSTALL) -D $(DIST); fi; if ! test -d $(DIST)/branding; then $(NSINSTALL) -D $(DIST)/branding; fi)
 _ABS_DIST := $(shell cd $(DIST) && pwd)
 
 AB = $(firstword $(subst -, ,$(AB_CD)))
 
-PWD := $(shell pwd)
-core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
+PWD := $(CURDIR)
 
 # These are defaulted to be compatible with the files the wget-en-US target
 # pulls. You may override them if you provide your own files. You _must_
 # override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
 # work in that case.
 ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
 WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 RETRIEVE_WINDOWS_INSTALLER = 1