builder: Make xzcat binary configurable and use AC_PATH_PROG.

This commit is contained in:
Richard W.M. Jones
2013-10-22 14:09:20 +01:00
parent 2f3a3e308a
commit 0e18bccb64
3 changed files with 13 additions and 2 deletions

View File

@@ -301,13 +301,18 @@ let main () =
output, Some size, format, delete_output_file, do_resize, true in
(* Create xzcat command to uncompress from input to output. *)
let xzcat_command input output =
sprintf "%s %s > %s" Config.xzcat input output
in
if not do_resize then (
(* If the user did not specify --size and the output is a regular
* file and the format is raw, then we just uncompress the template
* directly to the output file. This is fast but less flexible.
*)
let { Index_parser.file_uri = file_uri } = entry in
let cmd = sprintf "xzcat %s > %s" (quote template) (quote output) in
let cmd = xzcat_command template output in
if debug then eprintf "%s\n%!" cmd;
msg (f_"Uncompressing: %s") file_uri;
let r = Sys.command cmd in
@@ -323,7 +328,7 @@ let main () =
(* Uncompress it to a temporary file. *)
let { Index_parser.file_uri = file_uri } = entry in
let tmpfile = Filename.temp_file "vbsrc" ".img" in
let cmd = sprintf "xzcat %s > %s" (quote template) (quote tmpfile) in
let cmd = xzcat_command template tmpfile in
if debug then eprintf "%s\n%!" cmd;
msg (f_"Uncompressing: %s") file_uri;
let r = Sys.command cmd in

View File

@@ -698,6 +698,10 @@ if test "x$WRESTOOL" != "xno"; then
AC_DEFINE_UNQUOTED([WRESTOOL],["$WRESTOOL"],[Name of wrestool program.])
fi
dnl Check for xzcat (required).
AC_PATH_PROGS([XZCAT],[xzcat],[no])
test "x$XZCAT" = "xno" && AC_MSG_ERROR([xzcat must be installed])
dnl Check for QEMU for running binaries on this $host_cpu, fall
dnl back to basic 'qemu'. Allow the user to override it.
qemu_system="$(

View File

@@ -18,3 +18,5 @@
let package_name = "@PACKAGE_NAME@"
let package_version = "@PACKAGE_VERSION@"
let xzcat = "@XZCAT@"