Commit 6de5b591 authored by seawood%netscape.com's avatar seawood%netscape.com
Browse files

Fixing win32 gmake builds lack of debugging information problem by working...

Fixing win32 gmake builds lack of debugging information problem by working around a combination MSVC & cygwin make deficiencies:
* We must use the full path to the source file when calling MSVC so that debugging information shows up in the object files.
* Because of cygwin's use of /cygdrive when using full paths, we must use a cygwin-wrapper script in some cases to allow native win32 programs to use a fully qualified cygwin path.
* We have to call configure using the full path so that $(srcdir) contains the
full path in the Makefiles. The rules have been changed for win32 so that it
always use $(srcdir)/$*.{c,cpp} as the sourcefile name even when the file is in
the cwd.  This works around both the /cygdrive issue and the msvc's path info
optimization.
* We still use the wrapper when calling rc.exe & nsinstall.  nsinstall
frequently takes multiple args and is called all over the tree so changing each
calling site is going to be expensive.	(I'll have to check  the logs again but
I think the rc wrapping can go.)
* nspr & ldap still use the wrappers for all native win32 progs.  Neither nspr
nor ldap uses the acoutput-fast.pl script to speed up the substitution of
@srcdir@ into their Makefiles so, makefile substitution will break if we use
dos-paths.
* In the handful of directories where we copy srcfiles from another directory
in lieu of using VPATHs, we have to now copy those files to $(srcdir) so that
the default rules can find them.
Bug #141834 r=leaf,wtc,dmose,mcs
parent b38ebe63
Loading
Loading
Loading
Loading

build/cygwin-wrapper

0 → 100755
+17 −0
Original line number Diff line number Diff line
#!/bin/sh
#
# Stupid wrapper to avoid win32 dospath/cygdrive issues
#
prog=$1
shift
if test -z "$prog"; then
    exit 0
fi
if test "$prog" = "-up"; then
   prog=$1
   shift
   args=`echo $* | sed -e 's|-I\(.\):|-I/cygdrive/\1|g;'`
else
   args=`echo $* | sed -e 's|/cygdrive/\(.\)/|\1:/|g;'`
fi
exec $prog $args
+2 −13
Original line number Diff line number Diff line
@@ -362,17 +362,6 @@ CHECKOUT_CALENDAR := true
FASTUPDATE_CALENDAR := true
endif


# because some cygwin tools can't handle native dos-drive paths & vice-versa
# force configure to use a relative path for --srcdir
# need a better check for win32
# and we need to get OBJDIR earlier
ifdef MOZ_TOOLS
_tmpobjdir := $(shell cygpath -u $(OBJDIR))
_abs2rel := $(shell cygpath -w $(TOPSRCDIR)/build/unix/abs2rel.pl | sed -e 's|\\|/|g')
_OBJ2SRCPATH := $(shell $(_abs2rel) $(TOPSRCDIR) $(_tmpobjdir))
endif 

#######################################################################
# Rules
# 
@@ -590,8 +579,8 @@ else
  CONFIGURE := $(TOPSRCDIR)/configure
endif

ifdef _OBJ2SRCPATH
CONFIGURE_ARGS := --srcdir=$(_OBJ2SRCPATH) $(CONFIGURE_ARGS)
ifdef MOZ_TOOLS
  CONFIGURE := $(TOPSRCDIR)/configure
endif

$(OBJDIR)/Makefile $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ build_number: FORCE

nsBuildID.h: nsBuildID.h.in build_number 
	$(RM) $@
	$(PERL) -I$(srcdir) $(srcdir)/aboutime.pl $@ build_number $<
	$(PERL) -I$(srcdir) $(srcdir)/aboutime.pl $@ build_number $(srcdir)/nsBuildID.h.in

elf-dynstr-gc: elf-dynstr-gc.c Makefile Makefile.in
	$(CC) $(COMPILE_CFLAGS) $(GLIB_CFLAGS) $(GLIB_LIBS) $(LDFLAGS) -o $@ $<
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ XCFLAGS = @XCFLAGS@
XLDFLAGS	= @XLDFLAGS@
XLIBS		= @XLIBS@

CYGWIN_WRAPPER	= @CYGWIN_WRAPPER@
AIX_SHLIB_BIN	= @AIX_SHLIB_BIN@
AR		= @AR@
AR_FLAGS	= @AR_FLAGS@
+5 −3
Original line number Diff line number Diff line
@@ -287,13 +287,14 @@ else
# compiler optimization bugs, as well as running with Quantify.
ifdef MOZ_PROFILE
MOZ_OPTIMIZE_FLAGS=-Zi -O1 -UDEBUG -DNDEBUG
OS_LDFLAGS = /DEBUG /DEBUGTYPE:CV /OPT:REF /OPT:nowin98
OS_LDFLAGS = /DEBUG /DEBUGTYPE:CV /PDB:NONE /OPT:REF /OPT:nowin98
WIN32_EXE_LDFLAGS=/FIXED:NO
endif

# if MOZ_COVERAGE is set, we handle pdb files slightly differently
ifdef MOZ_COVERAGE
MOZ_OPTIMIZE_FLAGS=-Zi -O1 -UDEBUG -DNDEBUG
OS_LDFLAGS = /DEBUG /DEBUGTYPE:CV /OPT:REF /OPT:nowin98
OS_LDFLAGS = /DEBUG /DEBUGTYPE:CV /PDB:NONE /OPT:REF /OPT:nowin98
endif
# MOZ_COVERAGE

@@ -468,6 +469,7 @@ else
XPIDL_COMPILE 	= $(DIST)/bin/xpidl$(BIN_SUFFIX)
XPIDL_LINK	= $(DIST)/bin/xpt_link$(BIN_SUFFIX)
endif
MIDL		= midl

ifeq ($(OS_ARCH),OS2)
PATH_SEPARATOR	:= \;
@@ -720,7 +722,7 @@ GARBAGE += $(DEPENDENCIES) $(MKDEPENDENCIES) $(MKDEPENDENCIES).bak core $(wildc

ifeq (,$(filter-out WINNT, $(OS_ARCH)))
ifeq ($(OS_ARCH),WINNT)
NSINSTALL	= $(MOZ_TOOLS_DIR)/bin/nsinstall
NSINSTALL	= $(CYGWIN_WRAPPER) $(MOZ_TOOLS_DIR)/bin/nsinstall
else
NSINSTALL	= nsinstall
endif
Loading