#!/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