5.2. Version control
We need a special hack for version control.
Since every build results in a changed
version control record, we have to put
the record in the last module in the
compiler list to avoid unnecessary compilations.
Unfortunately, that means no modules can reference
it due to a limitation in Ocaml. Therefore,
we make the first module a reference to the version
control data, initialised with a dummy value,
put the real data in the last module, and store
it in the reference when the last module is
initialised. Note that this means the version
information will not be available until
the mainline module begins.
Start ocaml section to src/flx_version.mli[1
/1
]
1: # 297 "./lpsrc/flx.pak"
2: open Flx_types
3: val version_data: version_data_t ref
4:
Start ocaml section to src/flx_version.ml[1
/1
]
1: # 302 "./lpsrc/flx.pak"
2: open Flx_types
3: let version_data = ref
4: {
5: version_string = "no version";
6: build_time_float = -1.0;
7: build_time = "0000-00-00";
8: buildno = -1;
9: }
10:
Start ocaml section to src/flx_version_hook.ml[1
/1
]
1: # 338 "./lpsrc/flx.pak"
2: open Flx_types
3: let version_data: version_data_t =
4: {
5: buildno = 7;
6: version_string = "1.1.2";
7: build_time_float = 1165856981.47;
8: build_time = "Mon Dec 11 17:09:41 2006";
9: # 348 "./lpsrc/flx.pak"
10: }
11: ;;
12: Flx_version.version_data := version_data
13: ;;
14:
15: # 354 "./lpsrc/flx.pak"
16: