summaryrefslogtreecommitdiff
path: root/version.pl
diff options
context:
space:
mode:
authorhpa <hpa>2002-06-11 05:48:29 +0000
committerhpa <hpa>2002-06-11 05:48:29 +0000
commitabac6f53695c0b99e0235ca3da81ab3cd822f475 (patch)
tree42c9c90abcb685ec654b25e680f6a0e272d1fe52 /version.pl
parent73d0682dcdd250939e560d333b591d7a5a8299ca (diff)
downloadsyslinux-abac6f53695c0b99e0235ca3da81ab3cd822f475.tar.gz
Add an API for COMBOOT images, and add support for "COM32" -- 32-bit
linear .com files.
Diffstat (limited to 'version.pl')
-rwxr-xr-xversion.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/version.pl b/version.pl
new file mode 100755
index 00000000..fa09e40d
--- /dev/null
+++ b/version.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+#
+# Read the "version" file and produce some macro declarations
+#
+
+use Fcntl;
+
+$vfile = $ARGV[0];
+sysopen(VERSION, $vfile, O_RDONLY) or die "$0: Cannot open $vfile\n";
+$version = <VERSION>;
+chomp $version;
+close(VERSION);
+
+unless ( $version =~ /^([0-9]+)\.([0-9]+)$/ ) {
+ die "$0: Cannot parse version format\n";
+}
+$vma = $1+0; $vmi = $2+0;
+
+open(VI, "> version.gen") or die "$0: Cannot create version.gen\n";
+print VI "%define VERSION \"$version\"\n";
+print VI "%define VER_MAJOR $vma\n";
+print VI "%define VER_MINOR $vmi\n";
+close(VI);
+
+