The problem is that often the compiler and linker search paths aren't consistent.
By default (unless modified with -isystem or -I) the GCC search path is:
- /usr/local/include
- libdir/gcc/target/version/include
- /usr/target/include
- /usr/include
By default (unless modified with -L) Apple's linker's search path is:
and by default (at least with 2.23.52.20130913 on Ubuntu 13.04) (unless modified with -L) the GNU linker's search path is:
- /usr/local/lib:
- /lib/x86_64-linux-gnu:
- /usr/lib/x86_64-linux-gnu:
- /usr/lib/x86_64-linux-gnu/mesa:
- /lib:
- /usr/lib:
The linker and the compiler may pick up completely different versions of the library's headers and binaries when multiple versions are installed on the system. The compiler may then emit code which is incompatible with the library's ABI, with undefined and usually undesirable behaviour. This is why the check was added.
To ensure consistency you should pass the --with-openssl-includes= and --with-openssl-libraries= flags to the configure script. These directories will then be searched first by the compiler and linker.
./configure --with-openssl-includes=/usr/include --with-openssl-libraries=/usr/lib
will result in the bundled or packaged OpenSSL libraries/headers being used on most systems.
Another option is to set LD_LIBRARY_PATH at configure time, though you'll also need to set this in your init scripts, else the runtime version check (yes, we were thorough) will fail.
configure
tool, there should be a config.log generated that can give more clues about how it's doing the openssl header verification. – Hydrosol