summaryrefslogtreecommitdiff
path: root/gl/tests/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'gl/tests/Makefile.am')
-rw-r--r--gl/tests/Makefile.am29
1 files changed, 28 insertions, 1 deletions
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index cdf9763658..ae662e8066 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -31,6 +31,7 @@ DISTCLEANFILES =
MAINTAINERCLEANFILES =
AM_CPPFLAGS = \
+ -D@gltests_WITNESS@=1 \
-I. -I$(srcdir) \
-I../.. -I$(srcdir)/../.. \
-I../../gl -I$(srcdir)/../../gl
@@ -95,6 +96,30 @@ EXTRA_DIST += test-arpa_inet.c
## end gnulib module arpa_inet-tests
+## begin gnulib module c++defs
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += c++defs.h
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/c++defs.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/_GL_CXXDEFS/,$$p' \
+ < $(top_srcdir)/build-aux/c++defs.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/c++defs.h
+
+## end gnulib module c++defs
+
## begin gnulib module c-ctype-tests
TESTS += test-c-ctype
@@ -324,7 +349,7 @@ BUILT_SOURCES += sys/ioctl.h
# We need the following in order to create <sys/ioctl.h> when the system
# does not have a complete one.
-sys/ioctl.h: sys_ioctl.in.h $(WARN_ON_USE_H)
+sys/ioctl.h: sys_ioctl.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
$(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -335,6 +360,8 @@ sys/ioctl.h: sys_ioctl.in.h $(WARN_ON_USE_H)
-e 's|@''GNULIB_IOCTL''@|$(GNULIB_IOCTL)|g' \
-e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
-e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+ -e 's|@''REPLACE_IOCTL''@|$(REPLACE_IOCTL)|g' \
+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
< $(srcdir)/sys_ioctl.in.h; \
} > $@-t && \