Skip to content

Commit d083998

Browse files
committed
scons: explicitly define call arg in CheckLibWithHeader
For better compatibility with Scons version 4.9.0 and after. See also: * GEM5 upstream repository PR: gem5/gem5#2080 * SCons break change: SCons/scons#4676 Change-Id: I0082f1b12d6afc25e0791673cd8f7d4c400d8644
1 parent d27d44a commit d083998

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

SConstruct

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,15 +599,18 @@ for variant_path in variant_paths:
599599
with gem5_scons.Configure(env) as conf:
600600
# On Solaris you need to use libsocket for socket ops
601601
if not conf.CheckLibWithHeader(
602-
[None, 'socket'], 'sys/socket.h', 'C++', 'accept(0,0,0);'):
602+
[None, 'socket'], 'sys/socket.h', 'C++',
603+
call='accept(0,0,0);'):
603604
error("Can't find library with socket calls (e.g. accept()).")
604605

605-
if not conf.CheckLibWithHeader('z', 'zlib.h', 'C++','zlibVersion();'):
606+
if not conf.CheckLibWithHeader('z', 'zlib.h', 'C++',
607+
call='zlibVersion();'):
606608
error('Did not find needed zlib compression library '
607609
'and/or zlib.h header file.\n'
608610
'Please install zlib and try again.')
609611

610-
if not conf.CheckLibWithHeader('zstd', 'zstd.h', 'C++','ZSTD_isError(0);'):
612+
if not conf.CheckLibWithHeader('zstd', 'zstd.h', 'C++',
613+
call='ZSTD_isError(0);'):
611614
error('Did not find needed zstd compression library '
612615
'and/or zstd.h header file.\n'
613616
'Please install zstd and try again.')

src/base/SConsopts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ with gem5_scons.Configure(main) as conf:
5252

5353
conf.env['CONF']['HAVE_POSIX_CLOCK'] = \
5454
conf.CheckLibWithHeader([None, 'rt'], 'time.h', 'C',
55-
'clock_nanosleep(0,0,NULL,NULL);')
55+
call='clock_nanosleep(0,0,NULL,NULL);')
5656
if not conf.env['CONF']['HAVE_POSIX_CLOCK']:
5757
warning("Can't find library for POSIX clocks.")
5858

src/base/stats/SConsopts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ with gem5_scons.Configure(main) as conf:
4343
# since some installations don't use pkg-config.
4444
conf.env['CONF']['HAVE_HDF5'] = \
4545
conf.CheckLibWithHeader('hdf5', 'hdf5.h', 'C',
46-
'H5Fcreate("", 0, 0, 0);') and \
46+
call='H5Fcreate("", 0, 0, 0);') and \
4747
conf.CheckLibWithHeader('hdf5_cpp', 'H5Cpp.h', 'C++',
48-
'H5::H5File("", 0);')
48+
call='H5::H5File("", 0);')
4949

5050
if conf.env['CONF']['HAVE_HDF5']:
5151
conf.env.TagImplies('hdf5', 'gem5 lib')

src/cpu/kvm/SConsopts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ with gem5_scons.Configure(main) as conf:
4747
print("Info: Compatible header file <linux/kvm.h> not found, "
4848
"disabling KVM support.")
4949
elif not conf.CheckLibWithHeader([None, 'rt'], [ 'time.h', 'signal.h' ],
50-
'C', 'timer_create(CLOCK_MONOTONIC, NULL, NULL);'):
50+
'C', call='timer_create(CLOCK_MONOTONIC, NULL, NULL);'):
5151
warning("Cannot enable KVM, host doesn't support POSIX timers")
5252
elif host_isa == 'x86_64':
5353
if conf.CheckTypeSize('struct kvm_xsave',

src/mem/SConsopts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ import gem5_scons
3333
with gem5_scons.Configure(main) as conf:
3434
have_shm_open = \
3535
conf.CheckLibWithHeader([None, 'rt'], 'sys/mman.h', 'C',
36-
'shm_open("/test", 0, 0);')
36+
call='shm_open("/test", 0, 0);')
3737
if not have_shm_open:
3838
warning("Can't find library for sys/mman.")

src/proto/SConsopts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ with gem5_scons.Configure(main) as conf:
6161
(conf.env['HAVE_PKG_CONFIG'] and
6262
conf.CheckPkgConfig('protobuf', '--cflags', '--libs')) or
6363
conf.CheckLibWithHeader('protobuf', 'google/protobuf/message.h',
64-
'C++', 'GOOGLE_PROTOBUF_VERIFY_VERSION;'))
64+
'C++', call='GOOGLE_PROTOBUF_VERIFY_VERSION;'))
6565

6666
# If we have the compiler but not the library, print another warning.
6767
if main['HAVE_PROTOC'] and not main['CONF']['HAVE_PROTOBUF']:

src/sim/SConsopts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import gem5_scons
3131

3232
with gem5_scons.Configure(main) as conf:
3333
if conf.CheckLibWithHeader([None, 'execinfo'], 'execinfo.h', 'C',
34-
'char temp; backtrace_symbols_fd((void *)&temp, 0, 0);'):
34+
call='char temp; backtrace_symbols_fd((void *)&temp, 0, 0);'):
3535
conf.env['BACKTRACE_IMPL'] = 'glibc'
3636
else:
3737
conf.env['BACKTRACE_IMPL'] = 'none'

0 commit comments

Comments
 (0)