Iwyu relies on clang, hence we need to install it. In ubuntu 14.04 the latest version is 3.5: let's go with it.
sudo apt-get install clang-3.5 llvm-3.5-dev
Clone the github repo, and move to the 3.5 branch (same as our clang version).
git clone git@github.com:include-what-you-use/include-what-you-use.git
git checkout clang_3.5 -b clang_3.5
Compile it (I used cmake).
mkdir build
cd build
cmake -DLLVM_PATH=/usr/lib/llvm-3.5 ..
make
Due to a bug of iwyu, the executable must be manually copied into the system
[from the build dir]
cp include-what-you-use /usr/lib/llvm-3.5/bin/
I succeded to use it just setting it manually in autotools, so far. Edit epan/dissectors/Makefile
and set CC
to
/usr/lib/llvm-3.5/bin/include-what-you-use
. Run it
make -k packet-aeron.o
to compile packet-aeron.c
Thanks for the guide! I had to install clang headers as well:
sudo apt-get install libclang-3.5-dev