From 62aa55356300afd03fc1737114fa8c3929df0ed2 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 26 Dec 2016 05:07:40 +0000 Subject: Don't suppress error output when INSPIRCD_VERBOSE is set. --- make/configure.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/make/configure.pm b/make/configure.pm index 6b4693d45..59657bfc4 100644 --- a/make/configure.pm +++ b/make/configure.pm @@ -42,6 +42,7 @@ use make::console; use constant CONFIGURE_DIRECTORY => '.configure'; use constant CONFIGURE_CACHE_FILE => catfile(CONFIGURE_DIRECTORY, 'cache.cfg'); use constant CONFIGURE_CACHE_VERSION => '1'; +use constant CONFIGURE_ERROR_PIPE => $ENV{INSPIRCD_VERBOSE} ? '' : '1>/dev/null 2>/dev/null'; our @EXPORT = qw(CONFIGURE_CACHE_FILE CONFIGURE_CACHE_VERSION @@ -97,7 +98,7 @@ sub __get_template_settings($$$) { sub __test_compiler($) { my $compiler = shift; - return 0 unless run_test("`$compiler`", !system "$compiler -v >/dev/null 2>&1"); + return 0 unless run_test("`$compiler`", !system "$compiler -v ${\CONFIGURE_ERROR_PIPE}"); return 0 unless run_test("`$compiler`", test_file($compiler, 'compiler.cpp', '-fno-rtti'), 'compatible'); return 1; } @@ -199,8 +200,8 @@ sub test_file($$;$) { my ($compiler, $file, $args) = @_; my $status = 0; $args //= ''; - $status ||= system "$compiler -o __test_$file make/test/$file $args >/dev/null 2>&1"; - $status ||= system "./__test_$file >/dev/null 2>&1"; + $status ||= system "$compiler -o __test_$file make/test/$file $args ${\CONFIGURE_ERROR_PIPE}"; + $status ||= system "./__test_$file ${\CONFIGURE_ERROR_PIPE}"; unlink "./__test_$file"; return !$status; } @@ -208,7 +209,7 @@ sub test_file($$;$) { sub test_header($$;$) { my ($compiler, $header, $args) = @_; $args //= ''; - open(COMPILER, "| $compiler -E - $args >/dev/null 2>&1") or return 0; + open(COMPILER, "| $compiler -E - $args ${\CONFIGURE_ERROR_PIPE}") or return 0; print COMPILER "#include <$header>"; close(COMPILER); return !$?; -- cgit v1.2.3 From 27facf2e0cc75da52ce3acf2c21a06ea26d1d55d Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 26 Dec 2016 05:17:41 +0000 Subject: Fix the clock_gettime() test on macOS Sierra. macOS now supports clock_gettime() but it is part of libSystem rather than librt which does not exist on macOS. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 696d94886..4c80500fc 100755 --- a/configure +++ b/configure @@ -149,7 +149,7 @@ unless ($config{CXX}) { } my %compiler = get_compiler_info($config{CXX}); -$config{HAS_CLOCK_GETTIME} = run_test 'clock_gettime()', test_file($config{CXX}, 'clock_gettime.cpp', '-lrt'); +$config{HAS_CLOCK_GETTIME} = run_test 'clock_gettime()', test_file($config{CXX}, 'clock_gettime.cpp', $^O eq 'darwin' ? undef : '-lrt'); $config{HAS_EVENTFD} = run_test 'eventfd()', test_file($config{CXX}, 'eventfd.cpp'); if ($config{HAS_EPOLL} = run_test 'epoll', test_header($config{CXX}, 'sys/epoll.h')) { -- cgit v1.2.3