summaryrefslogtreecommitdiff
path: root/examples/depmod.pl
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-02 21:30:40 +0000
committerRob Landley <rob@landley.net>2006-06-02 21:30:40 +0000
commit9a990aaba82fb1e1e718c2485ca388d908c85ad7 (patch)
treec20740d23f992dc5604f431106011c1579b9c4cc /examples/depmod.pl
parente15d7573a1263fb364d1678c3a46be47a8b5e5ea (diff)
downloadbusybox-w32-9a990aaba82fb1e1e718c2485ca388d908c85ad7.tar.gz
busybox-w32-9a990aaba82fb1e1e718c2485ca388d908c85ad7.tar.bz2
busybox-w32-9a990aaba82fb1e1e718c2485ca388d908c85ad7.zip
Patch from Atsushi Nemoto:
This patch make depmod.pl more robust in cross environment.  If native nm did not recognize target's object, you can override it with NM environment variable.
Diffstat (limited to 'examples/depmod.pl')
-rwxr-xr-xexamples/depmod.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/depmod.pl b/examples/depmod.pl
index 0e66ee3eb..19eca80eb 100755
--- a/examples/depmod.pl
+++ b/examples/depmod.pl
@@ -25,6 +25,7 @@ my $kernelsyms="";
25my $stdout=0; 25my $stdout=0;
26my $verbose=0; 26my $verbose=0;
27my $help=0; 27my $help=0;
28my $nm = $ENV{'NM'} || "nm";
28 29
29# more globals 30# more globals
30my (@liblist) = (); 31my (@liblist) = ();
@@ -104,7 +105,7 @@ foreach my $obj ( @liblist ){
104 warn "\nMODULE = $tgtname\n" if $verbose; 105 warn "\nMODULE = $tgtname\n" if $verbose;
105 106
106 # get a list of symbols 107 # get a list of symbols
107 my @output=`nm $obj`; 108 my @output=`$nm $obj`;
108 109
109 build_ref_tables($tgtname, \@output, $exp, $dep); 110 build_ref_tables($tgtname, \@output, $exp, $dep);
110} 111}
@@ -112,7 +113,7 @@ foreach my $obj ( @liblist ){
112 113
113# vmlinux is a special name that is only used to resolve symbols 114# vmlinux is a special name that is only used to resolve symbols
114my $tgtname = 'vmlinux'; 115my $tgtname = 'vmlinux';
115my @output = $kernelsyms ? `cat $kernelsyms` : `nm $kernel`; 116my @output = $kernelsyms ? `cat $kernelsyms` : `$nm $kernel`;
116warn "\nMODULE = $tgtname\n" if $verbose; 117warn "\nMODULE = $tgtname\n" if $verbose;
117build_ref_tables($tgtname, \@output, $exp, $dep); 118build_ref_tables($tgtname, \@output, $exp, $dep);
118 119