my $objdir = shift;
my $ver = new IO::File;
- if (!$ver->open("$objdir/include/linux/utsrelease.h") &&
+ if (!$ver->open("$objdir/include/generated/utsrelease.h") &&
+ !$ver->open("$objdir/include/linux/utsrelease.h") &&
!$ver->open("$objdir/include/linux/version.h") &&
+ !$ver->open("$dir/include/generated/utsrelease.h") &&
!$ver->open("$dir/include/linux/utsrelease.h") &&
!$ver->open("$dir/include/linux/version.h")) {
die "Run make dep on '$dir'\n";
$path =~ s/(.+)\/.*/\1/;
push(@INC, $cwd . "/" . $path);
-my $is_git = 0;
-my $is_cvs = 0;
+# The _first_ argument on the command line may be --make_META
+# Remove it from ARGV if found
+if ($ARGV[0] eq "--make_META") {
+ shift @ARGV;
+ $make_meta = 1;
+}
# ARGV[0] = srcdir
# ARGV[1] = builddir
}
if (-d ".git") {
- $is_git = 1;
require "version_tag-git.pl";
-} elsif (-d "CVS") {
- $is_cvs = 1;
- require "version_tag-cvs.pl";
} else {
die("a tree status can only be determined in an source code control system checkout\n")
- if ($progname eq "make_META.pl");
+ if ($make_meta);
require "version_tag-none.pl";
}
my $pristine = is_pristine();
my $buildid = get_buildid();
-if ($progname eq "version_tag.pl") {
- die("you have to configure with a linux kernel source/headers tree (i.e. using\n--with-linux=) before you can run this script\n")
- if ($am_linuxdir eq "");
+if (!$make_meta) {
+ my $kernver = "";
+ $kernver = get_kernver($am_linuxdir, $am_linuxobjdir)
+ if ($am_linuxdir ne "");
- my $kernver = get_kernver($am_linuxdir, $am_linuxobjdir);
my $linuxdir =~ s/\//\./g;
generate_ver($tag, $local_version, $buildid, $linuxdir, $pristine, $kernver,
$ENV{LUSTRE_VERS});
-} elsif ($progname eq "make_META.pl") {
+} else {
print "TAG = $tag\n";
print "VERSION = $am_version\n";
print "BUILDID = $buildid\n";