checklibs.sh revision 4c713bf9401c2e55660bdcbba8d71032f482a330
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# This Source Code Form is subject to the terms of the Mozilla Public
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson# License, v. 2.0. If a copy of the MPL was not distributed with this
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson# file, You can obtain one at http://mozilla.org/MPL/2.0/.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# Check for missing #include <isc/print.h> or "print_p.h"
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson grep -vE -e '(lib/bind|lib/dns/rdata|lib/dns/gen.c)' \
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson -e '(lib/isc/win32/time.c|dlzexternal/driver.c)' |
3f42cf2f3e4dc7e740b4609ba7d7430292348f2bMark Andrews xargs grep -EL "(isc/print.h|print_p.h)" 2> /dev/null`
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence echo 'Missing #include <isc/print.h> or #include "print_p.h":'
886b96ebfd555cfeaf37ae46fc08421a41c61392Andreas Gustafsson# Check for missing #include <isc/string.h>"
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson grep -vE -e '(lib/bind|lib/dns/rdata|lib/dns/gen.c)' \
3aca8e5bf3740bbcc3bb13dde242d7cc369abb27Mark Andrews# Check for missing #include <inttypes.h>"
62700b67eb8abb7d13f9c3c1bc4b60a1477d35d8Mark Andrews grep -vE -e '(lib/bind|lib/dns/rdata|lib/dns/gen.c)' \
1adb2e87a20a480e640385609c9652dac04c7dffAndreas Gustafsson# Check for missing #include <config.h>
1adb2e87a20a480e640385609c9652dac04c7dffAndreas Gustafssonlist=`git ls-files -c bin lib | grep '\.c$' |
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson grep -vE -e '(/win32/|bin/pkcs11/|lib/dns/rdata|lib/bind/)' \
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson -e '(ifiter_|lib/dns/gen.c|lib/dns/spnego_asn1.c)' \
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson -e '(lib/dns/rbtdb64.c|lib/isc/entropy.c|lib/isc/fsaccess.c)' \
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrews -e '(bin/tests/virtual-time/vtwrapper.c|symtbl.c|version.c)'`
7b68fa6229f1edadac44c7ec459c9ed77a8368c8Mark Andrewslist=`git ls-files -c lib bin | grep '\.vcxproj\.in$' |
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington awk '{a[$2]++;} END { for (g in a) if (a[g] != 1) print g;}'`
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrews sed -n 's;^lib/\([^/]*\)/win32/.*\.def.*$;\1;p' |
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington test -z "$def" && continue;
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington test -f "$def" || continue;
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson test -d lib/$lib/include && dirs="$dirs lib/$lib/include"
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson test -d lib/$lib/win32/include && dirs="$dirs lib/$lib/win32/include"
6017f424ee3c02d7f22132c77576ea38542fa949Andreas Gustafsson test -z "$dirs" && continue;
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington list=`git ls-files -c $dirs | grep '\.h$' |
1adb2e87a20a480e640385609c9652dac04c7dffAndreas Gustafsson isc__taskmgr_dispatch) continue;; # internal
45e1bd63587102c3bb361eaca42ee7b714fb3542Mark Andrews isc_ntsecurity_getaccountgroups) continue;; # internal
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington isc_socketmgr_getmaxsockets) p=isc__socketmgr_getmaxsockets;;
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington test $lib = isc -a -f lib/isc/win32/libisc.def.exclude &&
90c099e88e9f16bfee9edee3ac1a51fc98843772Brian Wellington grep -q "^${p}"'$' lib/isc/win32/libisc.def.exclude &&
a687a0592bbe3a582860eb5f03725bf80d7ac1d8Mark Andrews grep -q "^$p(" lib/$lib/*.c lib/$lib/win32/*.c && echo "$p"