From 814aeb78686c7fdd3bab535d85b365607d2d76a3 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Wed, 3 Aug 2011 16:55:40 +0000 Subject: [PATCH] more portable if/then/else --- magic/Makefile.am | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/magic/Makefile.am b/magic/Makefile.am index 9486710b..f00d01ad 100644 --- a/magic/Makefile.am +++ b/magic/Makefile.am @@ -1,5 +1,5 @@ # -# $File: Makefile.am,v 1.66 2011/05/10 17:01:57 christos Exp $ +# $File: Makefile.am,v 1.69 2011/08/03 16:28:23 christos Exp $ # MAGIC_FRAGMENT_BASE = Magdir MAGIC_DIR = $(top_srcdir)/magic @@ -254,14 +254,16 @@ endif ${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) @rm -fr magic @mkdir magic && cp -p $(EXTRA_DIST) magic - @(if [ "${FILE_COMPILE}" = "file" ]; then \ + @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ + echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ + else \ v=$$(file --version | sed -e s/file-// -e q); \ - if [ $$v != ${PACKAGE_VERSION} ]; then \ + if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ echo "Cannot use the installed version of file ($$v) to"; \ echo "cross-compile file ${PACKAGE_VERSION}"; \ echo "Please install file ${PACKAGE_VERSION} locally first"; \ exit 1; \ fi; \ - fi) + fi) $(FILE_COMPILE) -C -m magic @rm -fr magic -- 2.40.0