upstream nginx-0.7.31
[nginx.git] / nginx / auto / lib / md5 / conf
1
2 # Copyright (C) Igor Sysoev
3
4
5 if [ $MD5 != NONE ]; then
6
7     if grep MD5_Init $MD5/md5.h >/dev/null; then
8         # OpenSSL md5
9         OPENSSL_MD5=YES
10         have=NGX_HAVE_OPENSSL_MD5 . auto/have
11         have=NGX_OPENSSL_MD5 . auto/have
12     else
13         # rsaref md5
14         OPENSSL_MD5=NO
15     fi
16
17     CORE_INCS="$CORE_INCS $MD5"
18
19     case "$NGX_CC_NAME" in
20
21         msvc* | owc* | bcc)
22             LINK_DEPS="$LINK_DEPS $MD5/md5.lib"
23             CORE_LIBS="$CORE_LIBS $MD5/md5.lib"
24         ;;
25
26         icc*)
27             LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
28
29             # to allow -ipo optimization we link with the *.o but not library
30             CORE_LIBS="$CORE_LIBS $MD5/md5_dgst.o"
31
32             if [ $MD5_ASM = YES ]; then
33                 CORE_LIBS="$CORE_LIBS $MD5/asm/mx86-elf.o"
34             fi
35         ;;
36
37         *)
38             LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
39             CORE_LIBS="$CORE_LIBS $MD5/libmd5.a"
40             #CORE_LIBS="$CORE_LIBS -L $MD5 -lmd5"
41         ;;
42
43     esac
44
45 else
46
47     if [ "$NGX_PLATFORM" != win32 ]; then
48
49         MD5=NO
50
51         # Solaris 8/9
52
53         ngx_feature="rsaref md5 library"
54         ngx_feature_name=
55         ngx_feature_run=no
56         ngx_feature_incs="#include <md5.h>"
57         ngx_feature_path=
58         ngx_feature_libs="-lmd5"
59         ngx_feature_test="MD5_CTX md5; MD5Init(&md5)"
60         . auto/feature
61
62         ngx_md5_lib="system md5"
63
64         if [ $ngx_found = no ]; then
65
66             # FreeBSD
67
68             ngx_feature="rsaref md library"
69             ngx_feature_libs="-lmd"
70             . auto/feature
71
72             ngx_md5_lib="system md"
73         fi
74
75         if [ $ngx_found = no ]; then
76
77             # OpenSSL crypto library
78
79             ngx_feature="OpenSSL md5 crypto library"
80             ngx_feature_name="NGX_OPENSSL_MD5"
81             ngx_feature_incs="#include <openssl/md5.h>"
82             ngx_feature_libs="-lcrypto"
83             ngx_feature_test="MD5_CTX md5; MD5_Init(&md5)"
84             . auto/feature
85
86             ngx_md5_lib="system crypto"
87
88             if [ $ngx_found = yes ]; then
89                 have=NGX_HAVE_OPENSSL_MD5_H . auto/have
90             fi
91         fi
92
93         if [ $ngx_found = yes ]; then
94             CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
95             MD5=YES
96             MD5_LIB=$ngx_md5_lib
97         fi
98
99     fi
100
101 fi