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: # 307 "./lpsrc/flx.pak"
     2: open Flx_types
     3: val version_data: version_data_t ref
     4: 
End ocaml section to src/flx_version.mli[1]
Start ocaml section to src/flx_version.ml[1 /1 ]
     1: # 312 "./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: 
End ocaml section to src/flx_version.ml[1]
Start ocaml section to src/flx_version_hook.ml[1 /1 ]
     1: # 348 "./lpsrc/flx.pak"
     2: open Flx_types
     3: let version_data: version_data_t =
     4: {
     5:   buildno = 6;
     6:   version_string = "1.1.3_rc4";
     7:   build_time_float = 1195934008.66;
     8:   build_time = "Sat Nov 24 19:53:28 2007";
     9: # 358 "./lpsrc/flx.pak"
    10: }
    11: ;;
    12: Flx_version.version_data := version_data
    13: ;;
    14: 
    15: # 364 "./lpsrc/flx.pak"
    16: 
End ocaml section to src/flx_version_hook.ml[1]