1 #!/bin/sh 2 3 # Find definition usage in this package's sources. 4 5 THISDIR=`dirname "$0"` 6 PKGDIR=`dirname "$THISDIR"` 7 CONFIG=$1 8 9 if [ ! -e "$CONFIG" ] ; then 10 cat 1>&2 <<EOF 11 Please specify the location of lib/config.h in the e2fsprogs distribution. 12 EOF 13 exit 1 14 fi 15 16 # Insert base configuration. 17 18 cat "$PKGDIR/lib/config.h.in-l4re" > "$PKGDIR/lib/config.h" 19 20 # Find definition names in the sources and insert appropriate configuration 21 # settings. 22 23 DEFS='HAVE_[0-9A-Z_]*\|TLS\|VERSION' 24 25 for SETTING in `find "$PKGDIR/include" "$PKGDIR/lib" -mindepth 2 -type f -name '*.[ch]' | xargs grep -o "$DEFS" | cut -d: -f2 | sort -u` ; do 26 grep -e "$SETTING" "$CONFIG" | grep '#define' 27 done \ 28 | uniq >> "$PKGDIR/lib/config.h" 29 30 # vim: tabstop=4 expandtab shiftwidth=4