From 62b10f1e2c716dcc2b1a7d1a2d7c4ed6042edbf5 Mon Sep 17 00:00:00 2001 From: Ethan Morgan Date: Sat, 14 Feb 2026 16:17:47 +0000 Subject: init repo --- configure | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100755 configure (limited to 'configure') diff --git a/configure b/configure new file mode 100755 index 0000000..0608b83 --- /dev/null +++ b/configure @@ -0,0 +1,137 @@ +#!/usr/bin/env sh +# +# Configure script for impl +# + +CONFIGURE_CMD_ARGS="${*}" + +PACKAGE_VERSION="0.1.0" +PACKAGE_DATE="$(date +%Y-%m-%d)" +PACKAGE_STRING="impl $PACKAGE_VERSION" +PACKAGE_BUGREPORT="ethan@gweithio.com" +PACKAGE_URL="https://sixfourtwelve.com/repos/impl.git" + +find_program() { + varname=$1 + shift + + printf "Checking for $varname ..." >&2 + for x in $*; do + if command -v $x >/dev/null 2>&1 && [ -x $(command -v $x) ]; then + binary="$(command -v $x)" + printf " $binary\n" >&2 + echo "${binary}" + return 0 + fi + done + printf " not found\n" >&2 + return 1 +} + +die() { + printf "%s\n" "${*}" + exit 1 +} + +# Default values +PREFIX="/usr/local" +OPTIMISE="release" +CC="" +AR="ar" +RANLIB="ranlib" +RM="rm" +INSTALL="install" + +# Parse arguments +while [ $# -gt 0 ]; do + case "$1" in + --prefix=*) + PREFIX="${1#--prefix=}" + ;; + --prefix) + shift + PREFIX="$1" + ;; + --debug) + OPTIMISE="debug" + ;; + --release) + OPTIMISE="release" + ;; + --help) + cat <&1 | grep -i clang >/dev/null; then + CCOM="clang" +elif $CC --version 2>&1 | grep -i gcc >/dev/null; then + CCOM="gcc" +else + CCOM="unknown" +fi + +printf "Compiler: %s (%s)\n" "$CC" "$CCOM" + +# Generate config.h +cat > config.h < Makefile + +echo "Configuration complete. Run 'make' to build." -- cgit v1.2.3