From e1dda9fde6193cc4cf42f359ee235369314857fa Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 4 Jun 2013 15:32:35 +0100 Subject: zypp: Only compile zypper support if OCaml inifiles module is found. --- README | 2 ++ configure.ac | 4 ++++ src/.depend | 2 -- src/Makefile.am | 36 ++++++++++++++++++++++++++++-------- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/README b/README index c3e7699..cf16fbe 100644 --- a/README +++ b/README @@ -60,6 +60,8 @@ For Debian/Ubuntu: Optional -------- + ocaml inifiles library (needed for zypper only) + These are only needed if you plan to boot the supermin appliances you are building: diff --git a/configure.ac b/configure.ac index f975f3f..83f95e2 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,10 @@ if test "$OCAMLFIND" = "no"; then AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)]) fi +dnl Optional OCaml packages. +AC_CHECK_OCAML_PKG([inifiles]) +AM_CONDITIONAL([HAVE_OCAML_INIFILES], [test "x$OCAML_PKG_inifiles" != "xno"]) + dnl Optional programs. AC_CHECK_PROG(PERLDOC,[perldoc],[perldoc],[no]) if test "x$PERLDOC" = "xno" ; then diff --git a/src/.depend b/src/.depend index 36a642f..624191e 100644 --- a/src/.depend +++ b/src/.depend @@ -17,5 +17,3 @@ supermin_utils.cmo: supermin_cmdline.cmi supermin_utils.cmi supermin_utils.cmx: supermin_cmdline.cmx supermin_utils.cmi supermin_yum_rpm.cmo: supermin_utils.cmi supermin_package_handlers.cmi supermin_cmdline.cmi config.cmo supermin_yum_rpm.cmx: supermin_utils.cmx supermin_package_handlers.cmx supermin_cmdline.cmx config.cmx -supermin_zypp_rpm.cmo: supermin_utils.cmi supermin_package_handlers.cmi supermin_cmdline.cmi config.cmo -supermin_zypp_rpm.cmx: supermin_utils.cmx supermin_package_handlers.cmx supermin_cmdline.cmx config.cmx diff --git a/src/Makefile.am b/src/Makefile.am index 6ed0faf..b0a6723 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,6 +17,22 @@ # # Written by Richard W.M. Jones +EXTRA_DIST = \ + config.ml \ + supermin.8 \ + supermin.pod \ + supermin.ml \ + supermin_cmdline.mli \ + supermin_cmdline.ml \ + supermin_debian.ml \ + supermin_package_handlers.mli \ + supermin_package_handlers.ml \ + supermin_pacman.ml \ + supermin_utils.mli \ + supermin_utils.ml \ + supermin_yum_rpm.ml \ + supermin_zypp_rpm.ml + # Note these must be in build dependency order. SOURCES = \ config.ml \ @@ -25,8 +41,14 @@ SOURCES = \ supermin_utils.mli \ supermin_utils.ml \ supermin_package_handlers.mli \ - supermin_package_handlers.ml \ - supermin_zypp_rpm.ml \ + supermin_package_handlers.ml + +if HAVE_OCAML_INIFILES +SOURCES += \ + supermin_zypp_rpm.ml +endif + +SOURCES += \ supermin_yum_rpm.ml \ supermin_debian.ml \ supermin_pacman.ml \ @@ -34,11 +56,6 @@ SOURCES = \ CLEANFILES = *~ *.cmi *.cmo *.cmx *.o supermin -EXTRA_DIST = \ - supermin.8 \ - supermin.pod \ - $(SOURCES) - man_MANS = \ supermin.8 @@ -56,7 +73,10 @@ OBJECTS = $(XOBJECTS) BEST = opt endif -OCAMLPACKAGES = -package unix,str,inifiles +OCAMLPACKAGES = -package unix,str +if HAVE_OCAML_INIFILES +OCAMLPACKAGES += -package inifiles +endif OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ supermin: $(OBJECTS)