Check --enable-rpm dependencies more rigorously
authorOndrej Oprala <ondrej.oprala@gmail.com>
Mon, 12 Dec 2016 15:37:54 +0000 (16:37 +0100)
committerOndrej Oprala <ondrej.oprala@gmail.com>
Tue, 13 Dec 2016 19:55:00 +0000 (20:55 +0100)
If a user has explicitly specified --enable-rpm when running
"configure", it will now fail unless both rpm2cpio and cpio
are present on the system.

        * configure.ac: Check if both rpm2cpio and cpio
        exist on the system. If not, disable the option and fail the
        configuration if --enable-rpm was specified explicitly.

Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com>
configure.ac

index 11adf18b5843200194163bb5afb13be6699b81c5..882c65221e8bdee6065cf4d0023d66e8ef6746f4 100644 (file)
@@ -202,10 +202,13 @@ if test x$ENABLE_RPM = xyes -o x$ENABLE_RPM = xauto; then
   AC_CHECK_PROG(HAS_RPM2CPIO, rpm2cpio, yes, no)
   AC_CHECK_PROG(HAS_CPIO, cpio, yes, no)
 
-  if test x$ENABLE_RPM = xauto; then
-    if test x$HAS_RPM2CPIO = xyes -a x$HAS_CPIO = xyes; then
-       ENABLE_RPM=yes
+  if test x$HAS_RPM2CPIO = xyes -a x$HAS_CPIO = xyes; then
+     ENABLE_RPM=yes
+  else
+    if test x$ENABLE_RPM = xyes; then
+      AC_MSG_ERROR([rpm support in abipkgdiff needs both 'rpm2cpio' and 'cpio' programs to be installed])
     fi
+    ENABLE_RPM=no
   fi
 fi