@@ -18,7 +18,7 @@ let cc verbose c_program =
18
18
let c_file = Filename. temp_file " configure" " .c" in
19
19
let o_file = c_file ^ " .o" in
20
20
output_file c_file c_program;
21
- let found = Sys. command (Printf. sprintf " cc -c %s -o %s %s" c_file o_file (if verbose then " " else " 2>/dev/null" )) = 0 in
21
+ let found = Sys. command (Printf. sprintf " cc -Werror - c %s -o %s %s" c_file o_file (if verbose then " " else " 2>/dev/null" )) = 0 in
22
22
if Sys. file_exists c_file then Sys. remove c_file;
23
23
if Sys. file_exists o_file then Sys. remove o_file;
24
24
found
@@ -116,6 +116,21 @@ let find_xen_4_5 verbose =
116
116
Printf. printf " Looking for xen-4.5: %s\n " (if found then " ok" else " missing" );
117
117
found
118
118
119
+ let find_xen_4_6 verbose =
120
+ let c_program = [
121
+ " #include <stdlib.h>" ;
122
+ " #include <xenctrl.h>" ;
123
+ " #include <xenguest.h>" ;
124
+ " int main(int argc, const char *argv){" ;
125
+ " int r = xc_assign_device(NULL, 0, 0, 0);" ;
126
+ " return 0;" ;
127
+ " }" ;
128
+ ] in
129
+ let found = cc verbose c_program in
130
+ Printf. printf " Looking for xen-4.6: %s\n " (if found then " ok" else " missing" );
131
+ found
132
+
133
+
119
134
let check_arm_header verbose =
120
135
let lines = run verbose " arch" in
121
136
let arch = List. hd lines in
@@ -147,6 +162,7 @@ let configure verbose disable_xenctrl disable_xenlight disable_xenguest =
147
162
let xenlight_4_4 = find_xenlight_4_4 verbose in
148
163
let xen_4_4 = xenlight_4_4 in
149
164
let xen_4_5 = find_xen_4_5 verbose in
165
+ let xen_4_6 = find_xen_4_6 verbose in
150
166
let xc_domain_save_generation_id = find_xc_domain_save_generation_id verbose in
151
167
let have_viridian = find_define verbose " HVM_PARAM_VIRIDIAN" in
152
168
if not xenctrl then begin
@@ -169,8 +185,10 @@ let configure verbose disable_xenctrl disable_xenlight disable_xenguest =
169
185
" # Do not edit" ;
170
186
Printf. sprintf " ENABLE_XENCTRL=--%s-xenctrl" (if disable_xenctrl then " disable" else " enable" );
171
187
Printf. sprintf " ENABLE_XENGUEST42=--%s-xenguest42" (if xen_4_4 || xen_4_5 || disable_xenguest then " disable" else " enable" );
172
- Printf. sprintf " ENABLE_XENGUEST44=%s" (if (xen_4_4 || xen_4_5) && not disable_xenguest then " true" else " false" );
188
+ Printf. sprintf " ENABLE_XENGUEST44=%s" (if (xen_4_4 || xen_4_5) && (not xen_4_6) && not disable_xenguest then " true" else " false" );
189
+ Printf. sprintf " ENABLE_XENGUEST46=%s" (if (xen_4_6) && not disable_xenguest then " true" else " false" );
173
190
Printf. sprintf " HAVE_XEN_4_5=%s" (if xen_4_5 then " true" else " false" );
191
+ Printf. sprintf " HAVE_XEN_4_6=%s" (if xen_4_6 then " true" else " false" );
174
192
175
193
] in
176
194
output_file config_mk lines;
@@ -180,6 +198,7 @@ let configure verbose disable_xenctrl disable_xenlight disable_xenguest =
180
198
" /* Do not edit */" ;
181
199
(if have_viridian then " " else " /* " ) ^ " #define HAVE_HVM_PARAM_VIRIDIAN" ^ (if have_viridian then " " else " */" );
182
200
(if xen_4_5 then " " else " /* " ) ^ " #define HAVE_XEN_4_5" ^ (if xen_4_5 then " " else " */" );
201
+ (if xen_4_6 then " " else " /* " ) ^ " #define HAVE_XEN_4_6" ^ (if xen_4_6 then " " else " */" );
183
202
(if xc_domain_save_generation_id then " " else " /* " ) ^ " #define HAVE_XC_DOMAIN_SAVE_GENERATION_ID" ^ (if xc_domain_save_generation_id then " " else " */" );
184
203
] in
185
204
output_file config_h lines;
0 commit comments