[beast: 68/70] BUILD: disable npm based Beast package builds if ebeast/ is not present



commit 5b14b6f5761451cacd73d964c001d27b599189cb
Author: Tim Janik <timj gnu org>
Date:   Fri Mar 24 21:46:05 2017 +0100

    BUILD: disable npm based Beast package builds if ebeast/ is not present
    
    Keep distcheck and Debian package builds working while ebeast is being
    developed, without forcing premature ebeast shipping.
    
    Signed-off-by: Tim Janik <timj gnu org>

 configure.ac |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7da6141..e26640a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -300,14 +300,21 @@ AC_CHECK_FUNCS(getpwnam_r getpwnam)
 AC_CHECK_FUNCS(timegm)
 
 # == NPM ==
-AC_PATH_PROG([NPM], [npm])
-if test "y$NPM" != "y" ; then
-    AC_MSG_CHECKING([for npm version])
-    NPM_VERSION=`$NPM --version`
-    AC_MSG_RESULT([$NPM_VERSION])
-    MC_CHECK_VERSION([$NPM_VERSION], 1.4.21, with_npm=yes, with_npm=no)
+AC_ARG_WITH([npm], [  --without-npm           Disable npm based Beast package builds])
+with_usable_npm=no
+# only attempt npm builds if ebeast/ files are present in the current build tree
+if test -r ebeast/package.json.in ; then
+    if test "_$with_npm" != "_no" ; then
+       AC_PATH_PROG([NPM], [npm])
+       if test "_$NPM" != "_" ; then
+           AC_MSG_CHECKING([for npm version])
+           NPM_VERSION=`$NPM --version`
+           AC_MSG_RESULT([$NPM_VERSION])
+           MC_CHECK_VERSION([$NPM_VERSION], 1.4.21, with_usable_npm=yes)
+       fi
+    fi
 fi
-AM_CONDITIONAL(WITH_NPM, [test "$with_npm" = "yes"])
+AM_CONDITIONAL(WITH_NPM, [test "_$with_usable_npm" = "_yes"])
 
 dnl #
 dnl # Define package requirements.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]