comparison auto/lib/openssl/conf @ 6403:e59e617f8fcb

Configure: fixed static nginx build with OpenSSL (ticket #903). Before 7142b04337d6, it was possible to build the OpenSSL library along with nginx, and link nginx statically with this library (--with-openssl=DIR --with-ld-opt=-static --with-http_ssl_module). This was broken on Linux by not adding -ldl after -lcrypto. The fix also makes it possible to link nginx statically on Linux with the system OpenSSL library, which never worked before.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 18 Feb 2016 11:39:57 +0300
parents 7142b04337d6
children a57b2b8999e7
comparison
equal deleted inserted replaced
6402:7296b38f6416 6403:e59e617f8fcb
30 30
31 CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include" 31 CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
32 CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h" 32 CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
33 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a" 33 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
34 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a" 34 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
35 CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
35 36
36 if [ "$NGX_PLATFORM" = win32 ]; then 37 if [ "$NGX_PLATFORM" = win32 ]; then
37 CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32" 38 CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
38 fi 39 fi
39 ;; 40 ;;
48 ngx_feature="OpenSSL library" 49 ngx_feature="OpenSSL library"
49 ngx_feature_name="NGX_OPENSSL" 50 ngx_feature_name="NGX_OPENSSL"
50 ngx_feature_run=no 51 ngx_feature_run=no
51 ngx_feature_incs="#include <openssl/ssl.h>" 52 ngx_feature_incs="#include <openssl/ssl.h>"
52 ngx_feature_path= 53 ngx_feature_path=
53 ngx_feature_libs="-lssl -lcrypto" 54 ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
54 ngx_feature_test="SSL_library_init()" 55 ngx_feature_test="SSL_library_init()"
55 . auto/feature 56 . auto/feature
56 57
57 if [ $ngx_found = no ]; then 58 if [ $ngx_found = no ]; then
58 59
60 61
61 ngx_feature="OpenSSL library in /usr/local/" 62 ngx_feature="OpenSSL library in /usr/local/"
62 ngx_feature_path="/usr/local/include" 63 ngx_feature_path="/usr/local/include"
63 64
64 if [ $NGX_RPATH = YES ]; then 65 if [ $NGX_RPATH = YES ]; then
65 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto" 66 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
66 else 67 else
67 ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto" 68 ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
68 fi 69 fi
69 70
70 . auto/feature 71 . auto/feature
71 fi 72 fi
72 73
76 77
77 ngx_feature="OpenSSL library in /usr/pkg/" 78 ngx_feature="OpenSSL library in /usr/pkg/"
78 ngx_feature_path="/usr/pkg/include" 79 ngx_feature_path="/usr/pkg/include"
79 80
80 if [ $NGX_RPATH = YES ]; then 81 if [ $NGX_RPATH = YES ]; then
81 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto" 82 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
82 else 83 else
83 ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto" 84 ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
84 fi 85 fi
85 86
86 . auto/feature 87 . auto/feature
87 fi 88 fi
88 89
92 93
93 ngx_feature="OpenSSL library in /opt/local/" 94 ngx_feature="OpenSSL library in /opt/local/"
94 ngx_feature_path="/opt/local/include" 95 ngx_feature_path="/opt/local/include"
95 96
96 if [ $NGX_RPATH = YES ]; then 97 if [ $NGX_RPATH = YES ]; then
97 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto" 98 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
98 else 99 else
99 ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto" 100 ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
100 fi 101 fi
101 102
102 . auto/feature 103 . auto/feature
103 fi 104 fi
104 105