diff --git a/mozilla/build/autoconf/make-makefile b/mozilla/build/autoconf/make-makefile index a0caa3e2830..e235e5767d8 100755 --- a/mozilla/build/autoconf/make-makefile +++ b/mozilla/build/autoconf/make-makefile @@ -38,7 +38,7 @@ # make-makefiles - Quickly create Makefiles for subdirectories. # Also, creates any needed subdirectories. # -# usage: make-makefiles [ -t -d ] [ | /Makefile ] ... +# usage: make-makefiles [ -t -p -d ] [ | /Makefile ] ... # Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com). @@ -46,7 +46,7 @@ # Determine various tree path variables # -($topsrcdir, $depth, @makefiles) = parse_arguments(@ARGV); +($topsrcdir, $ptopsrcdir, $depth, @makefiles) = parse_arguments(@ARGV); $object_fullpath = `pwd`; chdir $depth; @@ -75,6 +75,7 @@ create_directories(@makefiles); # was invoked. The path is either relative to the object directory # or an absolute path. $given_srcdir = find_srcdir($topsrcdir, $depth); +$pgiven_srcdir = find_srcdir($ptopsrcdir, $depth); if ($debug) { warn "object_fullpath = $object_fullpath\n"; @@ -84,7 +85,7 @@ if ($debug) { warn "given_srcdir = $given_srcdir\n"; } -@unhandled = update_makefiles($given_srcdir, @makefiles); +@unhandled = update_makefiles($given_srcdir, $pgiven_srcdir, @makefiles); run_config_status(@unhandled); @@ -112,6 +113,7 @@ sub parse_arguments { my @args = @_; my $depth = ''; my $topsrcdir = ''; + my $ptopsrcdir; my @makefiles = (); while (1) { @@ -123,6 +125,10 @@ sub parse_arguments { $topsrcdir = $args[1]; shift @args; shift @args; + } elsif ($args[0] eq '-p') { + $ptopsrcdir = $args[1]; + shift @args; + shift @args; } else { last; } @@ -132,6 +138,9 @@ sub parse_arguments { $topsrcdir = $0; # Figure out topsrcdir based on program name. $topsrcdir =~ s|/?build/autoconf/.*$||; } + if ($ptopsrcdir eq '') { + $ptopsrcdir = $topsrcdir; + } if ($depth eq '') { # Use $(DEPTH) in the Makefile or Makefile.in to determine the depth if (-e "Makefile.in") { @@ -159,7 +168,7 @@ sub parse_arguments { } @makefiles = "Makefile" unless @args; - return ($topsrcdir, $depth, @makefiles); + return ($topsrcdir, $ptopsrcdir, $depth, @makefiles); } @@ -173,7 +182,7 @@ sub create_directories { push @dirs, dirname($ac_file); } # Call mkdir with the directories sorted by subdir count (how many /'s) - system "mkdir -p ". join(' ', @dirs) if @dirs; + system "mkdir -p ". join(' ', map("\"$_\"", @dirs)) if @dirs; } # Find the top of the source directory @@ -199,7 +208,7 @@ sub find_srcdir { # Output the makefiles. # sub update_makefiles { - my ($ac_given_srcdir, @makefiles) = @_; + my ($ac_given_srcdir, $pac_given_srcdir, @makefiles) = @_; my @unhandled=(); my $ac_file; @@ -224,9 +233,9 @@ sub update_makefiles { $top_srcdir = $ac_dots; $top_srcdir =~ s%/$%%; } - } elsif ($ac_given_srcdir =~ m%^/% or $ac_given_srcdir =~ m%^.:/%) { - $srcdir = "$ac_given_srcdir$ac_dir_suffix"; - $top_srcdir = "$ac_given_srcdir"; + } elsif ($pac_given_srcdir =~ m%^/% or $pac_given_srcdir =~ m%^.:/%) { + $srcdir = "$pac_given_srcdir$ac_dir_suffix"; + $top_srcdir = "$pac_given_srcdir"; } else { $srcdir = "$ac_dots$ac_given_srcdir$ac_dir_suffix"; $top_srcdir = "$ac_dots$ac_given_srcdir"; diff --git a/mozilla/config/autoconf.mk.in b/mozilla/config/autoconf.mk.in index 98e491dc8ca..5443bb2939a 100644 --- a/mozilla/config/autoconf.mk.in +++ b/mozilla/config/autoconf.mk.in @@ -241,6 +241,7 @@ XLDFLAGS = @XLDFLAGS@ XLIBS = @XLIBS@ CYGWIN_WRAPPER = @CYGWIN_WRAPPER@ +AS_PERL = @AS_PERL@ CYGDRIVE_MOUNT = @CYGDRIVE_MOUNT@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ diff --git a/mozilla/config/rules.mk b/mozilla/config/rules.mk index ffd3888f1b5..f762dbe0132 100644 --- a/mozilla/config/rules.mk +++ b/mozilla/config/rules.mk @@ -1212,15 +1212,22 @@ endif ############################################################################### # Update Makefiles ############################################################################### + +# In GNU make 3.80, makefiles must use the /cygdrive syntax, even if we're +# processing them with AS perl. See bug 232003 +ifdef AS_PERL +CYGWIN_TOPSRCDIR = -nowrap -p $(topsrcdir) -wrap +endif + # Note: Passing depth to make-makefile is optional. # It saves the script some work, though. Makefile: Makefile.in - @$(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) + @$(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $(CYGWIN_TOPSRCDIR) ifdef SUBMAKEFILES # VPATH does not work on some machines in this case, so add $(srcdir) $(SUBMAKEFILES): % : $(srcdir)/%.in - $(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $@ + $(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $(CYGWIN_TOPSRCDIR) $@ endif ifdef AUTOUPDATE_CONFIGURE diff --git a/mozilla/configure.in b/mozilla/configure.in index 42b0f560c4f..0c7352c8930 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -882,7 +882,7 @@ case "$host" in CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper" fi if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then - _AS_PERL=1 + AS_PERL=1 PERL="${CYGWIN_WRAPPER} $PERL" fi ;; @@ -5980,6 +5980,7 @@ AC_SUBST(MOZ_MAPINFO) AC_SUBST(MOZ_BROWSE_INFO) AC_SUBST(MOZ_TOOLS_DIR) AC_SUBST(CYGWIN_WRAPPER) +AC_SUBST(AS_PERL) dnl Disable profile at startup, hack for tinderbox. if test "$MOZ_BYPASS_PROFILE_AT_STARTUP"; then @@ -6318,7 +6319,7 @@ dnl This does not change the $MAKEFILES variable. dnl dnl OpenVMS gets a line overflow on the long eval command, so use a temp file. dnl -if test -z "${_AS_PERL}"; then +if test -z "${AS_PERL}"; then echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh else echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh