def METHOD_NAME(self, env):
    # microarchitecture-specific optimization flags should be controlled
    # by Spack, otherwise we may end up with contradictory or invalid flags
    # see https://github.com/spack/spack/issues/17794
    # https://gitlab.com/libxc/libxc/-/issues/430 (configure script does not ensure C99)
    # TODO: Switch to cmake since this is better supported
    env.append_flags("CFLAGS", self.compiler.c99_flag)
    if "%intel" in self.spec:
        if which("xiar"):
            env.set("AR", "xiar")
    if "%aocc" in self.spec:
        env.append_flags("FCFLAGS", "-fPIC")
    if "+cuda" in self.spec:
        nvcc = self.spec["cuda"].prefix.bin.nvcc
        env.set("CCLD", "{0} -ccbin {1}".format(nvcc, spack_cc))
        env.set("CC", "{0} -x cu -ccbin {1}".format(nvcc, spack_cc))
        cuda_arch = self.spec.variants["cuda_arch"].value[0]
        if cuda_arch != "none":
            env.append_flags("CFLAGS", "-arch=sm_{0}".format(cuda_arch))