@@ -21,18 +21,29 @@ def is_debug():
21
21
22
22
23
23
if is_debug ():
24
- macroses .append (("PYXMLSEC_ENABLE_DEBUG" , 1 ))
24
+ macroses .append (("PYXMLSEC_ENABLE_DEBUG" , "1" ))
25
25
cflags .extend (["-Wall" , "-O0" ])
26
26
else :
27
27
cflags .extend (["-Os" ])
28
28
29
29
30
- def add_to_list (target , up ):
30
+ # values which requires escaping
31
+ require_escape = {"XMLSEC_CRYPTO" }
32
+
33
+
34
+ def add_to_list (target , up , need_to_escape = None ):
31
35
if up is None :
32
36
return target
33
37
34
38
value = set (target )
35
- value .update (up )
39
+ if need_to_escape :
40
+ for x in up :
41
+ if x [0 ] in need_to_escape :
42
+ value .add ((x [0 ], '"{0}"' .format (x [1 ])))
43
+ else :
44
+ value .add (x )
45
+ else :
46
+ value .update (up )
36
47
target [:] = list (value )
37
48
38
49
@@ -61,10 +72,12 @@ def patch_xmlsec(self):
61
72
62
73
ext = self .ext_map [__name__ ]
63
74
config = pkgconfig .parse ("xmlsec1" )
75
+ # need to escape XMLSEC_CRYPTO
64
76
# added build flags from pkg-config
65
- for item in ('define_macros' , ' libraries' , 'library_dirs' , 'include_dirs' ):
77
+ for item in ('libraries' , 'library_dirs' , 'include_dirs' ):
66
78
add_to_list (getattr (ext , item ), config .get (item ))
67
79
80
+ add_to_list (ext .define_macros , config .get ('define_macros' ), {"XMLSEC_CRYPTO" })
68
81
add_to_list (ext .include_dirs , lxml .get_include ())
69
82
70
83
0 commit comments