view configure @ 453:19f1aa01ea10

new approach to config & build for ThemWi software
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 10 May 2024 05:45:46 +0000
parents
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