From: Gabe Black Date: Sun, 7 Feb 2021 09:57:35 +0000 (-0800) Subject: scons: Simplify check for have_posix_clock. X-Git-Tag: develop-gem5-snapshot~86 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c4f2c650267998960217e230f361b014b7e85c0;p=gem5.git scons: Simplify check for have_posix_clock. The "library" argument can actually be a list, in which case each element of the list is checked, one after the other. Use that rather than calling the CheckLibWithHeader method multiple times and manually oring the results. Change-Id: I5c774be15eaa9a7e52ec3ee5a1bbcc5ef1fa0f41 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40863 Tested-by: kokoro Maintainer: Gabe Black Reviewed-by: Andreas Sandberg --- diff --git a/SConstruct b/SConstruct index 45a0df6e9..d4acd19e1 100755 --- a/SConstruct +++ b/SConstruct @@ -629,9 +629,7 @@ if main['HAVE_PROTOC'] and not main['HAVE_PROTOBUF']: # Check for librt. have_posix_clock = \ - conf.CheckLibWithHeader(None, 'time.h', 'C', - 'clock_nanosleep(0,0,NULL,NULL);') or \ - conf.CheckLibWithHeader('rt', 'time.h', 'C', + conf.CheckLibWithHeader([None, 'rt'], 'time.h', 'C', 'clock_nanosleep(0,0,NULL,NULL);') if not have_posix_clock: warning("Can't find library for POSIX clocks.")