From: Michael Tremer Date: Sun, 29 May 2022 13:19:18 +0000 (+0000) Subject: configure: Depend on sassc and uglifyjs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73eadbe5e64dcacd4fe50e49f00ee3417ea0dee8;p=pbs.git configure: Depend on sassc and uglifyjs Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 2277eb4d..0affc3b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -432,5 +432,16 @@ SED_PROCESS = \ $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \ < $< > $@ +UGLIFYJS_PROCESS = \ + $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(UGLIFYJS) --compress --mangle -- $< > $@ + %: %.in Makefile $(SED_PROCESS) + +%.css: %.scss + $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(SASSC) --style compressed $< > $@ + +%.min.js: %.js + $(UGLIFYJS_PROCESS) diff --git a/configure.ac b/configure.ac index 2302ccc5..7dada070 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,18 @@ AC_PROG_SED # Python AM_PATH_PYTHON([3.9]) +# SASSC +AC_CHECK_PROG(SASSC, [sassc], [sassc]) +if test -z "${SASSC}"; then + AC_MSG_ERROR([sassc is required]) +fi + +# uglifyjs.terser +AC_CHECK_PROG(UGLIFYJS, [uglifyjs.terser], [uglifyjs.terser]) +if test -z "${UGLIFYJS}"; then + AC_MSG_ERROR([uglifyjs.terser is required]) +fi + save_LIBS="$LIBS" # pkg-config