#!/bin/sh outdir=out cd ${WRKSRC} || exit 2 echo "Patching for FlexLexer.h <->gcc3 issues" file="" candidates=`find /usr/include/ -name FlexLexer.h` #take first found file. for d in $candidates; do if [ -f $d ]; then file=$d; break; fi; done if [ -z "${file}" ]; then echo "Cannot find FlexLexer.h"; exit 2; fi echo -n "Copying and fixing $file... " mkdir -p lily/$outdir rm -f lily/$outdir/FlexLexer.h sed \ -e 's/istream/std::istream/' \ -e 's/[^i]ostream/std::ostream/' \ -e 's/iostream.h/iostream/' \ $file > lily/$outdir/FlexLexer.h echo "done"