Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 1 | |
Igor Sysoev | 7af6b16 | 2004-02-09 07:46:43 +0000 | [diff] [blame] | 2 | if [ $MD5 != NONE ]; then |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 3 | |
| 4 | if grep MD5_Init $MD5/md5.h >/dev/null; then |
| 5 | # OpenSSL md5 |
| 6 | OPENSSL_MD5=YES |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 7 | have=HAVE_OPENSSL_MD5 . auto/have |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 8 | else |
| 9 | # rsaref md5 |
| 10 | OPENSSL_MD5=NO |
| 11 | fi |
| 12 | |
| 13 | CORE_INCS="$CORE_INCS -I $MD5" |
| 14 | |
Igor Sysoev | fc5a10a | 2004-03-09 19:47:07 +0000 | [diff] [blame] | 15 | 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 Sysoev | 3646a16 | 2004-03-14 20:46:25 +0000 | [diff] [blame] | 28 | *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 Sysoev | fc5a10a | 2004-03-09 19:47:07 +0000 | [diff] [blame] | 39 | *) |
| 40 | LINK_DEPS="$LINK_DEPS $MD5/libmd5.a" |
| 41 | CORE_LIBS="$CORE_LIBS -L $MD5 -lmd5" |
| 42 | ;; |
| 43 | |
| 44 | esac |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 45 | |
| 46 | else |
| 47 | |
| 48 | ngx_lib_inc="#include <sys/types.h> |
| 49 | #include <md5.h>" |
| 50 | |
Igor Sysoev | 7af6b16 | 2004-02-09 07:46:43 +0000 | [diff] [blame] | 51 | MD5=NO |
| 52 | |
Igor Sysoev | b54698b | 2004-02-23 20:57:12 +0000 | [diff] [blame] | 53 | # 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 Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 59 | |
| 60 | |
| 61 | if [ $ngx_found = yes ]; then |
| 62 | CORE_LIBS="$CORE_LIBS $ngx_libs" |
| 63 | MD5=YES |
Igor Sysoev | 0ee5d3c | 2004-02-20 16:48:59 +0000 | [diff] [blame] | 64 | MD5_LIB=md5 |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 65 | ngx_found=no |
| 66 | |
| 67 | else |
| 68 | # FreeBSD |
Igor Sysoev | b54698b | 2004-02-23 20:57:12 +0000 | [diff] [blame] | 69 | |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 70 | 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 Sysoev | 0ee5d3c | 2004-02-20 16:48:59 +0000 | [diff] [blame] | 80 | MD5_LIB=md |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 81 | ngx_found=no |
| 82 | |
| 83 | else |
Igor Sysoev | b54698b | 2004-02-23 20:57:12 +0000 | [diff] [blame] | 84 | # OpenSSL crypto library |
| 85 | |
| 86 | ngx_inc="#include <openssl/md5.h>" |
Igor Sysoev | 0ee5d3c | 2004-02-20 16:48:59 +0000 | [diff] [blame] | 87 | ngx_lib="OpenSSL md5 crypto" |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 88 | ngx_lib_test="MD5_CTX md5; MD5_Init(&md5)" |
Igor Sysoev | 0ee5d3c | 2004-02-20 16:48:59 +0000 | [diff] [blame] | 89 | ngx_libs=-lcrypto |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 90 | . auto/lib/test |
| 91 | fi |
| 92 | |
| 93 | |
| 94 | if [ $ngx_found = yes ]; then |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 95 | have=HAVE_OPENSSL_MD5 . auto/have |
Igor Sysoev | 0ee5d3c | 2004-02-20 16:48:59 +0000 | [diff] [blame] | 96 | have=HAVE_OPENSSL_MD5_H . auto/have |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 97 | CORE_LIBS="$CORE_LIBS $ngx_libs" |
| 98 | MD5=YES |
Igor Sysoev | 0ee5d3c | 2004-02-20 16:48:59 +0000 | [diff] [blame] | 99 | MD5_LIB=crypto |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 100 | fi |
| 101 | fi |