blob: dd20e468e78ddc203806a7f46963f9162063fbb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/bin/sh
# behold my awful terrible fake configure script
cd "$(dirname "$0")" || exit 1
# put in variables as given by long options
# e.g. --my-option=/usr becomes MY_OPTION=/usr
for arg in "$@"; do
without_dashes="${arg#--}"
name="${without_dashes%%=*}"
name="${name//-/_}"
value="${without_dashes#*=}"
echo "${name^^}:=${value}"
done > config.mk
# and here are some defaults in case nobody bothered to pass options
cat >>config.mk <<'EOF'
HARE ?= hare
DESTDIR ?=
PREFIX ?= /usr/local
SRCDIR ?= $(PREFIX)/src
HARESRCDIR ?= $(SRCDIR)/hare
THIRDPARTYDIR ?= $(HARESRCDIR)/third-party
EOF
# TODO: parse --host/--target/--build into appropriate hare architecture ?
# i feel like i need to say something on completion, because this script is so
# much faster and quieter than real autoconf configure, you might think it
# didn't do anything otherwise
echo 'configure: done' 1>&2
|