is basically patch #2939 from X.org bugzilla #3379. This does *not* fix the bug as it does not dynamically generate stubs at run-time. It just gets things one step closer.
EXPAT_INCLUDES config variable (set on FreeBSD) which is then used in Makefile.template's INCLUDES.