[PATCH] check NM environment variable in depmod.pl

Atsushi Nemoto anemo at mba.ocn.ne.jp
Thu Jun 1 06:44:38 UTC 2006


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.

--- busybox-1.1.3.org/examples/depmod.pl	2006-03-23 06:16:26.000000000 +0900
+++ busybox-1.1.3/examples/depmod.pl	2006-06-01 15:31:00.000000000 +0900
@@ -25,6 +25,7 @@
 my $stdout=0;
 my $verbose=0;
 my $help=0;
+my $nm = $ENV{'NM'} || "nm";
 
 # more globals
 my (@liblist) = ();
@@ -104,7 +105,7 @@
     warn "\nMODULE = $tgtname\n" if $verbose;
 
     # get a list of symbols
-	my @output=`nm $obj`;
+	my @output=`$nm $obj`;
 
     build_ref_tables($tgtname, \@output, $exp, $dep);
 }
@@ -112,7 +113,7 @@
 
 # vmlinux is a special name that is only used to resolve symbols
 my $tgtname = 'vmlinux';
-my @output = $kernelsyms ? `cat $kernelsyms` : `nm $kernel`;
+my @output = $kernelsyms ? `cat $kernelsyms` : `$nm $kernel`;
 warn "\nMODULE = $tgtname\n" if $verbose;
 build_ref_tables($tgtname, \@output, $exp, $dep);
 



More information about the busybox mailing list