diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-03-05 11:34:24 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-03-05 11:34:24 +0300 |
commit | ab9d5fdfd55c879611d69998fc58cbb39f25e73a (patch) | |
tree | 90ff43013ac4579f2c4ba1a42b8777bfa4fecaaa /auto | |
parent | 6a9304522227d4b4df873d3716cf06093d497700 (diff) |
nginx-0.0.2-2004-03-05-11:34:24 import
Diffstat (limited to 'auto')
-rw-r--r-- | auto/cc | 50 | ||||
-rw-r--r-- | auto/init | 6 | ||||
-rw-r--r-- | auto/make | 254 | ||||
-rw-r--r-- | auto/modules | 25 |
4 files changed, 261 insertions, 74 deletions
@@ -2,6 +2,7 @@ case $CC in *gcc) + # gcc 2.95.4, 3.3.2 # optimization #CFLAGS="$CFLAGS -O2 -fomit-frame-pointer" @@ -31,6 +32,7 @@ case $CC in have=HAVE_GCC_VARIADIC_MACROS . auto/have OBJEXT=o + COMPILEONLY="-c " OBJOUT="-o " BINOUT="-o " @@ -57,6 +59,7 @@ case $CC in have=HAVE_C99_VARIADIC_MACROS . auto/have OBJEXT=o + COMPILEONLY="-c " OBJOUT="-o " BINOUT="-o " @@ -113,6 +116,7 @@ case $CC in CORE_LINK="$CORE_LINK -debug -debugtype:coff" OBJEXT=obj + COMPILEONLY="-c " OBJOUT="-Fo" BINOUT="-Fe" @@ -122,6 +126,52 @@ case $CC in wcc386) # Open Watcom 1.0 + + # optimization + + # maximize speed + CFLAGS="$CFLAGS -ot" + # reorder instructions for best pipeline usage + CFLAGS="$CFLAGS -op" + # inline intrinsic functions + CFLAGS="$CFLAGS -oi" + # inline expansion + CFLAGS="$CFLAGS -oe" + # disable stack checking calls + CFLAGS="$CFLAGS -s" + # optimize for Pentium Pro + #CFLAGS="$CFLAGS -6r" + CFLAGS="$CFLAGS -6s" + + # warnings + #CFLAGS="$CFLAGS -w3" + CFLAGS="$CFLAGS -wx" + + # stop on warning + #CFLAGS="$CFLAGS -we" + + # built target is NT + CFLAGS="$CFLAGS -bt=nt" + + # multithreaded + CFLAGS="$CFLAGS -bm" + + # debug + CFLAGS="$CFLAGS -d2" + + # quiet + CFLAGS="$CFLAGS -zq" + + # link traget is NT + CORE_LINK="$CORE_LINK -l=nt" + + OBJEXT=obj + COMPILEONLY= + OBJOUT="-fo" + BINOUT="-fo" + INC_EQ=YES + MAKE_BS=YES + MAKE_SL=YES ;; esac @@ -10,6 +10,12 @@ NGX_ERR=$OBJS/autoconf.err CC_WARN=$CC +INC_EQ=NO +MAKE_BS=NO +MAKE_SL=NO +MAKE_BL=YES + + # checking echo's "-n" option and "\c" capabilties if echo "test\c" | grep c >/dev/null; then @@ -4,155 +4,261 @@ mkdir -p $OBJS/src/core $OBJS/src/event $OBJS/src/event/modules \ $OBJS/src/http $OBJS/src/http/modules $OBJS/src/http/modules/proxy -modules="$CORE_MODULES $EVENT_MODULES $HTTP_MODULES \ - $HTTP_FILTER_MODULES $HTTP_NOT_MODIFIED_FILTER_MODULE" +echo "CC = $CC" > $MAKEFILE +echo "CFLAGS = $CFLAGS" >> $MAKEFILE +echo >> $MAKEFILE -echo "#include <ngx_config.h>" > $NGX_MODULES_C -echo "#include <ngx_core.h>" >> $NGX_MODULES_C -echo >> $NGX_MODULES_C +# CORE_DEPS -for mod in $modules +if [ $MAKE_SL = YES ]; then + echo $ngx_n "CORE_DEPS =" $ngx_c >> $MAKEFILE +else + echo "CORE_DEPS = \\" >> $MAKEFILE +fi + +for dep in $CORE_DEPS do - echo "extern ngx_module_t $mod;" >> $NGX_MODULES_C + if [ $MAKE_BS = YES ]; then + dep=`echo $dep | sed -e "s/\//\\\\\\/g"` + fi + + if [ $MAKE_SL = YES ]; then + echo $ngx_n " $dep" $ngx_c >> $MAKEFILE + else + echo " $dep \\" >> $MAKEFILE + fi done +echo >> $MAKEFILE -echo >> $NGX_MODULES_C -echo 'ngx_module_t *ngx_modules[] = {' >> $NGX_MODULES_C -for mod in $modules -do - echo " &$mod," >> $NGX_MODULES_C -done +# CORE_INCS + +if [ $MAKE_SL = YES ]; then + echo >> $MAKEFILE +fi -echo " NULL" >> $NGX_MODULES_C -echo "};" >> $NGX_MODULES_C +inc="$CORE_INCS -I $OBJS" +if [ $INC_EQ = YES ]; then + inc=`echo $inc | sed -e "s/-I /-i=/g"` +fi +if [ $MAKE_BS = YES ]; then + inc=`echo $inc | sed -e "s/\//\\\\\\/g"` +fi -echo "CC = $CC" > $MAKEFILE -echo "CFLAGS = $CFLAGS" >> $MAKEFILE -echo >> $MAKEFILE +echo "CORE_INCS = $inc" >> $MAKEFILE +echo >> $MAKEFILE -echo "CORE_DEPS = \\" >> $MAKEFILE -for dep in $CORE_DEPS + +# HTTP_DEPS + +if [ $MAKE_SL = YES ]; then + echo $ngx_n "HTTP_DEPS =" $ngx_c >> $MAKEFILE +else + echo "HTTP_DEPS = \\" >> $MAKEFILE +fi + +for dep in $HTTP_DEPS do - if [ $PLATFORM = win32 ]; then + if [ $MAKE_BS = YES ]; then dep=`echo $dep | sed -e "s/\//\\\\\\/g"` fi - echo " $dep \\" >> $MAKEFILE + + if [ $MAKE_SL = YES ]; then + echo $ngx_n " $dep" $ngx_c >> $MAKEFILE + else + echo " $dep \\" >> $MAKEFILE + fi done -echo >> $MAKEFILE +echo >> $MAKEFILE -inc="$CORE_INCS -I $OBJS" -if [ $PLATFORM = win32 ]; then - inc=`echo $inc | sed -e "s/\//\\\\\\/g"` + +# HTTP_INCS + +if [ $MAKE_SL = YES ]; then + echo >> $MAKEFILE fi -echo "CORE_INCS = $inc" >> $MAKEFILE -echo >> $MAKEFILE -echo "HTTP_DEPS = \\" >> $MAKEFILE -for inc in $HTTP_DEPS -do - if [ $PLATFORM = win32 ]; then - inc=`echo $inc | sed -e "s/\//\\\\\\/g"` - fi - echo " $inc \\" >> $MAKEFILE -done -echo >> $MAKEFILE +inc="$HTTP_INCS -I $OBJS" +if [ $INC_EQ = YES ]; then + inc=`echo $inc | sed -e "s/-I /-i=/g"` +fi -inc="$HTTP_INCS" -if [ $PLATFORM = win32 ]; then +if [ $MAKE_BS = YES ]; then inc=`echo $inc | sed -e "s/\//\\\\\\/g"` fi -echo "HTTP_INCS = $inc" >> $MAKEFILE -echo >> $MAKEFILE +echo "HTTP_INCS = $inc" >> $MAKEFILE +echo >> $MAKEFILE -echo "nginx: \\" >> $MAKEFILE +# nginx + +if [ $MAKE_SL = YES ]; then + echo $ngx_n "nginx: " $ngx_c >> $MAKEFILE +else + echo "nginx: \\" >> $MAKEFILE +fi + + +# nginx deps for src in $CORE_SRCS $HTTP_SRCS do obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/" -e "s/\.S\$/.$OBJEXT/"` obj="$OBJS/$obj" - if [ $PLATFORM = win32 ]; then + + if [ $MAKE_BS = YES ]; then obj=`echo $obj | sed -e "s/\//\\\\\\/g"` fi - echo " $obj \\" >> $MAKEFILE + if [ $MAKE_SL = YES ]; then + echo $ngx_n " $obj" $ngx_c >> $MAKEFILE + else + echo " $obj \\" >> $MAKEFILE + fi done for src in $NGX_MODULES_C $LINK_DEPS do obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/"` - if [ $PLATFORM = win32 ]; then + + if [ $MAKE_BS = YES ]; then obj=`echo $obj | sed -e "s/\//\\\\\\/g"` fi - echo " $obj \\" >> $MAKEFILE + if [ $MAKE_SL = YES ]; then + echo $ngx_n " $obj" $ngx_c >> $MAKEFILE + else + echo " $obj \\" >> $MAKEFILE + fi done +echo >> $MAKEFILE + + +# nginx build + +if [ $MAKE_SL = YES ]; then + echo $ngx_n " \$(CC) ${BINOUT}nginx" $ngx_c >> $MAKEFILE +else + echo " \$(CC) ${BINOUT}nginx \\" >> $MAKEFILE +fi -echo >> $MAKEFILE -echo " \$(CC) ${BINOUT}nginx \\" >> $MAKEFILE + +# nginx build sources for src in $CORE_SRCS $HTTP_SRCS do obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/" -e "s/\.S\$/.$OBJEXT/"` obj="$OBJS/$obj" - if [ $PLATFORM = win32 ]; then + + if [ $MAKE_BS = YES ]; then obj=`echo $obj | sed -e "s/\//\\\\\\/g"` fi - echo " $obj \\" >> $MAKEFILE + if [ $MAKE_SL = YES ]; then + echo $ngx_n " $obj," $ngx_c >> $MAKEFILE + else + echo " $obj \\" >> $MAKEFILE + fi done + +# nginx build ngx_modules.c and libs + obj=`echo $NGX_MODULES_C | sed -e "s/\.c\$/.$OBJEXT/"` -if [ $PLATFORM = win32 ]; then +libs=`echo $CORE_LIBS | sed -e "s/\.c\$/.$OBJEXT/"` +src=$NGX_MODULES_C +if [ $MAKE_BS = YES ]; then obj=`echo $obj | sed -e "s/\//\\\\\\/g"` + src=`echo $src | sed -e "s/\//\\\\\\/g"` + libs=`echo $libs | sed -e "s/\//\\\\\\/g"` fi -echo " $obj \\" >> $MAKEFILE -echo " $CORE_LIBS \\" >> $MAKEFILE -echo " $CORE_LINK" >> $MAKEFILE -echo >> $MAKEFILE +if [ $MAKE_SL = YES ]; then + echo " $obj $libs $CORE_LINK" >> $MAKEFILE + echo >> $MAKEFILE +else + echo " $obj \\" >> $MAKEFILE + echo " $CORE_LIBS \\" >> $MAKEFILE + echo " $CORE_LINK" >> $MAKEFILE + echo >> $MAKEFILE +fi + + +# ngx_modules.c deps="\$(CORE_DEPS)" args="\$(CFLAGS) \$(CORE_INCS)" -echo "$obj: \\" >> $MAKEFILE -echo " $NGX_MODULES_C $deps" >> $MAKEFILE -echo " \$(CC) -c $args \\" >> $MAKEFILE -echo " $OBJOUT$obj \\" >> $MAKEFILE -echo " $NGX_MODULES_C" >> $MAKEFILE -echo >> $MAKEFILE - +if [ $MAKE_SL = YES ]; then + echo "$obj: $NGX_MODULES_C $deps" >> $MAKEFILE + echo $ngx_n " \$(CC) $COMPILEONLY $args" $ngx_c >> $MAKEFILE + echo " $OBJOUT$obj $src" >> $MAKEFILE + echo >> $MAKEFILE +else + echo "$obj: \\" >> $MAKEFILE + echo " $NGX_MODULES_C $deps" >> $MAKEFILE + echo " \$(CC) $COMPILEONLY $args \\" >> $MAKEFILE + echo " $OBJOUT$obj \\" >> $MAKEFILE + echo " $src" >> $MAKEFILE + echo >> $MAKEFILE +fi +# core sources for src in $CORE_SRCS do obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/" -e "s/\.S\$/.$OBJEXT/"` + obj="$OBJS/$obj" + + if [ $MAKE_BS = YES ]; then + obj=`echo $obj | sed -e "s/\//\\\\\\/g"` + src=`echo $src | sed -e "s/\//\\\\\\/g"` + fi - echo "$OBJS/$obj: \\" >> $MAKEFILE - echo " $src $deps" >> $MAKEFILE - echo " \$(CC) -c $args \\" >> $MAKEFILE - echo " $OBJOUT$OBJS/$obj \\" >> $MAKEFILE - echo " $src" >> $MAKEFILE - echo >> $MAKEFILE + if [ $MAKE_SL = YES ]; then + echo "$obj: $src $deps" >> $MAKEFILE + echo " \$(CC) $COMPILEONLY $args $OBJOUT$obj $src" >> $MAKEFILE + echo >> $MAKEFILE + else + echo "$obj: \\" >> $MAKEFILE + echo " $src $deps" >> $MAKEFILE + echo " \$(CC) $COMPILEONLY $args \\" >> $MAKEFILE + echo " $OBJOUT$obj \\" >> $MAKEFILE + echo " $src" >> $MAKEFILE + echo >> $MAKEFILE + fi done +# http sources + deps="\$(CORE_DEPS) \$(HTTP_DEPS)" args="\$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)" for src in $HTTP_SRCS do obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/"` + obj="$OBJS/$obj" - echo "$OBJS/$obj: \\" >> $MAKEFILE - echo " $src $deps" >> $MAKEFILE - echo " \$(CC) -c $args \\" >> $MAKEFILE - echo " $OBJOUT$OBJS/$obj \\" >> $MAKEFILE - echo " $src" >> $MAKEFILE - echo >> $MAKEFILE + if [ $MAKE_BS = YES ]; then + obj=`echo $obj | sed -e "s/\//\\\\\\/g"` + src=`echo $src | sed -e "s/\//\\\\\\/g"` + fi + + if [ $MAKE_SL = YES ]; then + echo "$obj: $src $deps" >> $MAKEFILE + echo " \$(CC) $COMPILEONLY $args $OBJOUT$obj $src" >> $MAKEFILE + echo >> $MAKEFILE + else + echo "$obj: \\" >> $MAKEFILE + echo " $src $deps" >> $MAKEFILE + echo " \$(CC) $COMPILEONLY $args \\" >> $MAKEFILE + echo " $OBJOUT$obj \\" >> $MAKEFILE + echo " $src" >> $MAKEFILE + echo >> $MAKEFILE + fi done diff --git a/auto/modules b/auto/modules index 1af94969c..ccd4d9af9 100644 --- a/auto/modules +++ b/auto/modules @@ -78,3 +78,28 @@ if [ $HTTP_PROXY = YES ]; then HTTP_DEPS="$HTTP_DEPS $HTTP_PROXY_DEPS" HTTP_SRCS="$HTTP_SRCS $HTTP_PROXY_SRCS" fi + + +modules="$CORE_MODULES $EVENT_MODULES $HTTP_MODULES \ + $HTTP_FILTER_MODULES $HTTP_NOT_MODIFIED_FILTER_MODULE" + + +echo "#include <ngx_config.h>" > $NGX_MODULES_C +echo "#include <ngx_core.h>" >> $NGX_MODULES_C +echo >> $NGX_MODULES_C + +for mod in $modules +do + echo "extern ngx_module_t $mod;" >> $NGX_MODULES_C +done + +echo >> $NGX_MODULES_C +echo 'ngx_module_t *ngx_modules[] = {' >> $NGX_MODULES_C + +for mod in $modules +do + echo " &$mod," >> $NGX_MODULES_C +done + +echo " NULL" >> $NGX_MODULES_C +echo "};" >> $NGX_MODULES_C |