scons: Simplify check for have_posix_clock.
authorGabe Black <gabe.black@gmail.com>
Sun, 7 Feb 2021 09:57:35 +0000 (01:57 -0800)
committerGabe Black <gabe.black@gmail.com>
Thu, 11 Feb 2021 19:33:24 +0000 (19:33 +0000)
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 <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
SConstruct

index 45a0df6e96d974d43f4591fb1d517e5d2598dcd2..d4acd19e1834c1ffd88fb4919f885e1b69b2d0d7 100755 (executable)
@@ -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.")