aboutsummaryrefslogtreecommitdiffstats
path: root/pc/mkconf.cmd
blob: 3d3eb3d334d5389cd19c92f57a66f07db4689497 (plain)
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
29
30
31
extproc sh

#! /bin/sh
#
# mkconf -- produce a config.h from a known configuration

case "$#" in
1)	;;
*)	echo "Usage:  mkconf system_type" >&2
	echo "Known systems:  `cd config; echo ;ls -C`" >&2
	exit 2
	;;
esac

if [ -f config/$1 ]; then
	sh ./mungeconf.cmd config/$1 config.h-dist >config.h
	sed -n '/^#echo /s///p' config/$1
	sed -n '/^MAKE_.*/s//s,^##&## ,,/p' config/$1 >sedscr
	if [ -s sedscr ]
	then
		sed -f sedscr Makefile-dist >Makefile
	else
		cp Makefile-dist Makefile
	fi
	cmd /c del sedscr
else
	echo "\`$1' is not a known configuration."
	echo "Either construct one based on the examples in the config directory,"
	echo "or copy config.h-dist to config.h and edit it."
	exit 1
fi