The good news is that there is no big mystery. One the include path is added, the build should be successful.
It appears that the QT include path was not added to QT_CPPFLAGS, or QT_CPPFLAGS was not included in CPPFLAGS.
Please send me the configure script you’re using. Perhaps it got mangled some how.
I did change a couple of values to make it work, and I was not exactly sure about the changes I made except that it avoided the errors.
export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
Notice the -v 11, my system didn't have 9 and I couldn't find it so it kept giving me errors.
The other change I did was:
Again, couldn't find the directory so I corrected(?) it.
I'm attaching the script as you asked.