@echo off
echo Configuring GAS for go32
rem This batch file assumes a unix-type "sed" program

update ../bfd/hosts/go32.h sysdep.h

echo # Makefile generated by "configure.bat"> Makefile

if exist config.sed del config.sed

echo "s/^	\$(srcdir)\/move-if-change/	update/	">> config.sed
echo "s/CC = cc/CC = gcc/				">> config.sed
echo "s/:\([^ 	]\)/: \1/g				">> config.sed
echo "s/^	\ *\.\//	go32 /			">> config.sed
echo "s/`echo \$(srcdir)\///g				">> config.sed
echo "s/ | sed 's,\^\\\.\/,,'`//g			">> config.sed
echo "s/^	cd \$(srcdir)[ 	]*;//			">> config.sed

echo "/^arparse\.c/ i\					">> config.sed
echo "arparse.o: arparse.c\				">> config.sed
echo "	$(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) arparse.c ">> config.sed
echo "/\$(BISON)/ c\					">> config.sed
echo "	bison $(BISONFLAGS) -o $@ arparse.y		">> config.sed
echo "/y\.tab\./ d					">> config.sed

echo "/^arlex.c/ {					">> config.sed
echo " i\						">> config.sed
echo "arlex.o: arlex.c					">> config.sed
echo " i\						">> config.sed
echo "	$(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) arlex.c ">> config.sed
echo "}							">> config.sed
echo "/\$(LEX)/ c\					">> config.sed
echo "	flex $(LEX_OPTIONS) arlex.l			">> config.sed
echo "s/lex\.yy\./lexyy./g				">> config.sed

echo "s/'"/\\"/g					">> config.sed
echo "s/"'/\\"/g					">> config.sed

echo "s/c\+\+filt/cppfilt/g				">> config.sed

sed -e "s/^\"//" -e "s/\"$//" -e "s/[ 	]*$//" config.sed > config2.sed
sed -f config2.sed Makefile.in >> Makefile
del config.sed
del config2.sed

echo int prepends_underscore = 1; > underscore.c
