Commit 5e234d9e authored by Keith Packard's avatar Keith Packard
Browse files

Fix grep pattern in makealias to work on non-Gnu grep (bug 8368).

grep -l -w '^foo' doesn't work on Solaris. Replace with
grep -l '^foo\>' instead which does. Also, grep -l will
report the filename more than once (!), so add | head -1
to pick just the first one.
parent 2b77216e
......@@ -15,7 +15,7 @@ while read name; do
echo "extern __typeof ($name) $alias $hattr;" >> $HEAD
echo "#define $name $alias" >> $HEAD
grep -l -w '^'$name "$SRCDIR"/*.c | sed -e 's/^.*\/\([^.]*\)\.c/#ifdef __\1__/' >> $TAIL
grep -l '^'$name'\>' "$SRCDIR"/*.c | head -1 | sed -e 's/^.*\/\([^.]*\)\.c/#ifdef __\1__/' >> $TAIL
echo "#undef $name" >> $TAIL
cattr='__attribute((alias("'$alias'"), visibility("default")))'
echo "extern __typeof ($name) $name $cattr;" >> $TAIL
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment