From 3d3e9b9cbf0bf43c3ce2670175d936677e29f621 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 21 Jun 2014 14:14:56 +0930 Subject: [PATCH] tools/configurator: set HAVE_CLOCK_GETTIME even if it's in -lrt. This avoids conflicts with autoconf and other config.h sources. Based on the work by Cody P Schafer . Signed-off-by: Rusty Russell --- tools/configurator/configurator.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c index 6fa88e5b..5ccc8c91 100644 --- a/tools/configurator/configurator.c +++ b/tools/configurator/configurator.c @@ -55,6 +55,7 @@ struct test { const char *depends; const char *link; const char *fragment; + const char *overrides; /* On success, force this to '1' */ bool done; bool answer; }; @@ -144,7 +145,9 @@ static struct test tests[] = { " struct timespec ts;\n" " clock_gettime(CLOCK_REALTIME, &ts);\n" " return ts;\n" - "}\n" }, + "}\n", + /* This means HAVE_CLOCK_GETTIME, too */ + "HAVE_CLOCK_GETTIME" }, { "HAVE_COMPOUND_LITERALS", INSIDE_MAIN, NULL, NULL, "int *foo = (int[]) { 1, 2, 3, 4 };\n" "return foo[0] ? 0 : 1;" }, @@ -479,6 +482,12 @@ static bool run_test(const char *cmd, struct test *test) test->answer = (status == 0); } test->done = true; + + if (test->answer && test->overrides) { + struct test *override = find_test(test->overrides); + override->done = true; + override->answer = true; + } return test->answer; } -- 2.39.2