aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Spil <Sp1l@users.noreply.github.com>2017-12-04 15:17:49 +0100
committerEugene Kliuchnikov <eustas@google.com>2017-12-04 15:17:49 +0100
commit62194f204d90a5a95310a6949f00a0c6c5ca07bd (patch)
tree9950b1a1a08b3ab829bc9adc2e634461544460a1
parent2d6b298e117576dc3e4fa41f53ba57400bf7beed (diff)
downloadbrotli-62194f204d90a5a95310a6949f00a0c6c5ca07bd.zip
brotli-62194f204d90a5a95310a6949f00a0c6c5ca07bd.tar.gz
brotli-62194f204d90a5a95310a6949f00a0c6c5ca07bd.tar.bz2
Work around Linuxisms (#627)
Missed this in my previous tests. Sorry for that. On BSDs, both bc and sed are part of the base operating system. For sed this results in an error as the check construct (--version) is a GNU-ism and only works for GNU sed, not for bsd sed. Similarly, BSD sed does not take parameters after the filename(s) operated on. Moving `-i` to the front fixes that. `-r` is provided for GNU compat in BSD sed as an alias of `-E`. The `-i` option in BSD sed requires an extension to work in-place. (thank you for picking up the nginx module too!)
-rwxr-xr-xbootstrap6
1 files changed, 4 insertions, 2 deletions
diff --git a/bootstrap b/bootstrap
index 7c7020d..dbaea15 100755
--- a/bootstrap
+++ b/bootstrap
@@ -2,7 +2,9 @@
REQUIRED='is required, but not installed.'
bc -v >/dev/null 2>&1 || { echo >&2 "'bc' $REQUIRED"; exit 1; }
+if [ `uname -s` != "FreeBSD" ]; then
sed --version >/dev/null 2>&1 || { echo >&2 "'sed' $REQUIRED"; exit 1; }
+fi
autoreconf --version >/dev/null 2>&1 || { echo >&2 "'autoconf' $REQUIRED"; exit 1; }
mkdir m4 2>/dev/null
@@ -21,7 +23,7 @@ BROTLI_VERSION_MINOR=`expr $BROTLI_VERSION_INT / 4096 % 4096`
BROTLI_VERSION_PATCH=`expr $BROTLI_VERSION_INT % 4096`
BROTLI_VERSION="$BROTLI_VERSION_MAJOR.$BROTLI_VERSION_MINOR.$BROTLI_VERSION_PATCH"
-sed -r "s/[0-9]+:[0-9]+:[0-9]+/$BROTLI_ABI_INFO/" Makefile.am -i
-sed -r "s/\[[0-9]+\.[0-9]+\.[0-9]+\]/[$BROTLI_VERSION]/" configure.ac -i
+sed -i.bak -r "s/[0-9]+:[0-9]+:[0-9]+/$BROTLI_ABI_INFO/" Makefile.am
+sed -i.bak -r "s/\[[0-9]+\.[0-9]+\.[0-9]+\]/[$BROTLI_VERSION]/" configure.ac
autoreconf --install --force --symlink || exit $