2017-02-02 22:08:43 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Small .h isolated compile checker
|
|
|
|
# Finds missing #include <...>
|
2017-02-07 15:38:57 +00:00
|
|
|
# prints compile time, number of includes, use with sort: ./check_include.sh 2>&1 | sort -rk3
|
2017-02-02 22:08:43 +00:00
|
|
|
pwd=`pwd`
|
2017-04-26 14:31:25 +00:00
|
|
|
inc="-I. -I./contrib/libdivide -I./contrib/libre2 -I./build/contrib/libre2 -I./contrib/libfarmhash -I./contrib/libmetrohash/src -I./contrib/libdouble-conversion -I./contrib/libcityhash/include -I./contrib/libzookeeper/include -I./contrib/libtcmalloc/include -I./build/contrib/libzlib-ng -I./contrib/libzlib-ng -I./contrib/libpoco/MongoDB/include -I./contrib/libpoco/XML/include -I./contrib/libpoco/Crypto/include -I./contrib/libpoco/Data/ODBC/include -I./contrib/libpoco/Data/include -I./contrib/libpoco/Net/include -I./contrib/libpoco/Util/include -I./contrib/libpoco/Foundation/include -I./contrib/libboost/boost_1_62_0 -I./libs/libmysqlxx/include -I./libs/libcommon/include -I./build/libs/libcommon/include -I./dbms/src -I./build/dbms/src -I./libs/libpocoext/include -I./libs/libzkutil/include -I./libs/libdaemon/include"
|
2017-02-02 22:08:43 +00:00
|
|
|
if [ -z $1 ]; then
|
2017-04-05 11:52:23 +00:00
|
|
|
cd ..
|
|
|
|
find dbms libs utils -name *.h -exec sh $pwd/$0 {} \; ;
|
2017-02-02 22:08:43 +00:00
|
|
|
else
|
2017-04-05 11:52:23 +00:00
|
|
|
echo -n "$1 "
|
|
|
|
echo -n `grep "#include" $1| wc -l` " "
|
|
|
|
echo -e "#include <$1> \n int main() {return 0;}" | bash -c "TIMEFORMAT='%3R'; time g++-6 -c -std=gnu++1y $inc -x c++ -"
|
2017-02-02 22:08:43 +00:00
|
|
|
fi
|