bug 371201 - error on spaces in XPI_NAME and some other Makefile vars. r=bsmedberg
authorted.mielczarek@gmail.com
Mon, 26 Mar 2007 11:15:02 -0700
changeset 111 319276b446255ecdaa740ca65cb899fed670c7db
parent 110 ff45fd5149fb121e75b05dd9507d8364d4cbd4cc
child 112 456d186738b3b0dbfb6ae26174b14a5047a44585
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs371201
milestone1.9a4pre
bug 371201 - error on spaces in XPI_NAME and some other Makefile vars. r=bsmedberg
config/config.mk
--- a/config/config.mk
+++ b/config/config.mk
@@ -57,16 +57,33 @@ ifndef INCLUDED_AUTOCONF_MK
 include $(DEPTH)/config/autoconf.mk
 endif
 ifndef INCLUDED_INSURE_MK
 ifdef MOZ_INSURIFYING
 include $(topsrcdir)/config/insure.mk
 endif
 endif
 
+# Sanity check some variables
+CHECK_VARS := \
+ XPI_NAME \
+ LIBRARY_NAME \
+ MODULE \
+ DEPTH \
+ SHORT_LIBNAME \
+ XPI_PKGNAME \
+ INSTALL_EXTENSION_ID \
+ $(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))
+
 # 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