L4Re/departure

Annotated libext2fs/tools/get_config

618:7123a7307a82
8 months ago Paul Boddie Introduced some debugging output control.
paul@212 1
#!/bin/sh
paul@212 2
paul@212 3
# Find definition usage in the available sources.
paul@212 4
paul@212 5
E2FSPROGS=$1
paul@212 6
paul@212 7
# Find definition names.
paul@212 8
paul@212 9
for DEF in `grep '#define' "$E2FSPROGS/lib/config.h" | sed 's/#define //;s/ .*$//' | grep -e '^[A-Z_]'` ; do
paul@212 10
paul@212 11
    # Look for use of each definition in the libext2fs sources, filtering out
paul@212 12
    # definitions that are not used.
paul@212 13
paul@212 14
    if find "$E2FSPROGS/lib" -mindepth 2 -name '*.[ch]' | xargs grep -q -e "$DEF" ; then
paul@212 15
        grep "#define $DEF" "$E2FSPROGS/lib/config.h"
paul@212 16
    fi
paul@212 17
done
paul@212 18
paul@212 19
# vim: tabstop=4 expandtab shiftwidth=4