aboutsummaryrefslogtreecommitdiff
path: root/configure
blob: a50278a01668647a126cfbbd3f117ccce92d2856 (plain) (blame)
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
#!/bin/sh
set -eu

# shellcheck disable=2068
for f in $@; do
	case "$f" in
		--prefix)
			shift
			CLI_PREFIX="$1"
			shift
			;;
		--prefix=*)
			CLI_PREFIX="${f#--prefix=}"
			shift
			;;
		*)
			if [ -n "${1:-}" ]; then
				shift
			fi
			;;
	esac
done

PREFIX="${CLI_PREFIX:-/usr/local}"

sed "s:@PREFIX@:$PREFIX:g" Makefile.in > Makefile

echo Done. >&2