summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjpierre%netscape.com <devnull@localhost>2003-04-17 01:59:34 +0000
committerjpierre%netscape.com <devnull@localhost>2003-04-17 01:59:34 +0000
commit8b090ac5c1810093324d3f0f00574e82bfd6a48e (patch)
tree25166ec01863ff922924b68a81a395bc46cff609
parentaf16613ee6f7c84e81895ef8b5b24148e9cf197a (diff)
downloadnss-hg-8b090ac5c1810093324d3f0f00574e82bfd6a48e.tar.gz
Fix for 202058 - Compile source files wit absolute pathnames to ease debugging on Win32 & OS/2
-rw-r--r--security/coreconf/rules.mk49
1 files changed, 45 insertions, 4 deletions
diff --git a/security/coreconf/rules.mk b/security/coreconf/rules.mk
index ac55f9279..7f142b0c5 100644
--- a/security/coreconf/rules.mk
+++ b/security/coreconf/rules.mk
@@ -380,20 +380,53 @@ WCCFLAGS1 := $(subst /,\\,$(CFLAGS))
WCCFLAGS2 := $(subst -I,-i=,$(WCCFLAGS1))
WCCFLAGS3 := $(subst -D,-d,$(WCCFLAGS2))
+# Translate source filenames to absolute paths. This is required for
+# debuggers under Windows & OS/2 to find source files automatically
+
+ifeq (,$(filter-out OS2%,$(OS_TARGET)))
+NEED_ABSOLUTE_PATH := 1
+PWD := $(shell pwd)
+endif
+
+ifeq (,$(filter-out WIN%,$(OS_TARGET)))
+ifndef NS_USE_GCC
+NEED_ABSOLUTE_PATH := 1
+ifeq (,$(findstring ;,$(PATH)))
+PWD := $(subst \,/,$(shell cygpath -w `pwd`))
+else
+PWD := $(shell pwd)
+endif
+endif
+endif
+
+ifdef NEED_ABSOLUTE_PATH
+abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
+else
+abspath = $(1)
+endif
+
$(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
@$(MAKE_OBJDIR)
ifdef USE_NT_C_SYNTAX
- $(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
$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c
ifdef USE_NT_C_SYNTAX
- $(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
ifndef XP_OS2_VACPP
ifneq (,$(filter-out WIN%,$(OS_TARGET)))
@@ -418,10 +451,14 @@ $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.S
$(OBJDIR)/$(PROG_PREFIX)%: %.cpp
@$(MAKE_OBJDIR)
ifdef USE_NT_C_SYNTAX
- $(CCC) -Fo$@ -c $(CFLAGS) $<
+ $(CCC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
+else
+ifdef NEED_ABSOLUTE_PATH
+ $(CCC) -o $@ -c $(CFLAGS) $(call abspath,$<)
else
$(CCC) -o $@ -c $(CFLAGS) $<
endif
+endif
#
# Please keep the next two rules in sync.
@@ -438,10 +475,14 @@ ifdef STRICT_CPLUSPLUS_SUFFIX
rm -f $(OBJDIR)/t_$*.cc
else
ifdef USE_NT_C_SYNTAX
- $(CCC) -Fo$@ -c $(CFLAGS) $<
+ $(CCC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
+else
+ifdef NEED_ABSOLUTE_PATH
+ $(CCC) -o $@ -c $(CFLAGS) $(call abspath,$<)
else
$(CCC) -o $@ -c $(CFLAGS) $<
endif
+endif
endif #STRICT_CPLUSPLUS_SUFFIX
%.i: %.cpp