| 1 | # HG changeset patch
|
|---|
| 2 | # User Ruslan Ermilov <ru@nginx.com>
|
|---|
| 3 | # Date 1455732623 -10800
|
|---|
| 4 | # Wed Feb 17 21:10:23 2016 +0300
|
|---|
| 5 | # Node ID 9722c35e94a3c5982d815e8b549f8d216935a25d
|
|---|
| 6 | # Parent 6812ca9a800247d2428f487d9b4938a2b499b7d8
|
|---|
| 7 | Configure: fixed static nginx build with OpenSSL (ticket #903).
|
|---|
| 8 |
|
|---|
| 9 | Before 7142b04337d6, it was possible to build in-tree version of OpenSSL
|
|---|
| 10 | and link nginx statically (--with-openssl=DIR --with-ld-opt=-static).
|
|---|
| 11 | It was broken by removing -ldl after -lcrypto.
|
|---|
| 12 |
|
|---|
| 13 | This change additionally makes it possible to link nginx statically with
|
|---|
| 14 | the system OpenSSL library.
|
|---|
| 15 |
|
|---|
| 16 | diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
|
|---|
| 17 | --- a/auto/lib/openssl/conf
|
|---|
| 18 | +++ b/auto/lib/openssl/conf
|
|---|
| 19 | @@ -32,6 +32,7 @@ if [ $OPENSSL != NONE ]; then
|
|---|
| 20 | CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
|
|---|
| 21 | CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
|
|---|
| 22 | CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
|
|---|
| 23 | + CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
|
|---|
| 24 |
|
|---|
| 25 | if [ "$NGX_PLATFORM" = win32 ]; then
|
|---|
| 26 | CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
|
|---|
| 27 | @@ -50,7 +51,7 @@ else
|
|---|
| 28 | ngx_feature_run=no
|
|---|
| 29 | ngx_feature_incs="#include <openssl/ssl.h>"
|
|---|
| 30 | ngx_feature_path=
|
|---|
| 31 | - ngx_feature_libs="-lssl -lcrypto"
|
|---|
| 32 | + ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
|
|---|
| 33 | ngx_feature_test="SSL_library_init()"
|
|---|
| 34 | . auto/feature
|
|---|
| 35 |
|
|---|
| 36 | @@ -62,9 +63,9 @@ else
|
|---|
| 37 | ngx_feature_path="/usr/local/include"
|
|---|
| 38 |
|
|---|
| 39 | if [ $NGX_RPATH = YES ]; then
|
|---|
| 40 | - ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
|
|---|
| 41 | + ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
|
|---|
| 42 | else
|
|---|
| 43 | - ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
|
|---|
| 44 | + ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
|
|---|
| 45 | fi
|
|---|
| 46 |
|
|---|
| 47 | . auto/feature
|
|---|
| 48 | @@ -78,9 +79,9 @@ else
|
|---|
| 49 | ngx_feature_path="/usr/pkg/include"
|
|---|
| 50 |
|
|---|
| 51 | if [ $NGX_RPATH = YES ]; then
|
|---|
| 52 | - ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
|
|---|
| 53 | + ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
|
|---|
| 54 | else
|
|---|
| 55 | - ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
|
|---|
| 56 | + ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
|
|---|
| 57 | fi
|
|---|
| 58 |
|
|---|
| 59 | . auto/feature
|
|---|
| 60 | @@ -94,9 +95,9 @@ else
|
|---|
| 61 | ngx_feature_path="/opt/local/include"
|
|---|
| 62 |
|
|---|
| 63 | if [ $NGX_RPATH = YES ]; then
|
|---|
| 64 | - ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
|
|---|
| 65 | + ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
|
|---|
| 66 | else
|
|---|
| 67 | - ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
|
|---|
| 68 | + ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
|
|---|
| 69 | fi
|
|---|
| 70 |
|
|---|
| 71 | . auto/feature
|
|---|
| 72 | diff --git a/auto/unix b/auto/unix
|
|---|
| 73 | --- a/auto/unix
|
|---|
| 74 | +++ b/auto/unix
|
|---|
| 75 | @@ -272,6 +272,7 @@ if [ $ngx_found != yes ]; then
|
|---|
| 76 |
|
|---|
| 77 | if [ $ngx_found = yes ]; then
|
|---|
| 78 | CORE_LIBS="$CORE_LIBS -ldl"
|
|---|
| 79 | + NGX_LIBDL="-ldl"
|
|---|
| 80 | fi
|
|---|
| 81 | fi
|
|---|
| 82 |
|
|---|