When using pkg-config, I expect that the module should then use EGL_CFLAGS, to be able to include that header if the flags contain additional include paths, and it's not the case here.
This is indeed an oversight, EGL_CFLAGS should be added to UNIX_CFLAGS in the Wayland driver.
The same actually goes for the EGL_SONAME, if pkg-config somehow locates the library in an unusual place, whether it then would still work at runtime is unclear.
I guess the assumption here is that in case of such setups, the dynamic linking runtime environment would also include the proper paths, but of course it's not guaranteed.
The fact that we are dlopen-ing (E)GL instead of doing a normal dynamic link (same as WineX11) is an indication that we also want to gracefully support scenarios in which the GL libraries are missing at runtime (?). I guess an improperly configured dynamic linking runtime above would be another case of this.
All that being said, I think the main benefit of utilizing the pkgconfig mechanism even in this case is to allow for more versatile build setups.