diff --git a/ares/configure.ac b/ares/configure.ac
index 6a8cf7dceb8a6cd35e536d1bd11436d62c4054f2..fe8a7a7f07441de1ad6f10afcd07ae621e715131 100644
--- a/ares/configure.ac
+++ b/ares/configure.ac
@@ -229,6 +229,20 @@ else
   AC_MSG_RESULT([no])
 fi
 
+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])
+  dnl Select strict ANSI C conformance
+  CFLAGS="$CFLAGS -strict-ansi"
+  dnl Select ANSI C dialect
+  CFLAGS="$CFLAGS -std=c89"
+  dnl Disable use of ANSI C aliasing rules in optimizations
+  CFLAGS="$CFLAGS -no-ansi-alias"
+else
+  AC_MSG_RESULT([no])
+fi
+
 AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
 CURL_CHECK_DEF([__DECC], [], [silent])
 CURL_CHECK_DEF([__DECC_VER], [], [silent])
diff --git a/configure.ac b/configure.ac
index 17f7c1c47f6eb23e0e7ed18907fe7f72fa70346c..71464f43f06d5a0079c317fdfeb118d97d687378 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,6 +296,20 @@ else
   AC_MSG_RESULT([no])
 fi
 
+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])
+  dnl Select strict ANSI C conformance
+  CFLAGS="$CFLAGS -strict-ansi"
+  dnl Select ANSI C dialect
+  CFLAGS="$CFLAGS -std=c89"
+  dnl Disable use of ANSI C aliasing rules in optimizations
+  CFLAGS="$CFLAGS -no-ansi-alias"
+else
+  AC_MSG_RESULT([no])
+fi
+
 AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
 CURL_CHECK_DEF([__DECC], [], [silent])
 CURL_CHECK_DEF([__DECC_VER], [], [silent])