From 6f468bd07664196ca5fbfeb52c4d2374c45f69c4 Mon Sep 17 00:00:00 2001 From: Ian Neal Date: Sat, 10 Nov 2012 09:38:02 +0000 Subject: [PATCH] Bug 807066 - Port changes to CL_INCLUDES_PREFIX and cl.py to comm-central r=callek --- config/config.mk | 7 +++++++ configure.in | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/config/config.mk b/config/config.mk index 5f4f2e7271..c058a2fcbd 100644 --- a/config/config.mk +++ b/config/config.mk @@ -115,6 +115,11 @@ FINAL_LINK_COMP_NAMES = $(MOZDEPTH)/config/final-link-comp-names MOZ_UNICHARUTIL_LIBS = $(LIBXUL_DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX) MOZ_WIDGET_SUPPORT_LIBS = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX) +ifdef _MSC_VER +CC_WRAPPER ?= $(PYTHON) -O $(topsrcdir)/mozilla/build/cl.py +CXX_WRAPPER ?= $(PYTHON) -O $(topsrcdir)/mozilla/build/cl.py +endif # _MSC_VER + CC := $(CC_WRAPPER) $(CC) CXX := $(CXX_WRAPPER) $(CXX) MKDIR ?= mkdir @@ -719,6 +724,8 @@ ifndef MOZ_SYSTEM_PLY PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply endif +export CL_INCLUDES_PREFIX + # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including # this file OBJ_SUFFIX := $(_OBJ_SUFFIX) diff --git a/configure.in b/configure.in index 511c7fbed7..de77d41b3b 100644 --- a/configure.in +++ b/configure.in @@ -6113,10 +6113,15 @@ else _DEFINES_CFLAGS='$(ACDEFINES) -D_COMM_CONFIG_H_ -DMOZILLA_CLIENT' _DEFINES_CXXFLAGS='$(ACDEFINES) -D_COMM_CONFIG_H_ -DMOZILLA_CLIENT' else - _topsrcdirwin=`cd \`dirname $0\`; pwd -W` - dnl cl.py provides dependency generation for MSVC - CC_WRAPPER="$PYTHON -O $_topsrcdirwin/mozilla/build/cl.py" - CXX_WRAPPER="$PYTHON -O $_topsrcdirwin/mozilla/build/cl.py" + echo '#include ' > 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 COMPILER_DEPEND=1 fi fi @@ -6125,9 +6130,6 @@ MDDEPDIR='.deps' AC_SUBST(MOZ_AUTO_DEPS) AC_SUBST(COMPILER_DEPEND) AC_SUBST(MDDEPDIR) -AC_SUBST(CC_WRAPPER) -AC_SUBST(CXX_WRAPPER) - dnl ======================================================== dnl =