Bug 232003 - AS perl and cygwin GNU make 3.80 don't play well together r=cls

git-svn-id: svn://10.0.0.236/trunk@168912 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bsmedberg%covad.net 2005-02-07 14:55:07 +00:00
parent 81cb4c062e
commit b9453ddbc8
4 changed files with 31 additions and 13 deletions

View File

@ -38,7 +38,7 @@
# make-makefiles - Quickly create Makefiles for subdirectories.
# Also, creates any needed subdirectories.
#
# usage: make-makefiles [ -t <topsrcdir> -d <depth> ] [ <subdir> | <subdir>/Makefile ] ...
# usage: make-makefiles [ -t <topsrcdir> -p <print_topsrcdir> -d <depth> ] [ <subdir> | <subdir>/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";

View File

@ -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@

View File

@ -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

View File

@ -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