def extract_defines(args):
    """
    Extract definitions from command-line arguments.
    Recognizes two argument "-D MACRO" and one argument "-DMACRO".
    """
    defines = []
    prefix = ""
    for a in args:
        if a == "-D":
            prefix = "-D"
        elif prefix:
            defines += [a]
            prefix = ""
        elif a[0:2] == "-D":
            defines += [a[2:]]
            prefix = ""
    return defines