Bug 738404 - Makefile.in edits to use threadsafe mkdir (bug 680246) - r=ted

This commit is contained in:
Joey Armstrong 2012-04-03 16:08:16 -04:00
Родитель e77beefa7b
Коммит 15ddc7aed7
18 изменённых файлов: 128 добавлений и 118 удалений

Просмотреть файл

@ -127,10 +127,14 @@ else
APPFILES = MacOS
endif
libs repackage::
mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
libs-preqs = \
$(call mkdir_deps,$(DIST)/$(APP_NAME).app/Contents/MacOS) \
$(call mkdir_deps,$(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj) \
$(NULL)
.PHONY: repackage
libs repackage:: $(libs-preqs)
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
mkdir -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
sed -e "s/%MOZ_APP_VERSION%/$(MOZ_APP_VERSION)/" -e "s/%MOZ_APP_NAME%/$(MOZ_APP_NAME)/" -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%APP_BINARY%/$(APP_BINARY)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
@ -140,7 +144,7 @@ ifdef LIBXUL_SDK
cp $(LIBXUL_DIST)/bin/xulrunner$(BIN_SUFFIX) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(APP_BINARY)
rsync -a --exclude nsinstall --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
else
rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
endif
printf "APPLMOZB" > $(DIST)/$(APP_NAME).app/Contents/PkgInfo

Просмотреть файл

@ -35,10 +35,10 @@
#
# ***** END LICENSE BLOCK *****
DEPTH = ../..
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
@ -102,8 +102,11 @@ REDIST_FILES = \
endif
ifdef REDIST_FILES
libs::
mkdir -p $(FINAL_TARGET)
libs-preqs = \
$(call mkdir_deps,$(FINAL_TARGET)) \
$(NULL)
libs:: $(libs-preqs)
install --preserve-timestamps $(foreach f,$(REDIST_FILES),"$(WIN32_REDIST_DIR)"/$(f)) $(FINAL_TARGET)
endif

Просмотреть файл

@ -101,7 +101,6 @@ ifeq (,$(strip $(AUTOCONF)))
AUTOCONF=$(error Could not find autoconf 2.13)
endif
MKDIR := mkdir
SH := /bin/sh
PERL ?= perl
PYTHON ?= python
@ -181,6 +180,9 @@ OBJDIR_TARGETS = install export libs clean realclean distclean alldep maybe_clob
build::
$(MAKE) -f $(TOPSRCDIR)/client.mk $(if $(MOZ_PGO),profiledbuild,realbuild)
# Define mkdir
include $(TOPSRCDIR)/config/makefiles/makeutils.mk
include $(TOPSRCDIR)/config/makefiles/autotargets.mk
# Print out any options loaded from mozconfig.
all realbuild clean depend distclean export libs install realclean::
@ -316,11 +318,13 @@ endif
configure-files: $(CONFIGURES)
configure:: configure-files
ifdef MOZ_BUILD_PROJECTS
@if test ! -d $(MOZ_OBJDIR); then $(MKDIR) $(MOZ_OBJDIR); else true; fi
endif
@if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
configure-preqs = \
configure-files \
$(call mkdir_deps,$(OBJDIR)) \
$(if $(MOZ_BUILD_PROJECTS),$(call mkdir_deps,$(MOZ_OBJDIR))) \
$(NULL)
configure:: $(configure-preqs)
@echo cd $(OBJDIR);
@echo $(CONFIGURE) $(CONFIGURE_ARGS)
@cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \

Просмотреть файл

@ -1,8 +1,42 @@
# -*- Makefile -*-
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Robert Ginda <rginda@netscape.com>
# John Taylor <jtaylor@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ..
topsrcdir = @top_srcdir@
@ -84,8 +118,11 @@ else
endif
ifdef WRAP_SYSTEM_INCLUDES
export::
if test ! -d system_wrappers; then mkdir system_wrappers; fi
export-preqs = \
$(call mkdir_deps,system_wrappers) \
$(NULL)
export:: $(export-preqs)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \
-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
@ -157,11 +194,14 @@ PYUNITS := \
unit-writemozinfo.py \
$(NULL)
check::\
check-python-modules check-jar-mn\
check-makefiles\
check-preqs = \
check-python-modules \
check-jar-mn \
check-makefiles \
$(NULL)
check:: $(check-preqs)
check-python-modules::
@$(EXIT_ON_ERROR) \
for test in $(PYUNITS); do \

Просмотреть файл

@ -46,7 +46,7 @@
# Define an include-at-most-once flag
ifdef INCLUDED_CONFIG_MK
$(error Don't include config.mk twice!)
$(error Do not include config.mk twice!)
endif
INCLUDED_CONFIG_MK = 1

Просмотреть файл

@ -11,12 +11,14 @@
# *_DEPS - Make dependencies derived from a given macro.
###########################################################################
MKDIR ?= mkdir -p
TOUCH ?= touch
###########################################################################
# Threadsafe directory creation
# GENERATED_DIRS - Automated creation of these directories.
###########################################################################
mkdir_deps =$(foreach dir,$($(1)),$(dir)/.mkdir.done)
mkdir_deps =$(foreach dir,$(getargv),$(dir)/.mkdir.done)
ifneq (,$(GENERATED_DIRS))
tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
@ -33,5 +35,11 @@ endif
# config/rules.mk::all target is available by default
# Add $(AUTO_DEPS) as an explicit target dependency when needed.
#################################################################
AUTO_DEPS +=$(GENERATED_DIRS_DEPS)
# Complain loudly if deps have not loaded so getargv != $(NULL)
ifndef getargv
$(error config/makefiles/makeutil.mk has not been included)
endif

Просмотреть файл

@ -34,17 +34,3 @@ argv +=)
## $(call banner,ref) ; ref=foo bar tans
## getarglist() would be a more accurate name but is longer to type
getargv = $(if $(call isvar,$(1)),$($(1)),$(argv))
## http://www.gnu.org/software/make/manual/make.html#Call-Function
## Usage: o = $(call map,origin,o map $(MAKE))
map = $(foreach val,$(2),$(call $(1),$(val)))
# Usage: $(call checkIfEmpty,[error|warning] foo NULL bar)
checkIfEmpty =$(foreach var,$(wordlist 2,100,$(getargv)),$(if $(strip $($(var))),$(NOP),$(call $(1),Variable $(var) does not contain a value)))
# Usage: $(call errorIfEmpty,foo NULL bar)
errorIfEmpty =$(call checkIfEmpty,error $(getargv))
warnIfEmpty =$(call checkIfEmpty,warning $(getargv))

Просмотреть файл

@ -36,14 +36,6 @@ $(info =========================================================================
$(info Running test: $(MAKECMDGOALS): pwd=$(CURDIR))
$(info ===========================================================================)
ifdef VERBOSE
$(info )
$(info ===========================================================================)
$(info Running test: istype, getargv)
$(info ===========================================================================)
endif
## Silent errors are oh so much fun
ifndef istype
$(error makeutils.mk was not included)
@ -98,32 +90,6 @@ ifneq (arg_list,$(call getargv,arg_ref))
$(error getargv(arg_ref)=list, found [$(call getargv,arg_ref)])
endif
ifdef MANUAL_TEST
# For automated testing a callback is needed that can set an external status
# variable that can be tested. Syntax is tricky to get correct functionality.
ifdef VERBOSE
$(info )
$(info ===========================================================================)
$(info Running test: checkIfEmpty)
$(info ===========================================================================)
endif
#status =
#setTRUE =status=true
#setFALSE =status=$(NULL)
#$(call checkIfEmpty,setFALSE NULL)
#$(if $(status),$(error checkIfEmpty(xyz) failed))
#$(call checkIfEmpty,setTRUE xyz)
#$(if $(status),$(error checkIfEmpty(xyz) failed))
xyz=abc
$(info STATUS: warnIfEmpty - two vars)
$(call warnIfEmpty,foo xyz bar)
$(info STATUS: errorIfEmpty - on first var)
$(call errorIfEmpty,foo xyz bar)
$(error TEST FAILED: processing should not reach this point)
endif
endif # check in MAKECMDGOALS

Просмотреть файл

@ -22,6 +22,9 @@ ifndef INCLUDED_VERSION_MK
include $(topsrcdir)/config/version.mk
endif
include $(topsrcdir)/config/makefiles/makeutils.mk
include $(topsrcdir)/config/makefiles/autotargets.mk
ifdef SDK_XPIDLSRCS
XPIDLSRCS += $(SDK_XPIDLSRCS)
endif
@ -477,8 +480,8 @@ endif
# A Makefile that needs $(MDDEPDIR) created but doesn't set any of these
# variables we know to check can just set NEED_MDDEPDIR explicitly.
ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS)$(NEED_MDDEPDIR))
MAKE_DIRS += $(CURDIR)/$(MDDEPDIR)
GARBAGE_DIRS += $(MDDEPDIR)
MAKE_DIRS += $(CURDIR)/$(MDDEPDIR)
GARBAGE_DIRS += $(CURDIR)/$(MDDEPDIR)
endif
#
@ -1426,12 +1429,6 @@ endif
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
# warn against overriding existing .h file.
$(XPIDL_GEN_DIR)/.done:
$(MKDIR) -p $(XPIDL_GEN_DIR)
@$(TOUCH) $@
# don't depend on $(XPIDL_GEN_DIR), because the modification date changes
# with any addition to the directory, regenerating all .h files -> everything.
XPIDL_DEPS = \
$(topsrcdir)/xpcom/idl-parser/header.py \
@ -1439,7 +1436,12 @@ XPIDL_DEPS = \
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
$(NULL)
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
xpidl-preqs = \
$(call mkdir_deps,$(XPIDL_GEN_DIR)) \
$(call mkdir_deps,$(MDDEPDIR)) \
$(NULL)
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
@ -1451,7 +1453,7 @@ $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
ifndef NO_GEN_XPT
# generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link
# into $(XPIDL_MODULE).xpt and export it to $(FINAL_TARGET)/components.
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
@ -1993,7 +1995,7 @@ $(foreach var,$(FREEZE_VARIABLES),$(eval $(var)_FROZEN := '$($(var))'))
CHECK_FROZEN_VARIABLES = $(foreach var,$(FREEZE_VARIABLES), \
$(if $(subst $($(var)_FROZEN),,'$($(var))'),$(error Makefile variable '$(var)' changed value after including rules.mk. Was $($(var)_FROZEN), now $($(var)).)))
libs export libs::
libs export::
$(CHECK_FROZEN_VARIABLES)
default all::

Просмотреть файл

@ -17,7 +17,6 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
# INCLUDED_CONFIG_MK = 1
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
@ -38,7 +37,5 @@ check:: $(tgts)
# Only run unit test when autotargets.mk is modified
$(autotgt_tests): $(topsrcdir)/config/makefiles/autotargets.mk
echo "MAKECMD=$(MAKE)"
MAKECMD=$(MAKE) $(PYTEST) $(srcdir)/check_mkdir.tpy
@$(TOUCH) $@

Просмотреть файл

@ -17,6 +17,7 @@ ifdef VERBOSE
endif
# Define macros
include $(topsrcdir)/config/makefiles/makeutils.mk
include $(topsrcdir)/config/makefiles/autotargets.mk
##########################

Просмотреть файл

@ -52,8 +52,9 @@ DIST_FILES = \
TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
include $(topsrcdir)/config/rules.mk
libs::
$(MKDIR) -p $(TEST_EXTENSIONS_DIR)
@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)

Просмотреть файл

@ -61,8 +61,9 @@ DIST_FILES = \
TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
include $(topsrcdir)/config/rules.mk
libs::
$(MKDIR) -p $(TEST_EXTENSIONS_DIR)
@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)

Просмотреть файл

@ -89,8 +89,9 @@ ifdef HOST_PROGRAM
endif
ifdef WRAP_SYSTEM_INCLUDES
export::
if test ! -d system_wrappers_js; then mkdir system_wrappers_js; fi
export:: \
$(call mkdir_deps,system_wrappers_js) \
$(NULL)
$(PYTHON) $(srcdir)/Preprocessor.py $(DEFINES) $(ACDEFINES) \
$(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers_js
$(INSTALL) system_wrappers_js $(DIST)

Просмотреть файл

@ -46,7 +46,7 @@
# Define an include-at-most-once flag
ifdef INCLUDED_CONFIG_MK
$(error Don't include config.mk twice!)
$(error Do not include config.mk twice!)
endif
INCLUDED_CONFIG_MK = 1

Просмотреть файл

@ -11,12 +11,14 @@
# *_DEPS - Make dependencies derived from a given macro.
###########################################################################
MKDIR ?= mkdir -p
TOUCH ?= touch
###########################################################################
# Threadsafe directory creation
# GENERATED_DIRS - Automated creation of these directories.
###########################################################################
mkdir_deps =$(foreach dir,$($(1)),$(dir)/.mkdir.done)
mkdir_deps =$(foreach dir,$(getargv),$(dir)/.mkdir.done)
ifneq (,$(GENERATED_DIRS))
tmpauto :=$(call mkdir_deps,GENERATED_DIRS)
@ -33,5 +35,11 @@ endif
# config/rules.mk::all target is available by default
# Add $(AUTO_DEPS) as an explicit target dependency when needed.
#################################################################
AUTO_DEPS +=$(GENERATED_DIRS_DEPS)
# Complain loudly if deps have not loaded so getargv != $(NULL)
ifndef getargv
$(error config/makefiles/makeutil.mk has not been included)
endif

Просмотреть файл

@ -34,17 +34,3 @@ argv +=)
## $(call banner,ref) ; ref=foo bar tans
## getarglist() would be a more accurate name but is longer to type
getargv = $(if $(call isvar,$(1)),$($(1)),$(argv))
## http://www.gnu.org/software/make/manual/make.html#Call-Function
## Usage: o = $(call map,origin,o map $(MAKE))
map = $(foreach val,$(2),$(call $(1),$(val)))
# Usage: $(call checkIfEmpty,[error|warning] foo NULL bar)
checkIfEmpty =$(foreach var,$(wordlist 2,100,$(getargv)),$(if $(strip $($(var))),$(NOP),$(call $(1),Variable $(var) does not contain a value)))
# Usage: $(call errorIfEmpty,foo NULL bar)
errorIfEmpty =$(call checkIfEmpty,error $(getargv))
warnIfEmpty =$(call checkIfEmpty,warning $(getargv))

Просмотреть файл

@ -22,6 +22,9 @@ ifndef INCLUDED_VERSION_MK
include $(topsrcdir)/config/version.mk
endif
include $(topsrcdir)/config/makefiles/makeutils.mk
include $(topsrcdir)/config/makefiles/autotargets.mk
ifdef SDK_XPIDLSRCS
XPIDLSRCS += $(SDK_XPIDLSRCS)
endif
@ -477,8 +480,8 @@ endif
# A Makefile that needs $(MDDEPDIR) created but doesn't set any of these
# variables we know to check can just set NEED_MDDEPDIR explicitly.
ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS)$(NEED_MDDEPDIR))
MAKE_DIRS += $(CURDIR)/$(MDDEPDIR)
GARBAGE_DIRS += $(MDDEPDIR)
MAKE_DIRS += $(CURDIR)/$(MDDEPDIR)
GARBAGE_DIRS += $(CURDIR)/$(MDDEPDIR)
endif
#
@ -1426,12 +1429,6 @@ endif
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include;
# warn against overriding existing .h file.
$(XPIDL_GEN_DIR)/.done:
$(MKDIR) -p $(XPIDL_GEN_DIR)
@$(TOUCH) $@
# don't depend on $(XPIDL_GEN_DIR), because the modification date changes
# with any addition to the directory, regenerating all .h files -> everything.
XPIDL_DEPS = \
$(topsrcdir)/xpcom/idl-parser/header.py \
@ -1439,7 +1436,12 @@ XPIDL_DEPS = \
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
$(NULL)
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
xpidl-preqs = \
$(call mkdir_deps,$(XPIDL_GEN_DIR)) \
$(call mkdir_deps,$(MDDEPDIR)) \
$(NULL)
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
@ -1451,7 +1453,7 @@ $(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
ifndef NO_GEN_XPT
# generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link
# into $(XPIDL_MODULE).xpt and export it to $(FINAL_TARGET)/components.
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(XPIDL_GEN_DIR)/.done
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_DEPS) $(xpidl-preqs)
$(REPORT_BUILD)
$(PYTHON_PATH) \
-I$(topsrcdir)/other-licenses/ply \
@ -1993,7 +1995,7 @@ $(foreach var,$(FREEZE_VARIABLES),$(eval $(var)_FROZEN := '$($(var))'))
CHECK_FROZEN_VARIABLES = $(foreach var,$(FREEZE_VARIABLES), \
$(if $(subst $($(var)_FROZEN),,'$($(var))'),$(error Makefile variable '$(var)' changed value after including rules.mk. Was $($(var)_FROZEN), now $($(var)).)))
libs export libs::
libs export::
$(CHECK_FROZEN_VARIABLES)
default all::