* WT-2658 Only include PPC-specific files in PPC builds * Add support for conditional file inclusion by adding a second argument on lines in dist/filelist. Add a new automake conditional, POWERPC_HOST, set for the various PPC host CPUs. Change dist/filelist to only compile the checksum/power8 files if POWERPC_HOST is set. * Merge the Windows and POSIX file lists, use POSIX_HOST and WINDOWS_HOST to mark source files needed for builds on those systems.
40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#! /bin/sh
|
|
|
|
# Complain about unused #defines.
|
|
t=__wt.$$
|
|
trap 'rm -f $t; exit 0' 0 1 2 3 13 15
|
|
|
|
# List of source files to search.
|
|
l=`sed -e '/^[a-z]/!d' -e 's/[ ].*$//' -e 's,^,../,' filelist`
|
|
l="$l `echo ../src/include/*.i ../src/utilities/*.c ../test/*/*.c`"
|
|
|
|
# List of include files for source #defines.
|
|
# Ignore the queue.h file, we don't use most of it.
|
|
dl="../src/include/*.[hi] ../src/include/*.in"
|
|
dl=`echo $dl | sed 's/ [^ ]*queue.h//'`
|
|
|
|
(
|
|
# Copy out the list of #defines we don't use, but it's OK.
|
|
sed -e '/^$/d' -e '/^#/d' < s_define.list
|
|
|
|
# Search the list of include files for #defines
|
|
# Ignore configuration objects #defines
|
|
# Ignore statistic "keys" generated for applications #defines
|
|
search=`cat $dl |
|
|
sed -e '/configuration section: BEGIN/,/configuration section: END/d' \
|
|
-e '/Statistics section: BEGIN/,/Statistics section: END/d' |
|
|
egrep '^#define' |
|
|
sed 's/#define[ ][ ]*\([A-Za-z_][A-Za-z0-9_]*\).*/\1/' |
|
|
sort -u`
|
|
|
|
# Print the list of macros, followed by the occurrences: we're looking for
|
|
# macros that only appear once.
|
|
echo "$search"
|
|
fgrep -who "$search" $l
|
|
|
|
) | sort | uniq -u > $t
|
|
|
|
test -s $t && cat $t
|
|
|
|
exit 0
|