building nginx with non-system openssl ?

Maxim Dounin mdounin at mdounin.ru
Sun Apr 4 02:05:19 MSD 2010


Hello!

On Fri, Apr 02, 2010 at 08:28:09PM -0700, Ben DJ wrote:

> I've installed OpenSSL 1.0.0 in /usr/local/ssl; sources are in
> /usr/local/src/openssl.

[...]

> I'm trying to build nginx so that it uses that openssl version's libs/headers.

If you want to use installed version, use:

./configure --with-cc-opt="-I /path/to/include" --with-ld-opt="-L /path/to/lib"

> Noting configure's options,
> 
>   --with-openssl=DIR                 set path to OpenSSL library sources
>   --with-openssl-opt=OPTIONS         set additional options for OpenSSL building
> 
> (what, exactly, are the 'additional options for OpenSSL building'
> supposed to be?)

These options are used to build OpenSSL library from sources.  
Additional options are passed to OpenSSL's ./config.

> If I,
> 
>   ./configure --with-http_ssl_module --with-openssl=/usr/local/src/openssl

[...]

> 	cd /usr/local/src/openssl \
> 	        && make clean \
> 	        && ./config --prefix=/usr/local/src/openssl/.openssl
> no-shared  no-threads \
> 	        && make \
> 	        && make install
> 	make[2]: Entering directory `/data/src/openssl'
> 	make[2]: *** No rule to make target `clean'.  Stop.
> 	make[2]: Leaving directory `/data/src/openssl'
> 	make[1]: *** [/usr/local/src/openssl/.openssl/include/openssl/ssl.h] Error 2
> 	make[1]: Leaving directory `/data/src/nginx-0.8.35'
> 	make: *** [build] Error 2

Either you don't have OpenSSL sources in /usr/local/src/openssl/ 
or they are corrupted somehow.  Vanilla OpenSSL 1.0.0 sources do 
have Makefile with target 'clean', try re-extracting them (if you 
really want nginx to build them instead of using already installed 
version).

> I'd normally set ldflags, cppflags and cflags ... but, afaict, they're
> not referenced in nginx source,
> 
> 	egrep -i "ldflags|cflags|cppflags" .
> 		(empty)

nginx do honor CFLAGS (use -r in grep, it helps), but not LDFLAGS.

> How do I configure/build nging to use 'my' openssl?

See above.

Maxim Dounin



More information about the nginx mailing list