- SCM tab= scm_c_make_hash_table (2);
- /* UGH. */
- SCM_STRUCT_DATA (gh_car (s))[scm_module_index_obarray]
- = (long unsigned int) tab;
+ /* Look up (evaluate) Scheme make-module function and call it */
+
+ SCM maker = ly_lily_module_constant ("make-module");
+ mod = scm_call_0 (maker);
+ /*
+ Look up and call Guile module-export-all! or, when using
+ Guile V1.8, the compatible shim defined in lily.scm.
+ */
+ SCM module_export_all_x = ly_lily_module_constant ("module-export-all!");
+ scm_call_1 (module_export_all_x, mod);
+
+ /*
+ Evaluate Guile module "the-root-module",
+ and ensure we inherit definitions from it and the "lily" module
+ N.B. this used to be "the-scm-module" and is deprecated in
+ Guile V1.9/2.0
+ */
+ SCM scm_module = ly_lily_module_constant ("the-root-module");
+ ly_use_module (mod, scm_module);
+ ly_use_module (mod, global_lily_module);
+ }
+ else
+ {
+ /* Evaluate and call make-safe-lilypond-module */
+ SCM proc = ly_lily_module_constant ("make-safe-lilypond-module");
+ mod = scm_call_0 (proc);