1/^PATH=/i
2F2CPREFIX=XXXXX
3.
4/^set -- `getopt/i
5# convert -O to -O1 and move "-o xxx" to the beginning
6set -- `perl -e '@a=map{$_ eq "-O"?"-O1":$_}@ARGV;($i)=grep{$a[$_] eq "-o"}0..$#a;if(defined($i)){@b=splice(@a,$i,2);unshift(@a,@b)}print "@a\n"' -- "$@"`
7.
8/^	-O)/s/case.*/CFLAGS="$CFLAGS -O$2"/
9.+1,.+4c
10		shift 2
11.
12g/        /s//	/g
13g/'-I/s/'/"/g
14g,/usr/local/,s,,${F2CPREFIX}/,g
15g,/lib/cpp,s,,$CC -E,
16g/ -lm"/s//"/
17g/ -u MAIN__/s///
18g/	$CC/s//& $ARCHFLAGS/
19w
20