[beast: 63/70] EBEAST: conditionalize ebeat app build on finding npm



commit ea1bcfe2a0fcf285147bac0157e8f69fb9c92578
Author: Tim Janik <timj gnu org>
Date:   Fri Mar 24 11:44:40 2017 +0100

    EBEAST: conditionalize ebeat app build on finding npm
    
    Signed-off-by: Tim Janik <timj gnu org>

 configure.ac       |    9 +++++++++
 ebeast/Makefile.am |    9 +++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 697eb7a..7da6141 100644
--- a/configure.ac
+++ b/configure.ac
@@ -299,6 +299,15 @@ AC_SUBST(LIBZ_LIBS)
 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)
+fi
+AM_CONDITIONAL(WITH_NPM, [test "$with_npm" = "yes"])
 
 dnl #
 dnl # Define package requirements.
diff --git a/ebeast/Makefile.am b/ebeast/Makefile.am
index c07475f..9846322 100644
--- a/ebeast/Makefile.am
+++ b/ebeast/Makefile.am
@@ -7,11 +7,16 @@ EXTRA_DIST += $(strip \
 )
 
 # == all: ==
-all:
-       @echo "$$(basename $$(pwd))/: experimental code, not built by default. Usage:"
+all: with_npm
+       @echo "$$(basename $$(pwd))/: experimental code. Usage:"
        @echo " make app        # build the v8 Bse module and app files"
        @echo " make run        # run the electron app in the current directory"
        @echo " make clean      # remove build files"
+if WITH_NPM
+with_npm: app
+else
+with_npm:
+endif
 
 # == package.json ==
 package.json: package.json.in ../config.status


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