From briefly looking at the xcodebuild output of the Apple Mac build I noticed that it includes -I. and -Iicu among the include directories. I also tried a similar approach to no avail.
Inserting a #pragma message directive to more easily see this issue and compiling Source/WebCore/platform/text/TextCodecUTF8.cpp, I get the following output:
[ 29%] In file included from /Users/dbates/Desktop/RIM/staging/usr/include/unicode/utf.h:230,
Building CXX object WebCore/CMakeFiles/webcore.dir/platform/text/transcoder/FontTranscoder.cpp.o
In file included from /Users/dbates/Desktop/RIM/webkit/Source/WebCore/platform/text/TextCodecUTF8.cpp:27:
/Users/dbates/Desktop/RIM/webkit/Source/WebCore/platform/text/TextCodecUTF8.h:50: error: 'U8_MAX_LENGTH' was not declared in this scope
The directory /Users/dbates/Desktop/RIM/staging/usr/include is specified to g++ using -isystem so that it is included in the system header search path.
/* include the utfXX.h ------------------------------------------------------ */
Notice the use of a relative include path. Changing "unicode/utf8.h" to "utf8.h" above resolves the build issue but it's undesirable to change these ICU headers as they are from a third-party.
This looks like bug 70913.
*** This bug has been marked as a duplicate of bug 70913 ***