Bug 105271: compile source files with absolute pathnames so that the

debuggers can find them automatically.  Currently enabled on Windows and
OS/2 only.  The patch is contributed by Julien Pierre.  r=wtc.
This commit is contained in:
wtc%netscape.com 2003-04-16 01:23:52 +00:00
parent 949f6757f2
commit 3655177e33

View File

@ -379,17 +379,39 @@ ifeq ($(OS_ARCH),SunOS)
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
endif
#
# Translate source filenames to absolute paths. This is required for
# debuggers under Windows and OS/2 to find source files automatically.
#
ifeq ($(OS_ARCH),OS2)
NEED_ABSOLUTE_PATH = 1
endif
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
NEED_ABSOLUTE_PATH = 1
endif
ifdef NEED_ABSOLUTE_PATH
PWD := $(shell pwd)
abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
@$(MAKE_OBJDIR)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CCC) -Fo$@ -c $(CCCFLAGS) $<
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CCC) -Fo$@ -c $(CCCFLAGS) $<
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<)
else
$(CCC) -o $@ -c $(CCCFLAGS) $<
endif
endif
endif
WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
@ -397,14 +419,18 @@ WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
$(OBJDIR)/%.$(OBJ_SUFFIX): %.c
@$(MAKE_OBJDIR)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
$(CC) -Fo$@ -c $(CFLAGS) $<
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
else
ifeq ($(MOZ_OS2_TOOLS),VACPP)
$(CC) -Fo$@ -c $(CFLAGS) $<
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
else
ifdef NEED_ABSOLUTE_PATH
$(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
else
$(CC) -o $@ -c $(CFLAGS) $<
endif
endif
endif
$(OBJDIR)/%.$(OBJ_SUFFIX): %.s