def build_args(self, spec, prefix):
        args = {
            'PREFIX': prefix,
            'APR': spec['apr'].prefix,
            'APU': spec['apr-util'].prefix,
            'OPENSSL': spec['openssl'].prefix,
            'ZLIB': spec['zlib'].prefix,
            'DEBUG': 'yes' if '+debug' in spec else 'no',
        }

        # SCons doesn't pass Spack environment variables to the
        # execution environment. Therefore, we can't use Spack's compiler
        # wrappers. Use the actual compilers. SCons seems to RPATH things
        # on its own anyway.
        args['CC'] = self.compiler.cc

        # Old versions of serf ignore the ZLIB variable on non-Windows platforms.
        # Also, there is no UUID variable to specify its installation location.
        # Pass explicit link flags for both.
        library_dirs = []
        include_dirs = []
        for dep in spec.dependencies(deptype='link'):
            query = self.spec[dep.name]
            library_dirs.extend(query.libs.directories)
            include_dirs.extend(query.headers.directories)

        rpath = self.compiler.cc_rpath_arg
        args['LINKFLAGS'] = '-L' + ' -L'.join(library_dirs)
        args['LINKFLAGS'] += ' ' + rpath + (' ' + rpath).join(library_dirs)
        args['CPPFLAGS'] = '-I' + ' -I'.join(include_dirs)

        return [key + '=' + value for key, value in args.items()]