summaryrefslogtreecommitdiffhomepage
path: root/auto/cc/test
diff options
context:
space:
mode:
Diffstat (limited to 'auto/cc/test')
-rw-r--r--auto/cc/test93
1 files changed, 16 insertions, 77 deletions
diff --git a/auto/cc/test b/auto/cc/test
index 9c9602db..34e4379e 100644
--- a/auto/cc/test
+++ b/auto/cc/test
@@ -46,45 +46,9 @@ then
$echo " + $NXT_CC_VERSION"
else
-if `/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" >> $NXT_AUTOCONF_ERR 2>&1`
-then
- NXT_CC_NAME=SunC
- $echo " + using Sun C compiler"
- NXT_CC_VERSION=`/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" 2>&1`
- $echo " + $NXT_CC_VERSION"
-
-else
-if `/bin/sh -c "($CC -qversion)" 2>&1 \
- | grep "^IBM XL" >> $NXT_AUTOCONF_ERR 2>&1`
-then
- NXT_CC_NAME=xlC
- $echo " + using AIX xlC compiler"
- NXT_CC_VERSION=`/bin/sh -c "($CC -qversion)" 2>&1 | grep "IBM XL" 2>&1`
- $echo " + $NXT_CC_VERSION"
-
-else
-if `/bin/sh -c "($CC -V)" 2>&1 | grep "Intel(R) C" >> $NXT_AUTOCONF_ERR 2>&1`
-then
- NXT_CC_NAME=ICC
- $echo " + using Intel C++ compiler"
- NXT_CC_VERSION=ICC
-
-else
-if `/bin/sh -c "($CC -v)" 2>&1 \
- | grep "Microsoft (R) 32-bit C/C" >> $NXT_AUTOCONF_ERR 2>&1`
-then
- NXT_CC_NAME=MSVC
- $echo " + using MS Visual C++ compiler"
- NXT_CC_VERSION=MSVC
-
-else
NXT_CC_NAME=cc
NXT_CC_VERSION=cc
-fi # MSVC
-fi # ICC
-fi # xlC
-fi # SunC
fi # Apple LLVM clang
fi # clang
fi # gcc
@@ -101,12 +65,12 @@ case $NXT_CC_NAME in
# Do not export symbols except explicitly marked with NXT_EXPORT.
NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
- # c99/gnu99 conflict with Solaris XOPEN.
- #NXT_CFLAGS="$NXT_CFLAGS -std=gnu99"
+ NXT_CFLAGS="$NXT_CFLAGS -fno-strict-overflow"
+
+ NXT_CFLAGS="$NXT_CFLAGS -std=gnu11"
NXT_CFLAGS="$NXT_CFLAGS -O"
- #NXT_CFLAGS="$NXT_CFLAGS -O0"
- NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
+ NXT_CFLAGS="$NXT_CFLAGS -Wall -Wextra"
#NXT_CFLAGS="$NXT_CFLAGS -Wunused-result"
NXT_CFLAGS="$NXT_CFLAGS -Wno-unused-parameter"
@@ -115,12 +79,14 @@ case $NXT_CC_NAME in
# -O2 enables -fstrict-aliasing and -fstrict-overflow.
#NXT_CFLAGS="$NXT_CFLAGS -O2"
- #NXT_CFLAGS="$NXT_CFLAGS -Wno-strict-aliasing"
+ NXT_CFLAGS="$NXT_CFLAGS -fno-strict-aliasing"
#NXT_CFLAGS="$NXT_CFLAGS -fomit-frame-pointer"
#NXT_CFLAGS="$NXT_CFLAGS -momit-leaf-frame-pointer"
- # -Wstrict-overflow is supported by GCC 4.2+.
+ # While -Wstrict-overflow is supported by GCC 4.2+,
+ # at level 3 and above it is prone to give false
+ # positives.
#NXT_CFLAGS="$NXT_CFLAGS -Wstrict-overflow=5"
NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
@@ -141,17 +107,22 @@ case $NXT_CC_NAME in
# Do not export symbols except explicitly marked with NXT_EXPORT.
NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
+ NXT_CFLAGS="$NXT_CFLAGS -fno-strict-overflow"
+
+ NXT_CFLAGS="$NXT_CFLAGS -std=gnu11"
+
NXT_CFLAGS="$NXT_CFLAGS -O"
- #NXT_CFLAGS="$NXT_CFLAGS -O0"
- NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
+ NXT_CFLAGS="$NXT_CFLAGS -Wall -Wextra"
#NXT_CFLAGS="$NXT_CFLAGS -Wunused-result"
NXT_CFLAGS="$NXT_CFLAGS -Wno-unused-parameter"
#NXT_CFLAGS="$NXT_CFLAGS -Wshorten-64-to-32"
NXT_CFLAGS="$NXT_CFLAGS -Wwrite-strings"
#NXT_CFLAGS="$NXT_CFLAGS -O2"
+ # strict-aliasing is always enabled by default in clang
+ NXT_CFLAGS="$NXT_CFLAGS -fno-strict-aliasing"
+
#NXT_CFLAGS="$NXT_CFLAGS -fomit-frame-pointer"
- NXT_CFLAGS="$NXT_CFLAGS -fstrict-aliasing"
NXT_CFLAGS="$NXT_CFLAGS -Wstrict-overflow=5"
NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
@@ -168,38 +139,6 @@ case $NXT_CC_NAME in
fi
;;
- SunC)
- nxt_have=NXT_SUNC . auto/have
-
- NXT_CFLAGS="$NXT_CFLAGS -fPIC"
- # Optimization.
- NXT_CFLAGS="$NXT_CFLAGS -O -fast"
- # Stop on warning.
- NXT_CFLAGS="$NXT_CFLAGS -errwarn=%all"
- # Debug.
- NXT_CFLAGS="$NXT_CFLAGS -g"
- ;;
-
- xlC)
- nxt_have=NXT_XLC . auto/have
-
- #NXT_CFLAGS="$NXT_CFLAGS -qalloca"
- # alloca support.
- NXT_CFLAGS="$NXT_CFLAGS -qlanglvl=extc99"
- # __thread support.
- NXT_CFLAGS="$NXT_CFLAGS -qtls"
- # Suppress warning
- # 1506-159 (E) Bit field type specified for XXX is not valid.
- # Type unsigned assumed.
- NXT_CFLAGS="$NXT_CFLAGS -qsuppress=1506-159"
- ;;
-
- ICC)
- ;;
-
- MSVC)
- ;;
-
*)
;;