pgcommon/Makefile.in orders CFLAGS incorrectly leading to wrong liblwgeom.h
|Reported by:||gdt||Owned by:||strk|
In both libpgcommon and postgis, CFLAGS end up with -I of system libraries before -I../liblwgeom. This causes the installed version of liblwgeom.h to be picked up, instead of the version from the postgis sources, resulting in a build failure.
I have observed the problem on NetBSD 6, and it has also been reported on FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211203
The workaround is to remove the installed version.
To fix, adjust CFLAGS/CPPFLAGS so that -I../liblwgeom is before includes of any directory that might have an installed version of postgis (e.g. -I/usr/pkg/include on NetBSD).