#! /bin/csh -f
unset	x10 buttons a4
set	noglob
foreach x ($argv[4-])
	if ($x == -DX10)	set x10
	if ($x == -DBUTTONS)	set buttons
	if ($x == -DA4)		set a4
	if ($x == -DSEARCH_SUBDIRECTORIES) set subdir
	if ($x == -DXDVIFONTS_ONLY) set texfonts
end
if ($?x10) then
	echo	/^\#ifx11/,/^\#/d
	echo	s/%%dot%%//
else
	echo	/^\#ifx10/,/^\#/d
	echo	s/%%dot%%/./
endif
if (! $?buttons)	echo /^\#ifbuttons/,/^\#/d
if (! $?subdir)		echo /^\#ifsubdir/,/^\#/d
if ($?texfonts)		echo /^\#iftexfonts/,/^\#/d
echo	/^\#/d
if ($?a4) then
	echo	's/%%defaultpagesize%%/21 x 29.7 cm (A4 size)/'
else
	echo	s/%%defaultpagesize%%/8.5 x 11 inches/
endif
echo	"s@%%DEFAULT_FONT_PATH%%@.TP\\
$1@" | sed -e "s@:@\\\\
.TP\\\\
@g"
echo	s/%%DEFAULT_FONT_SIZES%%/$2/ | sed -e "s/:/ :\\\\
/g"
if ($3 != "") then
	echo	"s@%%DEFAULT_VF_PATH%%@.TP\\
$3@" | sed -e "s@:@\\\\
.TP\\\\
@g"
else
	echo	's@%%DEFAULT_VF_PATH%%.*$@@'
endif
