From 45c2fb55c8685d454b984ca4c57997e80f8371ff Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 19 Nov 2015 14:35:13 +0100 Subject: [PATCH] tests: avoid source dependencies from other dirs in Makefile That causes compilation errors under certain cirquimstances. --- tests/Makefile.am | 12 ++++++------ tests/ban-ips.c | 1 + tests/ipv4-prefix.c | 1 + tests/ipv6-prefix.c | 1 + tests/json-escape.c | 1 + tests/kkdcp-parsing.c | 1 + tests/str-test.c | 2 ++ 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index a09bf533..33559e58 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -45,23 +45,23 @@ if LOCAL_TALLOC AM_CPPFLAGS += -I$(srcdir)/../src/ccan/talloc endif -kkdcp_parsing_SOURCES = ../src/config-kkdcp.c kkdcp-parsing.c +kkdcp_parsing_SOURCES = kkdcp-parsing.c kkdcp_parsing_LDADD = ../gl/libgnu.a $(LIBTALLOC_LIBS) ../src/ccan/libccan.a -json_escape_SOURCES = ../src/occtl/json.c json-escape.c +json_escape_SOURCES = json-escape.c json_escape_LDADD = ../gl/libgnu.a $(LIBTALLOC_LIBS) ../src/ccan/libccan.a -ipv4_prefix_SOURCES = ../src/ip-util.c ../src/ip-util.h ipv4-prefix.c +ipv4_prefix_SOURCES = ipv4-prefix.c ipv4_prefix_LDADD = ../gl/libgnu.a $(LIBTALLOC_LIBS) ../src/ccan/libccan.a ban_ips_CPPFLAGS = $(AM_CPPFLAGS) -DDISABLE_LOGS -ban_ips_SOURCES = ../src/main-ban.c ../src/main.h ban-ips.c +ban_ips_SOURCES = ban-ips.c ban_ips_LDADD = ../gl/libgnu.a $(LIBTALLOC_LIBS) ../src/ccan/libccan.a -str_test_SOURCES = ../src/str.c ../src/str.h str-test.c +str_test_SOURCES = str-test.c str_test_LDADD = ../gl/libgnu.a $(LIBTALLOC_LIBS) ../src/ccan/libccan.a -ipv6_prefix_SOURCES = ../src/ip-util.c ../src/ip-util.h ipv6-prefix.c +ipv6_prefix_SOURCES = ipv6-prefix.c ipv6_prefix_LDADD = ../gl/libgnu.a $(LIBTALLOC_LIBS) ../src/ccan/libccan.a check_PROGRAMS = str-test ipv4-prefix ipv6-prefix kkdcp-parsing json-escape ban-ips diff --git a/tests/ban-ips.c b/tests/ban-ips.c index 431e17a8..c014526f 100644 --- a/tests/ban-ips.c +++ b/tests/ban-ips.c @@ -28,6 +28,7 @@ #include "../src/main.h" #include "../src/main-ban.h" #include "../src/ip-util.h" +#include "../src/main-ban.c" /* Test the IP banning functionality */ static diff --git a/tests/ipv4-prefix.c b/tests/ipv4-prefix.c index ae89e9f9..7052e697 100644 --- a/tests/ipv4-prefix.c +++ b/tests/ipv4-prefix.c @@ -21,6 +21,7 @@ #include #include "../src/ip-util.h" +#include "../src/ip-util.c" int main() { diff --git a/tests/ipv6-prefix.c b/tests/ipv6-prefix.c index 2893defb..e7c99c6c 100644 --- a/tests/ipv6-prefix.c +++ b/tests/ipv6-prefix.c @@ -21,6 +21,7 @@ #include #include "../src/ip-util.h" +#include "../src/ip-util.c" static char* my_ipv6_prefix_to_mask(const char *str, unsigned prefix) { diff --git a/tests/json-escape.c b/tests/json-escape.c index c91aacf0..4d1ee4fc 100644 --- a/tests/json-escape.c +++ b/tests/json-escape.c @@ -24,6 +24,7 @@ #include #include #include "../src/occtl/json.h" +#include "../src/occtl/json.c" static char *strings[] = { diff --git a/tests/kkdcp-parsing.c b/tests/kkdcp-parsing.c index 4fa27355..4c4eb6eb 100644 --- a/tests/kkdcp-parsing.c +++ b/tests/kkdcp-parsing.c @@ -25,6 +25,7 @@ #include #include "../src/common-config.h" +#include "../src/config-kkdcp.c" int main() { diff --git a/tests/str-test.c b/tests/str-test.c index 62c092c8..4632d27c 100644 --- a/tests/str-test.c +++ b/tests/str-test.c @@ -15,12 +15,14 @@ * along with this program. If not, see . */ +#define _GNU_SOURCE #include #include #include #include #include "../src/str.h" +#include "../src/str.c" static char *myfunc(void *pool, const char *str) {