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
Родитель ac46334e60
Коммит cd7736f094
6 изменённых файлов: 30 добавлений и 4 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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@

Просмотреть файл

@ -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"

Просмотреть файл

@ -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.

Просмотреть файл

@ -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@

Просмотреть файл

@ -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"