4 # Compare the results of native and cross-compiled configure tests
7 from __future__
import print_function
12 'BUILD_DIRECTORY', 'SELFTEST_PREFIX', 'defines',
13 'CROSS_COMPILE', 'CROSS_ANSWERS', 'CROSS_EXECUTE',
14 'LIBSOCKET_WRAPPER_SO_PATH',
15 'LIBNSS_WRAPPER_SO_PATH',
16 'LIBPAM_WRAPPER_SO_PATH',
17 'PAM_SET_ITEMS_SO_PATH',
18 'LIBUID_WRAPPER_SO_PATH',
19 'LIBRESOLV_WRAPPER_SO_PATH',
27 for fname
in sys
.argv
[1:]:
31 if line
.startswith("cfg_files ="):
32 # waf writes configuration files as absolute paths
34 if len(line
.split('=', 1)) == 2:
35 key
= line
.split('=', 1)[0].strip()
36 value
= line
.split('=', 1)[1].strip()
39 # using waf with python 3.4 seems to randomly sort dict keys
40 # we can't modify the waf code but we can fake a dict value
41 # string representation as if it were sorted. python 3.6.5
42 # doesn't seem to suffer from this behaviour
43 if value
.startswith('{'):
45 amap
= ast
.literal_eval(value
)
47 for k
in sorted(amap
.keys()):
48 if not len(fakeline
) == 0:
49 fakeline
= fakeline
+ ", "
50 fakeline
= fakeline
+ '\'' + k
+ '\': \'' + amap
[k
] + '\''
51 line
= key
+ ' = {' + fakeline
+ '}'
55 diff
= list(difflib
.unified_diff(base_lines
, lines
, base_fname
, fname
))
57 print('configuration files %s and %s do not match' % (base_fname
, fname
))