File: library_paths

package info (click to toggle)
usrmerge 21
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 136 kB
  • sloc: perl: 395; sh: 104; makefile: 30
file content (41 lines) | stat: -rwxr-xr-x 949 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl
# This program will print the RTLD and shared libraries paths for all
# architectures.
#
# The command line argument is the path to the debian/sysdeps/ directory
# of the glibc package.

use warnings;
use strict;
use autodie;
use v5.16;

use File::Slurp;

my $sysdeps_dir = $ARGV[0] || '../glibc-*/debian/sysdeps';

foreach my $file (glob("$sysdeps_dir/*.mk")) {
	doit($file);
}

sub doit {
	my ($file) = @_;

	say "==== $file ====";
	my @lines = grep { !/^#/ } read_file($file, chomp => 1);
	my @multilib = map { /\s*\+=\s*(\S+)/; $1 }
		grep { /^GLIBC_MULTILIB_PASSES\b/ } @lines;
	unshift(@multilib, 'libc');

	foreach my $arch (@multilib) {
		my ($rtlddir) = map { /=\s*(\S+)/; $1 }
			grep { /^${arch}_rtlddir\b/ } @lines;
		my ($slibdir) = map { /=\s*(\S+)/; $1 }
			grep { /^${arch}_slibdir\b/ } @lines;

		$rtlddir ||= ''; $slibdir ||= '';
		say "$arch\tRTLD: $rtlddir\t\tSLIBDIR: $slibdir"
			if $rtlddir or $slibdir;
	}
}