L4Re/departure

Annotated libext2fs/tools/get_config

212:c0651b3b711f
2021-10-09 Paul Boddie Updated libext2fs to version 1.46.2, also introducing some notes about the process of adapting the library for L4Re, together with a tool to generate a configuration from an existing, external "host" build of the library.
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