source: nginx/auto/lib/openssl/conf

Last change on this file was 6862:abb0a4189cf7, checked in by Maxim Dounin <mdounin@…>, 9 months ago

Win32: compatiblity with OpenSSL 1.1.0.

OpenSSL 1.1.0 now uses normal "nmake; nmake install" instead of using
custom "ms\do_ms.bat" script and "ms\nt.mak" makefile. And Configure
now requires --prefix to be absolute, and no longer derives --openssldir
from prefix (so it's specified explicitly). Generated libraries are now
called "libcrypto.lib" and "libssl.lib" instead of "libeay32.lib"
and "ssleay32.lib". Appropriate tests added to support both old and new
variants.

Additionally, openssl/lhash.h now triggers warning C4090 ('function' :
different 'const' qualifiers), so the warning was disabled.

File size: 3.8 KB
Line 
1
2# Copyright (C) Igor Sysoev
3# Copyright (C) Nginx, Inc.
4
5
6if [ $OPENSSL != NONE ]; then
7
8    case "$CC" in
9
10        cl | bcc32)
11            have=NGX_OPENSSL . auto/have
12            have=NGX_SSL . auto/have
13
14            CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
15
16            CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
17            CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
18
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"
23            else
24                # OpenSSL 1.1.0+
25                CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
26                CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
27            fi
28
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"
33        ;;
34
35        *)
36            have=NGX_OPENSSL . auto/have
37            have=NGX_SSL . auto/have
38
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"
44
45            if [ "$NGX_PLATFORM" = win32 ]; then
46                CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
47            fi
48        ;;
49    esac
50
51else
52
53    if [ "$NGX_PLATFORM" != win32 ]; then
54
55        OPENSSL=NO
56
57        ngx_feature="OpenSSL library"
58        ngx_feature_name="NGX_OPENSSL"
59        ngx_feature_run=no
60        ngx_feature_incs="#include <openssl/ssl.h>"
61        ngx_feature_path=
62        ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL"
63        ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
64        . auto/feature
65
66        if [ $ngx_found = no ]; then
67
68            # FreeBSD port
69
70            ngx_feature="OpenSSL library in /usr/local/"
71            ngx_feature_path="/usr/local/include"
72
73            if [ $NGX_RPATH = YES ]; then
74                ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
75            else
76                ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto $NGX_LIBDL"
77            fi
78
79            . auto/feature
80        fi
81
82        if [ $ngx_found = no ]; then
83
84            # NetBSD port
85
86            ngx_feature="OpenSSL library in /usr/pkg/"
87            ngx_feature_path="/usr/pkg/include"
88
89            if [ $NGX_RPATH = YES ]; then
90                ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
91            else
92                ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto $NGX_LIBDL"
93            fi
94
95            . auto/feature
96        fi
97
98        if [ $ngx_found = no ]; then
99
100            # MacPorts
101
102            ngx_feature="OpenSSL library in /opt/local/"
103            ngx_feature_path="/opt/local/include"
104
105            if [ $NGX_RPATH = YES ]; then
106                ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
107            else
108                ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto $NGX_LIBDL"
109            fi
110
111            . auto/feature
112        fi
113
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"
118            OPENSSL=YES
119        fi
120    fi
121
122    if [ $OPENSSL != YES ]; then
123
124cat << END
125
126$0: error: SSL modules require the OpenSSL library.
127You can either do not enable the modules, or install the OpenSSL library
128into the system, or build the OpenSSL library statically from the source
129with nginx by using --with-openssl=<path> option.
130
131END
132        exit 1
133    fi
134
135fi
Note: See TracBrowser for help on using the repository browser.