summaryrefslogtreecommitdiff
path: root/m4/curl-compilers.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-08-08 17:50:16 +0200
committerYang Tse <yangsita@gmail.com>2011-08-08 17:50:16 +0200
commit56ef3e295fbe4f3c9de7cc13b9ee3527fd604e29 (patch)
tree33e203a714a628e3c84205c859e6c5dd4482bdbf /m4/curl-compilers.m4
parent3dcc0df5ccac15275f612f5c275ea320f5f41cd4 (diff)
downloadcurl-56ef3e295fbe4f3c9de7cc13b9ee3527fd604e29.tar.gz
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.
Diffstat (limited to 'm4/curl-compilers.m4')
-rw-r--r--m4/curl-compilers.m462
1 files changed, 33 insertions, 29 deletions
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
])