head	1.1;
access;
symbols
	dws_pl15i:1.1
	cluster_15h:1.1
	dws_pl15h_ibcs:1.1;
locks; strict;
comment	@# @;


1.1
date	94.02.26.22.05.16;	author dws;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Added iBCS emulation support.
@
text
@#! /bin/sh
# $Id: config,v 1.0 1994/02/20 23:28:29 st Exp st $
#
# config - used to configure the Linux kernel.
#
# usage: config [-v] <config-file>
#
# Based on Linux 0.99.10 Configure (Configure 1.3 04/05/93) by Linus
# Torvalds, <torvalds@@helsinki.fi>
#
# Hacked by Scott Telford (s.telford@@ed.ac.uk) to read a pseudo-BSD-like
# config file instead of interactive yes/no input - st 94/02/16
#
# supported directive syntax: 
#	ident <name>
#	cpu <type>
#	videomode <mode>
#	ramdisk <size>
#	options [<symbol> | <symbol> = <number> ]
#	config <image> root on [<device> | CURRENT]
#	# <comment>			- comment propagated to output
#	#<comment>			- comment not propagated
#
# (trailing comments ignored and not propagated)
# (ident and config <image> not supported in standard kernel makefile)
#
#set -x

# Set variables to initial state.
OPTS=""
CONFIG=../.config
CONFIG_H=../include/linux/autoconf.h

# Check commandline arguments.
  while [ $# != 1 ]
  do
	case $1 in
		-v) verbose=t ;;
	esac
	shift
  done
 	
  echo "#" > $CONFIG
  echo "# Automatically generated make config: don't edit" >> $CONFIG
  echo "#" >> $CONFIG

  echo "/*" > $CONFIG_H
  echo " * Automatically generated C config: don't edit" >> $CONFIG_H
  echo " */" >> $CONFIG_H

  echo >> $CONFIG
  echo >> $CONFIG_H

  # First of all, emit the "special" features to <linux/autoconf.h>.
  if [ "${OPTS}" ]
  then
	echo "#define ${OPTS}" >> $CONFIG_H
  fi

# Read our config file
(
  while read i
  do
	if [ "$i" != "" ] ; then
		set $i
		if [ "$verbose" = "t" ] ; then
		 	echo $* ; fi

		case $1 in 
			\#)
				shift
				echo "# $*" >> $CONFIG
				if [ "$*" != "" ] ; then
					echo "/* $* */" >> $CONFIG_H
				else
					echo >> $CONFIG_H
				fi
				;;

			\#*)	# ignore comments without following space
				;;

			options)
				if [ "$3" != "=" ] ; then
					echo "CONFIG_$2 = CONFIG_$2" >> $CONFIG
					echo "#define CONFIG_$2 1" >> $CONFIG_H
				else 
					echo "CONFIG_$2 = $4" >> $CONFIG
					echo "#define CONFIG_$2 ($4)"  >> $CONFIG_H
				fi
				;;

			ident)
				echo "#define LINUX_COMPILE_NAME \"$2\"" >> $CONFIG_H
				;;

			cpu)	
				case $2 in
					i386)
						;;
					i[45]86)
						echo "CONFIG_M486 = CONFIG_M486" >> $CONFIG
						echo "#define CONFIG_M486 1" >> $CONFIG_H
						;;
					*)
						echo "config: unsupported CPU type: $2"
						exit 1
						;;
				esac
				;;

			config)
				if [ "$3" = "root" -a "$4" = "on" ] ; then
					echo "IMAGE_FILE = $2" >> $CONFIG
					if [ "$5" != "CURRENT" ] ; then 
						echo "ROOT_DEV = /dev/$5" >> $CONFIG
					else
						echo "ROOT_DEV = CURRENT" >> $CONFIG
					fi
				else
					echo "config: bad config directive syntax: $*"
					exit 1
				fi
				;;

			videomode)
				echo "SVGA_MODE = -DSVGA_MODE=$2" >> $CONFIG
				;;

			ramdisk)
				echo "RAMDISK = -DRAMDISK=$2" >> $CONFIG
				;;

			*)
				echo "config: unrecognised directive: $*"
				exit 1
				;;
		esac
	else
		echo >> $CONFIG
		echo >> $CONFIG_H
	fi	

  done
) < $1

exit 0
@
