libexpat - Fix buildworld
[dragonfly.git] / sys / tools / emu10k1-mkalsa.sh
blob1d9b034a2ab8b7b763292e53c46f545b23b770f4
1 # $FreeBSD: src/sys/tools/emu10k1-mkalsa.sh,v 1.1 2004/02/05 22:51:16 peter Exp $
2 # $DragonFly: src/sys/tools/emu10k1-mkalsa.sh,v 1.1 2007/01/04 21:47:03 corecode Exp $
4 GREP=${GREP:-grep}
5 CC=${CC:-cc}
6 AWK=${AWK:-awk}
7 MV=${MV:=mv}
8 RM=${RM:=rm}
9 IN=$1
10 OUT=$2
12 trap "${RM} -f $OUT.tmp" EXIT
14 $GREP -v '#include' $IN | \
15 $CC -E -D__KERNEL__ -dM - | \
16 $AWK -F"[ (]" '
17 /define/ {
18 print "#ifndef " $2;
19 print;
20 print "#endif";
21 }' > $OUT.tmp
22 ${MV} -f $OUT.tmp $OUT