diff --git a/builder/builder.ml b/builder/builder.ml index b2bab3d3c..78faefc80 100644 --- a/builder/builder.ml +++ b/builder/builder.ml @@ -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 diff --git a/configure.ac b/configure.ac index eeca3fa60..4732c9207 100644 --- a/configure.ac +++ b/configure.ac @@ -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="$( diff --git a/mllib/config.ml.in b/mllib/config.ml.in index d18bf7bdf..129741dee 100644 --- a/mllib/config.ml.in +++ b/mllib/config.ml.in @@ -18,3 +18,5 @@ let package_name = "@PACKAGE_NAME@" let package_version = "@PACKAGE_VERSION@" + +let xzcat = "@XZCAT@"