Category Archives: autotools

apache2 build fails in yocto – "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]

I was trying to build apache2 on yocto. But I was getting below errors.

ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. Rerun configure task after fixing this.

Some googling led me to

So I looked into conf.log and find out those lines:

cc1: warning: include location "/usr/local/include" is unsafe for
cross-compilation [-Wpoison-system-directories]

arm-poky-linux-gnueabi/4.9.2/ld: warning: library search path "/usr/local/lib" 
is unsafe for cross-compilation

I googled again but, I couldn't understand 3 things yet:

  1. Why has the PATH been set to local path ?
  2. Why does this error only come when building apache2 [ I can build ngnix, cryptsetup, etc..]
  3. How can I fix it?