ff6299f831
This is an artifact from before SPDK had a configure script or a DPDK submodule. Make configure the only supported way for specifying the location of the DPDK installation to use with SPDK. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I5c197c46220928bb18b97c8807755967d76ea42c Reviewed-on: https://review.gerrithub.io/424893 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
48 lines
1.4 KiB
Python
Executable File
48 lines
1.4 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
import re
|
|
import sys
|
|
|
|
comment = re.compile('^\s*#')
|
|
assign = re.compile('^\s*([a-zA-Z_]+)\s*(\?)?=\s*([^#]*)')
|
|
|
|
args = os.environ.copy()
|
|
for arg in sys.argv:
|
|
m = assign.match(arg)
|
|
if m:
|
|
var = m.group(1).strip()
|
|
val = m.group(3).strip()
|
|
args[var] = val
|
|
|
|
defs = {}
|
|
for config in ('CONFIG', 'CONFIG.local'):
|
|
try:
|
|
with open(config) as f:
|
|
for line in f:
|
|
line = line.strip()
|
|
if not comment.match(line):
|
|
m = assign.match(line)
|
|
if m:
|
|
var = m.group(1).strip()
|
|
default = m.group(3).strip()
|
|
val = default
|
|
if var in args:
|
|
val = args[var]
|
|
if default.lower() == 'y' or default.lower() == 'n':
|
|
if val.lower() == 'y':
|
|
defs["SPDK_{0}".format(var)] = 1
|
|
else:
|
|
defs["SPDK_{0}".format(var)] = 0
|
|
else:
|
|
strval = val.replace('"', '\"')
|
|
defs["SPDK_{0}".format(var)] = strval
|
|
except IOError:
|
|
continue
|
|
|
|
for key, value in sorted(defs.items()):
|
|
if value == 0:
|
|
print("#undef {0}".format(key))
|
|
else:
|
|
print("#define {0} {1}".format(key, value))
|