#NEWLINE# def parse_defines( args ) : #NEWLINE# #INDENT# '\n    This parses a list of define argument in the form of -DNAME=VALUE or -DNAME (\n    which is treated as -DNAME=1).\n    ' #NEWLINE# macros = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for arg in args : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( var , val ) = arg . split ( '=' , 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# var = arg #NEWLINE# val = '1' #NEWLINE# #UNINDENT# macros [ var ] = val #NEWLINE# #UNINDENT# return args