def maybeAddQuotes(value):
	""" Return the supplied string enclosed in quotes, if they are needed.
	
	If the string 'value' needs to be quoted, because it contains whitespace, or a
	macro, or because it is empty, then return the string in double quotes.
	"""

	if ((len(value.split()) > 1) or (value.find('$(') != -1) or (value == "")):
		value = '"' + value + '"'
	return value