283156: teach make-makefile how to deal properly with .. components in DIRS, sr=bsmedberg

This commit is contained in:
shaver%mozilla.org 2005-03-04 13:37:14 +00:00
Родитель 93bcabd254
Коммит 1e4b1cef8d
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -226,7 +226,12 @@ sub update_makefiles {
$ac_dir_suffix = "/$ac_dir";
$ac_dir_suffix =~ s%^/\./%/%;
$ac_dots = $ac_dir_suffix;
$ac_dots =~ s%/[^/]*/\.\.%%g;
# Remove .. components from the provided dir suffix, and
# also the forward path components they were reversing.
my $backtracks = $ac_dots =~ s%\.\.(/|$)%%g;
while ($backtracks--) {
$ac_dots =~ s%/[^/]*%%;
}
$ac_dots =~ s%/[^/]*%../%g;
}
if ($ac_given_srcdir eq '.') {
@ -238,6 +243,10 @@ sub update_makefiles {
$srcdir = "$pac_given_srcdir$ac_dir_suffix";
$top_srcdir = "$pac_given_srcdir";
} else {
if ($debug) {
print "ac_dots = $ac_dots\n";
print "ac_dir_suffix = $ac_dir_suffix\n";
}
$srcdir = "$ac_dots$ac_given_srcdir$ac_dir_suffix";
$top_srcdir = "$ac_dots$ac_given_srcdir";
}