From 380e444ce979502e06746e1b9964fa9f2eb70dbe Mon Sep 17 00:00:00 2001 From: Mitchell Field Date: Sun, 3 Apr 2011 17:16:49 +1000 Subject: [PATCH 1/4] Bug 645356 - Use pymake builtins. r=khuey --- Makefile.in | 24 +++++++------- browser/app/Makefile.in | 8 ++--- browser/installer/windows/Makefile.in | 6 ++-- config/Makefile.in | 3 +- config/config.mk | 3 ++ config/rules.mk | 48 ++++++++++++++------------- js/src/Makefile.in | 14 ++++---- js/src/config/config.mk | 3 ++ js/src/config/rules.mk | 48 ++++++++++++++------------- 9 files changed, 84 insertions(+), 73 deletions(-) diff --git a/Makefile.in b/Makefile.in index 8f5d33bdca7b..f39835a029d7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -94,12 +94,12 @@ check:: endif default alldep all:: $(topsrcdir)/configure config.status - $(RM) -rf $(DIST)/sdk - $(RM) -rf $(DIST)/include - $(RM) -rf $(DIST)/private - $(RM) -rf $(DIST)/public - $(RM) -rf $(DIST)/bin/components - $(RM) -rf _tests + $(RM) -r $(DIST)/sdk + $(RM) -r $(DIST)/include + $(RM) -r $(DIST)/private + $(RM) -r $(DIST)/public + $(RM) -r $(DIST)/bin/components + $(RM) -r _tests $(topsrcdir)/configure: $(topsrcdir)/configure.in @echo "STOP! configure.in has changed, and your configure is out of date." @@ -117,7 +117,7 @@ config.status: $(topsrcdir)/configure # Build pseudo-external modules first when export is explicitly called export:: - $(RM) -rf $(DIST)/sdk + $(RM) -r $(DIST)/sdk $(MAKE) -C config export $(MAKE) tier_nspr @@ -130,7 +130,7 @@ include $(topsrcdir)/config/rules.mk distclean:: cat unallmakefiles | $(XARGS) rm -f - rm -f unallmakefiles $(DIST_GARBAGE) + $(RM) unallmakefiles $(DIST_GARBAGE) ifeq ($(OS_ARCH),WINNT) # we want to copy PDB files on Windows @@ -176,8 +176,8 @@ ifdef USE_ELF_HACK $(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack endif echo building symbol store - $(RM) -rf $(DIST)/crashreporter-symbols - $(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip" + $(RM) -r $(DIST)/crashreporter-symbols + $(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip" $(NSINSTALL) -D $(DIST)/crashreporter-symbols $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \ $(MAKE_SYM_STORE_ARGS) \ @@ -199,8 +199,8 @@ else ifdef WINCE ifdef SYMBOLSTORE_PATH echo building symbol store with symstore.exe - $(RM) -rf $(DIST)/symbols - $(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip" + $(RM) -r $(DIST)/symbols + $(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip" $(NSINSTALL) -D $(DIST)/symbols $(SYMBOLSTORE_PATH) add -r -f "$(subst /,\,$(shell pwd -W))\*.PDB" \ -s $(DIST)/symbols/ -t "$(MOZ_PKG_APPNAME)" -v "$(MOZ_PKG_VERSION)" diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index cd46034601ea..31e8a7751f02 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -318,7 +318,7 @@ AB_CD = $(MOZ_UI_LOCALE) AB := $(firstword $(subst -, ,$(AB_CD))) clean clobber repackage:: - rm -rf $(DIST)/$(APP_NAME).app + $(RM) -r $(DIST)/$(APP_NAME).app ifdef LIBXUL_SDK APPFILES = Resources @@ -327,9 +327,9 @@ APPFILES = MacOS endif libs repackage:: $(PROGRAM) application.ini - mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS + $(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/MacOS rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj - mkdir -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj + $(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%LOWER_APP_NAME%/$(LOWER_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist sed -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 @@ -338,7 +338,7 @@ libs repackage:: $(PROGRAM) application.ini ifdef LIBXUL_SDK cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox-bin 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 -cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES) diff --git a/browser/installer/windows/Makefile.in b/browser/installer/windows/Makefile.in index 0716e7d89a06..2cad3d917699 100644 --- a/browser/installer/windows/Makefile.in +++ b/browser/installer/windows/Makefile.in @@ -94,7 +94,8 @@ installer:: # For building the uninstaller during the application build so it can be # included for mar file generation. uninstaller:: - $(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR) + $(RM) -r $(CONFIG_DIR) + $(MKDIR) $(CONFIG_DIR) $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR) $(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR) $(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \ @@ -104,7 +105,8 @@ uninstaller:: $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR) $(CONFIG_DIR)/setup.exe:: - $(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR) + $(RM) -r $(CONFIG_DIR) + $(MKDIR) $(CONFIG_DIR) $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR) $(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR) $(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \ diff --git a/config/Makefile.in b/config/Makefile.in index 39a41295a038..af438afdefb6 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -104,8 +104,7 @@ HEADERS = \ export:: $(TARGETS) $(HEADERS) $(INSTALL) $(IFLAGS1) $(HEADERS) $(DIST)/include - -rm -f $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) - -rm -f $(DIST)/bin/chrome/chromelist.txt + -$(RM) $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) ifdef HOST_PROGRAM $(INSTALL) $(HOST_PROGRAM) $(DIST)/bin endif diff --git a/config/config.mk b/config/config.mk index b99c819d6bf2..1dc65497d5fb 100644 --- a/config/config.mk +++ b/config/config.mk @@ -159,6 +159,9 @@ endif CC := $(CC_WRAPPER) $(CC) CXX := $(CXX_WRAPPER) $(CXX) +MKDIR ?= mkdir +SLEEP ?= sleep +TOUCH ?= touch # determine debug-related options _DEBUG_CFLAGS := diff --git a/config/rules.mk b/config/rules.mk index ca0d22f761ec..92df7a722a85 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -934,24 +934,24 @@ checkout: $(MAKE) -C $(topsrcdir) -f client.mk checkout clean clobber realclean clobber_all:: $(SUBMAKEFILES) - -rm -f $(ALL_TRASH) - -rm -rf $(ALL_TRASH_DIRS) + -$(RM) $(ALL_TRASH) + -$(RM) -r $(ALL_TRASH_DIRS) $(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir))) distclean:: $(SUBMAKEFILES) $(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir))) - -rm -rf $(ALL_TRASH_DIRS) - -rm -f $(ALL_TRASH) \ + -$(RM) -r $(ALL_TRASH_DIRS) + -$(RM) $(ALL_TRASH) \ Makefile .HSancillary \ $(wildcard *.$(OBJ_SUFFIX)) $(wildcard *.ho) $(wildcard host_*.o*) \ $(wildcard *.$(LIB_SUFFIX)) $(wildcard *$(DLL_SUFFIX)) \ $(wildcard *.$(IMPORT_LIB_SUFFIX)) ifeq ($(OS_ARCH),OS2) - -rm -f $(PROGRAM:.exe=.map) + -$(RM) $(PROGRAM:.exe=.map) endif alltags: - rm -f TAGS + $(RM) TAGS find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM) # @@ -959,7 +959,7 @@ alltags: # creates OBJS, links with LIBS to create Foo # $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS) - @rm -f $@.manifest + @$(RM) $@.manifest ifeq (WINCE,$(OS_ARCH)) $(EXPAND_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) else @@ -1110,7 +1110,7 @@ EXTRA_DEPS += $(DTRACE_PROBE_OBJ) endif $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS) - rm -f $(LIBRARY) + $(RM) $(LIBRARY) $(EXPAND_AR) $(AR_FLAGS) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) $(RANLIB) $@ @@ -1123,7 +1123,7 @@ endif ifeq ($(OS_ARCH),OS2) $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS) - rm -f $@ + $(RM) $@ echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@ echo PROTMODE >> $@ echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@ @@ -1133,13 +1133,13 @@ $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS) $(ADD_TO_DEF_FILE) $(IMPORT_LIBRARY): $(SHARED_LIBRARY) - rm -f $@ + $(RM) $@ $(IMPLIB) $@ $^ $(RANLIB) $@ endif # OS/2 $(HOST_LIBRARY): $(HOST_OBJS) Makefile - rm -f $@ + $(RM) $@ $(HOST_AR) $(HOST_AR_FLAGS) $(HOST_OBJS) $(HOST_RANLIB) $@ @@ -1161,14 +1161,14 @@ endif $(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS_DEPS) $(LIBRARY) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) $(GLOBAL_DEPS) ifndef INCREMENTAL_LINKER - rm -f $@ + $(RM) $@ endif ifdef DTRACE_LIB_DEPENDENT ifndef XP_MACOSX dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS)) endif $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) - @rm -f $(DTRACE_PROBE_OBJ) + @$(RM) $(DTRACE_PROBE_OBJ) else # ! DTRACE_LIB_DEPENDENT $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(DTRACE_PROBE_OBJ) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) endif # DTRACE_LIB_DEPENDENT @@ -1186,7 +1186,7 @@ ifdef MOZ_PROFILE_GENERATE touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink endif endif # WINNT && !GCC - @rm -f foodummyfilefoo $(DELETE_AFTER_LINK) + @$(RM) foodummyfilefoo $(DELETE_AFTER_LINK) chmod +x $@ ifdef ENABLE_STRIP $(STRIP) $@ @@ -1302,7 +1302,7 @@ endif ifdef STRICT_CPLUSPLUS_SUFFIX echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > t_$*.cc $(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) t_$*.cc - rm -f t_$*.cc + $(RM) t_$*.cc else $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) endif #STRICT_CPLUSPLUS_SUFFIX @@ -1352,12 +1352,14 @@ endif # need 3 separate lines for OS/2 %:: %.pl - rm -f $@ + $(RM) $@ cp $< $@ chmod +x $@ %:: %.sh - rm -f $@; cp $< $@; chmod +x $@ + $(RM) $@ + cp $< $@ + chmod +x $@ # Cancel these implicit rules # @@ -1554,8 +1556,8 @@ $(IDL_DIR):: # generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include; # warn against overriding existing .h file. $(XPIDL_GEN_DIR)/.done: - @if test ! -d $(XPIDL_GEN_DIR); then echo Creating $(XPIDL_GEN_DIR)/.done; rm -rf $(XPIDL_GEN_DIR); mkdir $(XPIDL_GEN_DIR); fi - @touch $@ + $(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. @@ -1651,7 +1653,7 @@ $(_JAVA_GEN_DIR): $(JAVA_GEN_DIR)/.%.java.pp: %.idl $(XPIDL_COMPILE) $(_JAVA_GEN_DIR) $(REPORT_BUILD) $(ELOG) $(XPIDL_COMPILE) -m java -w $(XPIDL_FLAGS) -I$(srcdir) -I$(IDL_DIR) -o $(_JAVA_GEN_DIR)/$* $(_VPATH_SRCS) - @touch $@ + @$(TOUCH) $@ # "Install" generated Java interfaces. We segregate them based on the XPI_NAME. # If XPI_NAME is not set, install into the "default" directory. @@ -1849,7 +1851,7 @@ $(error XPI_NAME must be set for INSTALL_EXTENSION_ID) endif libs:: - $(RM) -rf "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" + $(RM) -r "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" $(NSINSTALL) -D "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" cd $(FINAL_TARGET) && tar $(TAR_CREATE_FLAGS) - . | (cd "../../bin/extensions/$(INSTALL_EXTENSION_ID)" && tar -xf -) @@ -1921,7 +1923,7 @@ endif $(LOOP_OVER_TOOL_DIRS) dependclean:: $(SUBMAKEFILES) - rm -f $(MDDEPFILES) + $(RM) $(MDDEPFILES) $(LOOP_OVER_PARALLEL_DIRS) $(LOOP_OVER_DIRS) $(LOOP_OVER_TOOL_DIRS) @@ -1944,7 +1946,7 @@ endif # COMPILER_DEPEND # it. $(CURDIR)/$(MDDEPDIR): - @if test ! -d $@; then echo Creating $@; rm -rf $@; mkdir $@; else true; fi + $(MKDIR) -p $@ ifneq (,$(filter-out all chrome default export realchrome tools clean clobber clobber_all distclean realclean,$(MAKECMDGOALS))) ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS)) diff --git a/js/src/Makefile.in b/js/src/Makefile.in index fd11b3fa8f37..e509e11d7501 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -658,11 +658,11 @@ DIST_GARBAGE = config.cache config.log config.status \ distclean:: cat unallmakefiles | $(XARGS) rm -f - rm -f $(DIST_GARBAGE) + $(RM) $(DIST_GARBAGE) # our build system doesn't handle subdir srcs very gracefully today export:: - mkdir -p nanojit + $(MKDIR) -p nanojit DEFINES += -DEXPORT_JS_API @@ -817,14 +817,14 @@ export:: jsautocfg.h ifeq (,$(CROSS_COMPILE)$(GNU_CC)$(filter-out WINNT,$(OS_ARCH))) jsautocfg.h: - touch $@ + $(TOUCH) $@ else ifeq ($(OS_ARCH),WINCE) jsautocfg.h: - touch $@ + $(TOUCH) $@ else jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX) - @rm -f $@ jsautocfg.tmp + @$(RM) $@ jsautocfg.tmp ./jscpucfg > jsautocfg.tmp mv jsautocfg.tmp $@ endif @@ -884,7 +884,7 @@ JS_CONFIG_LIBS=$(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) # this rule. at=@ js-config: js-config.in Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk $(topsrcdir)/config/rules.mk - rm -f js-config.tmp + $(RM) js-config.tmp sed < $< > js-config.tmp \ -e 's|$(at)prefix$(at)|$(prefix)|' \ -e 's|$(at)exec_prefix$(at)|$(exec_prefix)|' \ @@ -960,7 +960,7 @@ NANOJIT_CENTRAL_LOCAL=$(CURDIR)/nanojit-central CUR_REPO=$(srcdir)/../.. update-nanojit: - rm -Rf $(NANOJIT_CENTRAL_LOCAL) import-splicemap import-revmap + $(RM) -r $(NANOJIT_CENTRAL_LOCAL) import-splicemap import-revmap hg clone $(NANOJIT_CENTRAL_REPO) $(NANOJIT_CENTRAL_LOCAL) python $(srcdir)/find-child.py \ --src=$(NANOJIT_CENTRAL_LOCAL) \ diff --git a/js/src/config/config.mk b/js/src/config/config.mk index b99c819d6bf2..1dc65497d5fb 100644 --- a/js/src/config/config.mk +++ b/js/src/config/config.mk @@ -159,6 +159,9 @@ endif CC := $(CC_WRAPPER) $(CC) CXX := $(CXX_WRAPPER) $(CXX) +MKDIR ?= mkdir +SLEEP ?= sleep +TOUCH ?= touch # determine debug-related options _DEBUG_CFLAGS := diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index ca0d22f761ec..92df7a722a85 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -934,24 +934,24 @@ checkout: $(MAKE) -C $(topsrcdir) -f client.mk checkout clean clobber realclean clobber_all:: $(SUBMAKEFILES) - -rm -f $(ALL_TRASH) - -rm -rf $(ALL_TRASH_DIRS) + -$(RM) $(ALL_TRASH) + -$(RM) -r $(ALL_TRASH_DIRS) $(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir))) distclean:: $(SUBMAKEFILES) $(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir))) - -rm -rf $(ALL_TRASH_DIRS) - -rm -f $(ALL_TRASH) \ + -$(RM) -r $(ALL_TRASH_DIRS) + -$(RM) $(ALL_TRASH) \ Makefile .HSancillary \ $(wildcard *.$(OBJ_SUFFIX)) $(wildcard *.ho) $(wildcard host_*.o*) \ $(wildcard *.$(LIB_SUFFIX)) $(wildcard *$(DLL_SUFFIX)) \ $(wildcard *.$(IMPORT_LIB_SUFFIX)) ifeq ($(OS_ARCH),OS2) - -rm -f $(PROGRAM:.exe=.map) + -$(RM) $(PROGRAM:.exe=.map) endif alltags: - rm -f TAGS + $(RM) TAGS find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM) # @@ -959,7 +959,7 @@ alltags: # creates OBJS, links with LIBS to create Foo # $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS) - @rm -f $@.manifest + @$(RM) $@.manifest ifeq (WINCE,$(OS_ARCH)) $(EXPAND_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) else @@ -1110,7 +1110,7 @@ EXTRA_DEPS += $(DTRACE_PROBE_OBJ) endif $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS) - rm -f $(LIBRARY) + $(RM) $(LIBRARY) $(EXPAND_AR) $(AR_FLAGS) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) $(RANLIB) $@ @@ -1123,7 +1123,7 @@ endif ifeq ($(OS_ARCH),OS2) $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS) - rm -f $@ + $(RM) $@ echo LIBRARY $(SHARED_LIBRARY_NAME) INITINSTANCE TERMINSTANCE > $@ echo PROTMODE >> $@ echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@ @@ -1133,13 +1133,13 @@ $(DEF_FILE): $(OBJS) $(SHARED_LIBRARY_LIBS) $(ADD_TO_DEF_FILE) $(IMPORT_LIBRARY): $(SHARED_LIBRARY) - rm -f $@ + $(RM) $@ $(IMPLIB) $@ $^ $(RANLIB) $@ endif # OS/2 $(HOST_LIBRARY): $(HOST_OBJS) Makefile - rm -f $@ + $(RM) $@ $(HOST_AR) $(HOST_AR_FLAGS) $(HOST_OBJS) $(HOST_RANLIB) $@ @@ -1161,14 +1161,14 @@ endif $(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS_DEPS) $(LIBRARY) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) $(GLOBAL_DEPS) ifndef INCREMENTAL_LINKER - rm -f $@ + $(RM) $@ endif ifdef DTRACE_LIB_DEPENDENT ifndef XP_MACOSX dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS)) endif $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) - @rm -f $(DTRACE_PROBE_OBJ) + @$(RM) $(DTRACE_PROBE_OBJ) else # ! DTRACE_LIB_DEPENDENT $(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(DTRACE_PROBE_OBJ) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) endif # DTRACE_LIB_DEPENDENT @@ -1186,7 +1186,7 @@ ifdef MOZ_PROFILE_GENERATE touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink endif endif # WINNT && !GCC - @rm -f foodummyfilefoo $(DELETE_AFTER_LINK) + @$(RM) foodummyfilefoo $(DELETE_AFTER_LINK) chmod +x $@ ifdef ENABLE_STRIP $(STRIP) $@ @@ -1302,7 +1302,7 @@ endif ifdef STRICT_CPLUSPLUS_SUFFIX echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > t_$*.cc $(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) t_$*.cc - rm -f t_$*.cc + $(RM) t_$*.cc else $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) endif #STRICT_CPLUSPLUS_SUFFIX @@ -1352,12 +1352,14 @@ endif # need 3 separate lines for OS/2 %:: %.pl - rm -f $@ + $(RM) $@ cp $< $@ chmod +x $@ %:: %.sh - rm -f $@; cp $< $@; chmod +x $@ + $(RM) $@ + cp $< $@ + chmod +x $@ # Cancel these implicit rules # @@ -1554,8 +1556,8 @@ $(IDL_DIR):: # generate .h files from into $(XPIDL_GEN_DIR), then export to $(DIST)/include; # warn against overriding existing .h file. $(XPIDL_GEN_DIR)/.done: - @if test ! -d $(XPIDL_GEN_DIR); then echo Creating $(XPIDL_GEN_DIR)/.done; rm -rf $(XPIDL_GEN_DIR); mkdir $(XPIDL_GEN_DIR); fi - @touch $@ + $(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. @@ -1651,7 +1653,7 @@ $(_JAVA_GEN_DIR): $(JAVA_GEN_DIR)/.%.java.pp: %.idl $(XPIDL_COMPILE) $(_JAVA_GEN_DIR) $(REPORT_BUILD) $(ELOG) $(XPIDL_COMPILE) -m java -w $(XPIDL_FLAGS) -I$(srcdir) -I$(IDL_DIR) -o $(_JAVA_GEN_DIR)/$* $(_VPATH_SRCS) - @touch $@ + @$(TOUCH) $@ # "Install" generated Java interfaces. We segregate them based on the XPI_NAME. # If XPI_NAME is not set, install into the "default" directory. @@ -1849,7 +1851,7 @@ $(error XPI_NAME must be set for INSTALL_EXTENSION_ID) endif libs:: - $(RM) -rf "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" + $(RM) -r "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" $(NSINSTALL) -D "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)" cd $(FINAL_TARGET) && tar $(TAR_CREATE_FLAGS) - . | (cd "../../bin/extensions/$(INSTALL_EXTENSION_ID)" && tar -xf -) @@ -1921,7 +1923,7 @@ endif $(LOOP_OVER_TOOL_DIRS) dependclean:: $(SUBMAKEFILES) - rm -f $(MDDEPFILES) + $(RM) $(MDDEPFILES) $(LOOP_OVER_PARALLEL_DIRS) $(LOOP_OVER_DIRS) $(LOOP_OVER_TOOL_DIRS) @@ -1944,7 +1946,7 @@ endif # COMPILER_DEPEND # it. $(CURDIR)/$(MDDEPDIR): - @if test ! -d $@; then echo Creating $@; rm -rf $@; mkdir $@; else true; fi + $(MKDIR) -p $@ ifneq (,$(filter-out all chrome default export realchrome tools clean clobber clobber_all distclean realclean,$(MAKECMDGOALS))) ifneq (,$(OBJS)$(XPIDLSRCS)$(SIMPLE_PROGRAMS)) From 8a6652d7dce0ee919dc6fa85e3c8cc90bc320759 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Thu, 7 Apr 2011 15:57:41 +1000 Subject: [PATCH 2/4] Bug 647647 - Don't search --enable-extensions arguments for long-gone extensions. r=khuey --- configure.in | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/configure.in b/configure.in index 6a052216199a..32c5c56fe2ec 100644 --- a/configure.in +++ b/configure.in @@ -6546,54 +6546,12 @@ if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'` fi -dnl This might be temporary: build tridentprofile only on Windows -if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then - AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.]) - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'` -fi - -dnl cookie must be built before tridentprofile. put it at list's end. -if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'` - MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile" -fi - dnl xforms requires xtf if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.]) MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'` fi -if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then - AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.]) - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'` -fi - -if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then - AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.]) - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'` -fi - -if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then - AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.]) - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'` -fi - -if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then - AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.]) - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'` -fi - -if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then - AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.]) - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'` -fi - -if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then - AC_MSG_WARN([spellcheck is no longer an extension.]) - MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'` -fi - dnl Remove dupes MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}` From 7d31ce1e774d70b6410498454cad118800ffb267 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 8 Apr 2011 11:34:16 -0700 Subject: [PATCH 3/4] Bug 648446. Remove -pedantic from CFLAGS in qcms. r=khuey -pedantic causes warnings that we don't care about --- gfx/qcms/Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/qcms/Makefile.in b/gfx/qcms/Makefile.in index 4dfd8395f8a7..c68e52504315 100644 --- a/gfx/qcms/Makefile.in +++ b/gfx/qcms/Makefile.in @@ -45,6 +45,10 @@ endif endif endif +# -pedantic causes warnings that we don't care about +# so turn it off +CFLAGS := $(filter-out -pedantic,$(CFLAGS)) + FORCE_STATIC_LIB = 1 # This library is used by other shared libs FORCE_USE_PIC = 1 From 12c9483287b7353b894fae21b73ad903b0d09b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Sat, 9 Apr 2011 05:23:27 +1000 Subject: [PATCH 4/4] Bug 638149 - Need a way to disable -dead_strip on OS X. r=ted --- aclocal.m4 | 1 + build/autoconf/lto.m4 | 15 +++++++++++++++ configure.in | 6 +++++- js/src/aclocal.m4 | 1 + js/src/build/autoconf/lto.m4 | 15 +++++++++++++++ js/src/configure.in | 6 +++++- 6 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 build/autoconf/lto.m4 create mode 100644 js/src/build/autoconf/lto.m4 diff --git a/aclocal.m4 b/aclocal.m4 index a9f78c0c0618..6a3100883865 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -14,6 +14,7 @@ builtin(include, build/autoconf/altoptions.m4)dnl builtin(include, build/autoconf/mozprog.m4)dnl builtin(include, build/autoconf/mozheader.m4)dnl builtin(include, build/autoconf/acwinpaths.m4)dnl +builtin(include, build/autoconf/lto.m4)dnl MOZ_PROG_CHECKMSYS() diff --git a/build/autoconf/lto.m4 b/build/autoconf/lto.m4 new file mode 100644 index 000000000000..d7a9802166a5 --- /dev/null +++ b/build/autoconf/lto.m4 @@ -0,0 +1,15 @@ +dnl check if the build is using lto. This is really primitive and only detects llvm based +dnl compilers right now. +AC_DEFUN(MOZ_DOING_LTO, +[ + cat > conftest.c </dev/null 2>&1; then + if grep '^target triple =' conftest.s; then + $1=yes + fi + fi + rm -f conftest.[cs] +]) diff --git a/configure.in b/configure.in index 32c5c56fe2ec..203d6e280ad4 100644 --- a/configure.in +++ b/configure.in @@ -2007,6 +2007,8 @@ fi AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION") AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION) +MOZ_DOING_LTO(lto_is_enabled) + dnl ======================================================== dnl System overrides of the defaults for target dnl ======================================================== @@ -2108,9 +2110,11 @@ case "$target" in # builds. MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling" + if test "x$lto_is_enabled" = "xyes"; then + echo "Skipping -dead_strip because lto is enabled." dnl DTrace and -dead_strip don't interact well. See bug 403132. dnl =================================================================== - if test "x$enable_dtrace" = "xyes"; then + elif test "x$enable_dtrace" = "xyes"; then echo "Skipping -dead_strip because DTrace is enabled. See bug 403132." else dnl check for the presence of the -dead_strip linker flag diff --git a/js/src/aclocal.m4 b/js/src/aclocal.m4 index 3745619e7297..548173055b3c 100644 --- a/js/src/aclocal.m4 +++ b/js/src/aclocal.m4 @@ -9,5 +9,6 @@ builtin(include, build/autoconf/altoptions.m4)dnl builtin(include, build/autoconf/moznbytetype.m4)dnl builtin(include, build/autoconf/mozprog.m4)dnl builtin(include, build/autoconf/acwinpaths.m4)dnl +builtin(include, build/autoconf/lto.m4)dnl MOZ_PROG_CHECKMSYS() diff --git a/js/src/build/autoconf/lto.m4 b/js/src/build/autoconf/lto.m4 new file mode 100644 index 000000000000..d7a9802166a5 --- /dev/null +++ b/js/src/build/autoconf/lto.m4 @@ -0,0 +1,15 @@ +dnl check if the build is using lto. This is really primitive and only detects llvm based +dnl compilers right now. +AC_DEFUN(MOZ_DOING_LTO, +[ + cat > conftest.c </dev/null 2>&1; then + if grep '^target triple =' conftest.s; then + $1=yes + fi + fi + rm -f conftest.[cs] +]) diff --git a/js/src/configure.in b/js/src/configure.in index e89bf174b90b..b35e61eac5d1 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1886,6 +1886,8 @@ if test "$_python_res" != 0; then fi AC_MSG_RESULT([yes]) +MOZ_DOING_LTO(lto_is_enabled) + dnl ======================================================== dnl System overrides of the defaults for target dnl ======================================================== @@ -1990,9 +1992,11 @@ case "$target" in # builds. MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling" + if test "x$lto_is_enabled" = "xyes"; then + echo "Skipping -dead_strip because lto is enabled." dnl DTrace and -dead_strip don't interact well. See bug 403132. dnl =================================================================== - if test "x$enable_dtrace" = "xyes"; then + elif test "x$enable_dtrace" = "xyes"; then echo "Skipping -dead_strip because DTrace is enabled. See bug 403132." else dnl check for the presence of the -dead_strip linker flag