Add support for CL_INCLUDES_PREFIX environment variable for handling localized cl.exe /showIncludes output. (Bug 587372) r=ted a2.0=blocking2.0:final

This commit is contained in:
Masatoshi Kimura 2010-09-17 12:29:52 -07:00
parent 76a39e3812
commit d6b46ad3d3
6 changed files with 30 additions and 4 deletions

View File

@ -40,6 +40,8 @@ import os, os.path
import subprocess
import sys
CL_INCLUDES_PREFIX = os.environ.get("CL_INCLUDES_PREFIX", "Note: including file:")
def InvokeClWithDependencyGeneration(cmdline):
target = ""
# Figure out what the target is
@ -61,8 +63,8 @@ def InvokeClWithDependencyGeneration(cmdline):
for line in cl.stdout:
# cl -showIncludes prefixes every header with "Note: including file:"
# and an indentation corresponding to the depth (which we don't need)
if line.startswith("Note: including file:"):
dep = line[21:].strip()
if line.startswith(CL_INCLUDES_PREFIX):
dep = line[len(CL_INCLUDES_PREFIX):].strip()
# We can't handle pathes with spaces properly in mddepend.pl, but
# we can assume that anything in a path with spaces is a system
# header and throw it away.

View File

@ -570,6 +570,8 @@ STATIC_LIBIDL = @STATIC_LIBIDL@
MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@
export CL_INCLUDES_PREFIX = @CL_INCLUDES_PREFIX@
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@
COMPILER_DEPEND = @COMPILER_DEPEND@
MDDEPDIR := @MDDEPDIR@

View File

@ -8028,6 +8028,15 @@ else
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else
echo '#include <stdio.h>' > dummy-hello.c
changequote(,)
CL_INCLUDES_PREFIX=`"${CC}" -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
changequote([,])
if test -z "$CL_INCLUDES_PREFIX"; then
AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
fi
AC_SUBST(CL_INCLUDES_PREFIX)
rm -f dummy-hello.c
_topsrcdirwin=`cd \`dirname $0\`; pwd -W`
dnl cl.py provides dependency generation for MSVC
CC_WRAPPER="$PYTHON -O $_topsrcdirwin/build/cl.py"

View File

@ -40,6 +40,8 @@ import os, os.path
import subprocess
import sys
CL_INCLUDES_PREFIX = os.environ.get("CL_INCLUDES_PREFIX", "Note: including file:")
def InvokeClWithDependencyGeneration(cmdline):
target = ""
# Figure out what the target is
@ -61,8 +63,8 @@ def InvokeClWithDependencyGeneration(cmdline):
for line in cl.stdout:
# cl -showIncludes prefixes every header with "Note: including file:"
# and an indentation corresponding to the depth (which we don't need)
if line.startswith("Note: including file:"):
dep = line[21:].strip()
if line.startswith(CL_INCLUDES_PREFIX):
dep = line[len(CL_INCLUDES_PREFIX):].strip()
# We can't handle pathes with spaces properly in mddepend.pl, but
# we can assume that anything in a path with spaces is a system
# header and throw it away.

View File

@ -278,6 +278,8 @@ MOZ_TOOLKIT_REGISTRY_CFLAGS = \
MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@
export CL_INCLUDES_PREFIX = @CL_INCLUDES_PREFIX@
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@
COMPILER_DEPEND = @COMPILER_DEPEND@
MDDEPDIR := @MDDEPDIR@

View File

@ -4966,6 +4966,15 @@ else
_DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
else
echo '#include <stdio.h>' > dummy-hello.c
changequote(,)
CL_INCLUDES_PREFIX=`"${CC}" -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
changequote([,])
if test -z "$CL_INCLUDES_PREFIX"; then
AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
fi
AC_SUBST(CL_INCLUDES_PREFIX)
rm -f dummy-hello.c
_topsrcdirwin=`cd \`dirname $0\`; pwd -W`
dnl cl.py provides dependency generation for MSVC
CC_WRAPPER="$PYTHON -O $_topsrcdirwin/build/cl.py"