Re: [PATCH] guile: Compile and install Scheme files.

Doug Evans
2014-07-12T05:01:24Z

ludo@gnu.org (Ludovic Courtès) writes:

> This patch compiles Scheme code under data-directory/.
>
> Another option would have been to compile them from gdb/Makefile, and
> then simply copy them to data-directory/. It seemed more consistent to
> handle everything under data-directory/ though. WDYT?
>
> Thanks,
> Ludo’.
>
> gdb/
> 2014-06-20 Ludovic Courtès <ludo@gnu.org>
>
> * acinclude.m4 (GDB_GUILE_PROGRAM_NAMES): New macro.
> * configure.ac ["${have_libguile}" != no]: Use it.
> * configure: Regenerate.
> * data-directory/Makefile.in (GUILE_FILES): Rename to...
> (GUILE_SOURCE_FILES): ... this. New variable.
> (GUILE_COMPILED_FILES): New variable.
> (GUILE_FILES, GUILD, GUILD_COMPILE_FLAGS, COMPILE_SCM_FILE)
> (.SUFFIXES): New variables.
> (stamp-guile): Depend on $(GUILE_SOURCE_FILES). Build all of
> $(GUILE_SOURCE_FILES) with $(COMPILE_SCM_FILE).
> * guile/guile.c (boot_guile_support, handle_boot_error): New
> functions.
> (initialize_scheme_side): Use them and 'scm_c_catch' in lieu of
> 'gdbscm_safe_source_script'.
> * guile/lib/gdb.scm: Remove 'add-to-load-path' call.
> * guile/lib/boot.scm: Augment '%load-path' and
> '%load-compiled-path'. Remove 'load' call, and use
> 'load-compiled' for 'gdb.go'.
> * guile/lib/init.scm (%initialize): Remove 'add-to-load-path'
> call.

Hi.
I couldn't get this to work with guile 2.0.5.
The -L flag to guild compile doesn't seem to work.
Can you give it a try? Maybe I was doing something wrong.

My main concern is handling cross builds (build != host).
I haven't tried it yet, but we should before this patch goes in.
I don't mind not compiling the files in that case for the time being.

If the current patch only works for native builds (does it?),
can we provide a script that compiles all the files and
run it from gdb? Then the build could use that, and we
could ship it for use with cross builds (to be available to be
run as part of a post-installation step). WDYT?