view configure @ 457:9bcf65088006

doc/AMR-EFR-philosophy: document implemented solution
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 10 May 2024 18:20:06 +0000
parents 19f1aa01ea10
children cb1d1ea7f2c5
line wrap: on
line source

#!/bin/sh
# This configure script is custom and hand-coded;
# it is NOT a product of GNU Autoconf or any other such tools!

set -e

if [ ! -f configure ]
then
	echo "This script needs to be run from the top of the source tree" 1>&2
	exit 1
fi

# defaults that can be overridden
CC=gcc
CFLAGS=-O2
PREFIX=/opt/themwi

while [ $# != 0 ]
do
	case "$1" in
		--prefix=*)
			PREFIX=`echo $1 | cut -c 10-`
			;;
		CC=*)
			CC=`echo $1 | cut -c 4-`
			;;
		CFLAGS=*)
			CFLAGS=`echo $1 | cut -c 8-`
			;;
		*)
			echo "error: non-understood option $1" 1>&2
			exit 1;
			;;
	esac
	shift
done

# emit the Makefile include fragment
echo "CC=$CC" > config.defs
echo "CFLAGS=$CFLAGS" >> config.defs
echo "PREFIX=$PREFIX" >> config.defs