mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-02-05 22:17:05 +00:00
We compute various values for vpath lookup the first time through
and store them in static variables; however one value (std_dirs) was not being stored statically so the second time through it was not set. Fixes Savannah bug #32511
This commit is contained in:
parent
ef2b0425e7
commit
0369a93825
4 changed files with 38 additions and 41 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2011-09-18 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* remake.c (library_search): STD_DIRS is computed when other
|
||||||
|
static vars like buflen etc. are computed, so it must be static
|
||||||
|
as well. See Savannah bug #32511.
|
||||||
|
|
||||||
2011-09-16 Paul Smith <psmith@gnu.org>
|
2011-09-16 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* maintMakefile (do-po-update): Apparently we have to avoid
|
* maintMakefile (do-po-update): Apparently we have to avoid
|
||||||
|
|
4
remake.c
4
remake.c
|
@ -1538,8 +1538,7 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
|
||||||
unsigned int liblen;
|
unsigned int liblen;
|
||||||
|
|
||||||
/* Information about the earliest (in the vpath sequence) match. */
|
/* Information about the earliest (in the vpath sequence) match. */
|
||||||
unsigned int best_vpath, best_path;
|
unsigned int best_vpath = 0, best_path = 0;
|
||||||
unsigned int std_dirs = 0;
|
|
||||||
|
|
||||||
char **dp;
|
char **dp;
|
||||||
|
|
||||||
|
@ -1558,6 +1557,7 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
|
||||||
static char *buf = NULL;
|
static char *buf = NULL;
|
||||||
static unsigned int buflen = 0;
|
static unsigned int buflen = 0;
|
||||||
static int libdir_maxlen = -1;
|
static int libdir_maxlen = -1;
|
||||||
|
static unsigned int std_dirs = 0;
|
||||||
char *libbuf = variable_expand ("");
|
char *libbuf = variable_expand ("");
|
||||||
|
|
||||||
/* Expand the pattern using LIB as a replacement. */
|
/* Expand the pattern using LIB as a replacement. */
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2011-09-18 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* scripts/features/vpath3: Verify handling of -lfoo libraries
|
||||||
|
found via vpath vs. the standard directory search.
|
||||||
|
See Savannah bug #32511.
|
||||||
|
|
||||||
2011-09-12 Paul Smith <psmith@gnu.org>
|
2011-09-12 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* scripts/functions/call: Verify that using export in a $(call ...)
|
* scripts/functions/call: Verify that using export in a $(call ...)
|
||||||
|
|
|
@ -1,50 +1,35 @@
|
||||||
# -*-perl-*-
|
# -*-perl-*-
|
||||||
|
|
||||||
$description = "Test the interaction of the -lfoo feature and vpath";
|
$description = "Test the interaction of the -lfoo feature and vpath";
|
||||||
$details = "";
|
$details = "";
|
||||||
|
|
||||||
open(MAKEFILE,"> $makefile");
|
my @dirs_to_make = qw(a1 b1 a2 b2 b3);
|
||||||
|
for my $d (@dirs_to_make) {
|
||||||
# The Contents of the MAKEFILE ...
|
mkdir($d, 0777);
|
||||||
|
}
|
||||||
print MAKEFILE "vpath %.a a1\n";
|
|
||||||
print MAKEFILE "vpath %.so b1\n";
|
|
||||||
print MAKEFILE "vpath % a2 b2\n";
|
|
||||||
print MAKEFILE "vpath % b3\n";
|
|
||||||
print MAKEFILE "all: -l1 -l2 -l3; \@echo \$^\n";
|
|
||||||
|
|
||||||
# END of Contents of MAKEFILE
|
|
||||||
|
|
||||||
close(MAKEFILE);
|
|
||||||
|
|
||||||
mkdir("a1", 0777);
|
|
||||||
mkdir("b1", 0777);
|
|
||||||
mkdir("a2", 0777);
|
|
||||||
mkdir("b2", 0777);
|
|
||||||
mkdir("b3", 0777);
|
|
||||||
|
|
||||||
@files_to_touch = ("a1${pathsep}lib1.a",
|
|
||||||
"b1${pathsep}lib1.so",
|
|
||||||
"a2${pathsep}lib2.a",
|
|
||||||
"b2${pathsep}lib2.so",
|
|
||||||
"lib3.a",
|
|
||||||
"b3${pathsep}lib3.so");
|
|
||||||
|
|
||||||
|
my @files_to_touch = ("a1${pathsep}lib1.a",
|
||||||
|
"a1${pathsep}libc.a",
|
||||||
|
"b1${pathsep}lib1.so",
|
||||||
|
"a2${pathsep}lib2.a",
|
||||||
|
"b2${pathsep}lib2.so",
|
||||||
|
"lib3.a",
|
||||||
|
"b3${pathsep}lib3.so");
|
||||||
&touch(@files_to_touch);
|
&touch(@files_to_touch);
|
||||||
|
|
||||||
&run_make_with_options($makefile,"",&get_logfile);
|
run_make_test('
|
||||||
|
vpath %.h b3
|
||||||
|
vpath %.a a1
|
||||||
|
vpath %.so b1
|
||||||
|
vpath % a2 b2
|
||||||
|
vpath % b3
|
||||||
|
all: -l1 -lc -l2 -l3; @echo $^
|
||||||
|
',
|
||||||
|
'', "a1${pathsep}lib1.a a1${pathsep}libc.a a2${pathsep}lib2.a lib3.a\n");
|
||||||
|
|
||||||
# Create the answer to what should be produced by this Makefile
|
unlink(@files_to_touch);
|
||||||
$answer = "a1${pathsep}lib1.a a2${pathsep}lib2.a lib3.a\n";
|
for my $d (@dirs_to_make) {
|
||||||
|
rmdir($d);
|
||||||
if (&compare_output($answer,&get_logfile(1)))
|
|
||||||
{
|
|
||||||
unlink @files_to_touch;
|
|
||||||
rmdir("a1");
|
|
||||||
rmdir("b1");
|
|
||||||
rmdir("a2");
|
|
||||||
rmdir("b2");
|
|
||||||
rmdir("b3");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Reference in a new issue