From 2245ac2f884513bb3145f841fb3a9aed80b6ff34 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 2 Oct 2008 03:56:55 +0000 Subject: Initial attempt to support configure's --(dis|en)able-warnings option to specify dis(activation) of picky compiler warnings. If option is specified, it will be honored independant of the --(dis|en)able-debug option. If option is not specified, it will follow --(dis|en)able-debug setting, whose default is disabled if not specified. --- m4/curl-compilers.m4 | 316 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 m4/curl-compilers.m4 (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 new file mode 100644 index 000000000..a132ec28b --- /dev/null +++ b/m4/curl-compilers.m4 @@ -0,0 +1,316 @@ +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at http://curl.haxx.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# $Id$ +#*************************************************************************** + +# File version for 'aclocal' use. Keep it a single number. +# serial 1 + + +dnl CURL_CHECK_COMPILER +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is known. + +AC_DEFUN([CURL_CHECK_COMPILER], [ + # + compiler_id="unknown" + compiler_num="0" + # + CURL_CHECK_COMPILER_DEC + CURL_CHECK_COMPILER_IBM + CURL_CHECK_COMPILER_INTEL + CURL_CHECK_COMPILER_GNU + # +]) + + +dnl CURL_CHECK_COMPILER_DEC +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is DEC's. + +AC_DEFUN([CURL_CHECK_COMPILER_DEC], [ + AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler]) + CURL_CHECK_DEF([__DECC], [], [silent]) + CURL_CHECK_DEF([__DECC_VER], [], [silent]) + if test "$curl_cv_have_def___DECC" = "yes" && + test "$curl_cv_have_def___DECC_VER" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="DECC" + else + AC_MSG_RESULT([no]) + fi +]) + + +dnl CURL_CHECK_COMPILER_GNU +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is GNU's. + +AC_DEFUN([CURL_CHECK_COMPILER_GNU], [ + AC_REQUIRE([CURL_CHECK_COMPILER_INTEL])dnl + # + AC_MSG_CHECKING([whether we are using the GNU C compiler]) + CURL_CHECK_DEF([__GNUC__], [], [silent]) + if test "$curl_cv_have_def___GNUC__" = "yes" && + test "$compiler_id" = "unknown"; then + AC_MSG_RESULT([yes]) + compiler_id="GNUC" + gccver=`$CC -dumpversion` + gccvhi=`echo $gccver | cut -d . -f1` + gccvlo=`echo $gccver | cut -d . -f2` + compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` + else + AC_MSG_RESULT([no]) + fi +]) + + +dnl CURL_CHECK_COMPILER_IBM +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is IBM's. + +AC_DEFUN([CURL_CHECK_COMPILER_IBM], [ + AC_MSG_CHECKING([whether we are using the IBM C compiler]) + CURL_CHECK_DEF([__IBMC__], [], [silent]) + if test "$curl_cv_have_def___IBMC__" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="IBMC" + else + AC_MSG_RESULT([no]) + fi +]) + + +dnl CURL_CHECK_COMPILER_INTEL +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is Intel's. + +AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ + AC_BEFORE([$0],[CURL_CHECK_COMPILER_GNU])dnl + AC_MSG_CHECKING([whether we are using the Intel C compiler]) + CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent]) + if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then + AC_MSG_RESULT([yes]) + CURL_CHECK_DEF([__unix__], [], [silent]) + if test "$curl_cv_have_def___unix__" = "yes"; then + compiler_id="ICC_unix" + else + compiler_id="ICC_windows" + fi + compiler_num="$curl_cv_def___INTEL_COMPILER" + else + AC_MSG_RESULT([no]) + fi +]) + + +dnl CURL_PROCESS_CC_BASIC_OPTS +dnl ------------------------------------------------- +dnl Sets compiler options/flags which are independant +dnl of configure's debug or warnings options. + +AC_DEFUN([CURL_PROCESS_CC_BASIC_OPTS], [ + AC_REQUIRE([CURL_CHECK_COMPILER])dnl + # + if test "$compiler_id" = "DECC"; then + dnl Select strict ANSI C compiler mode + CFLAGS="$CFLAGS -std1" + dnl Turn off optimizer ANSI C aliasing rules + CFLAGS="$CFLAGS -noansi_alias" + dnl Generate warnings for missing function prototypes + CFLAGS="$CFLAGS -warnprotos" + dnl Change some warnings into fatal errors + CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs" + fi + # + if test "$compiler_id" = "IBMC"; then + dnl Ensure that compiler optimizations are always thread-safe. + CFLAGS="$CFLAGS -qthreaded" + dnl Disable type based strict aliasing optimizations, using worst + dnl case aliasing assumptions when compiling. Type based aliasing + dnl would restrict the lvalues that could be safely used to access + dnl a data object. + CFLAGS="$CFLAGS -qnoansialias" + dnl Force compiler to stop after the compilation phase, without + dnl generating an object code file when compilation has errors. + CFLAGS="$CFLAGS -qhalt=e" + fi + # + if test "$compiler_id" = "ICC_unix"; then + dnl On unix this compiler uses gcc's header files, so + dnl we select ANSI C89 dialect plus GNU extensions. + CPPFLAGS="$CPPFLAGS -std=gnu89" + dnl Change some warnings into errors + dnl #140: too many arguments in function call + dnl #147: declaration is incompatible with 'previous one' + dnl #165: too few arguments in function call + dnl #266: function declared implicitly + CPPFLAGS="$CPPFLAGS -we 140,147,165,266" + dnl Disable some remarks + dnl #279: controlling expression is constant + dnl #981: operands are evaluated in unspecified order + dnl #1469: "cc" clobber ignored + if test "$compiler_num" -lt "910"; then + CPPFLAGS="$CPPFLAGS -wd 279" + fi + CPPFLAGS="$CPPFLAGS -wd 981,1469" + dnl Disable use of ANSI C aliasing rules in optimizations + CFLAGS="$CFLAGS -no-ansi-alias" + dnl Disable floating point optimizations + CFLAGS="$CFLAGS -fp-model precise" + fi +]) + + +dnl CURL_PROCESS_CC_DEBUG_OPTS +dnl ------------------------------------------------- +dnl Sets compiler options/flags which depend on +dnl configure's debug given option. + +AC_DEFUN([CURL_PROCESS_CC_DEBUG_OPTS], [ + AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl + AC_REQUIRE([CURL_CHECK_COMPILER])dnl + # + if test "$want_debug" = "yes"; then + CFLAGS="$CFLAGS -g" + fi + # + if test "$want_debug" = "no"; then + dnl strip off optimizer flags + NEWFLAGS="" + for flag in $CFLAGS; do + case "$flag" in + -O*) + dnl echo "cut off $flag" + ;; + *) + NEWFLAGS="$NEWFLAGS $flag" + ;; + esac + done + CFLAGS=$NEWFLAGS + fi + # +]) + + +dnl CURL_PROCESS_CC_WARNING_OPTS +dnl ------------------------------------------------- +dnl Sets compiler options/flags which depend on +dnl configure's warnings given option. + +AC_DEFUN([CURL_PROCESS_CC_WARNING_OPTS], [ + AC_REQUIRE([CURL_CHECK_OPTION_WARNINGS])dnl + AC_REQUIRE([CURL_CHECK_COMPILER])dnl + # + if test "$compiler_id" = "DECC"; then + if test "$want_warnings" = "yes"; then + dnl Select a higher warning level than default level2 + CFLAGS="$CFLAGS -msg_enable level3" + fi + fi + # + if test "$compiler_id" = "ICC_unix"; then + if test "$want_warnings" = "yes"; then + if test "$compiler_num" -gt "600"; then + dnl Show errors, warnings, and remarks + CPPFLAGS="$CPPFLAGS -Wall" + dnl Perform extra compile-time code checking + CPPFLAGS="$CPPFLAGS -Wcheck" + fi + fi + fi + # + if test "$compiler_id" = "GNUC"; then + # + # FIXME: Some of these warnings should be changed into errors + # and moved to CURL-PROCESS-CC-BASIC-OPTS + # + if test "$want_warnings" = "yes"; then + dnl this is a set of options we believe *ALL* gcc versions support: + WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes" + dnl -Wcast-align is a bit too annoying on all gcc versions ;-) + if test "$compiler_num" -ge "207"; then + dnl gcc 2.7 or later + WARN="$WARN -Wmissing-declarations" + fi + if test "$compiler_num" -gt "295"; then + dnl only if the compiler is newer than 2.95 since we got lots of + dnl "`_POSIX_C_SOURCE' is not defined" in system headers with + dnl gcc 2.95.4 on FreeBSD 4.9! + WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar" + fi + if test "$compiler_num" -ge "296"; then + dnl gcc 2.96 or later + WARN="$WARN -Wfloat-equal" + fi + if test "$compiler_num" -gt "296"; then + dnl this option does not exist in 2.96 + WARN="$WARN -Wno-format-nonliteral" + fi + dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on + dnl on i686-Linux as it gives us heaps with false positives. + dnl Also, on gcc 4.0.X it is totally unbearable and complains all + dnl over making it unusable for generic purposes. Let's not use it. + if test "$compiler_num" -ge "303"; then + dnl gcc 3.3 and later + WARN="$WARN -Wendif-labels -Wstrict-prototypes" + fi + if test "$compiler_num" -ge "304"; then + # try these on gcc 3.4 + WARN="$WARN -Wdeclaration-after-statement" + fi + for flag in $CPPFLAGS; do + case "$flag" in + -I*) + dnl Include path, provide a -isystem option for the same dir + dnl to prevent warnings in those dirs. The -isystem was not very + dnl reliable on earlier gcc versions. + add=`echo $flag | sed 's/^-I/-isystem /g'` + WARN="$WARN $add" + ;; + esac + done + CFLAGS="$CFLAGS $WARN" + AC_MSG_NOTICE([Added this set of compiler options: $WARN]) + fi + fi + # +]) + + +dnl CURL_PROCESS_DEBUG_BUILD_OPTS +dnl ------------------------------------------------- +dnl Settings which depend on configure's debug given +dnl option, and further configure the build process. + +AC_DEFUN([CURL_PROCESS_DEBUG_BUILD_OPTS], [ + AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl + AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl + # + if test "$want_debug" = "yes"; then + CPPFLAGS="$CPPFLAGS -DCURLDEBUG" + fi + # +]) + + + -- cgit v1.2.1 From d930280af5df9de318229b8fa7d4f1f7d27b748d Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 7 Oct 2008 13:13:34 +0000 Subject: Initial attempt to support configure's --(dis|en)able-optimize option to specify dis(activation) of compiler optimizations. If option is specified, it will be honored independant of the --(dis|en)able-debug option. --- m4/curl-compilers.m4 | 295 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 266 insertions(+), 29 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index a132ec28b..1cff5be01 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 1 +# serial 2 dnl CURL_CHECK_COMPILER @@ -34,11 +34,33 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ compiler_id="unknown" compiler_num="0" # + flags_dbg_all="unknown" + flags_dbg_yes="unknown" + flags_dbg_off="unknown" + flags_opt_all="unknown" + flags_opt_yes="unknown" + flags_opt_off="unknown" + # CURL_CHECK_COMPILER_DEC CURL_CHECK_COMPILER_IBM CURL_CHECK_COMPILER_INTEL CURL_CHECK_COMPILER_GNU # + if test "$compiler_id" = "unknown"; then + cat <<_EOF 1>&2 +*** +*** Warning: This configure script does not have information about the +*** compiler you are using, relative to the flags required to enable or +*** disable generation of debug info, optimization options or warnings. +*** +*** Whatever settings are present in CFLAGS will be used for this run. +*** +*** If you wish to help the cURL project to better support your compiler +*** you can report this and the required info on the libcurl development +*** mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/ +*** +_EOF + fi ]) @@ -54,6 +76,12 @@ AC_DEFUN([CURL_CHECK_COMPILER_DEC], [ test "$curl_cv_have_def___DECC_VER" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="DECC" + flags_dbg_all="-g -g0 -g1 -g2 -g3" + flags_dbg_yes="-g2" + flags_dbg_off="-g0" + flags_opt_all="-O -O0 -O1 -O2 -O3 -O4" + flags_opt_yes="-O1" + flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi @@ -77,6 +105,19 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU], [ gccvhi=`echo $gccver | cut -d . -f1` gccvlo=`echo $gccver | cut -d . -f2` compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null` + flags_dbg_all="-g -g0 -g1 -g2 -g3" + flags_dbg_all="$flags_dbg_all -ggdb" + flags_dbg_all="$flags_dbg_all -gstabs" + flags_dbg_all="$flags_dbg_all -gstabs+" + flags_dbg_all="$flags_dbg_all -gcoff" + flags_dbg_all="$flags_dbg_all -gxcoff" + flags_dbg_all="$flags_dbg_all -gdwarf-2" + flags_dbg_all="$flags_dbg_all -gvms" + flags_dbg_yes="-g" + flags_dbg_off="-g0" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" + flags_opt_yes="-O2" + flags_opt_off="-O0" else AC_MSG_RESULT([no]) fi @@ -93,6 +134,19 @@ AC_DEFUN([CURL_CHECK_COMPILER_IBM], [ if test "$curl_cv_have_def___IBMC__" = "yes"; then AC_MSG_RESULT([yes]) compiler_id="IBMC" + flags_dbg_all="-g -g0 -g1 -g2 -g3" + flags_dbg_yes="-g" + flags_dbg_off="" + flags_opt_all="-O -O0 -O1 -O2 -O3 -O4 -O5" + flags_opt_all="$flags_opt_all -qnooptimize" + flags_opt_all="$flags_opt_all -qoptimize=0" + flags_opt_all="$flags_opt_all -qoptimize=1" + flags_opt_all="$flags_opt_all -qoptimize=2" + flags_opt_all="$flags_opt_all -qoptimize=3" + flags_opt_all="$flags_opt_all -qoptimize=4" + flags_opt_all="$flags_opt_all -qoptimize=5" + flags_opt_yes="-O2" + flags_opt_off="-qnooptimize" else AC_MSG_RESULT([no]) fi @@ -112,8 +166,27 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then compiler_id="ICC_unix" + flags_dbg_all="-g -g0" + flags_dbg_yes="-g -fp" + flags_dbg_off="-g0" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" + flags_opt_yes="-O2" + flags_opt_off="-O0" else compiler_id="ICC_windows" + flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7" + flags_dbg_all="$flags_dbg_all /debug" + flags_dbg_all="$flags_dbg_all /debug:none" + flags_dbg_all="$flags_dbg_all /debug:minimal" + flags_dbg_all="$flags_dbg_all /debug:partial" + flags_dbg_all="$flags_dbg_all /debug:full" + flags_dbg_all="$flags_dbg_all /debug:semantic_stepping" + flags_dbg_all="$flags_dbg_all /debug:extended" + flags_dbg_yes="/Zi /Oy-" + flags_dbg_off="" + flags_opt_all="/O /O0 /O1 /O2 /O3 /Os" + flags_opt_yes="/O2" + flags_opt_off="" fi compiler_num="$curl_cv_def___INTEL_COMPILER" else @@ -122,12 +195,13 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ ]) -dnl CURL_PROCESS_CC_BASIC_OPTS +dnl CURL_SET_COMPILER_BASIC_OPTS dnl ------------------------------------------------- -dnl Sets compiler options/flags which are independant -dnl of configure's debug or warnings options. +dnl Sets compiler specific options/flags which do not +dnl depend on configure's debug, optimize or warnings +dnl options. -AC_DEFUN([CURL_PROCESS_CC_BASIC_OPTS], [ +AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ AC_REQUIRE([CURL_CHECK_COMPILER])dnl # if test "$compiler_id" = "DECC"; then @@ -180,44 +254,134 @@ AC_DEFUN([CURL_PROCESS_CC_BASIC_OPTS], [ ]) -dnl CURL_PROCESS_CC_DEBUG_OPTS +dnl CURL_SET_COMPILER_DEBUG_OPTS dnl ------------------------------------------------- -dnl Sets compiler options/flags which depend on -dnl configure's debug given option. +dnl Sets compiler specific options/flags which depend +dnl on configure's debug option. -AC_DEFUN([CURL_PROCESS_CC_DEBUG_OPTS], [ +AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl # - if test "$want_debug" = "yes"; then - CFLAGS="$CFLAGS -g" + if test "$compiler_id" != "unknown"; then + # + ac_save_CFLAGS="$CFLAGS" + ac_save_CPPFLAGS="$CPPFLAGS" + # + honor_debug_option="yes" + CURL_VAR_STRIP([CFLAGS],[${flags_dbg_all}]) + CURL_VAR_STRIP([CPPFLAGS],[${flags_dbg_all}]) + if test "$want_debug" = "yes"; then + CFLAGS="$CFLAGS $flags_dbg_yes" + AC_MSG_CHECKING([if compiler accepts debug enabling flags $flags_dbg_yes]) + fi + if test "$want_debug" = "no"; then + CFLAGS="$CFLAGS $flags_dbg_off" + AC_MSG_CHECKING([if compiler accepts debug disabling flags $flags_dbg_off]) + fi + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + int i = 1; + return i; + ]]) + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + honor_debug_option="no" + ]) + # + if test "$honor_debug_option" = "no"; then + CFLAGS="$ac_save_CFLAGS" + CPPFLAGS="$ac_save_CPPFLAGS" + fi + # fi +]) + + +dnl CURL_SET_COMPILER_OPTIMIZE_OPTS +dnl ------------------------------------------------- +dnl Sets compiler specific options/flags which depend +dnl on configure's optimize option. + +AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ + AC_REQUIRE([CURL_CHECK_OPTION_OPTIMIZE])dnl + AC_REQUIRE([CURL_CHECK_COMPILER])dnl # - if test "$want_debug" = "no"; then - dnl strip off optimizer flags - NEWFLAGS="" - for flag in $CFLAGS; do - case "$flag" in - -O*) - dnl echo "cut off $flag" - ;; - *) - NEWFLAGS="$NEWFLAGS $flag" - ;; - esac - done - CFLAGS=$NEWFLAGS + if test "$compiler_id" != "unknown"; then + # + ac_save_CFLAGS="$CFLAGS" + ac_save_CPPFLAGS="$CPPFLAGS" + # + dnl If optimization request setting has not been explicitly specified, + dnl it has been derived from the debug setting and initially assumed. + dnl This initially assumed optimizer setting will finally be ignored + dnl if CFLAGS or CPPFLAGS already hold optimizer flags. This implies + dnl that an initially assumed optimizer setting might not be honored. + # + honor_optimize_option="yes" + if test "$want_optimize" = "assume_no" || + test "$want_optimize" = "assume_yes"; then + AC_MSG_CHECKING([if compiler optimizer assumed setting might be used]) + CURL_VAR_MATCH_IFELSE([CFLAGS],[${flags_opt_all}],[ + honor_optimize_option="no" + ]) + CURL_VAR_MATCH_IFELSE([CPPFLAGS],[${flags_opt_all}],[ + honor_optimize_option="no" + ]) + AC_MSG_RESULT([$honor_optimize_option]) + if test "$honor_optimize_option" = "yes"; then + if test "$want_optimize" = "assume_yes"; then + want_optimize="yes" + fi + if test "$want_optimize" = "assume_no"; then + want_optimize="no" + fi + fi + fi + # + if test "$honor_optimize_option" = "yes"; then + CURL_VAR_STRIP([CFLAGS],[${flags_opt_all}]) + CURL_VAR_STRIP([CPPFLAGS],[${flags_opt_all}]) + if test "$want_optimize" = "yes"; then + CFLAGS="$CFLAGS $flags_opt_yes" + AC_MSG_CHECKING([if compiler accepts optimizer enabling flags $flags_opt_yes]) + fi + if test "$want_optimize" = "no"; then + CFLAGS="$CFLAGS $flags_opt_off" + AC_MSG_CHECKING([if compiler accepts optimizer disabling flags $flags_opt_off]) + fi + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + int i = 1; + return i; + ]]) + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + honor_optimize_option="no" + ]) + fi + # + if test "$honor_optimize_option" = "no"; then + CFLAGS="$ac_save_CFLAGS" + CPPFLAGS="$ac_save_CPPFLAGS" + fi + # fi - # ]) -dnl CURL_PROCESS_CC_WARNING_OPTS +dnl CURL_SET_COMPILER_WARNING_OPTS dnl ------------------------------------------------- dnl Sets compiler options/flags which depend on dnl configure's warnings given option. -AC_DEFUN([CURL_PROCESS_CC_WARNING_OPTS], [ +AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_WARNINGS])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl # @@ -242,7 +406,7 @@ AC_DEFUN([CURL_PROCESS_CC_WARNING_OPTS], [ if test "$compiler_id" = "GNUC"; then # # FIXME: Some of these warnings should be changed into errors - # and moved to CURL-PROCESS-CC-BASIC-OPTS + # and moved to CURL-SET-COMPILER-BASIC-OPTS # if test "$want_warnings" = "yes"; then dnl this is a set of options we believe *ALL* gcc versions support: @@ -301,6 +465,7 @@ dnl CURL_PROCESS_DEBUG_BUILD_OPTS dnl ------------------------------------------------- dnl Settings which depend on configure's debug given dnl option, and further configure the build process. +dnl Don't use this macro for compiler dependant stuff. AC_DEFUN([CURL_PROCESS_DEBUG_BUILD_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl @@ -313,4 +478,76 @@ AC_DEFUN([CURL_PROCESS_DEBUG_BUILD_OPTS], [ ]) +dnl CURL_CHECK_PROG_CC +dnl ------------------------------------------------- +dnl Check for compiler program, preventing CFLAGS and +dnl CPPFLAGS from being unexpectedly changed. + +AC_DEFUN([CURL_CHECK_PROG_CC], [ + ac_save_CFLAGS="$CFLAGS" + ac_save_CPPFLAGS="$CPPFLAGS" + AC_PROG_CC + CFLAGS="$ac_save_CFLAGS" + CPPFLAGS="$ac_save_CPPFLAGS" +]) + + +dnl CURL_VAR_MATCH (VARNAME, VALUE) +dnl ------------------------------------------------- +dnl Verifies if shell variable VARNAME contains VALUE. +dnl Contents of variable VARNAME and VALUE are handled +dnl as whitespace separated lists of words. If at least +dnl one word of VALUE is present in VARNAME the match +dnl is considered positive, otherwise false. + +AC_DEFUN([CURL_VAR_MATCH], [ + ac_var_match_word="no" + for word1 in "${[$1]}"; do + for word2 in "[$2]"; do + if test "$word1" = "$word2"; then + ac_var_match_word="yes" + fi + done + done +]) + +dnl CURL_VAR_MATCH_IFELSE (VARNAME, VALUE, +dnl [ACTION-IF-MATCH], [ACTION-IF-NOT-MATCH]) +dnl ------------------------------------------------- +dnl This performs a CURL_VAR_MATCH check and executes +dnl first branch if the match is positive, otherwise +dnl the second branch is executed. + +AC_DEFUN([CURL_VAR_MATCH_IFELSE], [ + CURL_VAR_MATCH([$1],[$2]) + if test "$ac_var_match_word" = "yes"; then + ifelse($3,,:,[$3]) + ifelse($4,,,[else + [$4]]) + fi +]) + + +dnl CURL_VAR_STRIP (VARNAME, VALUE) +dnl ------------------------------------------------- +dnl Contents of variable VARNAME and VALUE are handled +dnl as whitespace separated lists of words. Each word +dnl from VALUE is removed from VARNAME when present. + +AC_DEFUN([CURL_VAR_STRIP], [ + ac_var_stripped="" + for word1 in "${[$1]}"; do + ac_var_strip_word="no" + for word2 in "[$2]"; do + if test "$word1" = "$word2"; then + ac_var_strip_word="yes" + fi + done + if test "$ac_var_strip_word" = "no"; then + ac_var_stripped="$ac_var_stripped $word1" + fi + done + dnl squeeze whitespace out of result + [$1]=`eval echo $[$1]` +]) -- cgit v1.2.1 From a6d93108884dc8140511bc0f2f001574fec1dbfc Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 7 Oct 2008 16:53:46 +0000 Subject: fix VAR_STRIP --- m4/curl-compilers.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 1cff5be01..90890700f 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -549,5 +549,5 @@ AC_DEFUN([CURL_VAR_STRIP], [ fi done dnl squeeze whitespace out of result - [$1]=`eval echo $[$1]` + [$1]=`eval echo $ac_var_stripped` ]) -- cgit v1.2.1 From aefab9293ae10946fc48fbb2df5c75b116cf0ccc Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 7 Oct 2008 17:37:25 +0000 Subject: adjust ICC_windows settings --- m4/curl-compilers.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 90890700f..ca2891400 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -167,14 +167,14 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ if test "$curl_cv_have_def___unix__" = "yes"; then compiler_id="ICC_unix" flags_dbg_all="-g -g0" - flags_dbg_yes="-g -fp" + flags_dbg_yes="-g" flags_dbg_off="-g0" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" else compiler_id="ICC_windows" - flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7" + flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" flags_dbg_all="$flags_dbg_all /debug" flags_dbg_all="$flags_dbg_all /debug:none" flags_dbg_all="$flags_dbg_all /debug:minimal" @@ -183,10 +183,10 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ flags_dbg_all="$flags_dbg_all /debug:semantic_stepping" flags_dbg_all="$flags_dbg_all /debug:extended" flags_dbg_yes="/Zi /Oy-" - flags_dbg_off="" - flags_opt_all="/O /O0 /O1 /O2 /O3 /Os" + flags_dbg_off="/debug:none /Oy-" + flags_opt_all="/O /O0 /O1 /O2 /O3 /Od /Og /Og- /Oi /Oi-" flags_opt_yes="/O2" - flags_opt_off="" + flags_opt_off="/Od" fi compiler_num="$curl_cv_def___INTEL_COMPILER" else -- cgit v1.2.1 From 1b246eecfe77425622d5e249f71b4b2a73fa97a8 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 8 Oct 2008 02:29:13 +0000 Subject: Initial attempt to detect HP C compiler --- m4/curl-compilers.m4 | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index ca2891400..ea10ceedb 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 2 +# serial 5 dnl CURL_CHECK_COMPILER @@ -42,6 +42,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ flags_opt_off="unknown" # CURL_CHECK_COMPILER_DEC + CURL_CHECK_COMPILER_HP CURL_CHECK_COMPILER_IBM CURL_CHECK_COMPILER_INTEL CURL_CHECK_COMPILER_GNU @@ -124,6 +125,28 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU], [ ]) +dnl CURL_CHECK_COMPILER_HP +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is HP's. + +AC_DEFUN([CURL_CHECK_COMPILER_HP], [ + AC_MSG_CHECKING([whether we are using the HP C compiler]) + CURL_CHECK_DEF([__HP_cc], [], [silent]) + if test "$curl_cv_have_def___HP_cc" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="HPC" + flags_dbg_all="-g -s" + flags_dbg_yes="-g" + flags_dbg_off="-s" + flags_opt_all="-O +O0 +O1 +O2 +O3 +O4" + flags_opt_yes="+O2" + flags_opt_off="+O0" + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_CHECK_COMPILER_IBM dnl ------------------------------------------------- dnl Verify if the C compiler being used is IBM's. @@ -215,6 +238,11 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs" fi # + if test "$compiler_id" = "HPC"; then + dnl Disallow run-time dereferencing of null pointers + CFLAGS="$CFLAGS -z" + fi + # if test "$compiler_id" = "IBMC"; then dnl Ensure that compiler optimizations are always thread-safe. CFLAGS="$CFLAGS -qthreaded" @@ -392,6 +420,13 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi fi # + if test "$compiler_id" = "HPC"; then + if test "$want_warnings" = "yes"; then + dnl Issue all warnings + CFLAGS="$CFLAGS +w1" + fi + fi + # if test "$compiler_id" = "ICC_unix"; then if test "$want_warnings" = "yes"; then if test "$compiler_num" -gt "600"; then -- cgit v1.2.1 From 6814907a2c3ce7b90cdd509f0dfca009e1ca228f Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 8 Oct 2008 03:50:45 +0000 Subject: Initial attempt to detect SUN C compiler --- m4/curl-compilers.m4 | 66 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 18 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index ea10ceedb..49337d0fb 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -46,6 +46,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_IBM CURL_CHECK_COMPILER_INTEL CURL_CHECK_COMPILER_GNU + CURL_CHECK_COMPILER_SUN # if test "$compiler_id" = "unknown"; then cat <<_EOF 1>&2 @@ -218,6 +219,28 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ ]) +dnl CURL_CHECK_COMPILER_SUN +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is SUN's. + +AC_DEFUN([CURL_CHECK_COMPILER_SUN], [ + AC_MSG_CHECKING([whether we are using the SUN C compiler]) + CURL_CHECK_DEF([__SUNPRO_C], [], [silent]) + if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="SUNC" + flags_dbg_all="-g -s" + flags_dbg_yes="-g" + flags_dbg_off="-s" + flags_opt_all="-O -xO1 -xO2 -xO3 -xO4 -xO5" + flags_opt_yes="-xO2" + flags_opt_off="" + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_SET_COMPILER_BASIC_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which do not @@ -420,24 +443,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi fi # - if test "$compiler_id" = "HPC"; then - if test "$want_warnings" = "yes"; then - dnl Issue all warnings - CFLAGS="$CFLAGS +w1" - fi - fi - # - if test "$compiler_id" = "ICC_unix"; then - if test "$want_warnings" = "yes"; then - if test "$compiler_num" -gt "600"; then - dnl Show errors, warnings, and remarks - CPPFLAGS="$CPPFLAGS -Wall" - dnl Perform extra compile-time code checking - CPPFLAGS="$CPPFLAGS -Wcheck" - fi - fi - fi - # if test "$compiler_id" = "GNUC"; then # # FIXME: Some of these warnings should be changed into errors @@ -493,6 +498,31 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi fi # + if test "$compiler_id" = "HPC"; then + if test "$want_warnings" = "yes"; then + dnl Issue all warnings + CFLAGS="$CFLAGS +w1" + fi + fi + # + if test "$compiler_id" = "ICC_unix"; then + if test "$want_warnings" = "yes"; then + if test "$compiler_num" -gt "600"; then + dnl Show errors, warnings, and remarks + CPPFLAGS="$CPPFLAGS -Wall" + dnl Perform extra compile-time code checking + CPPFLAGS="$CPPFLAGS -Wcheck" + fi + fi + fi + # + if test "$compiler_id" = "SUNC"; then + if test "$want_warnings" = "yes"; then + dnl Perform stricter semantic and lint-like checks + CFLAGS="$CFLAGS -v" + fi + fi + # ]) -- cgit v1.2.1 From 1fea66e5279bb0265dfb0089e4253089683d33a1 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 8 Oct 2008 16:12:10 +0000 Subject: refactoring of COMPILER_BASIC_OPTS --- m4/curl-compilers.m4 | 231 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 164 insertions(+), 67 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 49337d0fb..002ad8324 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -135,7 +135,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_HP], [ CURL_CHECK_DEF([__HP_cc], [], [silent]) if test "$curl_cv_have_def___HP_cc" = "yes"; then AC_MSG_RESULT([yes]) - compiler_id="HPC" + compiler_id="HPUXC" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" @@ -241,6 +241,64 @@ AC_DEFUN([CURL_CHECK_COMPILER_SUN], [ ]) +dnl CURL_COMPILER_WORKS_IFELSE ([ACTION-IF-WORKS], [ACTION-IF-NOT-WORKS]) +dnl ------------------------------------------------- +dnl Verify if the C compiler seems to work with the +dnl settings that are 'active' at the time the test +dnl is performed. + +AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ + dnl compilation capability verification + tmp_compiler_works="unknown" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + int i = 1; + return i; + ]]) + ],[ + tmp_compiler_works="yes" + ],[ + tmp_compiler_works="no" + ]) + dnl linking capability verification + if test "$tmp_compiler_works" = "yes"; then + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + int i = 1; + return i; + ]]) + ],[ + tmp_compiler_works="yes" + ],[ + tmp_compiler_works="no" + ]) + fi + dnl only do runtime verification when not cross-compiling + if test "x$cross_compiling" != "xyes" && + test "$tmp_compiler_works" = "yes"; then + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + int i = 0; + exit(i); + ]]) + ],[ + tmp_compiler_works="yes" + ],[ + tmp_compiler_works="no" + ]) + fi + dnl branch upon test result + if test "$tmp_compiler_works" = "yes"; then + ifelse($1,,:,[$1]) + ifelse($2,,,[else + $2]) + fi +]) + + dnl CURL_SET_COMPILER_BASIC_OPTS dnl ------------------------------------------------- dnl Sets compiler specific options/flags which do not @@ -250,57 +308,108 @@ dnl options. AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ AC_REQUIRE([CURL_CHECK_COMPILER])dnl # - if test "$compiler_id" = "DECC"; then - dnl Select strict ANSI C compiler mode - CFLAGS="$CFLAGS -std1" - dnl Turn off optimizer ANSI C aliasing rules - CFLAGS="$CFLAGS -noansi_alias" - dnl Generate warnings for missing function prototypes - CFLAGS="$CFLAGS -warnprotos" - dnl Change some warnings into fatal errors - CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs" - fi - # - if test "$compiler_id" = "HPC"; then - dnl Disallow run-time dereferencing of null pointers - CFLAGS="$CFLAGS -z" - fi - # - if test "$compiler_id" = "IBMC"; then - dnl Ensure that compiler optimizations are always thread-safe. - CFLAGS="$CFLAGS -qthreaded" - dnl Disable type based strict aliasing optimizations, using worst - dnl case aliasing assumptions when compiling. Type based aliasing - dnl would restrict the lvalues that could be safely used to access - dnl a data object. - CFLAGS="$CFLAGS -qnoansialias" - dnl Force compiler to stop after the compilation phase, without - dnl generating an object code file when compilation has errors. - CFLAGS="$CFLAGS -qhalt=e" - fi - # - if test "$compiler_id" = "ICC_unix"; then - dnl On unix this compiler uses gcc's header files, so - dnl we select ANSI C89 dialect plus GNU extensions. - CPPFLAGS="$CPPFLAGS -std=gnu89" - dnl Change some warnings into errors - dnl #140: too many arguments in function call - dnl #147: declaration is incompatible with 'previous one' - dnl #165: too few arguments in function call - dnl #266: function declared implicitly - CPPFLAGS="$CPPFLAGS -we 140,147,165,266" - dnl Disable some remarks - dnl #279: controlling expression is constant - dnl #981: operands are evaluated in unspecified order - dnl #1469: "cc" clobber ignored - if test "$compiler_num" -lt "910"; then - CPPFLAGS="$CPPFLAGS -wd 279" + if test "$compiler_id" != "unknown"; then + # + tmp_save_CPPFLAGS="$CPPFLAGS" + tmp_save_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="" + tmp_CFLAGS="" + # + case "$compiler_id" in + # + DECC) + # + dnl Select strict ANSI C compiler mode + tmp_CFLAGS="$tmp_CFLAGS -std1" + dnl Turn off optimizer ANSI C aliasing rules + tmp_CFLAGS="$tmp_CFLAGS -noansi_alias" + dnl Generate warnings for missing function prototypes + tmp_CFLAGS="$tmp_CFLAGS -warnprotos" + dnl Change some warnings into fatal errors + tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs" + ;; + # + GNUC) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + HPUXC) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + IBMC) + # + dnl Ensure that compiler optimizations are always thread-safe. + tmp_CFLAGS="$tmp_CFLAGS -qthreaded" + dnl Disable type based strict aliasing optimizations, using worst + dnl case aliasing assumptions when compiling. Type based aliasing + dnl would restrict the lvalues that could be safely used to access + dnl a data object. + tmp_CFLAGS="$tmp_CFLAGS -qnoansialias" + dnl Force compiler to stop after the compilation phase, without + dnl generating an object code file when compilation has errors. + tmp_CFLAGS="$tmp_CFLAGS -qhalt=e" + ;; + # + ICC_unix) + # + dnl On unix this compiler uses gcc's header files, so + dnl we select ANSI C89 dialect plus GNU extensions. + tmp_CPPFLAGS="$tmp_CPPFLAGS -std=gnu89" + dnl Change some warnings into errors + dnl #140: too many arguments in function call + dnl #147: declaration is incompatible with 'previous one' + dnl #165: too few arguments in function call + dnl #266: function declared implicitly + tmp_CPPFLAGS="$tmp_CPPFLAGS -we 140,147,165,266" + dnl Disable some remarks + dnl #279: controlling expression is constant + dnl #981: operands are evaluated in unspecified order + dnl #1469: "cc" clobber ignored + tmp_CPPFLAGS="$tmp_CPPFLAGS -wd 279,981,1469" + dnl Disable use of ANSI C aliasing rules in optimizations + tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" + dnl Disable floating point optimizations + tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" + ;; + # + ICC_windows) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + SUNC) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + esac + # + tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` + tmp_CFLAGS=`eval echo $tmp_CFLAGS` + # + if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then + AC_MSG_CHECKING([if compiler accepts some basic options]) + CPPFLAGS=`eval echo $tmp_save_CPPFLAGS $tmp_CPPFLAGS` + CFLAGS=`eval echo $tmp_save_CFLAGS $tmp_CFLAGS` + CURL_COMPILER_WORKS_IFELSE([ + AC_MSG_RESULT([yes]) + AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) + dnl restore initial settings + CPPFLAGS="$tmp_save_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS" + ]) fi - CPPFLAGS="$CPPFLAGS -wd 981,1469" - dnl Disable use of ANSI C aliasing rules in optimizations - CFLAGS="$CFLAGS -no-ansi-alias" - dnl Disable floating point optimizations - CFLAGS="$CFLAGS -fp-model precise" + # fi ]) @@ -330,13 +439,7 @@ AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ CFLAGS="$CFLAGS $flags_dbg_off" AC_MSG_CHECKING([if compiler accepts debug disabling flags $flags_dbg_off]) fi - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ - int i = 1; - return i; - ]]) - ],[ + CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) @@ -404,13 +507,7 @@ AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ CFLAGS="$CFLAGS $flags_opt_off" AC_MSG_CHECKING([if compiler accepts optimizer disabling flags $flags_opt_off]) fi - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - ]],[[ - int i = 1; - return i; - ]]) - ],[ + CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) @@ -498,7 +595,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi fi # - if test "$compiler_id" = "HPC"; then + if test "$compiler_id" = "HPUXC"; then if test "$want_warnings" = "yes"; then dnl Issue all warnings CFLAGS="$CFLAGS +w1" @@ -589,7 +686,7 @@ AC_DEFUN([CURL_VAR_MATCH_IFELSE], [ if test "$ac_var_match_word" = "yes"; then ifelse($3,,:,[$3]) ifelse($4,,,[else - [$4]]) + $4]) fi ]) -- cgit v1.2.1 From 5928ea9c7a53d24bba4e37b2e1c33305a37b72f1 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 8 Oct 2008 19:38:01 +0000 Subject: improve presentation of accepted/rejected debug/optimizer options --- m4/curl-compilers.m4 | 80 +++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 35 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 002ad8324..20791da98 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 5 +# serial 8 dnl CURL_CHECK_COMPILER @@ -425,32 +425,37 @@ AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ # if test "$compiler_id" != "unknown"; then # - ac_save_CFLAGS="$CFLAGS" - ac_save_CPPFLAGS="$CPPFLAGS" + tmp_save_CFLAGS="$CFLAGS" + tmp_save_CPPFLAGS="$CPPFLAGS" + # + tmp_options="" + tmp_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + CURL_VAR_STRIP([tmp_CFLAGS],[$flags_dbg_all]) + CURL_VAR_STRIP([tmp_CPPFLAGS],[$flags_dbg_all]) # - honor_debug_option="yes" - CURL_VAR_STRIP([CFLAGS],[${flags_dbg_all}]) - CURL_VAR_STRIP([CPPFLAGS],[${flags_dbg_all}]) if test "$want_debug" = "yes"; then - CFLAGS="$CFLAGS $flags_dbg_yes" - AC_MSG_CHECKING([if compiler accepts debug enabling flags $flags_dbg_yes]) + AC_MSG_CHECKING([if compiler accepts debug enabling options]) + tmp_options="$flags_dbg_yes" fi if test "$want_debug" = "no"; then - CFLAGS="$CFLAGS $flags_dbg_off" - AC_MSG_CHECKING([if compiler accepts debug disabling flags $flags_dbg_off]) + AC_MSG_CHECKING([if compiler accepts debug disabling options]) + tmp_options="$flags_dbg_off" fi + # + CPPFLAGS=`eval echo $tmp_CPPFLAGS` + CFLAGS=`eval echo $tmp_CFLAGS $tmp_options` CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) + AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) - honor_debug_option="no" + AC_MSG_NOTICE([compiler options rejected: $tmp_options]) + dnl restore initial settings + CPPFLAGS="$tmp_save_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS" ]) # - if test "$honor_debug_option" = "no"; then - CFLAGS="$ac_save_CFLAGS" - CPPFLAGS="$ac_save_CPPFLAGS" - fi - # fi ]) @@ -466,8 +471,13 @@ AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ # if test "$compiler_id" != "unknown"; then # - ac_save_CFLAGS="$CFLAGS" - ac_save_CPPFLAGS="$CPPFLAGS" + tmp_save_CFLAGS="$CFLAGS" + tmp_save_CPPFLAGS="$CPPFLAGS" + # + tmp_options="" + tmp_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="$CPPFLAGS" + honor_optimize_option="yes" # dnl If optimization request setting has not been explicitly specified, dnl it has been derived from the debug setting and initially assumed. @@ -475,14 +485,13 @@ AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ dnl if CFLAGS or CPPFLAGS already hold optimizer flags. This implies dnl that an initially assumed optimizer setting might not be honored. # - honor_optimize_option="yes" if test "$want_optimize" = "assume_no" || test "$want_optimize" = "assume_yes"; then AC_MSG_CHECKING([if compiler optimizer assumed setting might be used]) - CURL_VAR_MATCH_IFELSE([CFLAGS],[${flags_opt_all}],[ + CURL_VAR_MATCH_IFELSE([tmp_CFLAGS],[$flags_opt_all],[ honor_optimize_option="no" ]) - CURL_VAR_MATCH_IFELSE([CPPFLAGS],[${flags_opt_all}],[ + CURL_VAR_MATCH_IFELSE([tmp_CPPFLAGS],[$flags_opt_all],[ honor_optimize_option="no" ]) AC_MSG_RESULT([$honor_optimize_option]) @@ -497,29 +506,30 @@ AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ fi # if test "$honor_optimize_option" = "yes"; then - CURL_VAR_STRIP([CFLAGS],[${flags_opt_all}]) - CURL_VAR_STRIP([CPPFLAGS],[${flags_opt_all}]) + CURL_VAR_STRIP([tmp_CFLAGS],[$flags_opt_all]) + CURL_VAR_STRIP([tmp_CPPFLAGS],[$flags_opt_all]) if test "$want_optimize" = "yes"; then - CFLAGS="$CFLAGS $flags_opt_yes" - AC_MSG_CHECKING([if compiler accepts optimizer enabling flags $flags_opt_yes]) + AC_MSG_CHECKING([if compiler accepts optimizer enabling options]) + tmp_options="$flags_opt_yes" fi if test "$want_optimize" = "no"; then - CFLAGS="$CFLAGS $flags_opt_off" - AC_MSG_CHECKING([if compiler accepts optimizer disabling flags $flags_opt_off]) + AC_MSG_CHECKING([if compiler accepts optimizer disabling options]) + tmp_options="$flags_opt_off" fi + CPPFLAGS=`eval echo $tmp_CPPFLAGS` + CFLAGS=`eval echo $tmp_CFLAGS $tmp_options` CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) + AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) - honor_optimize_option="no" + AC_MSG_NOTICE([compiler options rejected: $tmp_options]) + dnl restore initial settings + CPPFLAGS="$tmp_save_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS" ]) fi # - if test "$honor_optimize_option" = "no"; then - CFLAGS="$ac_save_CFLAGS" - CPPFLAGS="$ac_save_CPPFLAGS" - fi - # fi ]) @@ -664,7 +674,7 @@ dnl is considered positive, otherwise false. AC_DEFUN([CURL_VAR_MATCH], [ ac_var_match_word="no" - for word1 in "${[$1]}"; do + for word1 in "$[$1]"; do for word2 in "[$2]"; do if test "$word1" = "$word2"; then ac_var_match_word="yes" @@ -699,7 +709,7 @@ dnl from VALUE is removed from VARNAME when present. AC_DEFUN([CURL_VAR_STRIP], [ ac_var_stripped="" - for word1 in "${[$1]}"; do + for word1 in "$[$1]"; do ac_var_strip_word="no" for word2 in "[$2]"; do if test "$word1" = "$word2"; then -- cgit v1.2.1 From 4f924ab07eb3e53a0671e0c5ef518e70fb0befa1 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 9 Oct 2008 00:50:50 +0000 Subject: HP C adjustments: Disallow run-time dereferencing of null pointers. Disable some remarks: #4227: padding struct with n bytes to align member. #4255: padding size of struct with n bytes to alignment boundary. --- m4/curl-compilers.m4 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 20791da98..729d41364 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -337,8 +337,12 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # HPUXC) # - dnl Placeholder - tmp_CFLAGS="$tmp_CFLAGS" + dnl Disallow run-time dereferencing of null pointers + tmp_CFLAGS="$tmp_CFLAGS -z" + dnl Disable some remarks + dnl #4227: padding struct with n bytes to align member + dnl #4255: padding size of struct with n bytes to alignment boundary + tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255" ;; # IBMC) -- cgit v1.2.1 From ed4ae322f522c07e725df11acc79d9f8b86a2a8a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 9 Oct 2008 03:02:25 +0000 Subject: Initial attempt to detect SGI C compiler --- m4/curl-compilers.m4 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 729d41364..55d3ff9db 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -46,6 +46,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_IBM CURL_CHECK_COMPILER_INTEL CURL_CHECK_COMPILER_GNU + CURL_CHECK_COMPILER_SGI CURL_CHECK_COMPILER_SUN # if test "$compiler_id" = "unknown"; then @@ -219,6 +220,40 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ ]) +dnl CURL_CHECK_COMPILER_SGI +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is SGI's. + +AC_DEFUN([CURL_CHECK_COMPILER_SGI], [ + AC_MSG_CHECKING([whether we are using the SGI C compiler]) + CURL_CHECK_DEF([_SGI_COMPILER_VERSION], [], [silent]) + CURL_CHECK_DEF([_COMPILER_VERSION], [], [silent]) + CURL_CHECK_DEF([__GNUC__], [], [silent]) + CURL_CHECK_DEF([__sgi], [], [silent]) + if test "$curl_cv_have_def___GNUC__ " = "no"; then + if test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes"; then + compiler_id="SGIC" + fi + if test "$curl_cv_have_def__COMPILER_VERSION " = "yes" && + test "$curl_cv_have_def___sgi " = "yes"; then + compiler_id="SGIC" + fi + fi + if test "$compiler_id" != "SGIC"; then + AC_MSG_RESULT([yes]) + compiler_id="SGIC" + flags_dbg_all="-g -g0 -g1 -g2 -g3" + flags_dbg_yes="-g" + flags_dbg_off="-g0" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_CHECK_COMPILER_SUN dnl ------------------------------------------------- dnl Verify if the C compiler being used is SUN's. @@ -387,6 +422,12 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS" ;; # + SGIC) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # SUNC) # dnl Placeholder @@ -627,6 +668,13 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi fi # + if test "$compiler_id" = "SGIC"; then + if test "$want_warnings" = "yes"; then + dnl Perform stricter semantic and lint-like checks + CFLAGS="$CFLAGS -fullwarn" + fi + fi + # if test "$compiler_id" = "SUNC"; then if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks -- cgit v1.2.1 From b2ca0babebaa3144e8d9ca12bdfec0358fb9159c Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 9 Oct 2008 03:05:48 +0000 Subject: oops --- m4/curl-compilers.m4 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 55d3ff9db..f15e9fb98 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 8 +# serial 11 dnl CURL_CHECK_COMPILER @@ -239,9 +239,8 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI], [ compiler_id="SGIC" fi fi - if test "$compiler_id" != "SGIC"; then + if test "$compiler_id" = "SGIC"; then AC_MSG_RESULT([yes]) - compiler_id="SGIC" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="-g0" -- cgit v1.2.1 From 43c2cf4edb497e325df35e7c997d36e7a6875f47 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 9 Oct 2008 13:11:10 +0000 Subject: remove extra whitespace from string in SGI C check --- m4/curl-compilers.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index f15e9fb98..469801e69 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -230,12 +230,12 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI], [ CURL_CHECK_DEF([_COMPILER_VERSION], [], [silent]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([__sgi], [], [silent]) - if test "$curl_cv_have_def___GNUC__ " = "no"; then + if test "$curl_cv_have_def___GNUC__" = "no"; then if test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes"; then compiler_id="SGIC" fi - if test "$curl_cv_have_def__COMPILER_VERSION " = "yes" && - test "$curl_cv_have_def___sgi " = "yes"; then + if test "$curl_cv_have_def__COMPILER_VERSION" = "yes" && + test "$curl_cv_have_def___sgi" = "yes"; then compiler_id="SGIC" fi fi -- cgit v1.2.1 From 1c5336cd57958b3015a615677e3ef008212d1b84 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 9 Oct 2008 15:06:20 +0000 Subject: convert rejected compiler options messages into a warnings --- m4/curl-compilers.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 469801e69..b10830609 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 11 +# serial 13 dnl CURL_CHECK_COMPILER @@ -447,7 +447,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) ],[ AC_MSG_RESULT([no]) - AC_MSG_NOTICE([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) + AC_MSG_WARN([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" @@ -494,7 +494,7 @@ AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) - AC_MSG_NOTICE([compiler options rejected: $tmp_options]) + AC_MSG_WARN([compiler options rejected: $tmp_options]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" @@ -567,7 +567,7 @@ AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ AC_MSG_NOTICE([compiler options added: $tmp_options]) ],[ AC_MSG_RESULT([no]) - AC_MSG_NOTICE([compiler options rejected: $tmp_options]) + AC_MSG_WARN([compiler options rejected: $tmp_options]) dnl restore initial settings CPPFLAGS="$tmp_save_CPPFLAGS" CFLAGS="$tmp_save_CFLAGS" -- cgit v1.2.1 From 98416a4fabda6695b0393bd7ffcf53555be6f7f5 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 9 Oct 2008 19:55:18 +0000 Subject: configure will also warn on 'strict compiler warning' rejected options --- m4/curl-compilers.m4 | 272 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 177 insertions(+), 95 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index b10830609..71e6ea495 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 13 +# serial 14 dnl CURL_CHECK_COMPILER @@ -275,6 +275,46 @@ AC_DEFUN([CURL_CHECK_COMPILER_SUN], [ ]) +dnl CURL_CONVERT_INCLUDE_TO_ISYSTEM +dnl ------------------------------------------------- +dnl Changes standard include paths present in CFLAGS +dnl and CPPFLAGS into isystem include paths. This is +dnl done to prevent GNUC from generating warnings on +dnl headers from these locations, even though this is +dnl not reliable on ancient GNUC versions. + +AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ + tmp_has_include="no" + tmp_chg_FLAGS=$CFLAGS + for word1 in $tmp_chg_FLAGS; do + case "$word" in + -I*) + tmp_has_include="yes" + ;; + esac + done + if test "$tmp_has_include" = "yes"; then + tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/ -I/ -isystem /g'` + CFLAGS=`eval echo $tmp_chg_FLAGS` + fi + tmp_has_include="no" + tmp_chg_FLAGS=$CPPFLAGS + for word1 in $tmp_chg_FLAGS; do + case "$word" in + -I*) + tmp_has_include="yes" + ;; + esac + done + if test "$tmp_has_include" = "yes"; then + tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/ -I/ -isystem /g'` + CPPFLAGS=`eval echo $tmp_chg_FLAGS` + fi +]) + + dnl CURL_COMPILER_WORKS_IFELSE ([ACTION-IF-WORKS], [ACTION-IF-NOT-WORKS]) dnl ------------------------------------------------- dnl Verify if the C compiler seems to work with the @@ -314,6 +354,9 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ test "$tmp_compiler_works" = "yes"; then AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ +# ifdef __STDC__ +# include +# endif ]],[[ int i = 0; exit(i); @@ -343,6 +386,10 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ AC_REQUIRE([CURL_CHECK_COMPILER])dnl # if test "$compiler_id" != "unknown"; then + # + if test "$compiler_id" = "GNUC"; then + CURL_CONVERT_INCLUDE_TO_ISYSTEM + fi # tmp_save_CPPFLAGS="$CPPFLAGS" tmp_save_CFLAGS="$CFLAGS" @@ -587,100 +634,135 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_WARNINGS])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl # - if test "$compiler_id" = "DECC"; then - if test "$want_warnings" = "yes"; then - dnl Select a higher warning level than default level2 - CFLAGS="$CFLAGS -msg_enable level3" - fi - fi - # - if test "$compiler_id" = "GNUC"; then + if test "$compiler_id" != "unknown"; then # - # FIXME: Some of these warnings should be changed into errors - # and moved to CURL-SET-COMPILER-BASIC-OPTS + tmp_save_CPPFLAGS="$CPPFLAGS" + tmp_save_CFLAGS="$CFLAGS" + tmp_CPPFLAGS="" + tmp_CFLAGS="" # - if test "$want_warnings" = "yes"; then - dnl this is a set of options we believe *ALL* gcc versions support: - WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes" - dnl -Wcast-align is a bit too annoying on all gcc versions ;-) - if test "$compiler_num" -ge "207"; then - dnl gcc 2.7 or later - WARN="$WARN -Wmissing-declarations" - fi - if test "$compiler_num" -gt "295"; then - dnl only if the compiler is newer than 2.95 since we got lots of - dnl "`_POSIX_C_SOURCE' is not defined" in system headers with - dnl gcc 2.95.4 on FreeBSD 4.9! - WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar" - fi - if test "$compiler_num" -ge "296"; then - dnl gcc 2.96 or later - WARN="$WARN -Wfloat-equal" - fi - if test "$compiler_num" -gt "296"; then - dnl this option does not exist in 2.96 - WARN="$WARN -Wno-format-nonliteral" - fi - dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on - dnl on i686-Linux as it gives us heaps with false positives. - dnl Also, on gcc 4.0.X it is totally unbearable and complains all - dnl over making it unusable for generic purposes. Let's not use it. - if test "$compiler_num" -ge "303"; then - dnl gcc 3.3 and later - WARN="$WARN -Wendif-labels -Wstrict-prototypes" - fi - if test "$compiler_num" -ge "304"; then - # try these on gcc 3.4 - WARN="$WARN -Wdeclaration-after-statement" - fi - for flag in $CPPFLAGS; do - case "$flag" in - -I*) - dnl Include path, provide a -isystem option for the same dir - dnl to prevent warnings in those dirs. The -isystem was not very - dnl reliable on earlier gcc versions. - add=`echo $flag | sed 's/^-I/-isystem /g'` - WARN="$WARN $add" - ;; - esac - done - CFLAGS="$CFLAGS $WARN" - AC_MSG_NOTICE([Added this set of compiler options: $WARN]) - fi - fi - # - if test "$compiler_id" = "HPUXC"; then - if test "$want_warnings" = "yes"; then - dnl Issue all warnings - CFLAGS="$CFLAGS +w1" - fi - fi - # - if test "$compiler_id" = "ICC_unix"; then - if test "$want_warnings" = "yes"; then - if test "$compiler_num" -gt "600"; then - dnl Show errors, warnings, and remarks - CPPFLAGS="$CPPFLAGS -Wall" - dnl Perform extra compile-time code checking - CPPFLAGS="$CPPFLAGS -Wcheck" - fi - fi - fi - # - if test "$compiler_id" = "SGIC"; then - if test "$want_warnings" = "yes"; then - dnl Perform stricter semantic and lint-like checks - CFLAGS="$CFLAGS -fullwarn" - fi - fi - # - if test "$compiler_id" = "SUNC"; then - if test "$want_warnings" = "yes"; then - dnl Perform stricter semantic and lint-like checks - CFLAGS="$CFLAGS -v" + case "$compiler_id" in + # + DECC) + # + if test "$want_warnings" = "yes"; then + dnl Select a higher warning level than default level2 + tmp_CFLAGS="$tmp_CFLAGS -msg_enable level3" + fi + ;; + # + GNUC) + # + if test "$want_warnings" = "yes"; then + dnl Set of options we believe *ALL* gcc versions support: + tmp_CFLAGS="$tmp_CFLAGS -pedantic -Wall -W -Winline -Wnested-externs" + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes -Wpointer-arith" + tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" + dnl -Wcast-align is a bit too annoying on all gcc versions ;-) + if test "$compiler_num" -ge "207"; then + dnl gcc 2.7 or later + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" + fi + if test "$compiler_num" -gt "295"; then + dnl only if the compiler is newer than 2.95 since we got lots of + dnl "`_POSIX_C_SOURCE' is not defined" in system headers with + dnl gcc 2.95.4 on FreeBSD 4.9! + tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long -Wno-multichar -Wshadow" + tmp_CFLAGS="$tmp_CFLAGS -Wsign-compare -Wundef" + fi + if test "$compiler_num" -ge "296"; then + dnl gcc 2.96 or later + tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" + fi + if test "$compiler_num" -gt "296"; then + dnl this option does not exist in 2.96 + tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" + fi + dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on + dnl on i686-Linux as it gives us heaps with false positives. + dnl Also, on gcc 4.0.X it is totally unbearable and complains all + dnl over making it unusable for generic purposes. Let's not use it. + if test "$compiler_num" -ge "303"; then + dnl gcc 3.3 and later + tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" + fi + if test "$compiler_num" -ge "304"; then + dnl gcc 3.4 and later + tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" + fi + fi + ;; + # + HPUXC) + # + if test "$want_warnings" = "yes"; then + dnl Issue all warnings + tmp_CFLAGS="$tmp_CFLAGS +w1" + fi + ;; + # + IBMC) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + ICC_unix) + # + if test "$want_warnings" = "yes"; then + if test "$compiler_num" -gt "600"; then + dnl Show errors, warnings, and remarks + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall" + dnl Perform extra compile-time code checking + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" + fi + fi + ;; + # + ICC_windows) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + SGIC) + # + if test "$want_warnings" = "yes"; then + dnl Perform stricter semantic and lint-like checks + tmp_CFLAGS="$tmp_CFLAGS -fullwarn" + fi + ;; + # + SUNC) + # + if test "$want_warnings" = "yes"; then + dnl Perform stricter semantic and lint-like checks + tmp_CFLAGS="$tmp_CFLAGS -v" + fi + ;; + # + esac + # + tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` + tmp_CFLAGS=`eval echo $tmp_CFLAGS` + # + if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then + AC_MSG_CHECKING([if compiler accepts strict warning options]) + CPPFLAGS=`eval echo $tmp_save_CPPFLAGS $tmp_CPPFLAGS` + CFLAGS=`eval echo $tmp_save_CFLAGS $tmp_CFLAGS` + CURL_COMPILER_WORKS_IFELSE([ + AC_MSG_RESULT([yes]) + AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_WARN([compiler options rejected: $tmp_CFLAGS $tmp_CPPFLAGS]) + dnl restore initial settings + CPPFLAGS="$tmp_save_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS" + ]) fi + # fi - # ]) @@ -725,8 +807,8 @@ dnl is considered positive, otherwise false. AC_DEFUN([CURL_VAR_MATCH], [ ac_var_match_word="no" - for word1 in "$[$1]"; do - for word2 in "[$2]"; do + for word1 in $[$1]; do + for word2 in [$2]; do if test "$word1" = "$word2"; then ac_var_match_word="yes" fi @@ -760,9 +842,9 @@ dnl from VALUE is removed from VARNAME when present. AC_DEFUN([CURL_VAR_STRIP], [ ac_var_stripped="" - for word1 in "$[$1]"; do + for word1 in $[$1]; do ac_var_strip_word="no" - for word2 in "[$2]"; do + for word2 in [$2]; do if test "$word1" = "$word2"; then ac_var_strip_word="yes" fi -- cgit v1.2.1 From 4b8f13e902abe1fcbf4052a598b4bde2d3233635 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 10 Oct 2008 00:07:41 +0000 Subject: Add debug tracing for COMPILER_WORKS_IFELSE --- m4/curl-compilers.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 71e6ea495..60e0c98f7 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -334,6 +334,9 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" + echo " " >&6 + sed 's/^/cc-fail> /' conftest.err >&6 + echo " " >&6 ]) dnl linking capability verification if test "$tmp_compiler_works" = "yes"; then @@ -347,6 +350,9 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" + echo " " >&6 + sed 's/^/ln-fail> /' conftest.err >&6 + echo " " >&6 ]) fi dnl only do runtime verification when not cross-compiling @@ -365,6 +371,9 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ tmp_compiler_works="yes" ],[ tmp_compiler_works="no" + echo " " >&6 + echo "rn-fail test program exited with status $ac_status" >&6 + echo " " >&6 ]) fi dnl branch upon test result -- cgit v1.2.1 From d61f2603722e8f83d8cb63fbef90fe0914e2338c Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 10 Oct 2008 02:32:46 +0000 Subject: HP C adjustments: Due to the HP-UX socklen_t issue it is insane to use the +w1 warning level. It generates more than 1100 warnings on socklen_t related statements. Until the issue is somehow fixed we will just use the +w2 warning level. --- m4/curl-compilers.m4 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 60e0c98f7..0be683e04 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -706,7 +706,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # if test "$want_warnings" = "yes"; then dnl Issue all warnings - tmp_CFLAGS="$tmp_CFLAGS +w1" + dnl tmp_CFLAGS="$tmp_CFLAGS +w1" + dnl Due to the HP-UX socklen_t issue it is insane to use the +w1 + dnl warning level. Until the issue is somehow fixed we will just + dnl use the +w2 warning level. + tmp_CFLAGS="$tmp_CFLAGS +w2" fi ;; # -- cgit v1.2.1 From 4f6f334f41a30a29d94a5e572a2771c1e33dff93 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 10 Oct 2008 05:09:28 +0000 Subject: simplify SGI C compiler check --- m4/curl-compilers.m4 | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 0be683e04..ffdcdfd19 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 14 +# serial 17 dnl CURL_CHECK_COMPILER @@ -226,21 +226,12 @@ dnl Verify if the C compiler being used is SGI's. AC_DEFUN([CURL_CHECK_COMPILER_SGI], [ AC_MSG_CHECKING([whether we are using the SGI C compiler]) - CURL_CHECK_DEF([_SGI_COMPILER_VERSION], [], [silent]) - CURL_CHECK_DEF([_COMPILER_VERSION], [], [silent]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([__sgi], [], [silent]) - if test "$curl_cv_have_def___GNUC__" = "no"; then - if test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes"; then - compiler_id="SGIC" - fi - if test "$curl_cv_have_def__COMPILER_VERSION" = "yes" && - test "$curl_cv_have_def___sgi" = "yes"; then - compiler_id="SGIC" - fi - fi - if test "$compiler_id" = "SGIC"; then + if test "$curl_cv_have_def___GNUC__" = "no" && + test "$curl_cv_have_def___sgi" = "yes"; then AC_MSG_RESULT([yes]) + compiler_id="SGIC" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="-g0" -- cgit v1.2.1 From ef49850789af67ff0a393b1ac62fb819fcc8cb3e Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 10 Oct 2008 09:14:18 +0000 Subject: 1) fix bug in CONVERT_INCLUDE_TO_ISYSTEM 2) Disable SGI remark: controlling expression is constant --- m4/curl-compilers.m4 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index ffdcdfd19..0af13bbe7 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 17 +# serial 18 dnl CURL_CHECK_COMPILER @@ -257,7 +257,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SUN], [ flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" - flags_opt_all="-O -xO1 -xO2 -xO3 -xO4 -xO5" + flags_opt_all="-O -xO -xO1 -xO2 -xO3 -xO4 -xO5" flags_opt_yes="-xO2" flags_opt_off="" else @@ -278,7 +278,7 @@ AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ tmp_has_include="no" tmp_chg_FLAGS=$CFLAGS for word1 in $tmp_chg_FLAGS; do - case "$word" in + case "$word1" in -I*) tmp_has_include="yes" ;; @@ -292,7 +292,7 @@ AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ tmp_has_include="no" tmp_chg_FLAGS=$CPPFLAGS for word1 in $tmp_chg_FLAGS; do - case "$word" in + case "$word1" in -I*) tmp_has_include="yes" ;; @@ -734,6 +734,9 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks tmp_CFLAGS="$tmp_CFLAGS -fullwarn" + dnl Disable some remarks + dnl #1209: controlling expression is constant + tmp_CFLAGS="$tmp_CFLAGS -woff 1209" fi ;; # -- cgit v1.2.1 From c859a6f3652396e6245d8680ce40ac29b6fa909e Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 10 Oct 2008 10:06:25 +0000 Subject: Initial attempt to detect LCC compiler --- m4/curl-compilers.m4 | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 0af13bbe7..f470175bb 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 18 +# serial 19 dnl CURL_CHECK_COMPILER @@ -46,6 +46,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_IBM CURL_CHECK_COMPILER_INTEL CURL_CHECK_COMPILER_GNU + CURL_CHECK_COMPILER_LCC CURL_CHECK_COMPILER_SGI CURL_CHECK_COMPILER_SUN # @@ -220,6 +221,28 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ ]) +dnl CURL_CHECK_COMPILER_LCC +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is LCC. + +AC_DEFUN([CURL_CHECK_COMPILER_LCC], [ + AC_MSG_CHECKING([whether we are using the LCC C compiler]) + CURL_CHECK_DEF([__LCC__], [], [silent]) + if test "$curl_cv_have_def___LCC__" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="LCC" + flags_dbg_all="-g" + flags_dbg_yes="-g" + flags_dbg_off="" + flags_opt_all="" + flags_opt_yes="" + flags_opt_off="" + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_CHECK_COMPILER_SGI dnl ------------------------------------------------- dnl Verify if the C compiler being used is SGI's. @@ -468,6 +491,12 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS" ;; # + LCC) + # + dnl Disallow run-time dereferencing of null pointers + tmp_CFLAGS="$tmp_CFLAGS -n" + ;; + # SGIC) # dnl Placeholder @@ -729,6 +758,14 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS" ;; # + LCC) + # + if test "$want_warnings" = "yes"; then + dnl Highest warning level is double -A + tmp_CFLAGS="$tmp_CFLAGS -A -A" + fi + ;; + # SGIC) # if test "$want_warnings" = "yes"; then -- cgit v1.2.1 From 0722e91eb9268ac53bb484f2af63aba80921090a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 10 Oct 2008 10:31:16 +0000 Subject: Initial attempt to detect Tiny C compiler --- m4/curl-compilers.m4 | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index f470175bb..06e5b5280 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 19 +# serial 20 dnl CURL_CHECK_COMPILER @@ -49,6 +49,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_LCC CURL_CHECK_COMPILER_SGI CURL_CHECK_COMPILER_SUN + CURL_CHECK_COMPILER_TINYC # if test "$compiler_id" = "unknown"; then cat <<_EOF 1>&2 @@ -289,6 +290,28 @@ AC_DEFUN([CURL_CHECK_COMPILER_SUN], [ ]) +dnl CURL_CHECK_COMPILER_TINYC +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is TINYC. + +AC_DEFUN([CURL_CHECK_COMPILER_TINYC], [ + AC_MSG_CHECKING([whether we are using the TinyCC C compiler]) + CURL_CHECK_DEF([__TINYC__], [], [silent]) + if test "$curl_cv_have_def___TINYC__" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="TINYC" + flags_dbg_all="-g -b" + flags_dbg_yes="-g -b" + flags_dbg_off="" + flags_opt_all="" + flags_opt_yes="" + flags_opt_off="" + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_CONVERT_INCLUDE_TO_ISYSTEM dnl ------------------------------------------------- dnl Changes standard include paths present in CFLAGS @@ -509,6 +532,12 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS" ;; # + TINYC) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # esac # tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` @@ -785,6 +814,18 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # + TINYC) + # + if test "$want_warnings" = "yes"; then + dnl Activate all warnings + tmp_CFLAGS="$tmp_CFLAGS -Wall" + dnl Make string constants be of type const char * + tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" + dnl Warn use of unsupported GCC features ignored by TCC + tmp_CFLAGS="$tmp_CFLAGS -Wunsupported" + fi + ;; + # esac # tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` -- cgit v1.2.1 From 430b1a22dbb3f004796d20177b361a501bb4c74a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 11 Oct 2008 16:19:35 +0000 Subject: LCC compiler adjustments: Warning level reduced from double -A to single -A --- m4/curl-compilers.m4 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 06e5b5280..42142f013 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 20 +# serial 21 dnl CURL_CHECK_COMPILER @@ -790,8 +790,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ LCC) # if test "$want_warnings" = "yes"; then - dnl Highest warning level is double -A - tmp_CFLAGS="$tmp_CFLAGS -A -A" + dnl Highest warning level is double -A, next is single -A. + dnl Due to the big number of warnings this triggers on third + dnl party header files it is impratical for to activate this + dnl warning level here. If you want them define it in CFLAGS. + tmp_CFLAGS="$tmp_CFLAGS -A" fi ;; # -- cgit v1.2.1 From a119114ad71a7a847ef15233ef783a00194e6eea Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 11 Oct 2008 16:59:44 +0000 Subject: split SGI compiler check. One for MIPS C and another for MIPSpro C --- m4/curl-compilers.m4 | 62 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 10 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 42142f013..1a4e01d46 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 21 +# serial 22 dnl CURL_CHECK_COMPILER @@ -47,7 +47,8 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_INTEL CURL_CHECK_COMPILER_GNU CURL_CHECK_COMPILER_LCC - CURL_CHECK_COMPILER_SGI + CURL_CHECK_COMPILER_SGI_MIPSpro_C + CURL_CHECK_COMPILER_SGI_MIPS _C CURL_CHECK_COMPILER_SUN CURL_CHECK_COMPILER_TINYC # @@ -244,18 +245,45 @@ AC_DEFUN([CURL_CHECK_COMPILER_LCC], [ ]) -dnl CURL_CHECK_COMPILER_SGI +dnl CURL_CHECK_COMPILER_SGI_MIPS_C dnl ------------------------------------------------- dnl Verify if the C compiler being used is SGI's. -AC_DEFUN([CURL_CHECK_COMPILER_SGI], [ - AC_MSG_CHECKING([whether we are using the SGI C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPS_C], [ + AC_REQUIRE([CURL_CHECK_COMPILER_SGI_MIPSpro_C])dnl + AC_MSG_CHECKING([if compiler is SGI MIPS C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([__sgi], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "no" && - test "$curl_cv_have_def___sgi" = "yes"; then + test "$curl_cv_have_def___sgi" = "yes" && + test "$compiler_id" = "unknown"; then AC_MSG_RESULT([yes]) - compiler_id="SGIC" + compiler_id="SGI_MIPS_C" + flags_dbg_all="-g -g0 -g1 -g2 -g3" + flags_dbg_yes="-g" + flags_dbg_off="-g0" + flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + AC_MSG_RESULT([no]) + fi +]) + + +dnl CURL_CHECK_COMPILER_SGI_MIPSpro_C +dnl ------------------------------------------------- +dnl Verify if the C compiler being used is SGI's. + +AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSpro_C], [ + AC_BEFORE([$0],[CURL_CHECK_COMPILER_SGI_MIPS_C])dnl + AC_MSG_CHECKING([if compiler is SGI MIPSpro C]) + CURL_CHECK_DEF([__GNUC__], [], [silent]) + CURL_CHECK_DEF([_SGI_COMPILER_VERSION], [], [silent]) + if test "$curl_cv_have_def___GNUC__" = "no" && + test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="SGI_MIPSpro_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="-g0" @@ -520,7 +548,13 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -n" ;; # - SGIC) + SGI_MIPS_C) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + SGI_MIPSpro_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" @@ -792,13 +826,21 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$want_warnings" = "yes"; then dnl Highest warning level is double -A, next is single -A. dnl Due to the big number of warnings this triggers on third - dnl party header files it is impratical for to activate this + dnl party header files it is impratical for us to use this dnl warning level here. If you want them define it in CFLAGS. tmp_CFLAGS="$tmp_CFLAGS -A" fi ;; # - SGIC) + SGI_MIPS_C) + # + if test "$want_warnings" = "yes"; then + dnl Perform stricter semantic and lint-like checks + tmp_CFLAGS="$tmp_CFLAGS -fullwarn" + fi + ;; + # + SGI_MIPSpro_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks -- cgit v1.2.1 From fefc6a7e6b3e1d6e595fa46b2877904573d2edf6 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 11 Oct 2008 18:04:39 +0000 Subject: remove extra space --- m4/curl-compilers.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 1a4e01d46..586585a4f 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 22 +# serial 23 dnl CURL_CHECK_COMPILER @@ -48,7 +48,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_GNU CURL_CHECK_COMPILER_LCC CURL_CHECK_COMPILER_SGI_MIPSpro_C - CURL_CHECK_COMPILER_SGI_MIPS _C + CURL_CHECK_COMPILER_SGI_MIPS_C CURL_CHECK_COMPILER_SUN CURL_CHECK_COMPILER_TINYC # -- cgit v1.2.1 From ab861e56f17ab02293c77fc221cd53931e4b3d2c Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 12 Oct 2008 16:57:40 +0000 Subject: LCC compiler adjustments: Highest warning level is double -A, next is single -A. Due to the big number of warnings these trigger on third party header files it is impratical for us to use any of them here. If you want them simply define it in CPPFLAGS. --- m4/curl-compilers.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 586585a4f..580be220b 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -825,10 +825,10 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # if test "$want_warnings" = "yes"; then dnl Highest warning level is double -A, next is single -A. - dnl Due to the big number of warnings this triggers on third - dnl party header files it is impratical for us to use this - dnl warning level here. If you want them define it in CFLAGS. - tmp_CFLAGS="$tmp_CFLAGS -A" + dnl Due to the big number of warnings these trigger on third + dnl party header files it is impratical for us to use any of + dnl them here. If you want them simply define it in CPPFLAGS. + tmp_CFLAGS="$tmp_CFLAGS" fi ;; # -- cgit v1.2.1 From 758939215d5351ce47e97ba17b663e0b1a197b1b Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 12 Oct 2008 22:52:25 +0000 Subject: adjust SGI MIPSpro C detection --- m4/curl-compilers.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 580be220b..dac93b985 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -279,9 +279,11 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSpro_C], [ AC_BEFORE([$0],[CURL_CHECK_COMPILER_SGI_MIPS_C])dnl AC_MSG_CHECKING([if compiler is SGI MIPSpro C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) + CURL_CHECK_DEF([_COMPILER_VERSION], [], [silent]) CURL_CHECK_DEF([_SGI_COMPILER_VERSION], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "no" && - test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes"; then + (test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes" || + test "$curl_cv_have_def__COMPILER_VERSION" = "yes"); then AC_MSG_RESULT([yes]) compiler_id="SGI_MIPSpro_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" -- cgit v1.2.1 From ca70beec479f40f87610b964ebe0bab4ed07edac Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 13 Oct 2008 00:43:30 +0000 Subject: Adjust GCC --enable-warnings: Do not enable -pedantic when cross-compiling with a gcc older than 3.0, to avoid warnings from third party system headers. --- m4/curl-compilers.m4 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index dac93b985..d25cba65a 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -748,8 +748,14 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ GNUC) # if test "$want_warnings" = "yes"; then + dnl Do not enable -pedantic when cross-compiling with a gcc older + dnl than 3.0, to avoid warnings from third party system headers. + if test "x$cross_compiling" != "xyes" || + test "$compiler_num" -ge "300"; then + tmp_CFLAGS="$tmp_CFLAGS -pedantic" + fi dnl Set of options we believe *ALL* gcc versions support: - tmp_CFLAGS="$tmp_CFLAGS -pedantic -Wall -W -Winline -Wnested-externs" + tmp_CFLAGS="$tmp_CFLAGS -Wall -W -Winline -Wnested-externs" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes -Wpointer-arith" tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" dnl -Wcast-align is a bit too annoying on all gcc versions ;-) @@ -785,6 +791,12 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi fi + # + dnl Do not issue warnings for code in system include paths. + if test "$compiler_num" -ge "300"; then + dnl gcc 3.0 and later + tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" + fi ;; # HPUXC) -- cgit v1.2.1 From 3ad956e73f0b79bca92949faf726768927caba3e Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 13 Oct 2008 17:06:06 +0000 Subject: Adjust GCC warnings: Disable following warnings when cross-compiling with a gcc older than 3.0, to avoid warnings from third party system headers: -Wmissing-prototypes -Wunused -Wshadow --- m4/curl-compilers.m4 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index d25cba65a..d7ab28a74 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -756,9 +756,14 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi dnl Set of options we believe *ALL* gcc versions support: tmp_CFLAGS="$tmp_CFLAGS -Wall -W -Winline -Wnested-externs" - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes -Wpointer-arith" - tmp_CFLAGS="$tmp_CFLAGS -Wwrite-strings" + tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" dnl -Wcast-align is a bit too annoying on all gcc versions ;-) + dnl Do not enable some warnings, when cross-compiling with a gcc + dnl older than 3.0, triggered on third party system headers. + if test "x$cross_compiling" != "xyes" || + test "$compiler_num" -ge "300"; then + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" + fi if test "$compiler_num" -ge "207"; then dnl gcc 2.7 or later tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" @@ -796,6 +801,13 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$compiler_num" -ge "300"; then dnl gcc 3.0 and later tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" + else + dnl Disable some warnings, when cross-compiling with a gcc + dnl older than 3.0, triggered on third party system headers. + if test "x$cross_compiling" = "xyes"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" + tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" + fi fi ;; # -- cgit v1.2.1 From ae754622547824d5a56fb467125e31e7e6757217 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 13 Oct 2008 19:32:11 +0000 Subject: make naming scheme more consistent across whole file --- m4/curl-compilers.m4 | 149 +++++++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 75 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index d7ab28a74..ba2e10ef6 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 23 +# serial 28 dnl CURL_CHECK_COMPILER @@ -41,16 +41,16 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ flags_opt_yes="unknown" flags_opt_off="unknown" # - CURL_CHECK_COMPILER_DEC - CURL_CHECK_COMPILER_HP - CURL_CHECK_COMPILER_IBM - CURL_CHECK_COMPILER_INTEL - CURL_CHECK_COMPILER_GNU + CURL_CHECK_COMPILER_DEC_C + CURL_CHECK_COMPILER_HPUX_C + CURL_CHECK_COMPILER_IBM_C + CURL_CHECK_COMPILER_INTEL_C + CURL_CHECK_COMPILER_GNU_C CURL_CHECK_COMPILER_LCC - CURL_CHECK_COMPILER_SGI_MIPSpro_C + CURL_CHECK_COMPILER_SGI_MIPSPRO_C CURL_CHECK_COMPILER_SGI_MIPS_C - CURL_CHECK_COMPILER_SUN - CURL_CHECK_COMPILER_TINYC + CURL_CHECK_COMPILER_SUNPRO_C + CURL_CHECK_COMPILER_TINY_C # if test "$compiler_id" = "unknown"; then cat <<_EOF 1>&2 @@ -70,18 +70,18 @@ _EOF ]) -dnl CURL_CHECK_COMPILER_DEC +dnl CURL_CHECK_COMPILER_DEC_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is DEC's. +dnl Verify if compiler being used is DEC C. -AC_DEFUN([CURL_CHECK_COMPILER_DEC], [ - AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_DEC_C], [ + AC_MSG_CHECKING([if compiler is DEC/Compaq/HP C]) CURL_CHECK_DEF([__DECC], [], [silent]) CURL_CHECK_DEF([__DECC_VER], [], [silent]) if test "$curl_cv_have_def___DECC" = "yes" && test "$curl_cv_have_def___DECC_VER" = "yes"; then AC_MSG_RESULT([yes]) - compiler_id="DECC" + compiler_id="DEC_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g2" flags_dbg_off="-g0" @@ -94,19 +94,18 @@ AC_DEFUN([CURL_CHECK_COMPILER_DEC], [ ]) -dnl CURL_CHECK_COMPILER_GNU +dnl CURL_CHECK_COMPILER_GNU_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is GNU's. +dnl Verify if compiler being used is GNU C. -AC_DEFUN([CURL_CHECK_COMPILER_GNU], [ - AC_REQUIRE([CURL_CHECK_COMPILER_INTEL])dnl - # - AC_MSG_CHECKING([whether we are using the GNU C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [ + AC_REQUIRE([CURL_CHECK_COMPILER_INTEL_C])dnl + AC_MSG_CHECKING([if compiler is GNU C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "yes" && test "$compiler_id" = "unknown"; then AC_MSG_RESULT([yes]) - compiler_id="GNUC" + compiler_id="GNU_C" gccver=`$CC -dumpversion` gccvhi=`echo $gccver | cut -d . -f1` gccvlo=`echo $gccver | cut -d . -f2` @@ -130,16 +129,16 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU], [ ]) -dnl CURL_CHECK_COMPILER_HP +dnl CURL_CHECK_COMPILER_HPUX_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is HP's. +dnl Verify if compiler being used is HP-UX C. -AC_DEFUN([CURL_CHECK_COMPILER_HP], [ - AC_MSG_CHECKING([whether we are using the HP C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_HPUX_C], [ + AC_MSG_CHECKING([if compiler is HP-UX C]) CURL_CHECK_DEF([__HP_cc], [], [silent]) if test "$curl_cv_have_def___HP_cc" = "yes"; then AC_MSG_RESULT([yes]) - compiler_id="HPUXC" + compiler_id="HP_UX_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" @@ -152,16 +151,16 @@ AC_DEFUN([CURL_CHECK_COMPILER_HP], [ ]) -dnl CURL_CHECK_COMPILER_IBM +dnl CURL_CHECK_COMPILER_IBM_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is IBM's. +dnl Verify if compiler being used is IBM C. -AC_DEFUN([CURL_CHECK_COMPILER_IBM], [ - AC_MSG_CHECKING([whether we are using the IBM C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_IBM_C], [ + AC_MSG_CHECKING([if compiler is IBM C]) CURL_CHECK_DEF([__IBMC__], [], [silent]) if test "$curl_cv_have_def___IBMC__" = "yes"; then AC_MSG_RESULT([yes]) - compiler_id="IBMC" + compiler_id="IBM_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="" @@ -181,19 +180,19 @@ AC_DEFUN([CURL_CHECK_COMPILER_IBM], [ ]) -dnl CURL_CHECK_COMPILER_INTEL +dnl CURL_CHECK_COMPILER_INTEL_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is Intel's. +dnl Verify if compiler being used is Intel C. -AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ - AC_BEFORE([$0],[CURL_CHECK_COMPILER_GNU])dnl - AC_MSG_CHECKING([whether we are using the Intel C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ + AC_BEFORE([$0],[CURL_CHECK_COMPILER_GNU_C])dnl + AC_MSG_CHECKING([if compiler is Intel C]) CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent]) if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then AC_MSG_RESULT([yes]) CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then - compiler_id="ICC_unix" + compiler_id="INTEL_UNIX_C" flags_dbg_all="-g -g0" flags_dbg_yes="-g" flags_dbg_off="-g0" @@ -201,7 +200,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ flags_opt_yes="-O2" flags_opt_off="-O0" else - compiler_id="ICC_windows" + compiler_id="INTEL_WINDOWS_C" flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" flags_dbg_all="$flags_dbg_all /debug" flags_dbg_all="$flags_dbg_all /debug:none" @@ -225,10 +224,10 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL], [ dnl CURL_CHECK_COMPILER_LCC dnl ------------------------------------------------- -dnl Verify if the C compiler being used is LCC. +dnl Verify if compiler being used is LCC. AC_DEFUN([CURL_CHECK_COMPILER_LCC], [ - AC_MSG_CHECKING([whether we are using the LCC C compiler]) + AC_MSG_CHECKING([if compiler is LCC]) CURL_CHECK_DEF([__LCC__], [], [silent]) if test "$curl_cv_have_def___LCC__" = "yes"; then AC_MSG_RESULT([yes]) @@ -247,10 +246,10 @@ AC_DEFUN([CURL_CHECK_COMPILER_LCC], [ dnl CURL_CHECK_COMPILER_SGI_MIPS_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is SGI's. +dnl Verify if compiler being used is SGI MIPS C. AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPS_C], [ - AC_REQUIRE([CURL_CHECK_COMPILER_SGI_MIPSpro_C])dnl + AC_REQUIRE([CURL_CHECK_COMPILER_SGI_MIPSPRO_C])dnl AC_MSG_CHECKING([if compiler is SGI MIPS C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) CURL_CHECK_DEF([__sgi], [], [silent]) @@ -271,11 +270,11 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPS_C], [ ]) -dnl CURL_CHECK_COMPILER_SGI_MIPSpro_C +dnl CURL_CHECK_COMPILER_SGI_MIPSPRO_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is SGI's. +dnl Verify if compiler being used is SGI MIPSpro C. -AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSpro_C], [ +AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSPRO_C], [ AC_BEFORE([$0],[CURL_CHECK_COMPILER_SGI_MIPS_C])dnl AC_MSG_CHECKING([if compiler is SGI MIPSpro C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) @@ -285,7 +284,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSpro_C], [ (test "$curl_cv_have_def__SGI_COMPILER_VERSION" = "yes" || test "$curl_cv_have_def__COMPILER_VERSION" = "yes"); then AC_MSG_RESULT([yes]) - compiler_id="SGI_MIPSpro_C" + compiler_id="SGI_MIPSPRO_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" flags_dbg_off="-g0" @@ -298,16 +297,16 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSpro_C], [ ]) -dnl CURL_CHECK_COMPILER_SUN +dnl CURL_CHECK_COMPILER_SUNPRO_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is SUN's. +dnl Verify if compiler being used is SunPro C. -AC_DEFUN([CURL_CHECK_COMPILER_SUN], [ - AC_MSG_CHECKING([whether we are using the SUN C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_SUNPRO_C], [ + AC_MSG_CHECKING([if compiler is SunPro C]) CURL_CHECK_DEF([__SUNPRO_C], [], [silent]) if test "$curl_cv_have_def___SUNPRO_C" = "yes"; then AC_MSG_RESULT([yes]) - compiler_id="SUNC" + compiler_id="SUNPRO_C" flags_dbg_all="-g -s" flags_dbg_yes="-g" flags_dbg_off="-s" @@ -320,16 +319,16 @@ AC_DEFUN([CURL_CHECK_COMPILER_SUN], [ ]) -dnl CURL_CHECK_COMPILER_TINYC +dnl CURL_CHECK_COMPILER_TINY_C dnl ------------------------------------------------- -dnl Verify if the C compiler being used is TINYC. +dnl Verify if compiler being used is Tiny C. -AC_DEFUN([CURL_CHECK_COMPILER_TINYC], [ - AC_MSG_CHECKING([whether we are using the TinyCC C compiler]) +AC_DEFUN([CURL_CHECK_COMPILER_TINY_C], [ + AC_MSG_CHECKING([if compiler is Tiny C]) CURL_CHECK_DEF([__TINYC__], [], [silent]) if test "$curl_cv_have_def___TINYC__" = "yes"; then AC_MSG_RESULT([yes]) - compiler_id="TINYC" + compiler_id="TINY_C" flags_dbg_all="-g -b" flags_dbg_yes="-g -b" flags_dbg_off="" @@ -463,7 +462,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # if test "$compiler_id" != "unknown"; then # - if test "$compiler_id" = "GNUC"; then + if test "$compiler_id" = "GNU_C"; then CURL_CONVERT_INCLUDE_TO_ISYSTEM fi # @@ -474,7 +473,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # case "$compiler_id" in # - DECC) + DEC_C) # dnl Select strict ANSI C compiler mode tmp_CFLAGS="$tmp_CFLAGS -std1" @@ -486,13 +485,13 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -msg_fatal toofewargs,toomanyargs" ;; # - GNUC) + GNU_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # - HPUXC) + HP_UX_C) # dnl Disallow run-time dereferencing of null pointers tmp_CFLAGS="$tmp_CFLAGS -z" @@ -502,7 +501,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS +W 4227,4255" ;; # - IBMC) + IBM_C) # dnl Ensure that compiler optimizations are always thread-safe. tmp_CFLAGS="$tmp_CFLAGS -qthreaded" @@ -516,7 +515,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -qhalt=e" ;; # - ICC_unix) + INTEL_UNIX_C) # dnl On unix this compiler uses gcc's header files, so dnl we select ANSI C89 dialect plus GNU extensions. @@ -538,7 +537,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" ;; # - ICC_windows) + INTEL_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" @@ -556,19 +555,19 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS" ;; # - SGI_MIPSpro_C) + SGI_MIPSPRO_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # - SUNC) + SUNPRO_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # - TINYC) + TINY_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" @@ -737,7 +736,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # case "$compiler_id" in # - DECC) + DEC_C) # if test "$want_warnings" = "yes"; then dnl Select a higher warning level than default level2 @@ -745,7 +744,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # - GNUC) + GNU_C) # if test "$want_warnings" = "yes"; then dnl Do not enable -pedantic when cross-compiling with a gcc older @@ -811,7 +810,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # - HPUXC) + HP_UX_C) # if test "$want_warnings" = "yes"; then dnl Issue all warnings @@ -823,13 +822,13 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # - IBMC) + IBM_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" ;; # - ICC_unix) + INTEL_UNIX_C) # if test "$want_warnings" = "yes"; then if test "$compiler_num" -gt "600"; then @@ -841,7 +840,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # - ICC_windows) + INTEL_WINDOWS_C) # dnl Placeholder tmp_CFLAGS="$tmp_CFLAGS" @@ -866,7 +865,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # - SGI_MIPSpro_C) + SGI_MIPSPRO_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks @@ -877,7 +876,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # - SUNC) + SUNPRO_C) # if test "$want_warnings" = "yes"; then dnl Perform stricter semantic and lint-like checks @@ -885,7 +884,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # - TINYC) + TINY_C) # if test "$want_warnings" = "yes"; then dnl Activate all warnings -- cgit v1.2.1 From 1fab40bb69669efcb52d03fd688289551727ad7a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 14 Oct 2008 04:09:07 +0000 Subject: Initial attempt to detect Watcom C compiler --- m4/curl-compilers.m4 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index ba2e10ef6..03d35cdf4 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -51,6 +51,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_SGI_MIPS_C CURL_CHECK_COMPILER_SUNPRO_C CURL_CHECK_COMPILER_TINY_C + CURL_CHECK_COMPILER_WATCOM_C # if test "$compiler_id" = "unknown"; then cat <<_EOF 1>&2 @@ -341,6 +342,39 @@ AC_DEFUN([CURL_CHECK_COMPILER_TINY_C], [ ]) +dnl CURL_CHECK_COMPILER_WATCOM_C +dnl ------------------------------------------------- +dnl Verify if compiler being used is Watcom C. + +AC_DEFUN([CURL_CHECK_COMPILER_WATCOM_C], [ + AC_MSG_CHECKING([if compiler is Watcom C]) + CURL_CHECK_DEF([__WATCOMC__], [], [silent]) + if test "$curl_cv_have_def___WATCOMC__" = "yes"; then + AC_MSG_RESULT([yes]) + CURL_CHECK_DEF([__UNIX__], [], [silent]) + if test "$curl_cv_have_def___UNIX__" = "yes"; then + compiler_id="WATCOM_UNIX_C" + flags_dbg_all="-g1 -g1+ -g2 -g3" + flags_dbg_yes="-g2" + flags_dbg_off="" + flags_opt_all="-O0 -O1 -O2 -O3" + flags_opt_yes="-O2" + flags_opt_off="-O0" + else + compiler_id="WATCOM_WINDOWS_C" + flags_dbg_all="" + flags_dbg_yes="" + flags_dbg_off="" + flags_opt_all="" + flags_opt_yes="" + flags_opt_off="" + fi + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_CONVERT_INCLUDE_TO_ISYSTEM dnl ------------------------------------------------- dnl Changes standard include paths present in CFLAGS @@ -573,6 +607,18 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS" ;; # + WATCOM_UNIX_C) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # + WATCOM_WINDOWS_C) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # esac # tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` @@ -896,6 +942,20 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi ;; # + WATCOM_UNIX_C) + # + if test "$want_warnings" = "yes"; then + dnl Issue all warnings + dnl tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra -Wpadded" + fi + ;; + # + WATCOM_WINDOWS_C) + # + dnl Placeholder + tmp_CFLAGS="$tmp_CFLAGS" + ;; + # esac # tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` -- cgit v1.2.1 From bf8d642607f49355d22e47eca09a79485a3fd1a9 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 14 Oct 2008 04:59:22 +0000 Subject: fix syntax error --- m4/curl-compilers.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 03d35cdf4..52f30b122 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -946,7 +946,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # if test "$want_warnings" = "yes"; then dnl Issue all warnings - dnl tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra -Wpadded" + tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra -Wpadded" fi ;; # -- cgit v1.2.1 From fde4b823f161ecec52423b7a79e380db915bfbb3 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 14 Oct 2008 14:19:34 +0000 Subject: Adjust GCC warnings: Better disable following warnings when cross-compiling with a gcc older than 3.0, to avoid warnings from third party system headers: -Wmissing-declarations -Wmissing-prototypes -Wunused -Wshadow --- m4/curl-compilers.m4 | 92 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 31 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 52f30b122..9232f4ca4 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 28 +# serial 31 dnl CURL_CHECK_COMPILER @@ -793,65 +793,95 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ GNU_C) # if test "$want_warnings" = "yes"; then + # dnl Do not enable -pedantic when cross-compiling with a gcc older dnl than 3.0, to avoid warnings from third party system headers. if test "x$cross_compiling" != "xyes" || test "$compiler_num" -ge "300"; then tmp_CFLAGS="$tmp_CFLAGS -pedantic" fi + # dnl Set of options we believe *ALL* gcc versions support: - tmp_CFLAGS="$tmp_CFLAGS -Wall -W -Winline -Wnested-externs" - tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" - dnl -Wcast-align is a bit too annoying on all gcc versions ;-) - dnl Do not enable some warnings, when cross-compiling with a gcc - dnl older than 3.0, triggered on third party system headers. - if test "x$cross_compiling" != "xyes" || - test "$compiler_num" -ge "300"; then - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" + tmp_CFLAGS="$tmp_CFLAGS -Wall -W" + # + dnl Only gcc 1.4 or later + if test "$compiler_num" -ge "104"; then + tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" + dnl If not cross-compiling with a gcc older than 3.0 + if test "x$cross_compiling" != "xyes" || + test "$compiler_num" -ge "300"; then + tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow" + fi fi + # + dnl Only gcc 2.7 or later if test "$compiler_num" -ge "207"; then - dnl gcc 2.7 or later - tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" + tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" + dnl If not cross-compiling with a gcc older than 3.0 + if test "x$cross_compiling" != "xyes" || + test "$compiler_num" -ge "300"; then + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" + fi fi - if test "$compiler_num" -gt "295"; then - dnl only if the compiler is newer than 2.95 since we got lots of - dnl "`_POSIX_C_SOURCE' is not defined" in system headers with - dnl gcc 2.95.4 on FreeBSD 4.9! - tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long -Wno-multichar -Wshadow" - tmp_CFLAGS="$tmp_CFLAGS -Wsign-compare -Wundef" + # + dnl Only gcc 2.95 or later + if test "$compiler_num" -ge "295"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" fi + # + dnl Only gcc 2.96 or later if test "$compiler_num" -ge "296"; then - dnl gcc 2.96 or later tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" + tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" + dnl -Wundef used only if gcc is 2.96 or later since we get + dnl lots of "`_POSIX_C_SOURCE' is not defined" in system + dnl headers with gcc 2.95.4 on FreeBSD 4.9 + tmp_CFLAGS="$tmp_CFLAGS -Wundef" fi - if test "$compiler_num" -gt "296"; then - dnl this option does not exist in 2.96 + # + dnl Only gcc 2.97 or later + if test "$compiler_num" -ge "297"; then tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" fi - dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on - dnl on i686-Linux as it gives us heaps with false positives. - dnl Also, on gcc 4.0.X it is totally unbearable and complains all - dnl over making it unusable for generic purposes. Let's not use it. + # + dnl Only gcc 3.0 or later + if test "$compiler_num" -ge "300"; then + dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on + dnl on i686-Linux as it gives us heaps with false positives. + dnl Also, on gcc 4.0.X it is totally unbearable and complains all + dnl over making it unusable for generic purposes. Let's not use it. + tmp_CFLAGS="$tmp_CFLAGS" + fi + # + dnl Only gcc 3.3 or later if test "$compiler_num" -ge "303"; then - dnl gcc 3.3 and later tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" fi + # + dnl Only gcc 3.4 or later if test "$compiler_num" -ge "304"; then - dnl gcc 3.4 and later tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi + # fi # dnl Do not issue warnings for code in system include paths. if test "$compiler_num" -ge "300"; then - dnl gcc 3.0 and later tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" else - dnl Disable some warnings, when cross-compiling with a gcc - dnl older than 3.0, triggered on third party system headers. + dnl When cross-compiling with a gcc older than 3.0, disable + dnl some warnings triggered on third party system headers. if test "x$cross_compiling" = "xyes"; then - tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" - tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" + if test "$compiler_num" -ge "104"; then + dnl gcc 1.4 or later + tmp_CFLAGS="$tmp_CFLAGS -Wno-unused -Wno-shadow" + fi + if test "$compiler_num" -ge "207"; then + dnl gcc 2.7 or later + tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-declarations" + tmp_CFLAGS="$tmp_CFLAGS -Wno-missing-prototypes" + fi fi fi ;; -- cgit v1.2.1 From 9786e7faebdac77a13e58c62cc9a7af14ac2e5e6 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 14 Oct 2008 15:24:02 +0000 Subject: Adjust Tiny C basic options: Remove -b from debug-enabled configuration, as Tiny C might have been built without the memory and bounds checker support. --- m4/curl-compilers.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 9232f4ca4..1598ad6fd 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 31 +# serial 32 dnl CURL_CHECK_COMPILER @@ -331,7 +331,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_TINY_C], [ AC_MSG_RESULT([yes]) compiler_id="TINY_C" flags_dbg_all="-g -b" - flags_dbg_yes="-g -b" + flags_dbg_yes="-g" flags_dbg_off="" flags_opt_all="" flags_opt_yes="" -- cgit v1.2.1 From 2f2ed4e40ebb31c80fdaeff2ab9c48d8e1654f02 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 14 Oct 2008 23:06:39 +0000 Subject: Adjust Watcom C warnings: Disable warnings on structure members padding. --- m4/curl-compilers.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 1598ad6fd..b97315f22 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 32 +# serial 33 dnl CURL_CHECK_COMPILER @@ -976,7 +976,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # if test "$want_warnings" = "yes"; then dnl Issue all warnings - tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra -Wpadded" + tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" fi ;; # -- cgit v1.2.1 From be760bed7e544136eaa175f0fe58251da1ff6e41 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 15 Oct 2008 18:10:02 +0000 Subject: Ensure that shell variable contents which have active meaning to the shell echo command are not interpreted when trying to remove extra whitespace from shell variable content. --- m4/curl-compilers.m4 | 74 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 16 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index b97315f22..860db5200 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 33 +# serial 34 dnl CURL_CHECK_COMPILER @@ -384,6 +384,7 @@ dnl headers from these locations, even though this is dnl not reliable on ancient GNUC versions. AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ + AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl tmp_has_include="no" tmp_chg_FLAGS=$CFLAGS for word1 in $tmp_chg_FLAGS; do @@ -396,7 +397,8 @@ AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/ -I/ -isystem /g'` - CFLAGS=`eval echo $tmp_chg_FLAGS` + CFLAGS="$tmp_chg_FLAGS" + squeeze CFLAGS fi tmp_has_include="no" tmp_chg_FLAGS=$CPPFLAGS @@ -410,7 +412,8 @@ AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ if test "$tmp_has_include" = "yes"; then tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/^-I/ -isystem /g'` tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/ -I/ -isystem /g'` - CPPFLAGS=`eval echo $tmp_chg_FLAGS` + CPPFLAGS="$tmp_chg_FLAGS" + squeeze CPPFLAGS fi ]) @@ -493,6 +496,7 @@ dnl options. AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ AC_REQUIRE([CURL_CHECK_COMPILER])dnl + AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # @@ -621,13 +625,15 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # esac # - tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` - tmp_CFLAGS=`eval echo $tmp_CFLAGS` + squeeze tmp_CPPFLAGS + squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts some basic options]) - CPPFLAGS=`eval echo $tmp_save_CPPFLAGS $tmp_CPPFLAGS` - CFLAGS=`eval echo $tmp_save_CFLAGS $tmp_CFLAGS` + CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" + squeeze CPPFLAGS + squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) @@ -652,6 +658,7 @@ dnl on configure's debug option. AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl + AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # @@ -673,8 +680,10 @@ AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ tmp_options="$flags_dbg_off" fi # - CPPFLAGS=`eval echo $tmp_CPPFLAGS` - CFLAGS=`eval echo $tmp_CFLAGS $tmp_options` + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS $tmp_options" + squeeze CPPFLAGS + squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_options]) @@ -698,6 +707,7 @@ dnl on configure's optimize option. AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_OPTIMIZE])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl + AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # @@ -746,8 +756,10 @@ AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ AC_MSG_CHECKING([if compiler accepts optimizer disabling options]) tmp_options="$flags_opt_off" fi - CPPFLAGS=`eval echo $tmp_CPPFLAGS` - CFLAGS=`eval echo $tmp_CFLAGS $tmp_options` + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS $tmp_options" + squeeze CPPFLAGS + squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_options]) @@ -772,6 +784,7 @@ dnl configure's warnings given option. AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_WARNINGS])dnl AC_REQUIRE([CURL_CHECK_COMPILER])dnl + AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl # if test "$compiler_id" != "unknown"; then # @@ -988,13 +1001,15 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # esac # - tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS` - tmp_CFLAGS=`eval echo $tmp_CFLAGS` + squeeze tmp_CPPFLAGS + squeeze tmp_CFLAGS # if test ! -z "$tmp_CFLAGS" || test ! -z "$tmp_CPPFLAGS"; then AC_MSG_CHECKING([if compiler accepts strict warning options]) - CPPFLAGS=`eval echo $tmp_save_CPPFLAGS $tmp_CPPFLAGS` - CFLAGS=`eval echo $tmp_save_CFLAGS $tmp_CFLAGS` + CPPFLAGS="$tmp_save_CPPFLAGS $tmp_CPPFLAGS" + CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" + squeeze CPPFLAGS + squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ AC_MSG_RESULT([yes]) AC_MSG_NOTICE([compiler options added: $tmp_CFLAGS $tmp_CPPFLAGS]) @@ -1011,6 +1026,28 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ ]) +dnl CURL_SHFUNC_SQUEEZE +dnl ------------------------------------------------- +dnl Declares a shell function squeeze() which removes +dnl redundant whitespace out of a shell variable. + +AC_DEFUN([CURL_SHFUNC_SQUEEZE], [ +squeeze() { + _sqz_result="" + eval _sqz_input=\[$][$]1 + for _sqz_token in $_sqz_input; do + if test -z "$_sqz_result"; then + _sqz_result="$_sqz_token" + else + _sqz_result="$_sqz_result $_sqz_token" + fi + done + eval [$]1=\$_sqz_result + return 0 +} +]) + + dnl CURL_PROCESS_DEBUG_BUILD_OPTS dnl ------------------------------------------------- dnl Settings which depend on configure's debug given @@ -1019,10 +1056,12 @@ dnl Don't use this macro for compiler dependant stuff. AC_DEFUN([CURL_PROCESS_DEBUG_BUILD_OPTS], [ AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl + AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl # if test "$want_debug" = "yes"; then CPPFLAGS="$CPPFLAGS -DCURLDEBUG" + squeeze CPPFLAGS fi # ]) @@ -1086,6 +1125,7 @@ dnl as whitespace separated lists of words. Each word dnl from VALUE is removed from VARNAME when present. AC_DEFUN([CURL_VAR_STRIP], [ + AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl ac_var_stripped="" for word1 in $[$1]; do ac_var_strip_word="no" @@ -1099,5 +1139,7 @@ AC_DEFUN([CURL_VAR_STRIP], [ fi done dnl squeeze whitespace out of result - [$1]=`eval echo $ac_var_stripped` + [$1]="$ac_var_stripped" + squeeze [$1] ]) + -- cgit v1.2.1 From fb66d5179663efbc143816d056630e2d98cf98f8 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 16 Oct 2008 01:45:07 +0000 Subject: some more temporary magic for the icc seg-fault issue --- m4/curl-compilers.m4 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 860db5200..0ccba96a1 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -922,10 +922,20 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$want_warnings" = "yes"; then if test "$compiler_num" -gt "600"; then dnl Show errors, warnings, and remarks - tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall" + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" dnl Perform extra compile-time code checking tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" fi + dnl Disable using EBP register in optimizations + tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" + dnl Disable inline expansion of intrinsic functions + tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" + dnl Disable inlining of functions + tmp_CFLAGS="$tmp_CFLAGS -fno-inline" + dnl Enable floating-point stack integrity checks + tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" + dnl Enable run-time detection of buffer overruns. + tmp_CFLAGS="$tmp_CFLAGS -fstack-security-check" fi ;; # -- cgit v1.2.1 From 07c3aaeea116603f58e8ebbcf8f4f7a39e761ef7 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 17 Oct 2008 17:11:11 +0000 Subject: fix missing double-quotes --- m4/curl-compilers.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 0ccba96a1..1b19c59c3 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -386,7 +386,7 @@ dnl not reliable on ancient GNUC versions. AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl tmp_has_include="no" - tmp_chg_FLAGS=$CFLAGS + tmp_chg_FLAGS="$CFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) @@ -395,13 +395,13 @@ AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ esac done if test "$tmp_has_include" = "yes"; then - tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/^-I/ -isystem /g'` - tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/ -I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CFLAGS="$tmp_chg_FLAGS" squeeze CFLAGS fi tmp_has_include="no" - tmp_chg_FLAGS=$CPPFLAGS + tmp_chg_FLAGS="$CPPFLAGS" for word1 in $tmp_chg_FLAGS; do case "$word1" in -I*) @@ -410,8 +410,8 @@ AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ esac done if test "$tmp_has_include" = "yes"; then - tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/^-I/ -isystem /g'` - tmp_chg_FLAGS=`echo $tmp_chg_FLAGS | sed 's/ -I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` CPPFLAGS="$tmp_chg_FLAGS" squeeze CPPFLAGS fi -- cgit v1.2.1 From 8d0cbaf8df1544d288131eb47a04ff0aefd88f16 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 19 Oct 2008 23:50:18 +0000 Subject: messages initially intended only for debug purposes, now become permanent since these are extremely useful when compiler rejects a set of options. --- m4/curl-compilers.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 1b19c59c3..36d8d2774 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 34 +# serial 37 dnl CURL_CHECK_COMPILER @@ -438,7 +438,7 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ ],[ tmp_compiler_works="no" echo " " >&6 - sed 's/^/cc-fail> /' conftest.err >&6 + sed 's/^/cc-fail: /' conftest.err >&6 echo " " >&6 ]) dnl linking capability verification @@ -454,7 +454,7 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ ],[ tmp_compiler_works="no" echo " " >&6 - sed 's/^/ln-fail> /' conftest.err >&6 + sed 's/^/link-fail: /' conftest.err >&6 echo " " >&6 ]) fi @@ -475,7 +475,7 @@ AC_DEFUN([CURL_COMPILER_WORKS_IFELSE], [ ],[ tmp_compiler_works="no" echo " " >&6 - echo "rn-fail test program exited with status $ac_status" >&6 + echo "run-fail: test program exited with status $ac_status" >&6 echo " " >&6 ]) fi -- cgit v1.2.1 From 231a51fe7ac4f21d3e8d6dd5b6e039e1aa304406 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 20 Oct 2008 15:56:08 +0000 Subject: some more temporary magic for the icc seg-fault issue --- m4/curl-compilers.m4 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 36d8d2774..f43b582cf 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 37 +# serial 38 dnl CURL_CHECK_COMPILER @@ -569,10 +569,6 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ dnl #981: operands are evaluated in unspecified order dnl #1469: "cc" clobber ignored tmp_CPPFLAGS="$tmp_CPPFLAGS -wd 279,981,1469" - dnl Disable use of ANSI C aliasing rules in optimizations - tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" - dnl Disable floating point optimizations - tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" ;; # INTEL_WINDOWS_C) @@ -936,6 +932,16 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" dnl Enable run-time detection of buffer overruns. tmp_CFLAGS="$tmp_CFLAGS -fstack-security-check" + dnl Disable use of ANSI C aliasing rules in optimizations + tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" + dnl Disable floating point optimizations + tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" + dnl Assume aliasing in the program. + tmp_CFLAGS="$tmp_CFLAGS -falias" + dnl Assume that arguments may be aliased. + tmp_CFLAGS="$tmp_CFLAGS -alias-args" + dnl Assume aliasing within functions + tmp_CFLAGS="$tmp_CFLAGS -ffnalias" fi ;; # -- cgit v1.2.1 From db325d1f4384e9e1693c5ddc1c2726e8cfa6a236 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 21 Oct 2008 17:54:18 +0000 Subject: some more temporary magic for the icc seg-fault issue --- m4/curl-compilers.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index f43b582cf..5061b0df7 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -921,6 +921,8 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" dnl Perform extra compile-time code checking tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" + dnl Generate inlining diagnostics + tmp_CPPFLAGS="$tmp_CPPFLAGS -Winline" fi dnl Disable using EBP register in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" @@ -928,6 +930,12 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" dnl Disable inlining of functions tmp_CFLAGS="$tmp_CFLAGS -fno-inline" + dnl Disable some IPO for single file optimizations + tmp_CFLAGS="$tmp_CFLAGS -fno-inline-functions" + dnl Disable inlining of standard library functions + tmp_CFLAGS="$tmp_CFLAGS -nolib-inline" + dnl Disable inlining of user-defined functions + tmp_CFLAGS="$tmp_CFLAGS -Ob0" dnl Enable floating-point stack integrity checks tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" dnl Enable run-time detection of buffer overruns. -- cgit v1.2.1 From b93f4f623c7627919d5f29944b4e56882776732e Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 22 Oct 2008 13:30:09 +0000 Subject: some more temporary magic for the icc seg-fault issue --- m4/curl-compilers.m4 | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 5061b0df7..05ce76c4a 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 38 +# serial 40 dnl CURL_CHECK_COMPILER @@ -191,6 +191,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent]) if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then AC_MSG_RESULT([yes]) + CURL_CHECK_DEF([__i386__], [], [silent]) CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then compiler_id="INTEL_UNIX_C" @@ -200,6 +201,13 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" + dnl icc 9.1 optimization on IA32 triggers SIGSEGV + if test "$curl_cv_have_def___i386__" = "yes" && + test "$compiler_num" -eq "910"; then + INTEL_UNIX_C_OPT_SIGSEGV="yes" + else + INTEL_UNIX_C_OPT_SIGSEGV="no" + fi else compiler_id="INTEL_WINDOWS_C" flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" @@ -921,11 +929,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" dnl Perform extra compile-time code checking tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" - dnl Generate inlining diagnostics - tmp_CPPFLAGS="$tmp_CPPFLAGS -Winline" fi dnl Disable using EBP register in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" + dnl Disable inlining of user-defined functions + tmp_CFLAGS="$tmp_CFLAGS -Ob0" dnl Disable inline expansion of intrinsic functions tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" dnl Disable inlining of functions @@ -934,8 +942,8 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -fno-inline-functions" dnl Disable inlining of standard library functions tmp_CFLAGS="$tmp_CFLAGS -nolib-inline" - dnl Disable inlining of user-defined functions - tmp_CFLAGS="$tmp_CFLAGS -Ob0" + dnl Disable full and partial inlining when IPO + tmp_CFLAGS="$tmp_CFLAGS -ip-no-inlining" dnl Enable floating-point stack integrity checks tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" dnl Enable run-time detection of buffer overruns. @@ -950,6 +958,10 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -alias-args" dnl Assume aliasing within functions tmp_CFLAGS="$tmp_CFLAGS -ffnalias" + dnl Disable prefetch insertion optimization + tmp_CFLAGS="$tmp_CFLAGS -no-prefetch" + dnl Disable loop unrolling optimization + tmp_CFLAGS="$tmp_CFLAGS -unroll0" fi ;; # -- cgit v1.2.1 From 198fa5e3c7354101ba3e01c4ec63e1bede58022d Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 23 Oct 2008 10:04:06 +0000 Subject: icc adjustments: Enable more icc warnings. Optimization disabling options used only for icc 9.1 --- m4/curl-compilers.m4 | 81 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 30 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 05ce76c4a..5cb950e34 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 40 +# serial 41 dnl CURL_CHECK_COMPILER @@ -929,39 +929,60 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CPPFLAGS="$tmp_CPPFLAGS -Wall -w2" dnl Perform extra compile-time code checking tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcheck" + dnl Warn on nested comments + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wcomment" + dnl Show warnings relative to deprecated features + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wdeprecated" + dnl Enable warnings for missing prototypes + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wmissing-prototypes" + dnl Enable warnings for 64-bit portability issues + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wp64" + dnl Enable warnings for questionable pointer arithmetic + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wpointer-arith" + dnl Check for function return typw issues + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wreturn-type" + dnl Warn on variable declarations hiding a previous one + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wshadow" + dnl Warn when a variable is used before initialized + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wuninitialized" + dnl Warn if a declared function is not used + tmp_CPPFLAGS="$tmp_CPPFLAGS -Wunused-function" fi dnl Disable using EBP register in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" - dnl Disable inlining of user-defined functions - tmp_CFLAGS="$tmp_CFLAGS -Ob0" - dnl Disable inline expansion of intrinsic functions - tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" - dnl Disable inlining of functions - tmp_CFLAGS="$tmp_CFLAGS -fno-inline" - dnl Disable some IPO for single file optimizations - tmp_CFLAGS="$tmp_CFLAGS -fno-inline-functions" - dnl Disable inlining of standard library functions - tmp_CFLAGS="$tmp_CFLAGS -nolib-inline" - dnl Disable full and partial inlining when IPO - tmp_CFLAGS="$tmp_CFLAGS -ip-no-inlining" - dnl Enable floating-point stack integrity checks - tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" - dnl Enable run-time detection of buffer overruns. - tmp_CFLAGS="$tmp_CFLAGS -fstack-security-check" dnl Disable use of ANSI C aliasing rules in optimizations tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" - dnl Disable floating point optimizations - tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" - dnl Assume aliasing in the program. - tmp_CFLAGS="$tmp_CFLAGS -falias" - dnl Assume that arguments may be aliased. - tmp_CFLAGS="$tmp_CFLAGS -alias-args" - dnl Assume aliasing within functions - tmp_CFLAGS="$tmp_CFLAGS -ffnalias" - dnl Disable prefetch insertion optimization - tmp_CFLAGS="$tmp_CFLAGS -no-prefetch" - dnl Disable loop unrolling optimization - tmp_CFLAGS="$tmp_CFLAGS -unroll0" + dnl Disable some optimizations to debug icc 9.1 SIGSEGV + if test "$INTEL_UNIX_C_OPT_SIGSEGV" = "yes"; then + dnl Disable inlining of user-defined functions + tmp_CFLAGS="$tmp_CFLAGS -Ob0" + dnl Disable inline expansion of intrinsic functions + tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" + dnl Disable inlining of functions + tmp_CFLAGS="$tmp_CFLAGS -fno-inline" + dnl Disable some IPO for single file optimizations + tmp_CFLAGS="$tmp_CFLAGS -fno-inline-functions" + dnl Disable inlining of standard library functions + tmp_CFLAGS="$tmp_CFLAGS -nolib-inline" + dnl Disable full and partial inlining when IPO + tmp_CFLAGS="$tmp_CFLAGS -ip-no-inlining" + dnl Enable floating-point stack integrity checks + tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" + dnl Enable run-time detection of buffer overruns. + tmp_CFLAGS="$tmp_CFLAGS -fstack-security-check" + dnl Disable floating point optimizations + tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" + dnl Assume aliasing in the program. + tmp_CFLAGS="$tmp_CFLAGS -falias" + dnl Assume that arguments may be aliased. + tmp_CFLAGS="$tmp_CFLAGS -alias-args" + dnl Assume aliasing within functions + tmp_CFLAGS="$tmp_CFLAGS -ffnalias" + dnl Disable prefetch insertion optimization + tmp_CFLAGS="$tmp_CFLAGS -no-prefetch" + dnl Disable loop unrolling optimization + tmp_CFLAGS="$tmp_CFLAGS -unroll0" + fi fi ;; # @@ -976,7 +997,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$want_warnings" = "yes"; then dnl Highest warning level is double -A, next is single -A. dnl Due to the big number of warnings these trigger on third - dnl party header files it is impratical for us to use any of + dnl party header files it is impractical for us to use any of dnl them here. If you want them simply define it in CPPFLAGS. tmp_CFLAGS="$tmp_CFLAGS" fi -- cgit v1.2.1 From 2b77d50776a5732dd5c0aeb84ce1e67836e4d443 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 24 Oct 2008 11:27:09 +0000 Subject: icc permanent adjustment: Select precise floating-point model, otherwise doubles are less than 64-bit wide icc test adjustment: Select c89 dialect --- m4/curl-compilers.m4 | 78 +++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 5cb950e34..75ffac326 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 41 +# serial 42 dnl CURL_CHECK_COMPILER @@ -191,6 +191,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ CURL_CHECK_DEF([__INTEL_COMPILER], [], [silent]) if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then AC_MSG_RESULT([yes]) + compiler_num="$curl_cv_def___INTEL_COMPILER" CURL_CHECK_DEF([__i386__], [], [silent]) CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then @@ -224,7 +225,6 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ flags_opt_yes="/O2" flags_opt_off="/Od" fi - compiler_num="$curl_cv_def___INTEL_COMPILER" else AC_MSG_RESULT([no]) fi @@ -565,7 +565,9 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # dnl On unix this compiler uses gcc's header files, so dnl we select ANSI C89 dialect plus GNU extensions. - tmp_CPPFLAGS="$tmp_CPPFLAGS -std=gnu89" + dnl tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" + dnl Select ANSI C89 dialect without GNU extensions. + tmp_CFLAGS="$tmp_CFLAGS -std=c89" dnl Change some warnings into errors dnl #140: too many arguments in function call dnl #147: declaration is incompatible with 'previous one' @@ -948,41 +950,41 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Warn if a declared function is not used tmp_CPPFLAGS="$tmp_CPPFLAGS -Wunused-function" fi - dnl Disable using EBP register in optimizations - tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" - dnl Disable use of ANSI C aliasing rules in optimizations - tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" - dnl Disable some optimizations to debug icc 9.1 SIGSEGV - if test "$INTEL_UNIX_C_OPT_SIGSEGV" = "yes"; then - dnl Disable inlining of user-defined functions - tmp_CFLAGS="$tmp_CFLAGS -Ob0" - dnl Disable inline expansion of intrinsic functions - tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" - dnl Disable inlining of functions - tmp_CFLAGS="$tmp_CFLAGS -fno-inline" - dnl Disable some IPO for single file optimizations - tmp_CFLAGS="$tmp_CFLAGS -fno-inline-functions" - dnl Disable inlining of standard library functions - tmp_CFLAGS="$tmp_CFLAGS -nolib-inline" - dnl Disable full and partial inlining when IPO - tmp_CFLAGS="$tmp_CFLAGS -ip-no-inlining" - dnl Enable floating-point stack integrity checks - tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" - dnl Enable run-time detection of buffer overruns. - tmp_CFLAGS="$tmp_CFLAGS -fstack-security-check" - dnl Disable floating point optimizations - tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" - dnl Assume aliasing in the program. - tmp_CFLAGS="$tmp_CFLAGS -falias" - dnl Assume that arguments may be aliased. - tmp_CFLAGS="$tmp_CFLAGS -alias-args" - dnl Assume aliasing within functions - tmp_CFLAGS="$tmp_CFLAGS -ffnalias" - dnl Disable prefetch insertion optimization - tmp_CFLAGS="$tmp_CFLAGS -no-prefetch" - dnl Disable loop unrolling optimization - tmp_CFLAGS="$tmp_CFLAGS -unroll0" - fi + fi + dnl Disable using EBP register in optimizations + tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" + dnl Disable use of ANSI C aliasing rules in optimizations + tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" + dnl Value-safe optimizations on floating-point data + tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" + dnl Disable some optimizations to debug icc 9.1 SIGSEGV + if test "$INTEL_UNIX_C_OPT_SIGSEGV" = "yes"; then + dnl Disable inlining of user-defined functions + tmp_CFLAGS="$tmp_CFLAGS -Ob0" + dnl Disable inline expansion of intrinsic functions + tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" + dnl Disable inlining of functions + tmp_CFLAGS="$tmp_CFLAGS -fno-inline" + dnl Disable some IPO for single file optimizations + tmp_CFLAGS="$tmp_CFLAGS -fno-inline-functions" + dnl Disable inlining of standard library functions + tmp_CFLAGS="$tmp_CFLAGS -nolib-inline" + dnl Disable full and partial inlining when IPO + tmp_CFLAGS="$tmp_CFLAGS -ip-no-inlining" + dnl Enable floating-point stack integrity checks + tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" + dnl Enable run-time detection of buffer overruns. + tmp_CFLAGS="$tmp_CFLAGS -fstack-security-check" + dnl Assume aliasing in the program. + tmp_CFLAGS="$tmp_CFLAGS -falias" + dnl Assume that arguments may be aliased. + tmp_CFLAGS="$tmp_CFLAGS -alias-args" + dnl Assume aliasing within functions + tmp_CFLAGS="$tmp_CFLAGS -ffnalias" + dnl Disable prefetch insertion optimization + tmp_CFLAGS="$tmp_CFLAGS -no-prefetch" + dnl Disable loop unrolling optimization + tmp_CFLAGS="$tmp_CFLAGS -unroll0" fi ;; # -- cgit v1.2.1 From 71edaf4d01c9f0bffa3f51354c1611c3969a2383 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 24 Oct 2008 12:23:24 +0000 Subject: some more temporary magic for the icc seg-fault issue --- m4/curl-compilers.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 75ffac326..e0cf59fe3 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -957,8 +957,17 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" dnl Value-safe optimizations on floating-point data tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" + dnl Only icc 10.0 or later + if test "$compiler_num" -ge "1000"; then + dnl Disable vectorizer diagnostic information + tmp_CFLAGS="$tmp_CFLAGS -vec-report0" + fi dnl Disable some optimizations to debug icc 9.1 SIGSEGV if test "$INTEL_UNIX_C_OPT_SIGSEGV" = "yes"; then + dnl Disable interprocedural optimizations + tmp_CFLAGS="$tmp_CFLAGS -no-ip -no-ipo" + dnl Separate functions for the linker + tmp_CFLAGS="$tmp_CFLAGS -ffunction-sections" dnl Disable inlining of user-defined functions tmp_CFLAGS="$tmp_CFLAGS -Ob0" dnl Disable inline expansion of intrinsic functions -- cgit v1.2.1 From d104216bbeed0b4ed13063f3b627d4d9527b6b08 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 25 Oct 2008 04:18:48 +0000 Subject: icc adjustments: Select ANSI C89 dialect plus GNU extensions, again. --- m4/curl-compilers.m4 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index e0cf59fe3..f01214d0f 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 42 +# serial 44 dnl CURL_CHECK_COMPILER @@ -565,9 +565,7 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # dnl On unix this compiler uses gcc's header files, so dnl we select ANSI C89 dialect plus GNU extensions. - dnl tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" - dnl Select ANSI C89 dialect without GNU extensions. - tmp_CFLAGS="$tmp_CFLAGS -std=c89" + tmp_CFLAGS="$tmp_CFLAGS -std=gnu89" dnl Change some warnings into errors dnl #140: too many arguments in function call dnl #147: declaration is incompatible with 'previous one' -- cgit v1.2.1 From 820011dedc4463c86d114e13f0754196f855b7e7 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 17 Nov 2008 21:11:10 +0000 Subject: Added more compiler warning options for gcc 4.3 --- m4/curl-compilers.m4 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index f01214d0f..85ba2a3e2 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -881,6 +881,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi # + dnl Only gcc 4.3 or later + if test "$compiler_num" -ge "403"; then + tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers" + fi + # fi # dnl Do not issue warnings for code in system include paths. -- cgit v1.2.1 From c36f0e71b6f6e2e04a5ad0ed96887c502452bef8 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 18 Nov 2008 20:13:55 +0000 Subject: attempting to keep lines below 80 chars --- m4/curl-compilers.m4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 85ba2a3e2..d832a6fd8 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 44 +# serial 46 dnl CURL_CHECK_COMPILER @@ -883,7 +883,9 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # dnl Only gcc 4.3 or later if test "$compiler_num" -ge "403"; then - tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration -Wmissing-parameter-type -Wempty-body -Wclobbered -Wignored-qualifiers" + tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration" + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-parameter-type -Wempty-body" + tmp_CFLAGS="$tmp_CFLAGS -Wclobbered -Wignored-qualifiers" fi # fi -- cgit v1.2.1 From 9bb1854398738ce1779363ec01a18daa26278772 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 15 Apr 2009 22:54:25 +0000 Subject: Set HP-UX compiler warning level back to the one that exposes the socklen_t issue on this platform. --- m4/curl-compilers.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index d832a6fd8..ffd906dbe 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 46 +# serial 47 dnl CURL_CHECK_COMPILER @@ -914,11 +914,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # if test "$want_warnings" = "yes"; then dnl Issue all warnings - dnl tmp_CFLAGS="$tmp_CFLAGS +w1" + tmp_CFLAGS="$tmp_CFLAGS +w1" dnl Due to the HP-UX socklen_t issue it is insane to use the +w1 dnl warning level. Until the issue is somehow fixed we will just dnl use the +w2 warning level. - tmp_CFLAGS="$tmp_CFLAGS +w2" + dnl tmp_CFLAGS="$tmp_CFLAGS +w2" fi ;; # -- cgit v1.2.1 From f6b55fae7971f63d5e02efad9d97d3b04f417f63 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 17 Apr 2009 07:48:37 +0000 Subject: remove compiler options used while debugging the icc 9.1 optimizer issue --- m4/curl-compilers.m4 | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index ffd906dbe..898d38fa3 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 47 +# serial 48 dnl CURL_CHECK_COMPILER @@ -192,7 +192,6 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ if test "$curl_cv_have_def___INTEL_COMPILER" = "yes"; then AC_MSG_RESULT([yes]) compiler_num="$curl_cv_def___INTEL_COMPILER" - CURL_CHECK_DEF([__i386__], [], [silent]) CURL_CHECK_DEF([__unix__], [], [silent]) if test "$curl_cv_have_def___unix__" = "yes"; then compiler_id="INTEL_UNIX_C" @@ -202,13 +201,6 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" - dnl icc 9.1 optimization on IA32 triggers SIGSEGV - if test "$curl_cv_have_def___i386__" = "yes" && - test "$compiler_num" -eq "910"; then - INTEL_UNIX_C_OPT_SIGSEGV="yes" - else - INTEL_UNIX_C_OPT_SIGSEGV="no" - fi else compiler_id="INTEL_WINDOWS_C" flags_dbg_all="/ZI /Zi /zI /zi /ZD /Zd /zD /zd /Z7 /z7 /Oy /Oy-" @@ -967,39 +959,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Disable vectorizer diagnostic information tmp_CFLAGS="$tmp_CFLAGS -vec-report0" fi - dnl Disable some optimizations to debug icc 9.1 SIGSEGV - if test "$INTEL_UNIX_C_OPT_SIGSEGV" = "yes"; then - dnl Disable interprocedural optimizations - tmp_CFLAGS="$tmp_CFLAGS -no-ip -no-ipo" - dnl Separate functions for the linker - tmp_CFLAGS="$tmp_CFLAGS -ffunction-sections" - dnl Disable inlining of user-defined functions - tmp_CFLAGS="$tmp_CFLAGS -Ob0" - dnl Disable inline expansion of intrinsic functions - tmp_CFLAGS="$tmp_CFLAGS -fno-builtin" - dnl Disable inlining of functions - tmp_CFLAGS="$tmp_CFLAGS -fno-inline" - dnl Disable some IPO for single file optimizations - tmp_CFLAGS="$tmp_CFLAGS -fno-inline-functions" - dnl Disable inlining of standard library functions - tmp_CFLAGS="$tmp_CFLAGS -nolib-inline" - dnl Disable full and partial inlining when IPO - tmp_CFLAGS="$tmp_CFLAGS -ip-no-inlining" - dnl Enable floating-point stack integrity checks - tmp_CFLAGS="$tmp_CFLAGS -fpstkchk" - dnl Enable run-time detection of buffer overruns. - tmp_CFLAGS="$tmp_CFLAGS -fstack-security-check" - dnl Assume aliasing in the program. - tmp_CFLAGS="$tmp_CFLAGS -falias" - dnl Assume that arguments may be aliased. - tmp_CFLAGS="$tmp_CFLAGS -alias-args" - dnl Assume aliasing within functions - tmp_CFLAGS="$tmp_CFLAGS -ffnalias" - dnl Disable prefetch insertion optimization - tmp_CFLAGS="$tmp_CFLAGS -no-prefetch" - dnl Disable loop unrolling optimization - tmp_CFLAGS="$tmp_CFLAGS -unroll0" - fi ;; # INTEL_WINDOWS_C) -- cgit v1.2.1 From cfda3e6a48fdeb2a3ffd9358a38666c2a1a6038b Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 7 May 2009 11:06:48 +0000 Subject: Moved *_CHECK_COMPILER_HALT_ON_ERROR and *_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE to *-compilers.m4 along with other *_CHECK_COMPILER_* --- m4/curl-compilers.m4 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 898d38fa3..adff294ad 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 48 +# serial 49 dnl CURL_CHECK_COMPILER @@ -380,8 +380,8 @@ dnl ------------------------------------------------- dnl Changes standard include paths present in CFLAGS dnl and CPPFLAGS into isystem include paths. This is dnl done to prevent GNUC from generating warnings on -dnl headers from these locations, even though this is -dnl not reliable on ancient GNUC versions. +dnl headers from these locations, although on ancient +dnl GNUC versions these warnings are not silenced. AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl @@ -1113,6 +1113,53 @@ AC_DEFUN([CURL_CHECK_PROG_CC], [ ]) +dnl CURL_CHECK_COMPILER_HALT_ON_ERROR +dnl ------------------------------------------------- +dnl Verifies if the compiler actually halts after the +dnl compilation phase without generating any object +dnl code file, when the source compiles with errors. + +AC_DEFUN([CURL_CHECK_COMPILER_HALT_ON_ERROR], [ + AC_MSG_CHECKING([if compiler halts on compilation errors]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + force compilation error + ]]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([compiler does not halt on compilation errors.]) + ],[ + AC_MSG_RESULT([yes]) + ]) +]) + + +dnl CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE +dnl ------------------------------------------------- +dnl Verifies if the compiler actually halts after the +dnl compilation phase without generating any object +dnl code file, when the source code tries to define a +dnl type for a constant array with negative dimension. + +AC_DEFUN([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [ + AC_REQUIRE([CURL_CHECK_COMPILER_HALT_ON_ERROR])dnl + AC_MSG_CHECKING([if compiler halts on negative sized arrays]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ]; + ]],[[ + bad_t dummy; + ]]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([compiler does not halt on negative sized arrays.]) + ],[ + AC_MSG_RESULT([yes]) + ]) +]) + + dnl CURL_VAR_MATCH (VARNAME, VALUE) dnl ------------------------------------------------- dnl Verifies if shell variable VARNAME contains VALUE. -- cgit v1.2.1 From 7a928b40f3d2615021faa1e1c921e30d5c983875 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 7 May 2009 13:58:15 +0000 Subject: Proper naming for the experimental compiler test and moved to *-compilers.m4 --- m4/curl-compilers.m4 | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index adff294ad..e1337d961 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 49 +# serial 50 dnl CURL_CHECK_COMPILER @@ -1160,6 +1160,68 @@ AC_DEFUN([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [ ]) +dnl CURL_CHECK_COMPILER_STRUCT_MEMBER_SIZE +dnl ------------------------------------------------- +dnl Verifies if the compiler is capable of handling the +dnl size of a struct member, struct which is a function +dnl result, as a compilation-time condition inside the +dnl type definition of a constant array. + +AC_DEFUN([CURL_CHECK_COMPILER_STRUCT_MEMBER_SIZE], [ + AC_REQUIRE([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE])dnl + AC_MSG_CHECKING([if compiler struct member size checking works]) + tst_compiler_check_one_works="unknown" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + struct mystruct { + int mi; + char mc; + struct mystruct *next; + }; + struct mystruct myfunc(); + typedef char good_t1[sizeof(myfunc().mi) == sizeof(int) ? 1 : -1 ]; + typedef char good_t2[sizeof(myfunc().mc) == sizeof(char) ? 1 : -1 ]; + ]],[[ + good_t1 dummy1; + good_t2 dummy2; + ]]) + ],[ + tst_compiler_check_one_works="yes" + ],[ + tst_compiler_check_one_works="no" + sed 's/^/cc-src: /' conftest.$ac_ext >&6 + sed 's/^/cc-err: /' conftest.err >&6 + ]) + tst_compiler_check_two_works="unknown" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + struct mystruct { + int mi; + char mc; + struct mystruct *next; + }; + struct mystruct myfunc(); + typedef char bad_t1[sizeof(myfunc().mi) != sizeof(int) ? 1 : -1 ]; + typedef char bad_t2[sizeof(myfunc().mc) != sizeof(char) ? 1 : -1 ]; + ]],[[ + bad_t1 dummy1; + bad_t2 dummy2; + ]]) + ],[ + tst_compiler_check_two_works="no" + ],[ + tst_compiler_check_two_works="yes" + ]) + if test "$tst_compiler_check_one_works" = "yes" && + test "$tst_compiler_check_two_works" = "yes"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([compiler fails struct member size checking.]) + fi +]) + + dnl CURL_VAR_MATCH (VARNAME, VALUE) dnl ------------------------------------------------- dnl Verifies if shell variable VARNAME contains VALUE. -- cgit v1.2.1 From f3e6a582d4656df085629d7086d96aa8bca62d06 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 15 May 2009 09:35:46 +0000 Subject: remove outdated comment --- m4/curl-compilers.m4 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index e1337d961..9a0c66bf8 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 50 +# serial 51 dnl CURL_CHECK_COMPILER @@ -907,10 +907,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$want_warnings" = "yes"; then dnl Issue all warnings tmp_CFLAGS="$tmp_CFLAGS +w1" - dnl Due to the HP-UX socklen_t issue it is insane to use the +w1 - dnl warning level. Until the issue is somehow fixed we will just - dnl use the +w2 warning level. - dnl tmp_CFLAGS="$tmp_CFLAGS +w2" fi ;; # -- cgit v1.2.1 From 065047dc62cba3efde597fa5420d112fc2f4c500 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 9 Jun 2009 17:59:28 +0000 Subject: Added --enable-curldebug configure option to enable and disable building with the low-level curl debug memory tracking 'feature' to allow decoupled setting from --enable-debug. --- m4/curl-compilers.m4 | 82 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 71 insertions(+), 11 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 9a0c66bf8..2e55dc803 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 51 +# serial 52 dnl CURL_CHECK_COMPILER @@ -1076,22 +1076,82 @@ squeeze() { ]) -dnl CURL_PROCESS_DEBUG_BUILD_OPTS +dnl CURL_CHECK_CURLDEBUG dnl ------------------------------------------------- -dnl Settings which depend on configure's debug given -dnl option, and further configure the build process. -dnl Don't use this macro for compiler dependant stuff. - -AC_DEFUN([CURL_PROCESS_DEBUG_BUILD_OPTS], [ - AC_REQUIRE([CURL_CHECK_OPTION_DEBUG])dnl +dnl Settings which depend on configure's curldebug given +dnl option, and other additional configure pre-requisites. +dnl Actually the curl debug memory tracking feature can +dnl only be used/enabled when libcurl is built as a static +dnl library or as a shared one on those systems on which +dnl shared libraries support undefined symbols. + +AC_DEFUN([CURL_CHECK_CURLDEBUG], [ AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl - AC_BEFORE([$0],[AC_PROG_LIBTOOL])dnl + supports_curldebug="unknown" + if test "$want_curldebug" = "yes"; then + if test "x$enable_shared" != "xno" && + test "x$enable_shared" != "xyes"; then + AC_MSG_WARN([unknown enable_shared setting.]) + supports_curldebug="no" + fi + if test "x$enable_static" != "xno" && + test "x$enable_static" != "xyes"; then + AC_MSG_WARN([unknown enable_static setting.]) + supports_curldebug="no" + fi + if test "$supports_curldebug" != "no"; then + if test "$enable_shared" = "yes" && + test "$need_no_undefined" = "yes"; then + supports_curldebug="no" + AC_MSG_WARN([shared library does not support undefined symbols.]) + fi + fi + fi # - if test "$want_debug" = "yes"; then + if test "$want_curldebug" = "yes"; then + AC_MSG_CHECKING([if curl debug memory tracking can be enabled]) + test "$supports_curldebug" = "no" || supports_curldebug="yes" + AC_MSG_RESULT([$supports_curldebug]) + if test "$supports_curldebug" = "no"; then + AC_MSG_WARN([cannot enable curl debug memory tracking.]) + want_curldebug="no" + fi + fi + # + if test "$want_curldebug" = "yes"; then CPPFLAGS="$CPPFLAGS -DCURLDEBUG" squeeze CPPFLAGS fi - # + if test "$want_debug" = "yes"; then + CPPFLAGS="$CPPFLAGS -DDEBUGBUILD" + squeeze CPPFLAGS + fi +]) + + +dnl CURL_CHECK_NO_UNDEFINED +dnl ------------------------------------------------- +dnl Checks if the -no-undefined flag must be used when +dnl building shared libraries. This is required on all +dnl systems on which shared libraries should not have +dnl references to undefined symbols. This check should +dnl not be done before AC-PROG-LIBTOOL. + +AC_DEFUN([CURL_CHECK_NO_UNDEFINED], [ + AC_BEFORE([$0],[CURL_CHECK_CURLDEBUG])dnl + AC_MSG_CHECKING([if shared libraries need -no-undefined]) + need_no_undefined="no" + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc* | *-*-aix*) + need_no_undefined="yes" + ;; + esac + if test "x$allow_undefined" = "xno"; then + need_no_undefined="yes" + elif test "x$allow_undefined_flag" = "xunsupported"; then + need_no_undefined="yes" + fi + AC_MSG_RESULT($need_no_undefined) ]) -- cgit v1.2.1 From d3e35d49ae4ffddea5539620578f0e00ef1f39f3 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 17 Jun 2009 02:26:39 +0000 Subject: Added a few more compiler warning options for gcc. --- m4/curl-compilers.m4 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 2e55dc803..21ccc65e7 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -873,11 +873,16 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi # + dnl Only gcc 4.2 or later + if test "$compiler_num" -ge "402"; then + tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" + fi dnl Only gcc 4.3 or later if test "$compiler_num" -ge "403"; then tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-parameter-type -Wempty-body" tmp_CFLAGS="$tmp_CFLAGS -Wclobbered -Wignored-qualifiers" + tmp_CFLAGS="$tmp_CFLAGS -Wconversion -Wno-sign-conversion -Wvla" fi # fi -- cgit v1.2.1 From f5d8c0befc61497b3d3572ae51e779b396589660 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 5 Mar 2010 22:53:30 +0000 Subject: Daniel Johnson provided fixes for building with the clang compiler --- m4/curl-compilers.m4 | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 21ccc65e7..c88917a69 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -45,6 +45,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ CURL_CHECK_COMPILER_HPUX_C CURL_CHECK_COMPILER_IBM_C CURL_CHECK_COMPILER_INTEL_C + CURL_CHECK_COMPILER_CLANG CURL_CHECK_COMPILER_GNU_C CURL_CHECK_COMPILER_LCC CURL_CHECK_COMPILER_SGI_MIPSPRO_C @@ -71,6 +72,40 @@ _EOF ]) +dnl CURL_CHECK_COMPILER_CLANG +dnl ------------------------------------------------- +dnl Verify if compiler being used is clang. + +AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ + AC_BEFORE([$0],[CURL_CHECK_COMPILER_GNU_C])dnl + AC_MSG_CHECKING([if compiler is clang]) + CURL_CHECK_DEF([__clang__], [], [silent]) + if test "$curl_cv_have_def___clang__" = "yes"; then + AC_MSG_RESULT([yes]) + compiler_id="CLANG" + clangver=`$CC -dumpversion` + clangvhi=`echo $clangver | cut -d . -f1` + clangvlo=`echo $clangver | cut -d . -f2` + compiler_num=`(expr $clangvhi "*" 100 + $clangvlo) 2>/dev/null` + flags_dbg_all="-g -g0 -g1 -g2 -g3" + flags_dbg_all="$flags_dbg_all -ggdb" + flags_dbg_all="$flags_dbg_all -gstabs" + flags_dbg_all="$flags_dbg_all -gstabs+" + flags_dbg_all="$flags_dbg_all -gcoff" + flags_dbg_all="$flags_dbg_all -gxcoff" + flags_dbg_all="$flags_dbg_all -gdwarf-2" + flags_dbg_all="$flags_dbg_all -gvms" + flags_dbg_yes="-g" + flags_dbg_off="-g0" + flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4" + flags_opt_yes="-Os" + flags_opt_off="-O0" + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_CHECK_COMPILER_DEC_C dnl ------------------------------------------------- dnl Verify if compiler being used is DEC C. @@ -101,6 +136,7 @@ dnl Verify if compiler being used is GNU C. AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [ AC_REQUIRE([CURL_CHECK_COMPILER_INTEL_C])dnl + AC_REQUIRE([CURL_CHECK_COMPILER_CLANG])dnl AC_MSG_CHECKING([if compiler is GNU C]) CURL_CHECK_DEF([__GNUC__], [], [silent]) if test "$curl_cv_have_def___GNUC__" = "yes" && @@ -500,7 +536,8 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # if test "$compiler_id" != "unknown"; then # - if test "$compiler_id" = "GNU_C"; then + if test "$compiler_id" = "GNU_C" || + test "$compiler_id" = "CLANG"; then CURL_CONVERT_INCLUDE_TO_ISYSTEM fi # @@ -511,6 +548,14 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ # case "$compiler_id" in # + CLANG) + # + dnl Disable warnings for unused arguments, otherwise clang will + dnl warn about compile-time arguments used during link-time, like + dnl -O and -g and -pedantic. + tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments" + ;; + # DEC_C) # dnl Select strict ANSI C compiler mode @@ -791,6 +836,31 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # case "$compiler_id" in # + CLANG) + # + if test "$want_warnings" = "yes"; then + dnl All versions of clang support the same warnings as at least + dnl gcc 4.2.1. + tmp_CFLAGS="$tmp_CFLAGS -pedantic" + tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" + tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" + tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow" + tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" + tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" + tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long" + tmp_CFLAGS="$tmp_CFLAGS -Wfloat-equal" + tmp_CFLAGS="$tmp_CFLAGS -Wno-multichar -Wsign-compare" + tmp_CFLAGS="$tmp_CFLAGS -Wundef" + tmp_CFLAGS="$tmp_CFLAGS -Wno-format-nonliteral" + tmp_CFLAGS="$tmp_CFLAGS -Wendif-labels -Wstrict-prototypes" + tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" + tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" + tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" + tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" + fi + ;; + # DEC_C) # if test "$want_warnings" = "yes"; then -- cgit v1.2.1 From d9291eb4b8fbb591321760d7dfcc514c14ce4e35 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 17 Mar 2010 10:44:28 +0000 Subject: replaced intel compiler option -no-ansi-alias with -fno-strict-aliasing --- m4/curl-compilers.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index c88917a69..9577bf738 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -22,7 +22,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 52 +# serial 55 dnl CURL_CHECK_COMPILER @@ -1022,7 +1022,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Disable using EBP register in optimizations tmp_CFLAGS="$tmp_CFLAGS -fno-omit-frame-pointer" dnl Disable use of ANSI C aliasing rules in optimizations - tmp_CFLAGS="$tmp_CFLAGS -no-ansi-alias" + tmp_CFLAGS="$tmp_CFLAGS -fno-strict-aliasing" dnl Value-safe optimizations on floating-point data tmp_CFLAGS="$tmp_CFLAGS -fp-model precise" dnl Only icc 10.0 or later -- cgit v1.2.1 From 3cd5b1cfb078cd7e96d7cd490740d955b7905caf Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Sun, 21 Mar 2010 20:46:33 -0400 Subject: Fix warnings for clang --- m4/curl-compilers.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 9577bf738..3f434d4c0 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -840,11 +840,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ # if test "$want_warnings" = "yes"; then dnl All versions of clang support the same warnings as at least - dnl gcc 4.2.1. + dnl gcc 4.2.1 except -Wunused. tmp_CFLAGS="$tmp_CFLAGS -pedantic" tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" - tmp_CFLAGS="$tmp_CFLAGS -Wunused -Wshadow" + tmp_CFLAGS="$tmp_CFLAGS -Wshadow" tmp_CFLAGS="$tmp_CFLAGS -Winline -Wnested-externs" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-declarations" tmp_CFLAGS="$tmp_CFLAGS -Wmissing-prototypes" @@ -858,6 +858,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" + # + dnl Only clang 1.1 or later + if test "$compiler_num" -ge "101"; then + tmp_CFLAGS="$tmp_CFLAGS -Wunused" + fi fi ;; # -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- m4/curl-compilers.m4 | 1 - 1 file changed, 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 3f434d4c0..1ea4d17eb 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -18,7 +18,6 @@ # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # -# $Id$ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -- cgit v1.2.1 From 7cebf22d572d8d1ee7845031d847ed047520edc0 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 9 Nov 2010 01:40:25 +0100 Subject: serial number bump --- m4/curl-compilers.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 1ea4d17eb..413293b10 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 55 +# serial 56 dnl CURL_CHECK_COMPILER -- cgit v1.2.1 From 1c4fa240bec959fd23f4826d9aa9e624fa48d01a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 18 Nov 2010 17:12:15 +0100 Subject: configure: use autobuilds to temporarily verify strict aliasing warnings. Temporarily, When cross-compiling with gcc 3.0 or later, enable strict aliasing rules and warnings. Given that cross-compiled targets autobuilds do not run the --- m4/curl-compilers.m4 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 413293b10..44998c06e 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -935,6 +935,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Also, on gcc 4.0.X it is totally unbearable and complains all dnl over making it unusable for generic purposes. Let's not use it. tmp_CFLAGS="$tmp_CFLAGS" + dnl When cross-compiling with gcc 3.0 or later, + dnl enable strict aliasing rules and warnings. + if test "x$cross_compiling" = "xyes"; then + tmp_CFLAGS="$tmp_CFLAGS -fstrict-aliasing -Wstrict-aliasing=2" + fi fi # dnl Only gcc 3.3 or later -- cgit v1.2.1 From dd5d3518e491f1294f7af9213c204a5bf4e17df3 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 2 Dec 2010 19:09:15 +0100 Subject: configure: undo using autobuilds to temporarily verify strict aliasing warnings. --- m4/curl-compilers.m4 | 5 ----- 1 file changed, 5 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 44998c06e..413293b10 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -935,11 +935,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ dnl Also, on gcc 4.0.X it is totally unbearable and complains all dnl over making it unusable for generic purposes. Let's not use it. tmp_CFLAGS="$tmp_CFLAGS" - dnl When cross-compiling with gcc 3.0 or later, - dnl enable strict aliasing rules and warnings. - if test "x$cross_compiling" = "xyes"; then - tmp_CFLAGS="$tmp_CFLAGS -fstrict-aliasing -Wstrict-aliasing=2" - fi fi # dnl Only gcc 3.3 or later -- cgit v1.2.1 From fba00c9f7be2dad06b8691952508882c4da14185 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 4 Jun 2011 04:27:09 +0200 Subject: xlc: avoid preprocessor definition usage when linking --- m4/curl-compilers.m4 | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 413293b10..adafaa61d 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 56 +# serial 57 dnl CURL_CHECK_COMPILER @@ -40,6 +40,8 @@ AC_DEFUN([CURL_CHECK_COMPILER], [ flags_opt_yes="unknown" flags_opt_off="unknown" # + flags_prefer_cppflags="no" + # CURL_CHECK_COMPILER_DEC_C CURL_CHECK_COMPILER_HPUX_C CURL_CHECK_COMPILER_IBM_C @@ -210,6 +212,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_IBM_C], [ flags_opt_all="$flags_opt_all -qoptimize=5" flags_opt_yes="-O2" flags_opt_off="-qnooptimize" + flags_prefer_cppflags="yes" else AC_MSG_RESULT([no]) fi @@ -586,15 +589,15 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [ IBM_C) # dnl Ensure that compiler optimizations are always thread-safe. - tmp_CFLAGS="$tmp_CFLAGS -qthreaded" + tmp_CPPFLAGS="$tmp_CPPFLAGS -qthreaded" dnl Disable type based strict aliasing optimizations, using worst dnl case aliasing assumptions when compiling. Type based aliasing dnl would restrict the lvalues that could be safely used to access dnl a data object. - tmp_CFLAGS="$tmp_CFLAGS -qnoansialias" + tmp_CPPFLAGS="$tmp_CPPFLAGS -qnoansialias" dnl Force compiler to stop after the compilation phase, without dnl generating an object code file when compilation has errors. - tmp_CFLAGS="$tmp_CFLAGS -qhalt=e" + tmp_CPPFLAGS="$tmp_CPPFLAGS -qhalt=e" ;; # INTEL_UNIX_C) @@ -720,8 +723,13 @@ AC_DEFUN([CURL_SET_COMPILER_DEBUG_OPTS], [ tmp_options="$flags_dbg_off" fi # - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS $tmp_options" + if test "$flags_prefer_cppflags" = "yes"; then + CPPFLAGS="$tmp_CPPFLAGS $tmp_options" + CFLAGS="$tmp_CFLAGS" + else + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS $tmp_options" + fi squeeze CPPFLAGS squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ @@ -796,8 +804,13 @@ AC_DEFUN([CURL_SET_COMPILER_OPTIMIZE_OPTS], [ AC_MSG_CHECKING([if compiler accepts optimizer disabling options]) tmp_options="$flags_opt_off" fi - CPPFLAGS="$tmp_CPPFLAGS" - CFLAGS="$tmp_CFLAGS $tmp_options" + if test "$flags_prefer_cppflags" = "yes"; then + CPPFLAGS="$tmp_CPPFLAGS $tmp_options" + CFLAGS="$tmp_CFLAGS" + else + CPPFLAGS="$tmp_CPPFLAGS" + CFLAGS="$tmp_CFLAGS $tmp_options" + fi squeeze CPPFLAGS squeeze CFLAGS CURL_COMPILER_WORKS_IFELSE([ @@ -951,6 +964,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ if test "$compiler_num" -ge "402"; then tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" fi + # dnl Only gcc 4.3 or later if test "$compiler_num" -ge "403"; then tmp_CFLAGS="$tmp_CFLAGS -Wtype-limits -Wold-style-declaration" @@ -1198,11 +1212,11 @@ AC_DEFUN([CURL_CHECK_CURLDEBUG], [ fi # if test "$want_curldebug" = "yes"; then - CPPFLAGS="$CPPFLAGS -DCURLDEBUG" + CPPFLAGS="-DCURLDEBUG $CPPFLAGS" squeeze CPPFLAGS fi if test "$want_debug" = "yes"; then - CPPFLAGS="$CPPFLAGS -DDEBUGBUILD" + CPPFLAGS="-DDEBUGBUILD $CPPFLAGS" squeeze CPPFLAGS fi ]) -- cgit v1.2.1 From 56ef3e295fbe4f3c9de7cc13b9ee3527fd604e29 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 8 Aug 2011 17:50:16 +0200 Subject: curl-compilers.m4: CURL_CONVERT_INCLUDE_TO_ISYSTEM adjustments: Add CURL_CHECK_COMPILER as a requirement. Ensure macro does nothing unless GNU_C or CLANG compiler is used. This should allow usage of this macro in unforeseen placements. --- m4/curl-compilers.m4 | 62 ++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 29 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index adafaa61d..1d9d48867 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -423,35 +423,39 @@ dnl GNUC versions these warnings are not silenced. AC_DEFUN([CURL_CONVERT_INCLUDE_TO_ISYSTEM], [ AC_REQUIRE([CURL_SHFUNC_SQUEEZE])dnl - tmp_has_include="no" - tmp_chg_FLAGS="$CFLAGS" - for word1 in $tmp_chg_FLAGS; do - case "$word1" in - -I*) - tmp_has_include="yes" - ;; - esac - done - if test "$tmp_has_include" = "yes"; then - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` - CFLAGS="$tmp_chg_FLAGS" - squeeze CFLAGS - fi - tmp_has_include="no" - tmp_chg_FLAGS="$CPPFLAGS" - for word1 in $tmp_chg_FLAGS; do - case "$word1" in - -I*) - tmp_has_include="yes" - ;; - esac - done - if test "$tmp_has_include" = "yes"; then - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` - tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` - CPPFLAGS="$tmp_chg_FLAGS" - squeeze CPPFLAGS + AC_REQUIRE([CURL_CHECK_COMPILER])dnl + if test "$compiler_id" = "GNU_C" || + test "$compiler_id" = "CLANG"; then + tmp_has_include="no" + tmp_chg_FLAGS="$CFLAGS" + for word1 in $tmp_chg_FLAGS; do + case "$word1" in + -I*) + tmp_has_include="yes" + ;; + esac + done + if test "$tmp_has_include" = "yes"; then + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` + CFLAGS="$tmp_chg_FLAGS" + squeeze CFLAGS + fi + tmp_has_include="no" + tmp_chg_FLAGS="$CPPFLAGS" + for word1 in $tmp_chg_FLAGS; do + case "$word1" in + -I*) + tmp_has_include="yes" + ;; + esac + done + if test "$tmp_has_include" = "yes"; then + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/^-I/ -isystem /g'` + tmp_chg_FLAGS=`echo "$tmp_chg_FLAGS" | "$SED" 's/ -I/ -isystem /g'` + CPPFLAGS="$tmp_chg_FLAGS" + squeeze CPPFLAGS + fi fi ]) -- cgit v1.2.1 From 3ef6418b611298ec748fe245eb082b8f33318aba Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 8 Aug 2011 18:25:01 +0200 Subject: curl-compilers.m4: serial number bump --- m4/curl-compilers.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 1d9d48867..c0f18c897 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 57 +# serial 58 dnl CURL_CHECK_COMPILER -- cgit v1.2.1 From 9e24b9c7afbcb81120af4cf3f6cdee49a06d8224 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 11 Apr 2012 19:33:54 +0200 Subject: build adjustments: CURL_HIDDEN_SYMBOLS no longer defined in config files configure script now provides conditional definitions for Makefile.am that result in CURL_HIDDEN_SYMBOLS being defined by resulting makefiles when appropriate. Additionally, configure script option for symbol hiding control is now named --enable-symbol-hiding --disable-symbol-hiding. While still valid, old option name --enable-hidden-symbols --disable-hidden-symbols will be deprecated in some future release. --- m4/curl-compilers.m4 | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 2 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index c0f18c897..9b212e462 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 58 +# serial 59 dnl CURL_CHECK_COMPILER @@ -1375,6 +1375,114 @@ AC_DEFUN([CURL_CHECK_COMPILER_STRUCT_MEMBER_SIZE], [ ]) +dnl CURL_CHECK_COMPILER_SYMBOL_HIDING +dnl ------------------------------------------------- +dnl Verify if compiler supports hiding library internal symbols, setting +dnl shell variable supports_symbol_hiding value as appropriate, as well as +dnl variables symbol_hiding_CFLAGS and symbol_hiding_EXTERN when supported. + +AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ + AC_REQUIRE([CURL_CHECK_COMPILER])dnl + AC_BEFORE([$0],[CURL_CONFIGURE_SYMBOL_HIDING])dnl + AC_MSG_CHECKING([if compiler supports hiding library internal symbols]) + supports_symbol_hiding="no" + symbol_hiding_CFLAGS="" + symbol_hiding_EXTERN="" + tmp_CFLAGS="" + tmp_EXTERN="" + case "$compiler_id" in + CLANG) + dnl All versions of clang support -fvisibility= + tmp_EXTERN="__attribute__ ((visibility (\"default\")))" + tmp_CFLAGS="-fvisibility=hidden" + supports_symbol_hiding="yes" + ;; + GNU_C) + dnl Only gcc 3.4 or later + if test "$compiler_num" -ge "304"; then + if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then + tmp_EXTERN="__attribute__ ((visibility (\"default\")))" + tmp_CFLAGS="-fvisibility=hidden" + supports_symbol_hiding="yes" + fi + fi + ;; + INTEL_UNIX_C) + dnl Only icc 9.0 or later + if test "$compiler_num" -ge "900"; then + if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fvisibility=hidden" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ +# include + ]],[[ + printf("icc fvisibility bug test"); + ]]) + ],[ + tmp_EXTERN="__attribute__ ((visibility (\"default\")))" + tmp_CFLAGS="-fvisibility=hidden" + supports_symbol_hiding="yes" + ]) + CFLAGS="$tmp_save_CFLAGS" + fi + fi + ;; + SUNPRO_C) + if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then + tmp_EXTERN="__global" + tmp_CFLAGS="-xldscope=hidden" + supports_symbol_hiding="yes" + fi + ;; + esac + if test "$supports_symbol_hiding" = "yes"; then + tmp_save_CFLAGS="$CFLAGS" + CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS" + squeeze CFLAGS + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + $tmp_EXTERN char *dummy(char *buff); + char *dummy(char *buff) + { + if(buff) + return ++buff; + else + return buff; + } + ]],[[ + char b[16]; + char *r = dummy(&b[0]); + if(r) + return (int)*r; + ]]) + ],[ + supports_symbol_hiding="yes" + if test -f conftest.err; then + grep 'visibility' conftest.err >/dev/null + if test "$?" -eq "0"; then + supports_symbol_hiding="no" + fi + fi + ],[ + supports_symbol_hiding="no" + echo " " >&6 + sed 's/^/cc-src: /' conftest.$ac_ext >&6 + sed 's/^/cc-err: /' conftest.err >&6 + echo " " >&6 + ]) + CFLAGS="$tmp_save_CFLAGS" + fi + if test "$supports_symbol_hiding" = "yes"; then + AC_MSG_RESULT([yes]) + symbol_hiding_CFLAGS="$tmp_CFLAGS" + symbol_hiding_EXTERN="$tmp_EXTERN" + else + AC_MSG_RESULT([no]) + fi +]) + + dnl CURL_VAR_MATCH (VARNAME, VALUE) dnl ------------------------------------------------- dnl Verifies if shell variable VARNAME contains VALUE. -- cgit v1.2.1 From 8b63b48627961c0bf880eb4d57cf24d6a828dcd2 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sat, 14 Apr 2012 15:06:57 +0200 Subject: headers: surround GCC attribute names with double underscores This protects from attribute names being defined by third party's code. Improvement: http://curl.haxx.se/mail/lib-2012-04/0127.html --- m4/curl-compilers.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 9b212e462..fffe85f20 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 59 +# serial 60 dnl CURL_CHECK_COMPILER @@ -1393,7 +1393,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ case "$compiler_id" in CLANG) dnl All versions of clang support -fvisibility= - tmp_EXTERN="__attribute__ ((visibility (\"default\")))" + tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ;; @@ -1401,7 +1401,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ dnl Only gcc 3.4 or later if test "$compiler_num" -ge "304"; then if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then - tmp_EXTERN="__attribute__ ((visibility (\"default\")))" + tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" fi @@ -1420,7 +1420,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [ printf("icc fvisibility bug test"); ]]) ],[ - tmp_EXTERN="__attribute__ ((visibility (\"default\")))" + tmp_EXTERN="__attribute__ ((__visibility__ (\"default\")))" tmp_CFLAGS="-fvisibility=hidden" supports_symbol_hiding="yes" ]) -- cgit v1.2.1 From bd12c44d355dcdcb7d094717b2139cec09a3a4c0 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 16 Apr 2012 02:49:50 +0200 Subject: curl-compilers.m4: -Wno-pedantic-ms-format for Windows gcc 4.5 builds When building a Windows target with gcc 4.5 or newer and strict compiler warnings enabled use -Wno-pedantic-ms-format in addition to other flags. --- m4/curl-compilers.m4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index fffe85f20..2752f65e4 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 60 +# serial 61 dnl CURL_CHECK_COMPILER @@ -161,6 +161,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [ flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" + CURL_CHECK_DEF([_WIN32], [], [silent]) else AC_MSG_RESULT([no]) fi @@ -977,6 +978,14 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wconversion -Wno-sign-conversion -Wvla" fi # + dnl Only gcc 4.5 or later + if test "$compiler_num" -ge "405"; then + dnl Only windows targets + if test "$curl_cv_have_def__WIN32" = "yes"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-pedantic-ms-format" + fi + fi + # fi # dnl Do not issue warnings for code in system include paths. -- cgit v1.2.1 From f1474db3600172804d6f79d30e1127c6c7efa066 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 26 Jun 2012 21:22:36 +0200 Subject: curl-compilers.m4: -Wstrict-aliasing=3 for warning enabled gcc and clang builds --- m4/curl-compilers.m4 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 2752f65e4..29507bae3 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 61 +# serial 62 dnl CURL_CHECK_COMPILER @@ -875,6 +875,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" + tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" # dnl Only clang 1.1 or later if test "$compiler_num" -ge "101"; then @@ -965,6 +966,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wdeclaration-after-statement" fi # + dnl Only gcc 4.0 or later + if test "$compiler_num" -ge "400"; then + tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" + fi + # dnl Only gcc 4.2 or later if test "$compiler_num" -ge "402"; then tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" -- cgit v1.2.1 From 60d5a16b998e5c38947a6420321e504f8e14ef96 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 29 Jun 2012 16:40:23 +0200 Subject: curl-compilers.m4: remove -Wstrict-aliasing=3 from clang Currently it is unknown if there is any version of clang that actually supports -Wstrict-aliasing. What is known is that there are several that don't support it. --- m4/curl-compilers.m4 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 29507bae3..0cbba7a09 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -21,7 +21,7 @@ #*************************************************************************** # File version for 'aclocal' use. Keep it a single number. -# serial 62 +# serial 63 dnl CURL_CHECK_COMPILER @@ -856,8 +856,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ CLANG) # if test "$want_warnings" = "yes"; then - dnl All versions of clang support the same warnings as at least - dnl gcc 4.2.1 except -Wunused. tmp_CFLAGS="$tmp_CFLAGS -pedantic" tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra" tmp_CFLAGS="$tmp_CFLAGS -Wpointer-arith -Wwrite-strings" @@ -875,7 +873,6 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wcast-align" tmp_CFLAGS="$tmp_CFLAGS -Wno-system-headers" tmp_CFLAGS="$tmp_CFLAGS -Wshorten-64-to-32" - tmp_CFLAGS="$tmp_CFLAGS -Wstrict-aliasing=3" # dnl Only clang 1.1 or later if test "$compiler_num" -ge "101"; then -- cgit v1.2.1 From c277bd6ce7069819484eb3dc30b5858735fde377 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 16 Nov 2012 13:06:49 +0100 Subject: autoconf: don't force-disable compiler debug option When nothing is told to configure, we should not enforce switching off debug options with -g0 (or similar). We instead don't use -g at all in that situaion and therefore allow the user's CFLAGS settings possibly dictate what to do. --- m4/curl-compilers.m4 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 0cbba7a09..819bbd9c8 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -97,7 +97,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_CLANG], [ flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" - flags_dbg_off="-g0" + flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -Os -O3 -O4" flags_opt_yes="-Os" flags_opt_off="-O0" @@ -121,7 +121,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_DEC_C], [ compiler_id="DEC_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g2" - flags_dbg_off="-g0" + flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -O4" flags_opt_yes="-O1" flags_opt_off="-O0" @@ -157,7 +157,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [ flags_dbg_all="$flags_dbg_all -gdwarf-2" flags_dbg_all="$flags_dbg_all -gvms" flags_dbg_yes="-g" - flags_dbg_off="-g0" + flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" @@ -236,7 +236,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_INTEL_C], [ compiler_id="INTEL_UNIX_C" flags_dbg_all="-g -g0" flags_dbg_yes="-g" - flags_dbg_off="-g0" + flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Os" flags_opt_yes="-O2" flags_opt_off="-O0" @@ -300,7 +300,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPS_C], [ compiler_id="SGI_MIPS_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" - flags_dbg_off="-g0" + flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" @@ -327,7 +327,7 @@ AC_DEFUN([CURL_CHECK_COMPILER_SGI_MIPSPRO_C], [ compiler_id="SGI_MIPSPRO_C" flags_dbg_all="-g -g0 -g1 -g2 -g3" flags_dbg_yes="-g" - flags_dbg_off="-g0" + flags_dbg_off="" flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast" flags_opt_yes="-O2" flags_opt_off="-O0" -- cgit v1.2.1