AC_SUBST(LT_NO_UNDEFINED)
-AM_CPPFLAGS="-include config.h"
+# The order in which the include folders are searched is important.
+# The top_builddir should always be searched first in the event that a build
+# time generated file is included.
+AM_CPPFLAGS="-I\$(top_builddir)/include -I\$(top_srcdir)/include -include config.h"
AC_SUBST(AM_CPPFLAGS)
AM_CFLAGS="-Wall -Wextra -Wno-unused-parameter $PTHREAD_CFLAGS"
-AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
+AM_CPPFLAGS += -I$(top_srcdir)/src
#Add the -version-info directly here since we are only building
# library that use the version-info
-AM_CFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/common -g
+AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/common
TEST_EXTENSIONS = .tap
TAP_LOG_DRIVER_FLAGS = --merge --comments
-AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
+AM_CPPFLAGS += -I$(top_srcdir)/src
noinst_HEADERS = thread-id.h
-AM_CFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
+AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common
TEST_EXTENSIONS = .tap
TAP_LOG_DRIVER_FLAGS = --merge --comments
-AM_CFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g
+AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common
LOG_DRIVER_FLAGS = --merge --comments
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
-AM_CFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src
+AM_CPPFLAGS += -I$(top_srcdir)/src
noinst_LIBRARIES = libtap.a
libtap_a_SOURCES = tap.c tap.h