Make --enable-insure work when building outside of the source dir.

This commit is contained in:
cls%seawood.org 1999-09-09 19:19:37 +00:00
parent 733677f07b
commit 868e1692ef
3 changed files with 8 additions and 23 deletions

View File

@ -39,30 +39,15 @@ fi
# Use DEPTH in the Makefile.in to determine the depth
depth=`grep -w DEPTH ${MAKEFILE} | grep -e "\.\." | awk -F"=" '{ print $2; }'`
cwd=`pwd`
# Determine the depth count
n=`echo $depth | tr '/' ' ' | wc -w`
# Determine the path (strip anything before the mozilla/ root)
# If we are building in the source directory then the Makefile will have
# srcdir set to '.' and we have to get the path from the pwd command.
# If we are building outside of the source tree then we can get the information
# we need from the srcdir statement in the Makefile.
cd $depth
objdir=`pwd`
tpth=`grep '^srcdir.*/mozilla/' ${MAKEFILE}`
if [ "$tpth" = "" ]; then
tpth=`pwd`
fi
path=`echo $tpth | awk -v count=$n -F"/" '\
{ for(i=NF-count+0; i <= NF ; i++) \
{ \
if (i!=NF) \
{ printf "%s/", $i } \
else \
{ printf "%s", $i } \
} \
}'`
path=`echo $cwd | sed "s|^${objdir}/||"`
match=$path

View File

@ -24,8 +24,8 @@ INSURE_INCLUDE=$(shell $(INSURE_MATCH_SCRIPT) $(MOZ_INSURE_DIRS))
ifeq ($(INSURE_EXCLUDE),0)
ifeq ($(INSURE_INCLUDE),1)
CC = $(MOZ_INSURE) gcc
CXX = $(MOZ_INSURE) g++
CC := $(MOZ_INSURE)
CXX := $(MOZ_INSURE)
endif # INSURE_INCLUDE == 1
endif # INSURE_EXCLUDE == 0

View File

@ -2535,7 +2535,7 @@ MOZ_ARG_ENABLE_BOOL(gprof,
MOZ_ARG_ENABLE_BOOL(insure,
[ --enable-insure Enable insure++ instrumentation (linux only)],
[ MOZ_INSURE="insure" MOZ_INSURIFYING=1 MOZ_INSURE_DIRS="mozilla" MOZ_INSURE_EXCLUDE_DIRS="mozilla/config" ])
[ MOZ_INSURE="insure" MOZ_INSURIFYING=1 MOZ_INSURE_DIRS="." MOZ_INSURE_EXCLUDE_DIRS="config" ])
MOZ_ARG_WITH_STRING(insure-dirs,
[ --with-insure-dirs=\$dirs Dirs to instrument ],
@ -2543,7 +2543,7 @@ MOZ_ARG_WITH_STRING(insure-dirs,
MOZ_ARG_WITH_STRING(insure-exclude-dirs,
[ --with-insure-exclude-dirs=\$dirs Dirs to not instrument ],
MOZ_INSURE_EXCLUDE_DIRS="mozilla/config $withval" )
MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
MOZ_ARG_ENABLE_BOOL(profile,
[ --enable-profile Enable profiling (solaris only)],