nginx/auto/cc

370 lines
8.4 KiB
Plaintext
Raw Normal View History

2003-11-25 14:44:56 -06:00
2004-04-14 12:44:28 -05:00
CFLAGS="$CFLAGS $CC_OPT"
2003-11-25 14:44:56 -06:00
case $CC in
2004-03-25 14:03:02 -06:00
*gcc*)
2004-04-13 10:08:48 -05:00
# gcc 2.7.2.3, 2.8.1, 2.95.4, 3.3.2, 3.3.3, 3.4
2003-11-25 14:44:56 -06:00
# optimization
#CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
2004-03-10 11:55:19 -06:00
2004-03-10 14:56:39 -06:00
case $CPU in
2004-03-12 10:57:08 -06:00
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-march=pentium"
;;
2004-03-10 11:55:19 -06:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
2004-03-10 14:56:39 -06:00
CPU_OPT="-march=pentiumpro"
2004-03-10 11:55:19 -06:00
;;
2004-03-12 10:57:08 -06:00
2004-03-10 11:55:19 -06:00
pentium4)
# optimize for Pentium 4, gcc 3.x
2004-03-10 14:56:39 -06:00
CPU_OPT="-march=pentium4"
2004-03-10 11:55:19 -06:00
;;
esac
2004-04-01 00:21:13 -06:00
# STUB for batch builds
if [ $CC = gcc27 ]; then CPU_OPT=; fi
2004-03-25 14:03:02 -06:00
CFLAGS="$CFLAGS $PIPE $CPU_OPT"
2004-03-10 14:56:39 -06:00
2004-03-11 15:34:52 -06:00
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
PCRE_OPT="$PCRE_OPT $PIPE"
2004-03-10 14:56:39 -06:00
fi
2004-03-11 15:34:52 -06:00
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
MD5_OPT="$MD5_OPT $PIPE"
2004-03-10 14:56:39 -06:00
fi
2004-03-11 15:34:52 -06:00
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
ZLIB_OPT="$ZLIB_OPT $PIPE"
2004-03-10 14:56:39 -06:00
fi
2003-11-25 14:44:56 -06: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 00:27:36 -06:00
# DragonFly's gcc3 generates DWARF
#CFLAGS="$CFLAGS -g -gstabs"
2004-03-29 11:43:58 -06:00
2004-02-18 09:45:21 -06:00
have=HAVE_GCC_VARIADIC_MACROS . auto/have
2003-11-30 14:03:18 -06:00
2004-03-11 15:34:52 -06:00
if [ ".$CPP" = "." ]; then
CPP="$CC -E"
fi
2004-03-09 13:47:07 -06:00
LINK="\$(CC)"
2004-03-29 11:43:58 -06:00
INCOPT="-I "
COMPOPT="-c"
2003-11-25 14:44:56 -06:00
OBJOUT="-o "
BINOUT="-o "
2004-03-29 11:43:58 -06:00
OBJEXT="o"
2003-11-25 14:44:56 -06:00
CC_STRONG="$CC -Wall -Werror"
;;
*icc)
# Intel C++ compiler 7.1
# optimization
CFLAGS="$CFLAGS -O"
2004-03-10 14:56:39 -06:00
# inline functions declared with __inline
2004-03-14 14:46:25 -06:00
#CFLAGS="$CFLAGS -Ob1"
2004-03-10 14:56:39 -06:00
# inline any function, at the compiler's discretion
2004-03-14 14:46:25 -06: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-10 11:55:19 -06:00
2004-03-10 14:56:39 -06:00
case $CPU in
2004-03-12 10:57:08 -06:00
pentium)
# optimize for Pentium and Athlon
CPU_OPT="-march=pentium"
;;
2004-03-10 11:55:19 -06:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
2004-03-10 14:56:39 -06:00
CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
2004-03-10 11:55:19 -06:00
;;
2004-03-12 10:57:08 -06:00
2004-03-10 11:55:19 -06:00
pentium4)
# optimize for Pentium 4, default
2004-03-10 14:56:39 -06:00
CPU_OPT="-march=pentium4"
2004-03-10 11:55:19 -06:00
;;
esac
2004-03-10 14:56:39 -06:00
CFLAGS="$CFLAGS $CPU_OPT"
2004-03-11 15:34:52 -06:00
if [ ".$PCRE_OPT" = "." ]; then
2004-03-14 14:46:25 -06:00
PCRE_OPT="-O $IPO $CPU_OPT"
2004-03-10 14:56:39 -06:00
fi
2004-03-11 15:34:52 -06:00
if [ ".$MD5_OPT" = "." ]; then
2004-03-14 14:46:25 -06:00
MD5_OPT="-O $IPO $CPU_OPT"
2004-03-10 14:56:39 -06:00
fi
2004-03-11 15:34:52 -06:00
if [ ".$ZLIB_OPT" = "." ]; then
2004-03-14 14:46:25 -06:00
ZLIB_OPT="-O $IPO $CPU_OPT"
2004-03-10 14:56:39 -06:00
fi
2003-11-25 14:44:56 -06:00
# warnings
CFLAGS="$CFLAGS -w1"
2004-03-16 01:10:12 -06:00
#CFLAGS="$CFLAGS -w2"
2003-11-25 14:44:56 -06:00
# stop on warning
CFLAGS="$CFLAGS -Werror"
2004-03-14 14:46:25 -06:00
# debug
CFLAGS="$CFLAGS -g"
2004-02-18 09:45:21 -06:00
have=HAVE_C99_VARIADIC_MACROS . auto/have
2003-11-30 14:03:18 -06:00
2004-03-09 13:47:07 -06:00
LINK="\$(CC)"
2004-03-29 11:43:58 -06:00
INCOPT="-I "
COMPOPT="-c"
2003-11-25 14:44:56 -06:00
OBJOUT="-o "
BINOUT="-o "
2004-03-29 11:43:58 -06:00
OBJEXT="o"
2003-11-25 14:44:56 -06: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-10 11:55:19 -06:00
2004-03-10 14:56:39 -06:00
case $CPU in
2004-03-29 11:43:58 -06:00
pentium)
2004-03-12 10:57:08 -06:00
# optimize for Pentium and Athlon
CPU_OPT="-G5"
;;
2004-03-10 11:55:19 -06:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
2004-03-10 14:56:39 -06:00
CPU_OPT="-G6"
2004-03-10 11:55:19 -06:00
;;
2004-03-12 10:57:08 -06:00
2004-03-10 11:55:19 -06:00
pentium4)
# optimize for Pentium 4
2004-03-10 14:56:39 -06:00
#CPU_OPT="-G7"
2004-03-10 11:55:19 -06:00
;;
esac
2004-03-10 14:56:39 -06:00
CFLAGS="$CFLAGS $CPU_OPT"
2003-11-25 14:44:56 -06:00
# warnings
2004-03-16 01:10:12 -06:00
#CFLAGS="$CFLAGS -W3"
CFLAGS="$CFLAGS -W4"
2003-11-25 14:44:56 -06:00
# stop on warning
CFLAGS="$CFLAGS -WX"
2004-03-11 15:34:52 -06:00
# link with libcmt.lib, multithreaded
#LIBC="-MT"
# link with msvcrt.dll
LIBC="-MD"
CFLAGS="$CFLAGS $LIBC"
2003-11-25 14:44:56 -06:00
# disable logo
CFLAGS="$CFLAGS -nologo"
2004-03-09 13:47:07 -06:00
LINK="\$(CC)"
2003-11-25 14:44:56 -06:00
# link flags
2004-03-11 15:34:52 -06:00
CORE_LINK="$CORE_LINK -link -verbose:lib"
2003-11-25 14:44:56 -06:00
# debug
CFLAGS="$CFLAGS -Yd"
CORE_LINK="$CORE_LINK -debug -debugtype:coff"
2004-03-09 13:47:07 -06:00
# precompiled headers
CORE_DEPS="$CORE_DEPS ngx_config.pch"
PCH="ngx_config.pch"
BUILDPCH="-Ycngx_config.h"
USEPCH="-Yungx_config.h"
2004-03-29 11:43:58 -06:00
INCOPT="-I "
COMPOPT="-c"
2003-11-25 14:44:56 -06:00
OBJOUT="-Fo"
BINOUT="-Fe"
2004-03-29 11:43:58 -06:00
OBJEXT="obj"
BINEXT=".exe"
#DIRSEP='\\'
2003-11-25 14:44:56 -06:00
;;
2004-03-04 10:34:23 -06:00
2004-03-09 13:47:07 -06:00
wcl386)
2004-03-04 10:34:23 -06:00
# Open Watcom 1.0
2004-03-05 02:34:24 -06: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-10 11:55:19 -06:00
2004-03-10 14:56:39 -06:00
case $CPU in
2004-03-12 10:57:08 -06: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-10 11:55:19 -06:00
pentiumpro)
# optimize for Pentium Pro, Pentium II and Pentium III
# register-based arguments passing conventions
2004-03-10 14:56:39 -06:00
CPU_OPT="-6r"
2004-03-10 11:55:19 -06:00
# stack-based arguments passing conventions
2004-03-10 14:56:39 -06:00
#CPU_OPT="-6s"
2004-03-10 11:55:19 -06:00
;;
esac
2004-03-10 14:56:39 -06:00
CFLAGS="$CFLAGS $CPU_OPT"
2004-03-05 02:34:24 -06:00
# warnings
#CFLAGS="$CFLAGS -w3"
CFLAGS="$CFLAGS -wx"
# stop on warning
2004-03-09 13:47:07 -06:00
CFLAGS="$CFLAGS -we"
2004-03-05 02:34:24 -06:00
# built target is NT
CFLAGS="$CFLAGS -bt=nt"
# multithreaded
CFLAGS="$CFLAGS -bm"
# debug
CFLAGS="$CFLAGS -d2"
# quiet
CFLAGS="$CFLAGS -zq"
2004-03-09 13:47:07 -06: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 02:34:24 -06:00
CORE_LINK="$CORE_LINK -l=nt"
2004-03-29 11:43:58 -06:00
INCOPT="-i="
COMPOPT="-c"
2004-03-05 02:34:24 -06:00
OBJOUT="-fo"
2004-03-09 13:47:07 -06:00
BINOUT="-fe="
2004-03-29 11:43:58 -06:00
OBJEXT="obj"
BINEXT=".exe"
DIRSEP='\\'
2004-03-09 13:47:07 -06:00
2004-03-05 02:34:24 -06:00
MAKE_SL=YES
2004-03-04 10:34:23 -06:00
;;
2004-03-29 11:43:58 -06: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-25 14:44:56 -06:00
esac