Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame^] | 1 | |
| 2 | if [ $MD5 != NO ]; then |
| 3 | |
| 4 | if grep MD5_Init $MD5/md5.h >/dev/null; then |
| 5 | # OpenSSL md5 |
| 6 | OPENSSL_MD5=YES |
| 7 | CFLAGS="$CFLAGS -D HAVE_OPENSSL_MD5" |
| 8 | else |
| 9 | # rsaref md5 |
| 10 | OPENSSL_MD5=NO |
| 11 | fi |
| 12 | |
| 13 | CORE_INCS="$CORE_INCS -I $MD5" |
| 14 | |
| 15 | if [ "$PLATFORM" = "win32" ]; then |
| 16 | CORE_LIBS="$CORE_LIBS md5.lib" |
| 17 | CORE_LINK="$CORE_LINK -libpath:$MD5" |
| 18 | else |
| 19 | LINK_DEPS="$LINK_DEPS $MD5/libmd5.a" |
| 20 | CORE_LIBS="$CORE_LIBS -L $MD5 -lmd5" |
| 21 | fi |
| 22 | |
| 23 | else |
| 24 | |
| 25 | ngx_lib_inc="#include <sys/types.h> |
| 26 | #include <md5.h>" |
| 27 | |
| 28 | # Solaris 8/9 |
| 29 | ngx_lib="rsaref md5" |
| 30 | ngx_lib_test="MD5_CTX md5; MD5Init(&md5)" |
| 31 | ngx_libs=-lmd5 |
| 32 | . auto/lib/test |
| 33 | |
| 34 | |
| 35 | if [ $ngx_found = yes ]; then |
| 36 | CORE_LIBS="$CORE_LIBS $ngx_libs" |
| 37 | MD5=YES |
| 38 | ngx_found=no |
| 39 | |
| 40 | else |
| 41 | # FreeBSD |
| 42 | ngx_lib="rsaref md" |
| 43 | ngx_lib_test="MD5_CTX md5; MD5Init(&md5)" |
| 44 | ngx_libs=-lmd |
| 45 | . auto/lib/test |
| 46 | fi |
| 47 | |
| 48 | |
| 49 | if [ $ngx_found = yes ]; then |
| 50 | CORE_LIBS="$CORE_LIBS $ngx_libs" |
| 51 | MD5=YES |
| 52 | ngx_found=no |
| 53 | |
| 54 | else |
| 55 | ngx_lib="OpenSSL md5" |
| 56 | ngx_lib_test="MD5_CTX md5; MD5_Init(&md5)" |
| 57 | ngx_libs=-lmd5 |
| 58 | . auto/lib/test |
| 59 | fi |
| 60 | |
| 61 | |
| 62 | if [ $ngx_found = yes ]; then |
| 63 | CFLAGS="$CFLAGS -D HAVE_OPENSSL_MD5" |
| 64 | CORE_LIBS="$CORE_LIBS $ngx_libs" |
| 65 | MD5=YES |
| 66 | fi |
| 67 | fi |