1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

49 commits

Author SHA1 Message Date
Mike Gran
8f254172ad Remove redefinition of when & unless in snarf-check-and-output-texi
* module/scripts/snarf-check-and-output-texi.scm (when, unless): removed
2019-05-23 17:16:30 +02:00
Ludovic Courtès
cbc2445eb1 compile: Update copyright year.
* module/scripts/compile.scm (show-version): Update copyright year.
2018-08-07 12:34:22 +02:00
Ludovic Courtès
240cc54659 compile: Improve error message.
* module/scripts/compile.scm (parse-args): Add missing newline in
"unrecognized option" message.
2018-08-07 12:34:17 +02:00
Ludovic Courtès
44cdabd9e3 compile: Add '-x' flag.
* module/scripts/compile.scm (%options, compile): Add '-x'.
* doc/ref/api-evaluation.texi (Compilation): Document it.
2018-08-07 12:34:11 +02:00
Ludovic Courtès
c91e9e9220 compile: Load language modules upfront.
Fixes a bug whereby "guild compile --target=arm-linux-gnueabihf
--from=elisp ... language/elisp/boot.el" would fail with an exception
from 'load-thunk-from-memory' while trying to load (language elisp spec)
from the guile-being-compiled instead of using that of the
guile-for-build.

The problem did not manifest with --from=scheme because (language scheme
spec) happened to be already loaded before we had changed %load-path.

* module/scripts/compile.scm (compile): Add calls to 'lookup-language'.
2018-08-07 11:35:34 +02:00
Andy Wingo
16db934bbc Add (system base optimize) module
* module/system/base/optimize.scm: New module.
* module/Makefile.am (SOURCES):
* am/bootstrap.am (SOURCES): Add new module.
* module/language/tree-il/optimize.scm (tree-il-optimizations): Rename
  from tree-il-default-optimization-options.  Directly specify the
  optimization level at which a pass should be enabled.
* module/language/cps/optimize.scm (cps-optimizations): Likewise, rename
  from cps-default-optimization-options.
* module/scripts/compile.scm (%options, show-optimization-help): Adapt
  to use new module.
2018-01-05 10:19:54 +01:00
Maxim Cournoyer
3e7c80a62f scripts: help: Fix reference to the "Using Guile Tools" node.
Fixes <https://bugs.gnu.org/28835>.

* module/scripts/help.scm (list-commands): Fix reference to the "Using
Guile Tools" node.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-11-22 16:21:59 +01:00
Andy Wingo
f169be9fc8 Wire up `guild compile -O0 foo.scm'
* module/scripts/compile.scm (%options): Resurrect -O option and make it
  follow GCC, more or less.  The default is equivalent to -O2.

* module/language/cps/compile-bytecode.scm (lower-cps):
* module/language/cps/optimize.scm (optimize-higher-order-cps): Move
  split-rec to run unconditionally for now, as closure conversion fails
  without it.
  (define-optimizer): Only verify the result if we are debugging, to
  save time.
  (cps-default-optimization-options): New exported procedure.

* module/language/tree-il/optimize.scm
  (tree-il-default-optimization-options): New exported procedure.
2015-10-22 17:44:17 +00:00
Mark H Weaver
856d318a9f Merge branch 'stable-2.0'
Conflicts:
	benchmark-suite/benchmarks/ports.bm
	libguile/async.h
	libguile/bytevectors.c
	libguile/foreign.c
	libguile/gsubr.c
	libguile/srfi-1.c
	libguile/vm-engine.h
	libguile/vm-i-scheme.c
	module/Makefile.am
	module/language/tree-il/analyze.scm
	module/language/tree-il/peval.scm
	module/scripts/compile.scm
	module/scripts/disassemble.scm
	test-suite/tests/asm-to-bytecode.test
	test-suite/tests/peval.test
	test-suite/tests/rdelim.test
2014-09-30 03:50:47 -04:00
Mark H Weaver
f2742bdd68 guild disassemble: Use #:prefix instead of #:renamer.
* module/scripts/disassemble.scm: Use #:prefix instead of #:renamer
  in #:use-module clause.
2014-09-20 05:47:05 -04:00
Ludovic Courtès
2da97f1c7c 'guild compile' doesn't leave temporary files behind it.
* module/scripts/compile.scm (compile): Add 'sigaction' call.
* test-suite/standalone/test-guild-compile: New file.
* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
2014-06-03 15:01:58 +02:00
Mark H Weaver
475772ea57 Merge branch 'stable-2.0'
Conflicts:
	GUILE-VERSION
	NEWS
	guile-readline/ice-9/readline.scm
	libguile/async.c
	libguile/backtrace.c
	libguile/deprecated.h
	libguile/gc-malloc.c
	libguile/gdbint.c
	libguile/init.c
	libguile/ioext.c
	libguile/mallocs.c
	libguile/print.c
	libguile/rw.c
	libguile/scmsigs.c
	libguile/script.c
	libguile/simpos.c
	libguile/snarf.h
	libguile/strports.c
	libguile/threads.c
	libguile/vm-i-scheme.c
	libguile/vm-i-system.c
	module/srfi/srfi-18.scm
	test-suite/Makefile.am
	test-suite/standalone/test-num2integral.c
2014-04-25 02:06:01 -04:00
Mark H Weaver
c3c3032608 Make snarfing tools more robust to varied C preprocessor behavior.
* libguile/guile-snarf.in (modern_snarf): Rewrite sed script to cope
  with newlines in the snarfed code segments, or multiple code segments
  on the same line.

* module/scripts/snarf-check-and-output-texi.scm (process-stream):
  Strip all 'hash' tokens from the stream.
  (do-command): Remove special cases that handled 'hash' tokens
  in a few places.
2014-03-06 17:25:55 -05:00
Andy Wingo
691697de09 Rename "RTL" to "bytecode"
"RTL" didn't make any sense, and now that there's no other bytecode to
disambiguate against, just call it bytecode.

* module/Makefile.am:
* module/ice-9/eval-string.scm:
* module/language/bytecode.scm:
* module/language/bytecode/spec.scm:
* module/language/cps/arities.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/contification.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/primitives.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/spec.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/rtl.scm:
* module/language/rtl/spec.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* module/system/repl/common.scm:
* module/system/vm/assembler.scm:
* module/system/vm/debug.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* test-suite/tests/cross-compilation.test:
* test-suite/tests/dwarf.test:
* test-suite/tests/rtl-compilation.test:
* test-suite/tests/rtl.test:
* test-suite/vm/run-vm-tests.scm: Fixups.
2013-12-02 21:31:47 +01:00
Andy Wingo
84680d2382 Miscellaneous fixups related to objcode removal.
* module/scripts/compile.scm: Fix --help message.

* module/system/repl/command.scm (disassemble): Fix error message.

* module/system/vm/frame.scm: Remove objcode import.

* module/system/vm/objcode.scm: Remove some exports related to the
  objcode type.
2013-11-08 17:42:54 +01:00
Andy Wingo
b73a2ee017 Default to compiling to RTL
* module/ice-9/eval-string.scm (eval-string)
* module/language/tree-il/spec.scm (tree-il)
* module/scripts/compile.scm (compile)
* module/system/base/compile.scm (compile-file, read-and-compile)
* module/system/repl/common.scm (repl-compile, repl-prepare-eval-thunk):
  Default to compiling to RTL.

* module/language/rtl/spec.scm (rtl->value): Add value compiler.
2013-10-31 14:17:30 +01:00
Andy Wingo
93009a7aca ,xx for RTL images
* module/scripts/disassemble.scm (disassemble):
* module/system/vm/disassembler.scm (disassemble-file): Factor
  disassemble-file out.

* module/system/repl/command.scm (disassemble-file): Map ,xx to
  disassemble RTL images.
2013-08-29 20:50:19 +02:00
Andy Wingo
610295ec9d add ability to disassemble ELF images
* module/scripts/disassemble.scm (disassemble): Update to work with
  RTl (and only RTL, as that's the future).

* module/system/vm/debug.scm (for-each-elf-symbol): New public
  interface.
  (debug-context-from-image): New helper.
  (find-debug-context): Use the helper.

* module/system/vm/disassembler.scm (disassemble-image): New public
  interface.
2013-08-29 20:44:55 +02:00
Andy Wingo
b8bc86bce1 instead of our custom .go format, use elf
* libguile/objcodes.c: Change to expect objcode on disk to be embedded
  in ELF instead of having the funky cookie.

  (to_native_order): Use already existing SCM_BYTE_ORDER style byte
  order instead of chars.
  (bytecode_to_objcode): No need for word_size arg.
  (scm_bytecode_to_objcode, scm_objcode_to_bytecode): Take optional
  endianness arg instead of sometimes using target-endianness.
  (scm_load_objcode, scm_write_objcode, scm_bytecode_to_native_objcode):
  Remove.

* libguile/objcodes.h: Adapt.

* libguile/vm.c (scm_load_compiled_with_vm): Use
  scm_load_thunk_from_file.
  (make_boot_program): Adapt to use scm_bytecode_to_objcode with
  endianness arg.

* module/Makefile.am (OBJCODE_LANG_SOURCES): Add (language objcode
  elf).
* module/language/objcode/elf.scm: New module, embeds objcode in ELF.

* module/language/bytecode/spec.scm (compile-objcode):
  (decompile-objcode): Use (target-endianness).

* module/language/objcode/spec.scm: use (language objcode elf) for
  write-objcode.

* module/scripts/disassemble.scm (disassemble):
* module/system/repl/command.scm (disassemble-file): Use
  load-thunk-from-file.

* module/system/vm/objcode.scm: Remove load-objcode and write-objcode.

* test-suite/tests/asm-to-bytecode.test (test-target): Adapt to the new
  ELF world.
2012-06-22 13:40:50 +02:00
Ludovic Courtès
f5e772b2ba Fix a couple of warnings.
* module/scripts/list.scm: Use SRFI-1.
* module/system/repl/error-handling.scm: Use (ice-9 format).
2012-01-26 00:37:23 +01:00
Ludovic Courtès
d4b8894520 Add a --target' option to guild compile'.
* module/scripts/compile.scm (%options)["--target"]: New option.
  (show-version): Update copyright year.
  (compile): Use `with-target' to install the target.

* doc/ref/api-evaluation.texi (Compilation): Mention `--target' option.
2011-11-22 00:22:46 +01:00
Andy Wingo
b8287e8823 better guild help FOO
* module/scripts/help.scm (show-help, show-summary, show-usage): Grovel
  for %synopsis and %help variables as well, and show them
  appropriately.  Export these routines for other script modules to
  use.  Needs documentation.
2011-08-19 12:32:01 +02:00
Ludovic Courtès
0d2e3fc1e7 Change guild --help' and --version' output to be more GNUish.
* meta/guild.in (display-version): Display the version, not the
  effective version.

* module/scripts/help.scm (list-commands)[help]: Add proper footer, as
  per the GCS.
2011-07-23 22:43:38 +02:00
Ludovic Courtès
3cf634fa7c Export `main' from (scripts help).
* module/scripts/help.scm: Export `main'.
2011-07-23 22:43:36 +02:00
Andy Wingo
4f0ea6e3ce add support for guild help FOO
* module/scripts/help.scm (main): Add support for guild help FOO.
2011-07-23 18:50:22 +02:00
Andy Wingo
f4a76a315a add (scripts help)
* meta/guild.in (display-version): Use (ice-9 command-line)'s
  version-etc.
  (main): Dispatch --help to guild help.

* module/scripts/help.scm: New file, a copy of list.scm, but with a
  better name.

* module/Makefile.am: Add help.scm to the list.

* module/scripts/list.scm: Change to be an alias to "help".
  (list-scripts): Restore this API.
2011-07-23 18:24:16 +02:00
Andy Wingo
a1a2ed5342 more work on "guild list"
* module/scripts/: Add %summary entries, and in many cases,
  %include-in-guild-list entries to inhibit a script from appearing in
  "guild list".  Update list.scm to respect this new variable.
2011-07-23 17:50:41 +02:00
Andy Wingo
d322dc92ec remove scripts PROGRAM
* module/scripts/PROGRAM.scm: Remove this useless template, which was
  cluttering `guild list'.  We'll perhaps cull the list a bit more in
  2.2.

* module/Makefile.am: Adapt.
2011-07-23 13:54:28 +02:00
Andy Wingo
5d48015adf a prettier `guild list'
* module/scripts/list.scm (strip-extensions): Don't list programs
  without extensions.
  (main): Be prettier.  Parse out a %summary from modules, for a brief
  synopsis.
2011-07-23 13:52:51 +02:00
Andy Wingo
b8b0659879 rename guile-tools' to guild'
* configure.ac: Look for ln -s.  Write out `guild' instead of
  `guile-tools'.

* meta/Makefile.am (install-data-hook): Link the installed `guild' to
  the backward-compatible `guile-tools' name.
  (bin_SCRIPTS, EXTRA_DIST): Fix up for guild change.

* meta/guild.in: Moved here from `guile-tools.in'.

* doc/ref/Makefile.am (autoconf-macros.texi):
* doc/ref/api-evaluation.texi (Compilation):
* doc/ref/autoconf.texi (Autofrisk, Using Autofrisk):
* doc/ref/mod-getopt-long.texi (getopt-long Reference):
* doc/ref/tools.texi (Miscellaneous Tools, Executable Modules): Minimal
  doc update.

* .gitignore:
* am/guilec (.scm.go):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.go): Update makefiles, etc.

* module/scripts/README:
* module/scripts/lint.scm:
* module/scripts/list.scm: Update commentaries.
2011-05-31 22:01:47 +02:00
Neil Jerram
9228f9eb95 Reveal guile-tools's inner simplicity...
...by not using its own-rolled getopt, and moving the `list' function
to a separate script

* meta/guile-tools.in: Use (ice-9 getopt-long).

  (directory-files, strip-extensions, unique, find-submodules,
  list-scripts): Deleted (and moved to new `list.scm' file).

  (getopt): Deleted.

  (main): Use getopt-long.  Default to calling the `list' script if no
  script is specified.

* module/scripts/list.scm: New script.

* module/Makefile.am (SCRIPTS_SOURCES): Add list.scm.
2011-05-26 17:58:18 +01:00
Neil Jerram
c6e05396dc Remove statements about scripts/* that are no longer true
* doc/ref/tools.texi (Executable Modules): Say "guile-tools modules"
  instead of "executable modules".  Remove obsolete statements about
  not ending in .scm, being executable, and beginning with shell
  script invocation sequence.

* module/scripts/README: Ditto.
2011-03-25 19:45:14 +00:00
Ludovic Courtès
a4060f6710 Add `*current-warning-prefix*'.
* module/system/base/message.scm (*current-warning-prefix*): New
  variable.
  (%warning-types): Honor `*current-warning-prefix*'.

* module/scripts/compile.scm (compile): Use an empty
  `*current-warning-prefix*'.

* module/system/repl/common.scm (repl-compile): Likewise.

* test-suite/tests/tree-il.test (call-with-warnings): Likewise.
2011-02-13 19:13:36 +01:00
Andy Wingo
6f06e8d35f autocompile -> auto-compile
* NEWS:
* check-guile.in:
* doc/guile.1:
* doc/ref/scheme-scripts.texi:
* libguile/init.c:
* libguile/load.c:
* libguile/load.h:
* libguile/script.c:
* module/Makefile.am:
* module/ice-9/boot-9.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* test-suite/Makefile.am:
* test-suite/tests/popen.test: Change "autocompile" to "auto-compile" or
  "auto_compile", as appropriate, in variable names, function names,
  command line arguments, and the documentation.
2011-02-13 15:06:11 +01:00
Ludovic Courtès
dcb9aceb48 Have "frisk" recognize #:use-module' and #:autoload'.
* module/scripts/frisk.scm (grok-proc): Support keywords `#:use-module'
  and `#:autoload'.
2010-10-27 23:31:49 +02:00
Ludovic Courtès
796c980a6a Placate `-Wformat'.
* module/scripts/compile.scm (fail): Use a fancy format string instead
  of a non-literal one.
2010-10-13 00:06:29 +02:00
Andy Wingo
3932bdb3af remove a number of debug options
* libguile/private-options.h (SCM_BREAKPOINTS_P, SCM_TRACE_P)
  (SCM_REC_PROCNAMES_P, SCM_BACKTRACE_INDENT, SCM_N_FRAMES)
  (SCM_BACKTRACE_MAXDEPTH, SCM_DEVAL_P): Remove these internal names.

* libguile/eval.c (scm_debug_opts): Remove the corresponding debug
  options -- breakpoints, trace, procnames, indent, frames, maxdepth,
  and debug.

* libguile/debug.c (scm_debug_options): Remove SCM_N_FRAMES check.

* test-suite/lib.scm (with-debugging-evaluator*):
* module/scripts/summarize-guile-TODO.scm:
* module/statprof.scm (statprof-reset):
* module/ice-9/boot-9.scm (turn-on-debugging): Remove useless
  debug-enable 'debug calls.

* module/ice-9/deprecated.scm (debug-enable): As it seems that 'debug is
  a particulatly common option that we just removed, add a deprecation
  shim.

* doc/ref/api-options.texi (Debugger options): Update the set of debug
  options.
2010-09-24 20:57:01 +02:00
Thien-Thi Nguyen
395afce9f2 [maint] Remove unused script guile-doc-snarf.
* doc/ref/tools.texi (Doc Snarfing): Don't mention guile-doc-snarf.

* configure.ac (libguile/guile-doc-snarf): Delete ‘GUILE_CONFIG_SCRIPT’.

* libguile/Makefile.am (noinst_SCRIPTS): Remove guile-doc-snarf.
* libguile/.gitignore: Remove guile-doc-snarf.
* libguile/guile-doc-snarf.in: Delete file.

* module/scripts/doc-snarf.scm: Comment munging; nfc.

* AUTHORS: Update.
2010-07-22 21:10:38 +02:00
Andy Wingo
445f31fc06 fix doc snarfing with fedora 12
* module/scripts/snarf-check-and-output-texi.scm
  (process-multiline-directive): Be more accepting of source location
  markers in the preprocessed source, by adding a couple cases in which
  they can appear. Not foolproof, but it does adapt to what new GCCs are
  putting out (e.g. cpp (GCC) 4.4.2 20091222 (Red Hat 4.4.2-20)).
2010-01-17 18:22:51 +01:00
Ludovic Courtès
bce5cb5641 Provide Guile-friendly `coding:' meta-data.
* module/ice-9/i18n.scm, module/rnrs/bytevector.scm,
  module/rnrs/io/ports.scm, module/scripts/compile.scm,
  module/srfi/srfi-35.scm, module/srfi/srfi-88.scm: Write `coding:'
  comment at the top.
2010-01-11 01:21:13 +01:00
Ludovic Courtès
a2ca725212 Remove unused variables in ice-9/goops/srfi/scripts.
* module/ice-9/boot-9.scm (scm-style-repl)[-abort]: Remove.

* module/oop/goops.scm (class)[slot-defs]: Remove.
  (compute-slot-accessors)[name]: Remove.
  (compute-get-n-set)[env]: Remove.

* module/oop/goops/active-slot.scm (compute-get-n-set)[env, name]:
  Remove.

* module/oop/goops/dispatch.scm (cache-try-hash!)[max-misses]: Remove.

* module/oop/goops/save.scm (make-mapper)[dims]: Remove.

* module/scripts/autofrisk.scm (>>checks)[prog]: Remove.

* module/srfi/srfi-19.scm (priv:read-directives)[ireaderf, eireader4]:
  Remove.
2009-09-21 00:24:08 +02:00
Ludovic Courtès
54b38caf19 Add proper --help' and --version' for `guile-tools compile'.
* configure.ac: Produce `meta/guile-tools'.

* meta/Makefile.am (EXTRA_DIST): Add `guile-tools.in'.
  (bin_SCRIPTS): Remove `guile-tools'.

* meta/uninstalled-env.in (PATH): Add "${top_builddir}/meta".

* module/scripts/compile.scm (%options): Add `--version'.
  (parse-args): Show the offending option name upon error.
  (show-version): New.
  (compile): Use `%guile-bug-report-address'.
2009-08-15 14:18:57 +02:00
Ludovic Courtès
2e4c3227ce Add `(system base message)', a simple warning framework.
* module/Makefile.am (SOURCES): Add `system/base/message.scm'.

* module/scripts/compile.scm (%options): Add `--warn'.
  (parse-args): Update default value for `warnings'.
  (show-warning-help): New procedure.
  (compile)[compile-opts]: Add `#:warnings'.
  Update help message.

* module/system/base/compile.scm (compile): Sanity-check the requested
  warnings.

* module/system/base/message.scm: New file.
2009-07-31 00:49:22 +02:00
Ludovic Courtès
8141fc3b46 Fix "guile-tools disassemble".
* module/scripts/disassemble.scm (disassemble): Accept a variable number
  of arguments.  Invoke the right `disassemble' procedure.
2009-06-19 21:54:51 +02:00
Neil Jerram
83ba2d3750 Complete changing license to LGPLv3+
(Still guile-readline to do, but that will all be GPLv3+.)
2009-06-17 22:30:26 +01:00
Andy Wingo
5e89cd13c0 disable autocompilation when running guile-tools compile
* module/scripts/compile.scm (compile): Disable autocompilation when
  running guile-tools compile.
2009-06-05 11:47:34 +02:00
Andy Wingo
fb3807793f scripts take rest args
* meta/guile-tools: Instead of fixing scripts I should have been fixing
  the script runner.

* module/scripts/compile.scm:
* module/scripts/snarf-guile-m4-docs.scm: Fix to take rest args.
2009-04-20 18:20:01 +02:00
Andy Wingo
2b4b555b8f fix build errors on fresh checkout
* meta/guile-tools: We can't use srfi-1, because on a fresh checkout
  the srfi-1 shlib isn't built yet. Bummer.

* meta/uninstalled-env.in: Fix up the DYLD lines for BSDen.

* module/scripts/snart-guile-m4-docs.scm: Fix expected arguments.
2009-04-20 17:23:40 +02:00
Andy Wingo
6d66647d5b guile-tools is a scheme script that loads scheme modules
* meta/guile-tools: Changed to be a scheme script. Instead of looking for
  executables in a "scripts dir", we just look for modules in (scripts),
  and load the modules directly.

* module/Makefile.am:
* module/scripts/: Move the scripts into module/ so they can be compiled.
  Rename scripts from `foo' to `foo.scm'.

* libguile/Makefile.am: Invoke the snarf->texi code via guile-tools.

* configure.in:
* .gitignore: Update for changes.
2009-04-17 11:19:42 +02:00