]> granicus.if.org Git - file/commitdiff
more portable if/then/else FILE5_08
authorChristos Zoulas <christos@zoulas.com>
Wed, 3 Aug 2011 16:55:40 +0000 (16:55 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 3 Aug 2011 16:55:40 +0000 (16:55 +0000)
magic/Makefile.am

index 9486710bce40cbfa0a79b0c55e5fa984a43fb7dd..f00d01ad01bdec4f8a7ad8b652cde0acfa21417c 100644 (file)
@@ -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