Whamcloud - gitweb
Branch HEAD
authorrobert.read <robert.read>
Tue, 16 Jun 2009 18:35:05 +0000 (18:35 +0000)
committerrobert.read <robert.read>
Tue, 16 Jun 2009 18:35:05 +0000 (18:35 +0000)
b=16424
i=sheng.yang
i=yibin.wang
a=brian

Build fix for sles' -obj dirs.

lustre/scripts/version_tag.pl

index 8ae53ae..0433366 100644 (file)
@@ -144,7 +144,7 @@ sub get_latest_mtime()
 sub get_linuxdir()
 {
     my $config = new IO::File;
 sub get_linuxdir()
 {
     my $config = new IO::File;
-    my ($line, $dir);
+    my ($line, $dir, $objdir);
     if (!$config->open("autoMakefile")) {
         die "Run ./configure first\n";
     }
     if (!$config->open("autoMakefile")) {
         die "Run ./configure first\n";
     }
@@ -152,16 +152,19 @@ sub get_linuxdir()
         chomp($line);
         if ($line =~ /LINUX :?= (.*)/) {
             $dir = $1;
         chomp($line);
         if ($line =~ /LINUX :?= (.*)/) {
             $dir = $1;
+        } elsif ($line =~ /LINUX_OBJ :?= (.*)/) {
+            $objdir = $1;
             last;
         }
     }
     $config->close();
     my $ver = new IO::File;
             last;
         }
     }
     $config->close();
     my $ver = new IO::File;
-    if (!$ver->open("$dir/include/linux/utsrelease.h")) {
-        if (!$ver->open("$dir/include/linux/version.h")) {
+    if (!$ver->open("$objdir/include/linux/utsrelease.h") &&
+        !$ver->open("$objdir/include/linux/version.h") &&
+        !$ver->open("$dir/include/linux/utsrelease.h") &&
+        !$ver->open("$dir/include/linux/version.h")) {
             die "Run make dep on $dir\n";
         }
             die "Run make dep on $dir\n";
         }
-    }
     while(defined($line = <$ver>)) {
         $line =~ /\#define UTS_RELEASE "(.*)"/;
         if ($1) {
     while(defined($line = <$ver>)) {
         $line =~ /\#define UTS_RELEASE "(.*)"/;
         if ($1) {