blob: 57662f70267d249521297ce42885d7bdfafa1ffd [file] [log] [blame]
Igor Sysoevdc867cd2003-12-14 20:10:27 +00001
Igor Sysoev7af6b162004-02-09 07:46:43 +00002if [ $MD5 != NONE ]; then
Igor Sysoevdc867cd2003-12-14 20:10:27 +00003
4 if grep MD5_Init $MD5/md5.h >/dev/null; then
5 # OpenSSL md5
6 OPENSSL_MD5=YES
Igor Sysoeva4b16df2004-02-02 21:19:52 +00007 have=HAVE_OPENSSL_MD5 . auto/have
Igor Sysoevdc867cd2003-12-14 20:10:27 +00008 else
9 # rsaref md5
10 OPENSSL_MD5=NO
11 fi
12
13 CORE_INCS="$CORE_INCS -I $MD5"
14
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000015 case $CC in
16
17 cl)
18 LINK_DEPS="$LINK_DEPS $MD5/md5.lib"
19 CORE_LIBS="$CORE_LIBS md5.lib"
20 CORE_LINK="$CORE_LINK -libpath:$MD5"
21 ;;
22
23 wcl386)
24 LINK_DEPS="$LINK_DEPS $MD5/md5.lib"
25 CORE_LIBS="$CORE_LIBS $MD5/md5.lib"
26 ;;
27
Igor Sysoev3646a162004-03-14 20:46:25 +000028 *icc)
29 LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
30
31 # to allow -ipo optimization we link with the *.o but not library
32 CORE_LIBS="$CORE_LIBS $MD5/md5_dgst.o"
33
34 if [ $MD5_ASM = YES ]; then
35 CORE_LIBS="$CORE_LIBS $MD5/asm/mx86-elf.o"
36 fi
37 ;;
38
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000039 *)
40 LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
41 CORE_LIBS="$CORE_LIBS -L $MD5 -lmd5"
42 ;;
43
44 esac
Igor Sysoevdc867cd2003-12-14 20:10:27 +000045
46else
47
48ngx_lib_inc="#include <sys/types.h>
49#include <md5.h>"
50
Igor Sysoev7af6b162004-02-09 07:46:43 +000051 MD5=NO
52
Igor Sysoevb54698b2004-02-23 20:57:12 +000053 # Solaris 8/9
54
55 ngx_lib="rsaref md5"
56 ngx_lib_test="MD5_CTX md5; MD5Init(&md5)"
57 ngx_libs=-lmd5
58 . auto/lib/test
Igor Sysoevdc867cd2003-12-14 20:10:27 +000059
60
61 if [ $ngx_found = yes ]; then
62 CORE_LIBS="$CORE_LIBS $ngx_libs"
63 MD5=YES
Igor Sysoev0ee5d3c2004-02-20 16:48:59 +000064 MD5_LIB=md5
Igor Sysoevdc867cd2003-12-14 20:10:27 +000065 ngx_found=no
66
67 else
68 # FreeBSD
Igor Sysoevb54698b2004-02-23 20:57:12 +000069
Igor Sysoevdc867cd2003-12-14 20:10:27 +000070 ngx_lib="rsaref md"
71 ngx_lib_test="MD5_CTX md5; MD5Init(&md5)"
72 ngx_libs=-lmd
73 . auto/lib/test
74 fi
75
76
77 if [ $ngx_found = yes ]; then
78 CORE_LIBS="$CORE_LIBS $ngx_libs"
79 MD5=YES
Igor Sysoev0ee5d3c2004-02-20 16:48:59 +000080 MD5_LIB=md
Igor Sysoevdc867cd2003-12-14 20:10:27 +000081 ngx_found=no
82
83 else
Igor Sysoevb54698b2004-02-23 20:57:12 +000084 # OpenSSL crypto library
85
86 ngx_inc="#include <openssl/md5.h>"
Igor Sysoev0ee5d3c2004-02-20 16:48:59 +000087 ngx_lib="OpenSSL md5 crypto"
Igor Sysoevdc867cd2003-12-14 20:10:27 +000088 ngx_lib_test="MD5_CTX md5; MD5_Init(&md5)"
Igor Sysoev0ee5d3c2004-02-20 16:48:59 +000089 ngx_libs=-lcrypto
Igor Sysoevdc867cd2003-12-14 20:10:27 +000090 . auto/lib/test
91 fi
92
93
94 if [ $ngx_found = yes ]; then
Igor Sysoeva4b16df2004-02-02 21:19:52 +000095 have=HAVE_OPENSSL_MD5 . auto/have
Igor Sysoev0ee5d3c2004-02-20 16:48:59 +000096 have=HAVE_OPENSSL_MD5_H . auto/have
Igor Sysoevdc867cd2003-12-14 20:10:27 +000097 CORE_LIBS="$CORE_LIBS $ngx_libs"
98 MD5=YES
Igor Sysoev0ee5d3c2004-02-20 16:48:59 +000099 MD5_LIB=crypto
Igor Sysoevdc867cd2003-12-14 20:10:27 +0000100 fi
101fi