diff options
Diffstat (limited to 'auto/lib/sha1')
-rw-r--r-- | auto/lib/sha1/conf | 81 | ||||
-rw-r--r-- | auto/lib/sha1/make | 96 | ||||
-rw-r--r-- | auto/lib/sha1/makefile.bcc | 19 | ||||
-rw-r--r-- | auto/lib/sha1/makefile.msvc | 19 | ||||
-rw-r--r-- | auto/lib/sha1/makefile.owc | 9 |
5 files changed, 224 insertions, 0 deletions
diff --git a/auto/lib/sha1/conf b/auto/lib/sha1/conf new file mode 100644 index 000000000..a1e20c9b2 --- /dev/null +++ b/auto/lib/sha1/conf @@ -0,0 +1,81 @@ + +# Copyright (C) Igor Sysoev + + +if [ $SHA1 != NONE ]; then + + CORE_INCS="$CORE_INCS $SHA1" + + case "$NGX_CC_NAME" in + + msvc* | owc* | bcc) + LINK_DEPS="$LINK_DEPS $SHA1/sha1.lib" + CORE_LIBS="$CORE_LIBS $SHA1/sha1.lib" + ;; + + icc*) + LINK_DEPS="$LINK_DEPS $SHA1/libsha.a" + + # to allow -ipo optimization we link with the *.o but not library + CORE_LIBS="$CORE_LIBS $SHA1/sha1_dgst.o" + + if [ $SHA1_ASM = YES ]; then + CORE_LIBS="$CORE_LIBS $SHA1/asm/sx86-elf.o" + fi + ;; + + *) + LINK_DEPS="$LINK_DEPS $SHA1/libsha.a" + CORE_LIBS="$CORE_LIBS $SHA1/libsha.a" + #CORE_LIBS="$CORE_LIBS -L $SHA1 -lsha" + ;; + + esac + +else + + if [ "$NGX_PLATFORM" != win32 ]; then + SHA1=NO + + # FreeBSD + + ngx_feature="sha1 in system md library" + ngx_feature_name= + ngx_feature_run=no + ngx_feature_incs="#include <sha.h>" + ngx_feature_libs="-lmd" + ngx_feature_test="SHA_CTX sha1; SHA1_Init(&sha1)" + . auto/feature + + + if [ $ngx_found = yes ]; then + CORE_LIBS="$CORE_LIBS $ngx_feature_libs" + SHA1=YES + SHA1_LIB=md + ngx_found=no + + else + if [ $SHA1 = NO ]; then + + # OpenSSL crypto library + + ngx_feature="OpenSSL sha1 crypto library" + ngx_feature_name= + ngx_feature_run=no + ngx_feature_incs="#include <openssl/sha.h>" + ngx_feature_libs="-lcrypto" + ngx_feature_test="SHA_CTX sha1; SHA1_Init(&sha1)" + . auto/feature + fi + fi + + + if [ $ngx_found = yes ]; then + have=NGX_HAVE_OPENSSL_SHA1_H . auto/have + CORE_LIBS="$CORE_LIBS $ngx_feature_libs" + SHA1=YES + SHA1_LIB=crypto + fi + fi + +fi diff --git a/auto/lib/sha1/make b/auto/lib/sha1/make new file mode 100644 index 000000000..bd1036e1f --- /dev/null +++ b/auto/lib/sha1/make @@ -0,0 +1,96 @@ + +# Copyright (C) Igor Sysoev + + +case "$NGX_CC_NAME" in + + msvc*) + ngx_makefile=makefile.msvc + ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC SHA1_ASM=$SHA1_ASM" + ;; + + owc*) + ngx_makefile=makefile.owc + ngx_opt="CPU_OPT=\"$CPU_OPT\"" + ;; + + bcc) + ngx_makefile=makefile.bcc + ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DSHA1_ASM=$SHA1_ASM" + ;; + +esac + + +done=NO + + +case "$NGX_PLATFORM" in + + win32) + cp auto/lib/sha1/$ngx_makefile $SHA1 + + cat << END >> $NGX_MAKEFILE + +`echo "$SHA1/sha1.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"` + cd `echo $SHA1 | sed -e "s/\//$ngx_regex_dirsep/g"` + \$(MAKE) -f $ngx_makefile $ngx_opt + cd ..\\..\\.. + +END + + done=YES + ;; + + SunOS:*:i86pc) + if [ $SHA1_ASM = YES ]; then + + cat << END >> $NGX_MAKEFILE + +$SHA1/libsha.a: $NGX_MAKEFILE + cd $SHA1 \\ + && \$(MAKE) CFLAGS="$SHA1_OPT -DSOL -DSHA1_ASM -DL_ENDIAN" \\ + CC="\$(CC)" CPP="\$(CPP)" \\ + SHA_ASM_OBJ=asm/sx86-sol.o clean libsha.a + +END + + done=YES + fi + ;; + + # FreeBSD: i386 + # Linux: i686 + + *:i386 | *:i686) + if [ $SHA1_ASM = YES ]; then + + cat << END >> $NGX_MAKEFILE + +$SHA1/libsha.a: $NGX_MAKEFILE + cd $SHA1 \\ + && \$(MAKE) CFLAGS="$SHA1_OPT -DELF -DSHA1_ASM -DL_ENDIAN" \\ + CC="\$(CC)" CPP="\$(CPP)" \\ + SHA_ASM_OBJ=asm/sx86-elf.o clean libsha.a + +END + + done=YES + fi + ;; + +esac + + +if [ $done = NO ]; then + + cat << END >> $NGX_MAKEFILE + +$SHA1/libsha.a: $NGX_MAKEFILE + cd $SHA1 \\ + && \$(MAKE) CFLAGS="$SHA1_OPT" \\ + CC="\$(CC)" SHA_ASM_OBJ= clean libsha.a + +END + +fi diff --git a/auto/lib/sha1/makefile.bcc b/auto/lib/sha1/makefile.bcc new file mode 100644 index 000000000..255e56a89 --- /dev/null +++ b/auto/lib/sha1/makefile.bcc @@ -0,0 +1,19 @@ + +# Copyright (C) Igor Sysoev + + +CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN + +!if "$(SHA1_ASM)" == "YES" + +sha1.lib: + bcc32 -c $(CFLAGS) -DSHA1_ASM sha1dgst.c + tlib sha1.lib +sha1dgst.obj +"asm\s-win32.obj" + +!else + +sha1.lib: + bcc32 -c $(CFLAGS) sha1dgst.c + tlib sha1.lib +sha1dgst.obj + +!endif diff --git a/auto/lib/sha1/makefile.msvc b/auto/lib/sha1/makefile.msvc new file mode 100644 index 000000000..2ec55d5a8 --- /dev/null +++ b/auto/lib/sha1/makefile.msvc @@ -0,0 +1,19 @@ + +# Copyright (C) Igor Sysoev + + +CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN + +!if "$(SHA1_ASM)" == "YES" + +sha1.lib: + cl -c $(CFLAGS) -D SHA1_ASM sha1dgst.c + link -lib -out:sha1.lib sha1dgst.obj asm/s-win32.obj + +!else + +sha1.lib: + cl -c $(CFLAGS) sha1dgst.c + link -lib -out:sha1.lib sha1dgst.obj + +!endif diff --git a/auto/lib/sha1/makefile.owc b/auto/lib/sha1/makefile.owc new file mode 100644 index 000000000..767870d8a --- /dev/null +++ b/auto/lib/sha1/makefile.owc @@ -0,0 +1,9 @@ + +# Copyright (C) Igor Sysoev + + +CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT) + +sha1.lib: + wcl386 -c $(CFLAGS) -dL_ENDIAN sha1dgst.c + wlib -n sha1.lib sha1dgst.obj |