2 # Copyright (C) Igor Sysoev
3 # Copyright (C) Nginx, Inc.
6 if [ $OPENSSL != NONE ]; then
11 have=NGX_OPENSSL . auto/have
12 have=NGX_SSL . auto/have
14 CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
16 CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
17 CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
19 if [ -f $OPENSSL/ms/do_ms.bat ]; then
20 # before OpenSSL 1.1.0
21 CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
22 CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
25 CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
26 CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
29 # libeay32.lib requires gdi32.lib
30 CORE_LIBS="$CORE_LIBS gdi32.lib"
31 # OpenSSL 1.0.0 requires crypt32.lib
32 CORE_LIBS="$CORE_LIBS crypt32.lib"
36 have=NGX_OPENSSL . auto/have
37 have=NGX_SSL . auto/have
39 CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
40 CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
41 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
42 CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
43 CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
45 if [ "$NGX_PLATFORM" = win32 ]; then
46 CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
53 if [ "$NGX_PLATFORM" != win32 ]; then
57 ngx_feature="OpenSSL library"
58 ngx_feature_name="NGX_OPENSSL"
60 ngx_feature_incs="#include <openssl/ssl.h>"
62 ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
63 ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
66 if [ $ngx_found = no ]; then
70 ngx_feature="OpenSSL library in /usr/local/"
71 ngx_feature_path="/usr/local/include"
73 if [ $NGX_RPATH = YES ]; then
74 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
76 ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
82 if [ $ngx_found = no ]; then
86 ngx_feature="OpenSSL library in /usr/pkg/"
87 ngx_feature_path="/usr/pkg/include"
89 if [ $NGX_RPATH = YES ]; then
90 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
92 ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
98 if [ $ngx_found = no ]; then
102 ngx_feature="OpenSSL library in /opt/local/"
103 ngx_feature_path="/opt/local/include"
105 if [ $NGX_RPATH = YES ]; then
106 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
108 ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
114 if [ $ngx_found = yes ]; then
115 have=NGX_SSL . auto/have
116 CORE_INCS="$CORE_INCS $ngx_feature_path"
117 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
122 if [ $OPENSSL != YES ]; then
126 $0: error: SSL modules require the OpenSSL library.
127 You can either do not enable the modules, or install the OpenSSL library
128 into the system, or build the OpenSSL library statically from the source
129 with nginx by using --with-openssl=<path> option.