# LPATH=/usr/src/postgis
LPATH ?= \$$libdir
-#
-# Path to flex, yacc
-#
-FLEX ?= flex
-YACC ?= yacc
-
#---------------------------------------------------------------
# END OF CONFIGURATION
#---------------------------------------------------------------
top_builddir = ${PGSQL_SRC}
include $(top_builddir)/src/Makefile.global
+#
+# This needs to be defined after PGSQL Makefile.global
+# has been sources as it redefines FLEX
+#
+ifeq ($(strip $(FLEX)),)
+ FLEX = flex
+endif
+ifeq ($(strip $(YACC)),)
+ YACC = yacc
+endif
+
#---------------------------------------------------------------
# Test the version string and set the USE_VERSION macro
# appropriately.