diff options
author | Andreas Fankhauser (@tux-six) | 2022-07-07 02:26:29 +0200 |
---|---|---|
committer | Andreas Fankhauser (@tux-six) | 2022-07-07 02:29:04 +0200 |
commit | be5a1fe4a8fe8e79214cb87a870d7e744ea9f200 (patch) | |
tree | 09b9f577d185d65858d22875bf8f0aacb8874e80 /configure | |
download | DeflateAndInflate-be5a1fe4a8fe8e79214cb87a870d7e744ea9f200.zip DeflateAndInflate-be5a1fe4a8fe8e79214cb87a870d7e744ea9f200.tar.gz |
Extract from existing sources
I tried this to be a grafted history because MUST NOT include all the other,
unrelated crap from the mess where I did extract this code from. But it seems a
hard thing to do as all sorts of git commands (eg push, clone, ...) did not
work as epxected. So I keep the commit metadata here where this got split-off.
commit 196ff8beda7a23aee6e1e7388cfc24f6247a63c9
Author: Andreas Fankhauser (@tux-six) <https://hiddenalpha.ch/slnk/id/1:c0n74ct>
Date: 2022-06-10 02:52:11 +0200
(scriptlee) Fix bug in http
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/configure b/configure new file mode 100755 index 0000000..cc38eac --- /dev/null +++ b/configure @@ -0,0 +1,47 @@ + +set -e +if test -n "$BASH_VERSION"; then set -o posix; fi + + +# See https://www.gnu.org/prep/standards/html_node/Directory-Variables.html +prefix=/usr/local +exec_prefix='$(PREFIX)' +bindir='$(EXEC_PREFIX)/bin' +host= + + +main() { + parseArgs "$@" + echo TODO create Makefile +} + + +printHelp() { + echo '' + echo "Example usage: $0 --prefix /usr/local" + echo '' + echo 'Options:' + echo ' --prefix <path> Default "/usr/local"' + echo ' --bindir <path> Default "$(EXEC_PREFIX)/bin"' + echo ' --host <name> Default <empty> (Eg "x86_64-w64-mingw32")' + echo '' +} + + +parseArgs() { + # See: https://stackoverflow.com/a/14203146/4415884 + while test $# -gt 0 ; do + case $1 in + --help) printHelp; exit 1; ;; + --prefix) prefix="$2" shift; shift; ;; + --exec_prefix) exec_prefix="$2" shift; shift; ;; + --bindir) bindir="$2" shift; shift; ;; + --host) host="$2" shift; shift; ;; + *) echo "[ERROR] Unexpected argument: $1" exit 1 ;; + esac + done +} + + +main "$@" + |