]> git.wh0rd.org Git - fontconfig.git/blob - src/makealias
[fcformat] Add element filtering and deletion
[fontconfig.git] / src / makealias
1 #!/bin/sh
2 SRCDIR=$1
3 shift
4 HEAD=$1
5 shift
6 TAIL=$1
7 shift
8 rm -f $HEAD $TAIL
9 echo "#if HAVE_GNUC_ATTRIBUTE" >> $TAIL
10 cat "$@" | grep '^Fc[^ ]* *(' | sed -e 's/ *(.*$//' |
11 while read name; do
12         case $name in
13         FcCacheDir|FcCacheSubdir)
14                 ;;
15         *)
16                 alias="IA__$name"
17                 hattr='__attribute((visibility("hidden")))'
18                 echo "extern __typeof ($name) $alias $hattr;" >> $HEAD
19                 echo "#define $name $alias" >> $HEAD
20                 grep -l '^'$name'[ (]' "$SRCDIR"/*.c | sed -n 1p | sed -e 's/^.*\/\([^.]*\)\.c/#ifdef __\1__/' >> $TAIL
21                 echo "#undef $name" >> $TAIL
22                 cattr='__attribute((alias("'$alias'"), visibility("default")))'
23                 echo "extern __typeof ($name) $name $cattr;" >> $TAIL
24                 echo "#endif" >> $TAIL
25                 ;;
26         esac
27 done
28 echo "#endif" >> $TAIL