mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
Add a new --libfiles option, for getting fully-qualified pathnames to libraries.
This can be used for tools that want makefile rules to depend on the libraries (e.g. so the tool is relinked when a library changes). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fc790168a2
commit
d179de5ca2
@ -81,6 +81,7 @@ if ($ABS_RUN_DIR eq $ABS_OBJ_ROOT) {
|
|||||||
|
|
||||||
sub usage;
|
sub usage;
|
||||||
sub fix_library_names (@);
|
sub fix_library_names (@);
|
||||||
|
sub fix_library_files (@);
|
||||||
sub expand_dependecies (@);
|
sub expand_dependecies (@);
|
||||||
sub name_map_entries;
|
sub name_map_entries;
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ my @components;
|
|||||||
my $has_opt = 0;
|
my $has_opt = 0;
|
||||||
my $want_libs = 0;
|
my $want_libs = 0;
|
||||||
my $want_libnames = 0;
|
my $want_libnames = 0;
|
||||||
|
my $want_libfiles = 0;
|
||||||
my $want_components = 0;
|
my $want_components = 0;
|
||||||
foreach my $arg (@ARGV) {
|
foreach my $arg (@ARGV) {
|
||||||
if ($arg =~ /^-/) {
|
if ($arg =~ /^-/) {
|
||||||
@ -113,6 +115,8 @@ foreach my $arg (@ARGV) {
|
|||||||
$has_opt = 1; $want_libs = 1;
|
$has_opt = 1; $want_libs = 1;
|
||||||
} elsif ($arg eq "--libnames") {
|
} elsif ($arg eq "--libnames") {
|
||||||
$has_opt = 1; $want_libnames = 1;
|
$has_opt = 1; $want_libnames = 1;
|
||||||
|
} elsif ($arg eq "--libfiles") {
|
||||||
|
$has_opt = 1; $want_libfiles = 1;
|
||||||
} elsif ($arg eq "--components") {
|
} elsif ($arg eq "--components") {
|
||||||
$has_opt = 1; print join(' ', name_map_entries), "\n";
|
$has_opt = 1; print join(' ', name_map_entries), "\n";
|
||||||
} elsif ($arg eq "--targets-built") {
|
} elsif ($arg eq "--targets-built") {
|
||||||
@ -140,14 +144,11 @@ if (@components == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Handle any arguments which require building our dependency graph.
|
# Handle any arguments which require building our dependency graph.
|
||||||
if ($want_libs || $want_libnames) {
|
if ($want_libs || $want_libnames || $want_libfiles) {
|
||||||
my @libs = expand_dependecies(@components);
|
my @libs = expand_dependecies(@components);
|
||||||
if ($want_libs) {
|
print join(' ', fix_library_names(@libs)), "\n" if ($want_libs);
|
||||||
print join(' ', fix_library_names(@libs)), "\n";
|
print join(' ', @libs), "\n" if ($want_libnames);
|
||||||
}
|
print join(' ', fix_library_files(@libs)), "\n" if ($want_libfiles);
|
||||||
if ($want_libnames) {
|
|
||||||
print join(' ', @libs), "\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
@ -178,6 +179,7 @@ Options:
|
|||||||
--ldflags Print Linker flags.
|
--ldflags Print Linker flags.
|
||||||
--libs Libraries needed to link against LLVM components.
|
--libs Libraries needed to link against LLVM components.
|
||||||
--libnames Bare library names for in-tree builds.
|
--libnames Bare library names for in-tree builds.
|
||||||
|
--libfiles Fully qualified library filenames for makefile depends.
|
||||||
--components List of all possible components.
|
--components List of all possible components.
|
||||||
--targets-built List of all targets currently built.
|
--targets-built List of all targets currently built.
|
||||||
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
|
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
|
||||||
@ -206,6 +208,16 @@ sub fix_library_names (@) {
|
|||||||
return @result;
|
return @result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Turn the list of libraries into a list of files.
|
||||||
|
sub fix_library_files(@) {
|
||||||
|
my @libs = @_;
|
||||||
|
my @result;
|
||||||
|
foreach my $lib (@libs) {
|
||||||
|
# Transform the bare library name into a filename.
|
||||||
|
push @result, "$LIBDIR/$lib";
|
||||||
|
}
|
||||||
|
return @result;
|
||||||
|
}
|
||||||
|
|
||||||
#==========================================================================
|
#==========================================================================
|
||||||
# Library Dependency Analysis
|
# Library Dependency Analysis
|
||||||
|
Loading…
x
Reference in New Issue
Block a user