nginx-0.0.2-2004-03-10-23:56:39 import

This commit is contained in:
Igor Sysoev 2004-03-10 20:56:39 +00:00
parent 24b56c92bb
commit 7b90834fba
11 changed files with 114 additions and 43 deletions

61
auto/cc
View File

@ -7,19 +7,30 @@ case $CC in
# optimization
#CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
case $CPU_OPT in
case $CPU in
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
LIB_OPT="-march=pentiumpro"
CPU_OPT="-march=pentiumpro"
;;
pentium4)
# optimize for Pentium 4, gcc 3.x
LIB_OPT="-march=pentium4"
CPU_OPT="-march=pentium4"
;;
esac
CFLAGS="$CFLAGS $LIB_OPT"
ZLIB_OPT="-O2 -fomit-frame-pointer $LIB_OPT"
CFLAGS="$CFLAGS $CPU_OPT"
if [ $PCRE_OPT = NO ]; then
PCRE_OPT="CFLAGS=\"-O2 -fomit-frame-pointer $CPU_OPT\""
fi
if [ $MD5_OPT = NO ]; then
MD5_OPT="CFLAGS=\"-O2 -fomit-frame-pointer $CPU_OPT\""
fi
if [ $ZLIB_OPT = NO ]; then
ZLIB_OPT="CFLAGS=\"-O2 -fomit-frame-pointer $CPU_OPT $ZLIB_ASMV\""
fi
# warnings
CFLAGS="$CFLAGS -O -W"
@ -57,19 +68,35 @@ case $CC in
# optimization
CFLAGS="$CFLAGS -O"
# inline functions declared with __inline
CFLAGS="$CFLAGS -Ob1"
# inline any function, at the compiler's discretion
#CFLAGS="$CFLAGS -Ob2"
case $CPU_OPT in
case $CPU in
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
LIB_OUT="-mcpu=pentiumpro -march=pentiumpro"
CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
;;
pentium4)
# optimize for Pentium 4, default
LIB_OPT="-march=pentium4"
CPU_OPT="-march=pentium4"
;;
esac
CFLAGS="$CFLAGS $LIB_OUT"
CFLAGS="$CFLAGS $CPU_OPT"
if [ $PCRE_OPT = NO ]; then
PCRE_OPT="CFLAGS=\"-O $CPU_OPT\""
fi
if [ $MD5_OPT = NO ]; then
MD5_OPT="CFLAGS=\"-O $CPU_OPT\""
fi
if [ $ZLIB_OPT = NO ]; then
ZLIB_OPT="CFLAGS=\"-O $CPU_OPT $ZLIB_ASMV\""
fi
# warnings
CFLAGS="$CFLAGS -w1"
@ -108,18 +135,18 @@ case $CC in
# disable stack checking calls
CFLAGS="$CFLAGS -Gs"
case $CPU_OPT in
case $CPU in
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
LIB_OUT="-G6"
CPU_OPT="-G6"
;;
pentium4)
# optimize for Pentium 4
#LIB_OUT="-G7"
#CPU_OPT="-G7"
;;
esac
CFLAGS="$CFLAGS $LIB_OUT"
CFLAGS="$CFLAGS $CPU_OPT"
# warnings
CFLAGS="$CFLAGS -W3"
@ -184,17 +211,17 @@ case $CC in
# disable stack checking calls
CFLAGS="$CFLAGS -s"
case $CPU_OPT in
case $CPU in
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
# register-based arguments passing conventions
LIB_OUT="-6r"
CPU_OPT="-6r"
# stack-based arguments passing conventions
#LIB_OUT="-6s"
#CPU_OPT="-6s"
;;
esac
CFLAGS="$CFLAGS $LIB_OUT"
CFLAGS="$CFLAGS $CPU_OPT"
# warnings
#CFLAGS="$CFLAGS -w3"

View File

@ -31,24 +31,34 @@ case $PLATFORM in
cp auto/lib/md5/$makefile $MD5
echo " cd $MD5" >> $MAKEFILE
echo " \$(MAKE) -f $makefile LIB_OPT=$LIB_OPT" >> $MAKEFILE
echo $ngx_n " \$(MAKE) -f $makefile" $ngx_c >> $MAKEFILE
echo " CPU_OPT=$CPU_OPT MD5_ASM=$MD5_ASM" >> $MAKEFILE
echo " cd ..\\..\\.." >> $MAKEFILE
;;
SunOS:*:i86pc)
echo " cd $MD5 && \$(MAKE) x86-solaris" >> $MAKEFILE
if [ $MD5_ASM = YES ]; then
echo " cd $MD5 && \$(MAKE) $MD5_OPT x86-solaris" >> $MAKEFILE
else
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT \\" >> $MAKEFILE
echo " MD5_ASM_OBJ= CC=$CC all" >> $MAKEFILE
fi
;;
*:i386)
echo " cd $MD5 && \$(MAKE) x86-elf" >> $MAKEFILE
if [ $MD5_ASM = YES ]; then
echo " cd $MD5 && \$(MAKE) $MD5_OPT x86-elf" >> $MAKEFILE
else
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT \\" >> $MAKEFILE
echo " MD5_ASM_OBJ= CC=$CC all" >> $MAKEFILE
fi
;;
*)
if [ $CC = gcc ]; then
echo " cd $MD5 && \$(MAKE) gcc" >> $MAKEFILE
else
echo " cd $MD5 && \$(MAKE) cc" >> $MAKEFILE
fi
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT MD5_ASM_OBJ= CC=$CC all" >> $MAKEFILE
;;
esac

View File

@ -1,6 +1,16 @@
CFLAGS = -nologo -c -MT -O2 -Ob1 -Oi -Gs $(LIB_OPT) -D MD5_ASM -D L_ENDIAN
CFLAGS = -nologo -c -MT -O2 -Ob1 -Oi -Gs $(CPU_OPT) -D L_ENDIAN
!if "$(MD5_ASM)" == "YES"
md5.lib:
cl $(CFLAGS) -D MD5_ASM md5_dgst.c
link -lib -out:md5.lib md5_dgst.obj asm/m-win32.obj
!else
md5.lib:
cl $(CFLAGS) md5_dgst.c
link -lib -out:md5.lib md5_dgst.obj asm/m-win32.obj
link -lib -out:md5.lib md5_dgst.obj
!endif

View File

@ -1,5 +1,5 @@
CFLAGS = -c -zq -bt=nt -bm -ot -op -oi -oe -s $(LIB_OPT)
CFLAGS = -c -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
md5.lib:
wcl386 $(CFLAGS) -dL_ENDIAN md5_dgst.c

View File

@ -32,14 +32,14 @@ case $PLATFORM in
cp auto/lib/pcre/patch.config $PCRE
cp auto/lib/pcre/$makefile $PCRE
echo " cd $PCRE" >> $MAKEFILE
echo " \$(MAKE) -f $makefile LIB_OPT=$LIB_OPT" >> $MAKEFILE
echo " \$(MAKE) -f $makefile CPU_OPT=$CPU_OPT" >> $MAKEFILE
echo " cd ..\\..\\.." >> $MAKEFILE
;;
*)
echo " cd $PCRE \\" >> $MAKEFILE
echo $ngx_n " && CFLAGS=\"-O2 $LIB_OPT\"" $ngx_c >> $MAKEFILE
echo " ./configure --disable-shared \\" >> $MAKEFILE
echo " && CC=$CC $PCRE_OPT \\" >> $MAKEFILE
echo " ./configure --disable-shared \\" >> $MAKEFILE
echo " && \$(MAKE)" >> $MAKEFILE
;;

View File

@ -1,5 +1,5 @@
CFLAGS = -O2 -Ob1 -Oi -Gs -MT $(LIB_OPT)
CFLAGS = -O2 -Ob1 -Oi -Gs -MT $(CPU_OPT)
PCREFLAGS = -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10

View File

@ -1,5 +1,5 @@
CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(LIB_OPT)
CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
PCREFLAGS = -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10

View File

@ -31,20 +31,28 @@ case $PLATFORM in
cp auto/lib/zlib/$makefile $ZLIB
echo " cd $ZLIB" >> $MAKEFILE
echo " \$(MAKE) -f $makefile LIB_OPT=$LIB_OPT" >> $MAKEFILE
echo " \$(MAKE) -f $makefile CPU_OPT=$CPU_OPT" >> $MAKEFILE
echo " cd ..\\..\\.." >> $MAKEFILE
;;
*:i386 | *:i686)
echo " cd $ZLIB \\" >> $MAKEFILE
echo " && cp contrib/asm686/match.S . \\" >> $MAKEFILE
echo " && CFLAGS=\"-O3 -DASMV\" ./configure \\" >> $MAKEFILE
echo " && \$(MAKE) OBJA=match.o" >> $MAKEFILE
if [ $ZLIB_ASM = pentiumpro ]; then
echo " cd $ZLIB \\" >> $MAKEFILE
echo " && cp contrib/asm686/match.S . \\" >> $MAKEFILE
echo " && CC=$CC $ZLIB_OPT ./configure \\" >> $MAKEFILE
echo " && \$(MAKE) OBJA=match.o" >> $MAKEFILE
else
echo " cd $ZLIB \\" >> $MAKEFILE
echo " && CC=$CC $ZLIB_OPT ./configure \\" >> $MAKEFILE
echo " && \$(MAKE)" >> $MAKEFILE
fi
;;
*)
echo " cd $ZLIB && ./configure && \$(MAKE)" >> $MAKEFILE
echo " cd $ZLIB \\" >> $MAKEFILE
echo " && CC=$CC $ZLIB_OPT ./configure \\" >> $MAKEFILE
echo " && \$(MAKE)" >> $MAKEFILE
;;
esac

View File

@ -1,5 +1,5 @@
CFLAGS = -nologo -c -MT -O2 -Ob1 -Oi -Gs $(LIB_OPT)
CFLAGS = -nologo -c -MT -O2 -Ob1 -Oi -Gs $(CPU_OPT)
zlib.lib:
cl $(CFLAGS) adler32.c crc32.c deflate.c trees.c zutil.c

View File

@ -1,5 +1,5 @@
CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(LIB_OPT)
CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
zlib.lib:
wcl386 $(CFLAGS) adler32.c crc32.c deflate.c trees.c zutil.c

View File

@ -4,7 +4,7 @@ help=no
CC=gcc
OBJS=objs
CPU_OPT=NO
CPU=NO
TEST_BUILD_DEVPOLL=NO
TEST_BUILD_EPOLL=NO
@ -26,12 +26,17 @@ HTTP_PROXY=YES
USE_PCRE=NO
PCRE=NONE
PCRE_OPT=NO
USE_MD5=NO
MD5=NONE
MD5_OPT=NO
MD5_ASM=NO
USE_ZLIB=NO
ZLIB=NONE
ZLIB_OPT=NO
ZLIB_ASM=NO
for option
@ -64,13 +69,19 @@ do
--without-http_proxy_module) HTTP_PROXY=NO ;;
--with-cc=*) CC="$value" ;;
--with-cpu=*) CPU_OPT="$value" ;;
--with-cpu-opt=*) CPU="$value" ;;
--without-pcre) USE_PCRE=DISABLED ;;
--with-pcre=*) PCRE="$value" ;;
--with-pcre-opt=*) PCRE_OPT="$value" ;;
--with-md5=*) MD5="$value" ;;
--with-md5-opt=*) MD5_OPT="$value" ;;
--with-md5-asm) MD5_ASM=YES ;;
--with-zlib=*) ZLIB="$value" ;;
--with-zlib-opt=*) ZLIB_OPT="$value" ;;
--with-zlib-asm=*) ZLIB_ASM="$value" ;;
--test-build-devpoll) TEST_BUILD_DEVPOLL=YES ;;
--test-build-epoll) TEST_BUILD_EPOLL=YES ;;
@ -106,3 +117,8 @@ if [ $help = yes ]; then
exit 1
fi
if [ $ZLIB_ASM != NO ]; then
ZLIB_ASMV=-DASMV
fi