A patch making makepkg work with icc by huntxu (mhuntxu[AT]gmail[dot]com)
--- makepkg.orig	2009-10-02 22:40:42.711085370 +0800
+++ makepkg	2009-10-02 22:41:29.349081726 +0800
@@ -703,8 +703,37 @@
 		MAKEFLAGS=""
 	fi
 
+	# I don't think ccache can be used with icc
+	local useicc=0
+	if [ "$(check_buildenv icc)" = "y" -a "$(check_option icc)" != "n" ]; then
+	  if [ -r /etc/package.icc ]; then
+			while read -a target; do
+				if [ "${target}" = "${pkgname}" ]; then
+					useicc=1
+					CC="icc"
+					CXX="icpc"
+					AR="xiar"
+					LD="xild"
+					CFLAGS=${ICCCFLAGS}
+					CXXFLAGS=${ICCCXXFLAGS}
+					export CC CXX AR LD
+					if [ -r /etc/package.icc-cflags ]; then
+						while read target flags; do
+							if [ "${target}" = "${pkgname}" ]; then
+								CFLAGS="$CFLAGS $flags"
+								CXXFLAGS="$CXXFLAGS $flags"
+								break;
+							fi
+						done < /etc/package.icc-cflags
+					fi
+					break
+				fi
+			done < /etc/package.icc
+		fi
+	fi
+
 	# use ccache if it is requested (check buildenv and PKGBUILD opts)
-	if [ "$(check_buildenv ccache)" = "y" -a "$(check_option ccache)" != "n" ]; then
+	if [ "${useicc}" = "0" -a "$(check_buildenv ccache)" = "y" -a "$(check_option ccache)" != "n" ]; then
 		[ -d /usr/lib/ccache/bin ] && export PATH="/usr/lib/ccache/bin:$PATH"
 	fi
 
