summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure55
1 files changed, 55 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..e5c7fe7
--- /dev/null
+++ b/configure
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+set -e
+
+OUT=Makefile.inc
+
+> "${OUT}"
+
+checking() {
+ printf "checking for %s... " "$1" >&2
+}
+
+check() {
+ checking="$1"
+ shift
+ var="${VAR:-${checking^^}}"
+ cmd="${!var}"
+ varflags="${var}FLAGS"
+ varflags="$@ ${!varflags}"
+ if [[ -z "${cmd}" ]]; then
+ cmd="${checking}"
+ fi
+ get=$(command -v "${cmd}")
+ e=$?
+ if [[ -n "$get" ]]; then
+ echo ${get}
+ echo ${var} := ${get} ${varflags} >> "${OUT}"
+ fi
+ return $e
+}
+
+rcheck() {
+ checking "$1"
+ if ! check "$@"; then
+ echo no
+ return 1
+ fi
+}
+
+ocheck() {
+ rcheck "$@" || true
+}
+
+checking "zopfli or gzip"
+VAR=GZIP check zopfli || check gzip -9
+
+rcheck apngasm
+rcheck convert
+rcheck cwebp -quiet -alpha_cleanup -m 6
+rcheck ffmpeg -v warning -y
+rcheck npm --quiet
+rcheck webpmux
+ocheck defluff
+ocheck pngquant
+ocheck zopflipng