nginx/auto/cc

368 lines
8.4 KiB
Plaintext
Raw Normal View History

2003-11-26 04:44:56 +08:00
case $CC in
2004-03-26 04:03:02 +08:00
*gcc*)
2004-04-13 23:08:48 +08:00
# gcc 2.7.2.3, 2.8.1, 2.95.4, 3.3.2, 3.3.3, 3.4
2003-11-26 04:44:56 +08:00
# optimization
#CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
2004-03-11 01:55:19 +08:00
2004-03-11 04:56:39 +08:00
case $CPU in
2004-03-13 00:57:08 +08:00
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-march=pentium"
;;
2004-03-11 01:55:19 +08:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
2004-03-11 04:56:39 +08:00
CPU_OPT="-march=pentiumpro"
2004-03-11 01:55:19 +08:00
;;
2004-03-13 00:57:08 +08:00
2004-03-11 01:55:19 +08:00
pentium4)
# optimize for Pentium 4, gcc 3.x
2004-03-11 04:56:39 +08:00
CPU_OPT="-march=pentium4"
2004-03-11 01:55:19 +08:00
;;
esac
2004-04-01 14:21:13 +08:00
# STUB for batch builds
if [ $CC = gcc27 ]; then CPU_OPT=; fi
2004-03-26 04:03:02 +08:00
CFLAGS="$CFLAGS $PIPE $CPU_OPT"
2004-03-11 04:56:39 +08:00
2004-03-12 05:34:52 +08:00
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
PCRE_OPT="$PCRE_OPT $PIPE"
2004-03-11 04:56:39 +08:00
fi
2004-03-12 05:34:52 +08:00
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
MD5_OPT="$MD5_OPT $PIPE"
2004-03-11 04:56:39 +08:00
fi
2004-03-12 05:34:52 +08:00
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
ZLIB_OPT="$ZLIB_OPT $PIPE"
2004-03-11 04:56:39 +08:00
fi
2003-11-26 04:44:56 +08:00
# warnings
CFLAGS="$CFLAGS -O -W"
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
#CFLAGS="$CFLAGS -Wconversion"
#CFLAGS="$CFLAGS -Winline"
# we have a lot of the unused function arguments
CFLAGS="$CFLAGS -Wno-unused"
# stop on warning
CFLAGS="$CFLAGS -Werror"
# ANSI C warnings
#CFLAGS="$CFLAGS -pedantic"
# debug
CFLAGS="$CFLAGS -g"
2004-03-30 14:27:36 +08:00
# DragonFly's gcc3 generates DWARF
#CFLAGS="$CFLAGS -g -gstabs"
2004-03-30 01:43:58 +08:00
2004-02-18 23:45:21 +08:00
have=HAVE_GCC_VARIADIC_MACROS . auto/have
2003-12-01 04:03:18 +08:00
2004-03-12 05:34:52 +08:00
if [ ".$CPP" = "." ]; then
CPP="$CC -E"
fi
2004-03-10 03:47:07 +08:00
LINK="\$(CC)"
2004-03-30 01:43:58 +08:00
INCOPT="-I "
COMPOPT="-c"
2003-11-26 04:44:56 +08:00
OBJOUT="-o "
BINOUT="-o "
2004-03-30 01:43:58 +08:00
OBJEXT="o"
2003-11-26 04:44:56 +08:00
CC_STRONG="$CC -Wall -Werror"
;;
*icc)
# Intel C++ compiler 7.1
# optimization
CFLAGS="$CFLAGS -O"
2004-03-11 04:56:39 +08:00
# inline functions declared with __inline
2004-03-15 04:46:25 +08:00
#CFLAGS="$CFLAGS -Ob1"
2004-03-11 04:56:39 +08:00
# inline any function, at the compiler's discretion
2004-03-15 04:46:25 +08:00
CFLAGS="$CFLAGS -Ob2"
# single-file IP optimizations
#IPO="-ip"
# multi-file IP optimizations
IPO="-ipo -ipo_obj"
CFLAGS="$CFLAGS $IPO"
CORE_LINK="$CORE_LINK $IPO"
CORE_LINK="$CORE_LINK -opt_report_file=$OBJS/opt_report_file"
2004-03-11 01:55:19 +08:00
2004-03-11 04:56:39 +08:00
case $CPU in
2004-03-13 00:57:08 +08:00
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-march=pentium"
;;
2004-03-11 01:55:19 +08:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
2004-03-11 04:56:39 +08:00
CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
2004-03-11 01:55:19 +08:00
;;
2004-03-13 00:57:08 +08:00
2004-03-11 01:55:19 +08:00
pentium4)
# optimize for Pentium 4, default
2004-03-11 04:56:39 +08:00
CPU_OPT="-march=pentium4"
2004-03-11 01:55:19 +08:00
;;
esac
2004-03-11 04:56:39 +08:00
CFLAGS="$CFLAGS $CPU_OPT"
2004-03-12 05:34:52 +08:00
if [ ".$PCRE_OPT" = "." ]; then
2004-03-15 04:46:25 +08:00
PCRE_OPT="-O $IPO $CPU_OPT"
2004-03-11 04:56:39 +08:00
fi
2004-03-12 05:34:52 +08:00
if [ ".$MD5_OPT" = "." ]; then
2004-03-15 04:46:25 +08:00
MD5_OPT="-O $IPO $CPU_OPT"
2004-03-11 04:56:39 +08:00
fi
2004-03-12 05:34:52 +08:00
if [ ".$ZLIB_OPT" = "." ]; then
2004-03-15 04:46:25 +08:00
ZLIB_OPT="-O $IPO $CPU_OPT"
2004-03-11 04:56:39 +08:00
fi
2003-11-26 04:44:56 +08:00
# warnings
CFLAGS="$CFLAGS -w1"
2004-03-16 15:10:12 +08:00
#CFLAGS="$CFLAGS -w2"
2003-11-26 04:44:56 +08:00
# stop on warning
CFLAGS="$CFLAGS -Werror"
2004-03-15 04:46:25 +08:00
# debug
CFLAGS="$CFLAGS -g"
2004-02-18 23:45:21 +08:00
have=HAVE_C99_VARIADIC_MACROS . auto/have
2003-12-01 04:03:18 +08:00
2004-03-10 03:47:07 +08:00
LINK="\$(CC)"
2004-03-30 01:43:58 +08:00
INCOPT="-I "
COMPOPT="-c"
2003-11-26 04:44:56 +08:00
OBJOUT="-o "
BINOUT="-o "
2004-03-30 01:43:58 +08:00
OBJEXT="o"
2003-11-26 04:44:56 +08:00
CC_STRONG="$CC -w1 -Werror"
;;
cl)
# MSVC 6.0 SP2
# optimization
# maximize speed
CFLAGS="$CFLAGS -O2"
# enable global optimization
CFLAGS="$CFLAGS -Og"
# enable intrinsic functions
CFLAGS="$CFLAGS -Oi"
# inline expansion
CFLAGS="$CFLAGS -Ob1"
# enable frame pointer omission
CFLAGS="$CFLAGS -Oy"
# disable stack checking calls
CFLAGS="$CFLAGS -Gs"
2004-03-11 01:55:19 +08:00
2004-03-11 04:56:39 +08:00
case $CPU in
2004-03-30 01:43:58 +08:00
pentium)
2004-03-13 00:57:08 +08:00
# optimize for Pentium and Athlon
CPU_OPT="-G5"
;;
2004-03-11 01:55:19 +08:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
2004-03-11 04:56:39 +08:00
CPU_OPT="-G6"
2004-03-11 01:55:19 +08:00
;;
2004-03-13 00:57:08 +08:00
2004-03-11 01:55:19 +08:00
pentium4)
# optimize for Pentium 4
2004-03-11 04:56:39 +08:00
#CPU_OPT="-G7"
2004-03-11 01:55:19 +08:00
;;
esac
2004-03-11 04:56:39 +08:00
CFLAGS="$CFLAGS $CPU_OPT"
2003-11-26 04:44:56 +08:00
# warnings
2004-03-16 15:10:12 +08:00
#CFLAGS="$CFLAGS -W3"
CFLAGS="$CFLAGS -W4"
2003-11-26 04:44:56 +08:00
# stop on warning
CFLAGS="$CFLAGS -WX"
2004-03-12 05:34:52 +08:00
# link with libcmt.lib, multithreaded
#LIBC="-MT"
# link with msvcrt.dll
LIBC="-MD"
CFLAGS="$CFLAGS $LIBC"
2003-11-26 04:44:56 +08:00
# disable logo
CFLAGS="$CFLAGS -nologo"
2004-03-10 03:47:07 +08:00
LINK="\$(CC)"
2003-11-26 04:44:56 +08:00
# link flags
2004-03-12 05:34:52 +08:00
CORE_LINK="$CORE_LINK -link -verbose:lib"
2003-11-26 04:44:56 +08:00
# debug
CFLAGS="$CFLAGS -Yd"
CORE_LINK="$CORE_LINK -debug -debugtype:coff"
2004-03-10 03:47:07 +08:00
# precompiled headers
CORE_DEPS="$CORE_DEPS ngx_config.pch"
PCH="ngx_config.pch"
BUILDPCH="-Ycngx_config.h"
USEPCH="-Yungx_config.h"
2004-03-30 01:43:58 +08:00
INCOPT="-I "
COMPOPT="-c"
2003-11-26 04:44:56 +08:00
OBJOUT="-Fo"
BINOUT="-Fe"
2004-03-30 01:43:58 +08:00
OBJEXT="obj"
BINEXT=".exe"
#DIRSEP='\\'
2003-11-26 04:44:56 +08:00
;;
2004-03-05 00:34:23 +08:00
2004-03-10 03:47:07 +08:00
wcl386)
2004-03-05 00:34:23 +08:00
# Open Watcom 1.0
2004-03-05 16:34:24 +08:00
# 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"
2004-03-11 01:55:19 +08:00
2004-03-11 04:56:39 +08:00
case $CPU in
2004-03-13 00:57:08 +08:00
pentium)
# optimize for Pentium and Athlon
# register-based arguments passing conventions
CPU_OPT="-5r"
# stack-based arguments passing conventions
#CPU_OPT="-5s"
;;
2004-03-11 01:55:19 +08:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
# register-based arguments passing conventions
2004-03-11 04:56:39 +08:00
CPU_OPT="-6r"
2004-03-11 01:55:19 +08:00
# stack-based arguments passing conventions
2004-03-11 04:56:39 +08:00
#CPU_OPT="-6s"
2004-03-11 01:55:19 +08:00
;;
esac
2004-03-11 04:56:39 +08:00
CFLAGS="$CFLAGS $CPU_OPT"
2004-03-05 16:34:24 +08:00
# warnings
#CFLAGS="$CFLAGS -w3"
CFLAGS="$CFLAGS -wx"
# stop on warning
2004-03-10 03:47:07 +08:00
CFLAGS="$CFLAGS -we"
2004-03-05 16:34:24 +08:00
# built target is NT
CFLAGS="$CFLAGS -bt=nt"
# multithreaded
CFLAGS="$CFLAGS -bm"
# debug
CFLAGS="$CFLAGS -d2"
# quiet
CFLAGS="$CFLAGS -zq"
2004-03-10 03:47:07 +08:00
# precompiled headers
CORE_DEPS="$CORE_DEPS $OBJS\\ngx_config.pch"
PCH="$OBJS\\ngx_config.pch"
BUILDPCH="-fhq=$OBJS\\ngx_config.pch"
USEPCH="-fh=$OBJS\\ngx_config.pch"
LINK="\$(CC)"
# link flags
2004-03-05 16:34:24 +08:00
CORE_LINK="$CORE_LINK -l=nt"
2004-03-30 01:43:58 +08:00
INCOPT="-i="
COMPOPT="-c"
2004-03-05 16:34:24 +08:00
OBJOUT="-fo"
2004-03-10 03:47:07 +08:00
BINOUT="-fe="
2004-03-30 01:43:58 +08:00
OBJEXT="obj"
BINEXT=".exe"
DIRSEP='\\'
2004-03-10 03:47:07 +08:00
2004-03-05 16:34:24 +08:00
MAKE_SL=YES
2004-03-05 00:34:23 +08:00
;;
2004-03-30 01:43:58 +08:00
bcc32)
# Borland C++ 5.5
# optimization
# maximize speed
CFLAGS="$CFLAGS -O2"
case $CPU in
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-5"
;;
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
CPU_OPT="-6"
;;
esac
CFLAGS="$CFLAGS $CPU_OPT"
# multithreaded
CFLAGS="$CFLAGS -tWM"
# stop on warning
CFLAGS="$CFLAGS -w!"
# disable logo
CFLAGS="$CFLAGS -q"
# precompiled headers
CORE_DEPS="$CORE_DEPS $OBJS\\ngx_config.csm"
PCH="$OBJS\\ngx_config.csm"
BUILDPCH="-H=$OBJS\\ngx_config.csm"
USEPCH="-Hu -H=$OBJS\\ngx_config.csm"
LINK="\$(CC)"
INCOPT="-I"
COMPOPT="-c"
OBJOUT="-o"
BINOUT="-e"
OBJEXT="obj"
BINEXT=".exe"
DIRSEP='\\'
;;
2003-11-26 04:44:56 +08:00
esac