]> git.wh0rd.org - fontconfig.git/blame - src/makealias
Replace gnu-specific sed command with simple grep.
[fontconfig.git] / src / makealias
CommitLineData
23816bf9
KP
1#!/bin/sh
2SRCDIR=$1
3shift
4HEAD=fcalias.h
5TAIL=fcaliastail.h
6rm -f $HEAD $TAIL
6cff1dca 7cat "$@" | grep '^Fc[^ ]* *(' | sed -e 's/ *(.*$//' |
23816bf9
KP
8while read name; do
9 case $name in
10 FcCacheDir|FcCacheSubdir)
11 ;;
12 *)
13 alias="IA__$name"
14 hattr='__attribute((visibility("hidden")))'
15 echo "extern __typeof ($name) $alias $hattr;" >> $HEAD
16 echo "#define $name $alias" >> $HEAD
17 grep -l -w '^'$name "$SRCDIR"/*.c | sed -e 's/^.*\/\([^.]*\)\.c/#ifdef __\1__/' >> $TAIL
18 echo "#undef $name" >> $TAIL
19 cattr='__attribute((alias("'$alias'"), visibility("default")))'
20 echo "extern __typeof ($name) $name $cattr;" >> $TAIL
21 echo "#endif" >> $TAIL
22 ;;
23 esac
24done