Skip to content

Commit f350f11

Browse files
committed
fix
1 parent 2d30b76 commit f350f11

11 files changed

+78
-61
lines changed

GNUmakefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ all: build test
1313
# default build
1414
#
1515

16-
VERSION = 15.08.15
16+
VERSION := $(shell python3 showversion.py)
1717
DISTDIR ?= ./build/dist
1818
PREFIX ?= /usr/local
1919
EXECPREFIX ?= ${PREFIX}/bin
@@ -85,7 +85,10 @@ help:
8585
# FBUILD_PARAMS: parameters to fbuild, default none
8686
# fbuild/fbuild-light --help for options
8787

88-
build: configure bootstrap bootstrap-tools rebuild uproot
88+
showversion:
89+
echo Felix Version ${VERSION}
90+
91+
build: showversion configure bootstrap bootstrap-tools rebuild uproot
8992

9093
bootstrap: fbuild
9194
cp ${BUILDROOT}/host/bin/bootflx ${BUILDROOT}/host/bin/flx

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
#
1010
# We currently make a debug build for 64 bit windows ONLY.
1111

12-
all: bootstrap tools target uproot test
12+
all: showversion bootstrap tools target uproot test
13+
14+
showversion:
15+
python showversion.py
1316

1417
rebuild: copy extract tools target uproot
1518

File renamed without changes.
File renamed without changes.
File renamed without changes.

buildsystem/version.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
flx_version_major = '15'
2-
flx_version_minor = '08'
3-
flx_version_patch = '15'
4-
flx_version_release = ''
5-
flx_version = flx_version_major+'.'+flx_version_minor+'.'+flx_version_patch+flx_version_release
1+
flx_version_major = "2015"
2+
flx_version_minor = "10"
3+
flx_version_patch = "29"
4+
flx_version_release = ""
5+
flx_version = flx_version_major+"."+flx_version_minor+"."+flx_version_patch+flx_version_release

fbuildroot.py

+55-23
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
# HACK
1616
import os, sys
1717

18+
import time
19+
now = time.time()
20+
gmtime = time.gmtime(now)
21+
1822
from os.path import join
1923
import fnmatch
2024

@@ -430,44 +434,72 @@ def find_grammar(build_dir):
430434

431435
flx_find_grammar_files.run(build_dir)
432436

433-
def write_script(version):
437+
def write_script(buildroot,version):
434438
Path("installscript").makedirs()
435439
f = open (Path("installscript") / "posixinstall.sh","w")
436-
f.write(r"rm -rfd /usr/local/lib/felix/felix-"+version+r"")
437-
f.write(r"mkdir -p /usr/local/lib/felix/felix-"+version+r"/share")
438-
f.write(r"mkdir -p /usr/local/lib/felix/felix-"+version+r"/host")
439-
f.write(r"cp -r build/release/share/* /usr/local/lib/felix/felix-"+version+r"/share")
440-
f.write(r"cp -r build/release/host/* /usr/local/lib/felix/felix-"+version+r"/host")
440+
f.write(r"rm -rfd /usr/local/lib/felix/felix-"+version+r""+"\n")
441+
f.write(r"mkdir -p /usr/local/lib/felix/felix-"+version+r"/share"+"\n")
442+
f.write(r"mkdir -p /usr/local/lib/felix/felix-"+version+r"/host"+"\n")
443+
f.write(r"cp -r build/release/share/* /usr/local/lib/felix/felix-"+version+r"/share"+"\n")
444+
f.write(r"cp -r build/release/host/* /usr/local/lib/felix/felix-"+version+r"/host"+"\n")
441445
f.close()
442446

443447
f = open (Path("installscript") / "win32install.bat","w")
444448
f.write(r"@echo off")
445-
f.write(r"mkdir c:\usr\local\lib\felix\felix-"+version+r"\crap")
446-
f.write(r"rmdir /S /Q c:\usr\local\lib\felix\felix-"+version+r"")
447-
f.write(r"mkdir c:\usr\local\lib\felix\felix-"+version+r"\share")
448-
f.write(r"mkdir c:\usr\local\lib\felix\felix-"+version+r"\host")
449-
f.write(r"xcopy /E build\release\share\* c:\usr\local\lib\felix\felix-"+version+r"\share")
450-
f.write(r"xcopy /E build\release\host\* c:\usr\local\lib\felix\felix-"+version+r"\host")
449+
f.write(r"mkdir c:\usr\local\lib\felix\felix-"+version+r"\crap"+"\n")
450+
f.write(r"rmdir /S /Q c:\usr\local\lib\felix\felix-"+version+r""+"\n")
451+
f.write(r"mkdir c:\usr\local\lib\felix\felix-"+version+r"\share"+"\n")
452+
f.write(r"mkdir c:\usr\local\lib\felix\felix-"+version+r"\host"+"\n")
453+
f.write(r"xcopy /E build\release\share\* c:\usr\local\lib\felix\felix-"+version+r"\share"+"\n")
454+
f.write(r"xcopy /E build\release\host\* c:\usr\local\lib\felix\felix-"+version+r"\host"+"\n")
451455
f.close()
452456

453457
f = open (Path("installscript") / "linuxsetup.sh","w")
454-
f.write(r"export PATH=/usr/local/lib/felix/felix-"+version+r"/host/bin:$PATH")
455-
f.write(r"export LD_LIBRARY_PATH=/usr/local/lib/felix/felix-"+version+r"/host/lib/rtl:$LD_LIBRARY_PATH")
458+
f.write(r"export PATH=/usr/local/lib/felix/felix-"+version+r"/host/bin:$PATH"+"\n")
459+
f.write(r"export LD_LIBRARY_PATH=/usr/local/lib/felix/felix-"+version+r"/host/lib/rtl:$LD_LIBRARY_PATH"+"\n")
456460
f.close()
457461

458462
f = open (Path("installscript") / "osxsetup.sh","w")
459-
f.write(r"export PATH=/usr/local/lib/felix/felix-"+version+r"/host/bin:$PATH")
460-
f.write(r"export DYLD_LIBRARY_PATH=/usr/local/lib/felix/felix-"+version+r"/host/lib/rtl:$DYLD_LIBRARY_PATH")
463+
f.write(r"export PATH=/usr/local/lib/felix/felix-"+version+r"/host/bin:$PATH"+"\n")
464+
f.write(r"export DYLD_LIBRARY_PATH=/usr/local/lib/felix/felix-"+version+r"/host/lib/rtl:$DYLD_LIBRARY_PATH"+"\n")
461465
f.close()
462466

463-
f = open (Path("installscript") / "win32setup.sh","w")
464-
f.write(r"@echo off")
465-
f.write(r"set PATH=C:\usr\local\lib\felix\felix-"+version+r"\host\bin;C:\usr\local\lib\felix\felix-"+version+r"\host\lib\rtl;%PATH%")
467+
f = open (Path("installscript") / "win32setup.bat","w")
468+
f.write(r"@echo off"+"\n")
469+
f.write(r"set PATH=C:\usr\local\lib\felix\felix-"+version+r"\host\bin;C:\usr\local\lib\felix\felix-"+version+r"\host\lib\rtl;%PATH%"+"\n")
470+
f.close()
471+
472+
f = open("VERSION","w")
473+
f.write(flx_version+"\n")
466474
f.close()
467475

468-
def set_version():
476+
short_time = time.strftime("%a %d %b %Y",gmtime)
477+
(buildroot/"src"/"compiler"/"flx_version_hook").makedirs()
478+
f = open (buildroot/"src"/"compiler"/"flx_version_hook"/"flx_version_hook.ml","w")
479+
f.write("open Flx_version\n")
480+
f.write("let version_data: version_data_t =\n")
481+
f.write("{\n")
482+
f.write(' version_string = "%s";' % flx_version+"\n")
483+
f.write(' build_time_float = %s;' % now+"\n")
484+
f.write(' build_time = "%s";' % time.ctime(now)+"\n")
485+
f.write("}\n")
486+
f.write(";;\n")
487+
f.write("let set_version () =\n")
488+
f.write(" Flx_version.version_data := version_data\n")
489+
f.write(";;\n")
490+
491+
(buildroot/"share"/"lib"/"std").makedirs()
492+
f = open(buildroot/"share"/"lib"/"std"/"version.flx","w")
493+
f.write("// GENERATED DURING BUILD (for version number)\n")
494+
f.write("class Version\n")
495+
f.write("{\n")
496+
f.write(' const felix_version : string = \'::std::string("'+flx_version+'")\';\n')
497+
f.write("}\n")
498+
f.close()
499+
500+
def set_version(buildroot):
469501
print("FELIX VERSION " + flx_version)
470-
write_script(flx_version)
502+
write_script(buildroot,flx_version)
471503

472504
@fbuild.db.caches
473505
def configure(ctx):
@@ -477,8 +509,6 @@ def configure(ctx):
477509
host = config_host(ctx, build)
478510
target = config_target(ctx, host)
479511

480-
set_version()
481-
482512
# Make sure the config directories exist.
483513
#(ctx.buildroot / 'host/config').makedirs()
484514

@@ -596,6 +626,8 @@ def configure(ctx):
596626
def build(ctx):
597627
"""Compile Felix."""
598628

629+
set_version(ctx.buildroot)
630+
599631
print("[fbuild] RUNNING PACKAGE MANAGER")
600632
tangle_packages(Path("src")/"packages", ctx.buildroot)
601633

lpsrc/flx_maker.pak

-30
Original file line numberDiff line numberDiff line change
@@ -201,33 +201,3 @@
201201
tangle("}")
202202
tangle("")
203203

204-
@h = tangler("share/lib/std/version.flx")
205-
@select(h)
206-
// GENERATED DURING BUILD (for version number)
207-
publish "System Interface"
208-
class Version
209-
{
210-
@tangle(' const felix_version : string = \'::std::string("'+pyconfig.flx_version+'")\';')
211-
}
212-
213-
214-
@h=tangler('src/compiler/flx_version_hook/flx_version_hook.ml')
215-
@select(h)
216-
@import time
217-
@now = time.time()
218-
@gmtime = time.gmtime(now)
219-
@short_time = time.strftime("%a %d %b %Y",gmtime)
220-
open Flx_version
221-
let version_data: version_data_t =
222-
{
223-
@tangle(' version_string = "%s";' % pyconfig.flx_version)
224-
@tangle(' build_time_float = %s;' % now)
225-
@tangle(' build_time = "%s";' % time.ctime(now))
226-
@f = open ("VERSION","w")
227-
@f.write(pyconfig.flx_version+"\n")
228-
@f.close()
229-
}
230-
;;
231-
let set_version () =
232-
Flx_version.version_data := version_data
233-
;;

set_FLX_VERSION.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export FLX_VERSION=`python3 showversion.py`

showversion.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import sys
2+
sys.path=['buildsystem']
3+
import version
4+
print(version.flx_version)

win32_make_set_FLX_VERSION.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import sys
2+
sys.path=['buildsystem']
3+
import version
4+
print('set FLX_VERSION='+version.flx_version)

0 commit comments

Comments
 (0)