aboutsummaryrefslogtreecommitdiffstats
path: root/dist/windows/mcode/ghdlversion.adb
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@tu-dresden.de>2017-02-17 04:53:59 +0100
committerPatrick Lehmann <Patrick.Lehmann@tu-dresden.de>2017-02-17 04:53:59 +0100
commit330ea6732666779dcadaf8936805acefa4eadc0a (patch)
treec651eef937cc0b70ac6b6bc4b40fd87938fb6eab /dist/windows/mcode/ghdlversion.adb
parentf0857455d654fd3a3b9de1bbca52c7bd6fcb5033 (diff)
downloadghdl-330ea6732666779dcadaf8936805acefa4eadc0a.tar.gz
ghdl-330ea6732666779dcadaf8936805acefa4eadc0a.tar.bz2
ghdl-330ea6732666779dcadaf8936805acefa4eadc0a.zip
Fixed Windows compile flow (PowerShell scripts) for GHDL and library compilations.
Diffstat (limited to 'dist/windows/mcode/ghdlversion.adb')
-rw-r--r--dist/windows/mcode/ghdlversion.adb30
1 files changed, 30 insertions, 0 deletions
diff --git a/dist/windows/mcode/ghdlversion.adb b/dist/windows/mcode/ghdlversion.adb
new file mode 100644
index 000000000..d2f1c28be
--- /dev/null
+++ b/dist/windows/mcode/ghdlversion.adb
@@ -0,0 +1,30 @@
+with Ada.Text_IO; use Ada.Text_IO;
+with Ada.Strings.Fixed; use Ada.Strings.Fixed;
+
+procedure Ghdlversion is
+ Line : String (1 .. 128);
+ Len : Natural;
+ Pos : Natural;
+ E : Natural;
+begin
+ loop
+ exit when End_Of_File;
+ Get_Line (Line, Len);
+
+ -- Search GHDL
+ Pos := Index (Line (1 .. Len), "GHDL ");
+ if Pos /= 0 then
+ Pos := Pos + 5;
+ E := Pos;
+ while Line (E) in '0' .. '9'
+ or Line (E) in 'a' .. 'z'
+ or Line (E) = '.'
+ loop
+ exit when E = Len;
+ E := E + 1;
+ end loop;
+ Put_Line ("!define VERSION """ & Line (Pos .. E - 1) & """");
+ return;
+ end if;
+ end loop;
+end Ghdlversion;