Hi Xiaoyu,
For your comment (1), I don't see a way to rule out headers using configdata. I was already using configdata to get the include directories, but configdata doesn't list the specific header files that will be used for compilation.
We can ignore things with a common name or specific files, but ruling out all of them doesn't seem possible using what is given.
The rest of the comments can be addressed.