nginx-0.0.2-2004-03-12-00:34:52 import

This commit is contained in:
Igor Sysoev 2004-03-11 21:34:52 +00:00
parent 6bb889f442
commit a893eab667
17 changed files with 120 additions and 121 deletions

54
auto/cc
View File

@ -21,17 +21,22 @@ case $CC in
CFLAGS="$CFLAGS $PIPE"
CFLAGS="$CFLAGS $CPU_OPT"
if [ $PCRE_OPT = NO ]; then
PCRE_OPT="CFLAGS=\"-O2 -fomit-frame-pointer $PIPE $CPU_OPT\""
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
PCRE_OPT="$PCRE_OPT $PIPE"
fi
if [ $MD5_OPT = NO ]; then
MD5_OPT="CFLAGS=\"-O2 -fomit-frame-pointer $PIPE $CPU_OPT\""
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
MD5_OPT="$MD5_OPT $PIPE"
fi
if [ $ZLIB_OPT = NO ]; then
ZLIB_OPT="CFLAGS=\"-O2 -fomit-frame-pointer"
ZLIB_OPT="$ZLIB_OPT $PIPE $CPU_OPT $ZLIB_ASMV\""
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
ZLIB_OPT="$ZLIB_OPT $PIPE"
fi
# warnings
@ -54,6 +59,10 @@ case $CC in
have=HAVE_GCC_VARIADIC_MACROS . auto/have
if [ ".$CPP" = "." ]; then
CPP="$CC -E"
fi
LINK="\$(CC)"
OBJEXT=o
@ -88,16 +97,16 @@ case $CC in
CFLAGS="$CFLAGS $CPU_OPT"
if [ $PCRE_OPT = NO ]; then
PCRE_OPT="CFLAGS=\"-O $CPU_OPT\""
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O $CPU_OPT"
fi
if [ $MD5_OPT = NO ]; then
MD5_OPT="CFLAGS=\"-O $CPU_OPT\""
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O $CPU_OPT"
fi
if [ $ZLIB_OPT = NO ]; then
ZLIB_OPT="CFLAGS=\"-O $CPU_OPT $ZLIB_ASMV\""
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O $CPU_OPT"
fi
# warnings
@ -157,8 +166,12 @@ case $CC in
# stop on warning
CFLAGS="$CFLAGS -WX"
# multithreaded
CFLAGS="$CFLAGS -MT"
# link with libcmt.lib, multithreaded
#LIBC="-MT"
# link with msvcrt.dll
LIBC="-MD"
CFLAGS="$CFLAGS $LIBC"
# disable logo
CFLAGS="$CFLAGS -nologo"
@ -166,16 +179,7 @@ case $CC in
LINK="\$(CC)"
# link flags
CORE_LINK="$CORE_LINK -link"
# msvcrt.dll
CORE_LINK="$CORE_LINK -nodefaultlib:libcmt"
CORE_LIBS="$CORE_LIBS msvcrt.lib"
# static libc
#CORE_LINK="$CORE_LINK -nodefaultlib:msvcrt"
CORE_LINK="$CORE_LINK -verbose:lib"
CORE_LINK="$CORE_LINK -link -verbose:lib"
# debug
CFLAGS="$CFLAGS -Yd"

View File

@ -3,12 +3,10 @@ if [ $USE_PCRE = YES ]; then
. auto/lib/pcre/conf
fi
if [ $USE_MD5 = YES ]; then
. auto/lib/md5/conf
fi
if [ $USE_ZLIB = YES ]; then
. auto/lib/zlib/conf
fi

View File

@ -1,4 +1,8 @@
if [ $PCRE != NO ]; then
. auto/lib/pcre/make
fi
if [ $MD5 != NO ]; then
. auto/lib/md5/make
fi
@ -6,7 +10,3 @@ fi
if [ $ZLIB != NO ]; then
. auto/lib/zlib/make
fi
if [ $PCRE != NO ]; then
. auto/lib/pcre/make
fi

View File

@ -25,6 +25,9 @@ case $PLATFORM in
esac
done=NO
case $PLATFORM in
win32)
@ -32,39 +35,51 @@ case $PLATFORM in
cp auto/lib/md5/$makefile $MD5
echo " cd $MD5" >> $MAKEFILE
echo $ngx_n " \$(MAKE) -f $makefile" $ngx_c >> $MAKEFILE
echo " CPU_OPT=$CPU_OPT MD5_ASM=$MD5_ASM" >> $MAKEFILE
echo " CPU_OPT=$CPU_OPT LIBC=$LIBC MD5_ASM=$MD5_ASM" >> $MAKEFILE
echo " cd ..\\..\\.." >> $MAKEFILE
done=YES
;;
SunOS:*:i86pc)
if [ $MD5_ASM = YES ]; then
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT MAKE=\$(MAKE) \\" >> $MAKEFILE
echo " x86-solaris" >> $MAKEFILE
else
MD5_OPT="CFLAGS=\"$MD5_OPT -DSOL -DMD5_ASM -DL_ENDIAN\""
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT \\" >> $MAKEFILE
echo " MD5_ASM_OBJ= CC=$CC all" >> $MAKEFILE
echo " MD5_ASM_OBJ=asm/mx86-elf.o \\" >> $MAKEFILE
echo " CC=$CC CPP=\"$CPP\" libmd5.a" >> $MAKEFILE
done=YES
fi
;;
# FreeBSD: i386
# Linux: i686
*:i386 | *:i686)
if [ $MD5_ASM = YES ]; then
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT MAKE=\$(MAKE) \\" >> $MAKEFILE
echo " x86-elf" >> $MAKEFILE
else
MD5_OPT="CFLAGS=\"$MD5_OPT -DELF -DMD5_ASM -DL_ENDIAN\""
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT \\" >> $MAKEFILE
echo " MD5_ASM_OBJ= CC=$CC all" >> $MAKEFILE
fi
;;
echo " MD5_ASM_OBJ=asm/mx86-elf.o \\" >> $MAKEFILE
echo " CC=$CC CPP=\"$CPP\" libmd5.a" >> $MAKEFILE
*)
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) $MD5_OPT MD5_ASM_OBJ= CC=$CC all" >> $MAKEFILE
done=YES
fi
;;
esac
if [ $done = NO ]; then
echo " cd $MD5 \\" >> $MAKEFILE
echo " && \$(MAKE) CFLAGS=\"$MD5_OPT\" \\" >> $MAKEFILE
echo " MD5_ASM_OBJ= CC=$CC libmd5.a" >> $MAKEFILE
fi
echo >> $MAKEFILE

View File

@ -1,5 +1,5 @@
CFLAGS = -nologo -c -MT -O2 -Ob1 -Oi -Gs $(CPU_OPT) -D L_ENDIAN
CFLAGS = -nologo -c -MT -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
!if "$(MD5_ASM)" == "YES"

View File

@ -10,7 +10,6 @@ if [ $PCRE != NONE ]; then
have=HAVE_PCRE . auto/have
have=PCRE_STATIC . auto/have
CORE_DEPS="$CORE_DEPS $PCRE/pcre.lib"
#CORE_DEPS="$PCRE/pcre.lib $CORE_DEPS"
CORE_LIBS="$CORE_LIBS pcre.lib"
CORE_LINK="$CORE_LINK -libpath:$PCRE"
;;
@ -24,7 +23,8 @@ if [ $PCRE != NONE ]; then
*)
have=HAVE_PCRE . auto/have
CORE_DEPS="$CORE_DEPS $PCRE/.libs/libpcre.a"
CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
CORE_LIBS="$CORE_LIBS -L $PCRE/.libs -lpcre"
;;

View File

@ -12,39 +12,30 @@ case $CC in
esac
case $PLATFORM in
win32)
echo "$PCRE/pcre.lib:" >> $MAKEFILE
;;
*)
echo "$PCRE/.libs/libpcre.a:" >> $MAKEFILE
;;
esac
case $PLATFORM in
win32)
cp auto/lib/pcre/patch.pcre.in $PCRE
cp auto/lib/pcre/patch.config.in $PCRE
cp auto/lib/pcre/$makefile $PCRE
echo "$PCRE/pcre.lib:" >> $MAKEFILE
echo " cd $PCRE" >> $MAKEFILE
echo " \$(MAKE) -f $makefile CPU_OPT=$CPU_OPT" >> $MAKEFILE
echo " \$(MAKE) -f $makefile CPU_OPT=$CPU_OPT LIBC=$LIBC">> $MAKEFILE
echo " cd ..\\..\\.." >> $MAKEFILE
;;
*)
# the patch allows to run the parallel make jobs
cp auto/lib/pcre/patch.Makefile.in $PCRE
PCRE_OPT="CFLAGS=\"$PCRE_OPT\""
echo "$PCRE/pcre.h:" >> $MAKEFILE
echo " cd $PCRE \\" >> $MAKEFILE
echo " && patch < patch.Makefile.in \\" >> $MAKEFILE
echo " && CC=$CC $PCRE_OPT \\" >> $MAKEFILE
echo " ./configure --disable-shared \\" >> $MAKEFILE
echo " && \$(MAKE)" >> $MAKEFILE
echo " ./configure --disable-shared" >> $MAKEFILE
echo >> $MAKEFILE
echo "$PCRE/.libs/libpcre.a: $PCRE/pcre.h" >> $MAKEFILE
echo " cd $PCRE \\" >> $MAKEFILE
echo " && \$(MAKE) libpcre.la" >> $MAKEFILE
;;
esac

View File

@ -1,11 +1,11 @@
CFLAGS = -O2 -Ob1 -Oi -Gs -MT $(CPU_OPT)
CFLAGS = -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)
PCREFLAGS = -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10
pcre.lib:
patch -o pcre.h pcre.in patch.pcre
patch -o config.h config.in patch.config
patch -o pcre.h pcre.in patch.pcre.in
patch -o config.h config.in patch.config.in
cl -Fedftables dftables.c

View File

@ -4,8 +4,8 @@ PCREFLAGS = -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10
pcre.lib:
patch -o pcre.h pcre.in patch.pcre
patch -o config.h config.in patch.config
patch -o pcre.h pcre.in patch.pcre.in
patch -o config.h config.in patch.config.in
wcl386 -zq -bt=nt -l=nt -fe=dftables dftables.c
dftables > chartables.c

View File

@ -1,11 +0,0 @@
--- Makefile.in Thu Mar 11 16:19:09 2004
+++ Makefile.in Thu Mar 11 16:21:16 2004
@@ -96,7 +96,7 @@
OBJ = maketables.@OBJEXT@ get.@OBJEXT@ study.@OBJEXT@ pcre.@OBJEXT@ @POSIX_OBJ@
LOBJ = maketables.lo get.lo study.lo pcre.lo @POSIX_LOBJ@
-all: libpcre.la @POSIX_LIB@ pcretest@EXEEXT@ pcregrep@EXEEXT@ @ON_WINDOWS@ winshared
+all: libpcre.la
pcregrep@EXEEXT@: libpcre.la pcregrep.@OBJEXT@ @ON_WINDOWS@ winshared
$(LINK) -o pcregrep@EXEEXT@ pcregrep.@OBJEXT@ libpcre.la

View File

@ -25,14 +25,19 @@ case $PLATFORM in
esac
done=NO
case $PLATFORM in
win32)
cp auto/lib/zlib/$makefile $ZLIB
echo " cd $ZLIB" >> $MAKEFILE
echo " \$(MAKE) -f $makefile CPU_OPT=$CPU_OPT" >> $MAKEFILE
echo " \$(MAKE) -f $makefile CPU_OPT=$CPU_OPT LIBC=$LIBC">> $MAKEFILE
echo " cd ..\\..\\.." >> $MAKEFILE
done=YES
;;
@ -40,21 +45,22 @@ case $PLATFORM in
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 " && CC=$CC CFLAGS=\"$ZLIB_OPT -DASMV\" \\" >> $MAKEFILE
echo " ./configure \\" >> $MAKEFILE
echo " && \$(MAKE) OBJA=match.o libz.a" >> $MAKEFILE
*)
echo " cd $ZLIB \\" >> $MAKEFILE
echo " && CC=$CC $ZLIB_OPT ./configure \\" >> $MAKEFILE
echo " && \$(MAKE)" >> $MAKEFILE
done=YES
fi
;;
esac
if [ $done = NO ]; then
echo " cd $ZLIB \\" >> $MAKEFILE
echo " && CC=$CC CFLAGS=\"$ZLIB_OPT\" ./configure \\" >> $MAKEFILE
echo " && \$(MAKE) libz.a" >> $MAKEFILE
fi
echo >> $MAKEFILE

View File

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

View File

@ -5,6 +5,7 @@ mkdir -p $OBJS/src/core $OBJS/src/event $OBJS/src/event/modules \
echo "CC = $CC" > $MAKEFILE
echo "CPP = $CPP" >> $MAKEFILE
echo "LINK = $LINK" >> $MAKEFILE
if [ $CC = wcl386 ]; then
echo MAKE = wmake >> $MAKEFILE

View File

@ -55,23 +55,27 @@ HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES \
HTTP_MODULES="$HTTP_MODULES $HTTP_STATIC_MODULE $HTTP_INDEX_MODULE"
if [ $HTTP_REWRITE = YES -a $USE_PCRE != DISABLED ]; then
have=NGX_HTTP_REWRITE . auto/have
USE_PCRE=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_REWRITE_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_REWRITE_SRCS"
fi
if [ $HTTP_GZIP = YES ]; then
have=NGX_HTTP_GZIP . auto/have
USE_ZLIB=YES
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_GZIP_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_GZIP_SRCS"
fi
if [ $HTTP_SSI = YES ]; then
have=NGX_HTTP_SSI . auto/have
HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS"
fi
if [ $HTTP_PROXY = YES ]; then
have=NGX_HTTP_PROXY . auto/have
USE_MD5=YES
HTTP_MODULES="$HTTP_MODULES $HTTP_PROXY_MODULE"
HTTP_INCS="$HTTP_INCS $HTTP_PROXY_INCS"

View File

@ -2,6 +2,7 @@
help=no
CC=gcc
CPP=
OBJS=objs
DEBUG=NO
@ -27,16 +28,16 @@ HTTP_PROXY=YES
USE_PCRE=NO
PCRE=NONE
PCRE_OPT=NO
PCRE_OPT=
USE_MD5=NO
MD5=NONE
MD5_OPT=NO
MD5_OPT=
MD5_ASM=NO
USE_ZLIB=NO
ZLIB=NONE
ZLIB_OPT=NO
ZLIB_OPT=
ZLIB_ASM=NO
@ -70,6 +71,7 @@ do
--without-http_proxy_module) HTTP_PROXY=NO ;;
--with-cc=*) CC="$value" ;;
--with-cpp=*) CPP="$value" ;;
--with-cpu-opt=*) CPU="$value" ;;
--with-debug) DEBUG=YES ;;
@ -119,8 +121,3 @@ if [ $help = yes ]; then
exit 1
fi
if [ $ZLIB_ASM != NO ]; then
ZLIB_ASMV=-DASMV
fi

View File

@ -226,20 +226,14 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle)
}
}
#if (WIN32)
#if 0
/* TODO: TEST */
fprintf(stderr, "BEFORE\n");
CloseHandle(GetStdHandle(STD_ERROR_HANDLE));
SetStdHandle(STD_ERROR_HANDLE, cycle->log->file->fd);
fprintf(stderr, "AFTER\n");
#endif
#else
#if !(WIN32)
if (dup2(cycle->log->file->fd, STDERR_FILENO) == NGX_ERROR) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
"dup2(STDERR) failed");
failed = 1;
}
#endif
if (failed) {
@ -454,15 +448,13 @@ void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user)
file[i].fd = fd;
}
#if (WIN32)
/* TODO: TEST */
CloseHandle(GetStdHandle(STD_ERROR_HANDLE));
SetStdHandle(STD_ERROR_HANDLE, cycle->log->file->fd);
#else
#if !(WIN32)
if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
"dup2(STDERR) failed");
}
#endif
}

View File

@ -19,8 +19,10 @@ ngx_http_header_t ngx_http_headers_in[] = {
{ ngx_string("If-Range"), offsetof(ngx_http_headers_in_t, if_range) },
#endif
#if (NGX_HTTP_GZIP)
{ ngx_string("Accept-Encoding"),
offsetof(ngx_http_headers_in_t, accept_encoding) },
#endif
{ ngx_string("Authorization"),
offsetof(ngx_http_headers_in_t, authorization) },