From 42090217cf2d7257a7efcf3902cfd447649242db Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 30 May 2011 21:28:30 +0200 Subject: [PATCH 1/5] add (system base target) * module/Makefile.am: * module/system/base/target.scm: Add a minimal module to parameterize the target system type and inspect properties on it like cpu, vendor, os, endianness, and word size. --- module/Makefile.am | 3 +- module/system/base/target.scm | 76 +++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 module/system/base/target.scm diff --git a/module/Makefile.am b/module/Makefile.am index ddd46749f..ecae83bbe 100644 --- a/module/Makefile.am +++ b/module/Makefile.am @@ -173,7 +173,8 @@ SYSTEM_BASE_SOURCES = \ system/base/compile.scm \ system/base/language.scm \ system/base/lalr.scm \ - system/base/message.scm + system/base/message.scm \ + system/base/target.scm ICE_9_SOURCES = \ ice-9/r4rs.scm \ diff --git a/module/system/base/target.scm b/module/system/base/target.scm new file mode 100644 index 000000000..573ccca46 --- /dev/null +++ b/module/system/base/target.scm @@ -0,0 +1,76 @@ +;;; Compilation targets + +;; Copyright (C) 2011 Free Software Foundation, Inc. + +;; This library is free software; you can redistribute it and/or +;; modify it under the terms of the GNU Lesser General Public +;; License as published by the Free Software Foundation; either +;; version 3 of the License, or (at your option) any later version. +;; +;; This library is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; Lesser General Public License for more details. +;; +;; You should have received a copy of the GNU Lesser General Public +;; License along with this library; if not, write to the Free Software +;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +;; 02110-1301 USA + +;;; Code: + +(define-module (system base target) + #:use-module (rnrs bytevectors) + #:export (target-type with-target + + target-cpu target-vendor target-os + + target-endianness target-word-size)) + + + +;;; +;;; Target types +;;; + +(define %target-type (make-fluid)) + +(define (target-type) + (or (fluid-ref %target-type) + %host-type)) + +(define (validate-target target) + (if (or (not (string? target)) + (let ((parts (string-split target #\-))) + (or (< 3 (length parts)) + (or-map string-null? parts)))) + (error "invalid target" target))) + +(define (with-target target thunk) + (validate-target target) + (with-fluids ((%target-type target)) + (thunk))) + +(define (target-cpu) + (let ((t (target-type))) + (substring t 0 (string-index t #\-)))) + +(define (target-vendor) + (let* ((t (target-type)) + (start (1+ (string-index t #\-)))) + (substring t start (string-index t #\- start)))) + +(define (target-os) + (let* ((t (target-type)) + (start (1+ (string-index t #\- (1+ (string-index t #\-)))))) + (substring t start))) + +(define (target-endianness) + (if (equal? (target-type) %host-type) + (native-endianness) + (error "cross-compilation not yet handled" %host-type (target-type)))) + +(define (target-word-size) + (if (equal? (target-type) %host-type) + ((@ (system foreign) sizeof) '*) + (error "cross-compilation not yet handled" %host-type (target-type)))) From 34ed9dfd1f728cc5d509665d4c6f4b66c4dda02c Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 27 May 2011 13:29:45 +0200 Subject: [PATCH 2/5] compile-bytecode uses target-endianness * module/language/assembly/compile-bytecode.scm (compile-bytecode): Use target-endianness, from (system base target). --- module/language/assembly/compile-bytecode.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/module/language/assembly/compile-bytecode.scm b/module/language/assembly/compile-bytecode.scm index c31582991..163ffccdc 100644 --- a/module/language/assembly/compile-bytecode.scm +++ b/module/language/assembly/compile-bytecode.scm @@ -20,6 +20,7 @@ (define-module (language assembly compile-bytecode) #:use-module (system base pmatch) + #:use-module (system base target) #:use-module (language assembly) #:use-module (system vm instruction) #:use-module (rnrs bytevectors) @@ -38,7 +39,7 @@ ((_ arg) (begin body body* ...))))))) - (define (fill-bytecode bv) + (define (fill-bytecode bv target-endianness) (let ((pos 0)) (define-inline1 (write-byte b) (bytevector-u8-set! bv pos b) @@ -54,7 +55,7 @@ (bytevector-u32-set! bv pos x (endianness big)) (set! pos (+ pos 4))) (define-inline1 (write-uint32 x) - (bytevector-u32-native-set! bv pos x) + (bytevector-u32-set! bv pos x target-endianness) (set! pos (+ pos 4))) (define-inline1 (write-loader-len len) (bytevector-u8-set! bv pos (ash len -16)) @@ -77,7 +78,7 @@ (bytevector-copy! bv* 0 bv pos len) (set! pos (+ pos len)))) (define-inline1 (write-wide-string s) - (write-bytevector (string->utf32 s (native-endianness)))) + (write-bytevector (string->utf32 s target-endianness))) (define-inline1 (write-break label) (let ((offset (- (assq-ref labels label) (+ (get-addr) 3)))) (cond ((>= offset (ash 1 23)) (error "jump too far forward" offset)) @@ -160,6 +161,7 @@ (fill-bytecode (make-bytevector (+ 4 4 length (if meta (1- (byte-length meta)) - 0))))) - + 0))) + (target-endianness))) + (else (error "bad assembly" assembly)))) From f0b7c3c6b9d5ed8b95ed501c24037880815c8325 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 30 May 2011 22:18:48 +0200 Subject: [PATCH 3/5] write-objcode uses target-endianness, target-word-size * libguile/_scm.h (SCM_OBJCODE_ENDIANNESS_OFFSET): (SCM_OBJCODE_WORD_SIZE_OFFSET): New defines. * libguile/objcodes.c (scm_write_objcode): Use target-endianness and target-word-size when writing the objcode cookie. --- libguile/_scm.h | 3 +++ libguile/objcodes.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/libguile/_scm.h b/libguile/_scm.h index 284213032..48fb2ccb6 100644 --- a/libguile/_scm.h +++ b/libguile/_scm.h @@ -219,6 +219,9 @@ /* The objcode magic header. */ #define SCM_OBJCODE_COOKIE \ "GOOF----" SCM_OBJCODE_MACHINE_VERSION_STRING +#define SCM_OBJCODE_ENDIANNESS_OFFSET 8 +#define SCM_OBJCODE_WORD_SIZE_OFFSET 11 + #endif /* SCM__SCM_H */ diff --git a/libguile/objcodes.c b/libguile/objcodes.c index 448badafb..c45ca8585 100644 --- a/libguile/objcodes.c +++ b/libguile/objcodes.c @@ -327,10 +327,38 @@ SCM_DEFINE (scm_write_objcode, "write-objcode", 2, 0, 0, "") #define FUNC_NAME s_scm_write_objcode { + static SCM target_endianness_var = SCM_BOOL_F; + static SCM target_word_size_var = SCM_BOOL_F; + + char cookie[sizeof (SCM_OBJCODE_COOKIE) - 1]; + char endianness; + char word_size; + SCM_VALIDATE_OBJCODE (1, objcode); SCM_VALIDATE_OUTPUT_PORT (2, port); - scm_c_write (port, SCM_OBJCODE_COOKIE, strlen (SCM_OBJCODE_COOKIE)); + if (scm_is_false (target_endianness_var)) + target_endianness_var = + scm_c_public_variable ("system base target", "target-endianness"); + if (scm_is_false (target_word_size_var)) + target_word_size_var = + scm_c_public_variable ("system base target", "target-word-size"); + + endianness = + scm_is_eq (scm_call_0 (scm_variable_ref (target_endianness_var)), + scm_endianness_big) ? 'B' : 'L'; + switch (scm_to_int (scm_call_0 (scm_variable_ref (target_word_size_var)))) + { + case 4: word_size = '4'; break; + case 8: word_size = '8'; break; + default: abort (); + } + + memcpy (cookie, SCM_OBJCODE_COOKIE, strlen (SCM_OBJCODE_COOKIE)); + cookie[SCM_OBJCODE_ENDIANNESS_OFFSET] = endianness; + cookie[SCM_OBJCODE_WORD_SIZE_OFFSET] = word_size; + + scm_c_write (port, cookie, strlen (SCM_OBJCODE_COOKIE)); scm_c_write (port, SCM_OBJCODE_DATA (objcode), sizeof (struct scm_objcode) + SCM_OBJCODE_TOTAL_LEN (objcode)); From b8b065987961063e09d476234ffcbe8728cf2715 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 30 May 2011 23:02:03 +0200 Subject: [PATCH 4/5] 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. --- .gitignore | 2 +- am/guilec | 2 +- configure.ac | 3 ++- doc/ref/Makefile.am | 2 +- doc/ref/api-evaluation.texi | 8 ++++---- doc/ref/autoconf.texi | 11 ++++++----- doc/ref/mod-getopt-long.texi | 4 ++-- doc/ref/tools.texi | 27 ++++++++++++++------------- libguile/Makefile.am | 2 +- meta/Makefile.am | 11 ++++++++--- meta/{guile-tools.in => guild.in} | 18 +++++++++--------- module/Makefile.am | 2 +- module/scripts/README | 6 +++--- module/scripts/lint.scm | 4 ++-- module/scripts/list.scm | 4 ++-- 15 files changed, 57 insertions(+), 49 deletions(-) rename meta/{guile-tools.in => guild.in} (86%) diff --git a/.gitignore b/.gitignore index a0eeeca76..928db2060 100644 --- a/.gitignore +++ b/.gitignore @@ -120,7 +120,7 @@ INSTALL /GRTAGS /GSYMS /GTAGS -/meta/guile-tools +/meta/guild /meta/guile-config /lib/locale.h /module/ice-9/eval.go.stamp diff --git a/am/guilec b/am/guilec index a34683266..7f4e85d0a 100644 --- a/am/guilec +++ b/am/guilec @@ -28,4 +28,4 @@ SUFFIXES = .scm .go .scm.go: $(AM_V_GUILEC)GUILE_AUTO_COMPILE=0 \ $(top_builddir)/meta/uninstalled-env \ - guile-tools compile $(GUILE_WARNINGS) -o "$@" "$<" + guild compile $(GUILE_WARNINGS) -o "$@" "$<" diff --git a/configure.ac b/configure.ac index 146b77b00..3f820bfc1 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,7 @@ gl_EARLY AC_PROG_CPP AC_PROG_SED AC_PROG_AWK +AC_PROG_LN_S dnl Gnulib. gl_INIT @@ -1724,7 +1725,7 @@ GUILE_CONFIG_SCRIPT([benchmark-guile]) GUILE_CONFIG_SCRIPT([meta/guile]) GUILE_CONFIG_SCRIPT([meta/uninstalled-env]) GUILE_CONFIG_SCRIPT([meta/gdb-uninstalled-guile]) -GUILE_CONFIG_SCRIPT([meta/guile-tools]) +GUILE_CONFIG_SCRIPT([meta/guild]) GUILE_CONFIG_SCRIPT([libguile/guile-snarf]) GUILE_CONFIG_SCRIPT([libguile/guile-snarf-docs]) GUILE_CONFIG_SCRIPT([test-suite/standalone/test-use-srfi]) diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am index 2ccf7dd22..4def24610 100644 --- a/doc/ref/Makefile.am +++ b/doc/ref/Makefile.am @@ -114,7 +114,7 @@ EXTRA_DIST = ChangeLog-2008 $(PICTURES) autoconf.texi: autoconf-macros.texi autoconf-macros.texi: $(top_srcdir)/meta/guile.m4 - GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guile-tools \ + GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild \ snarf-guile-m4-docs $(top_srcdir)/meta/guile.m4 \ > $(srcdir)/$@ diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi index e87331086..aa7d9c7bb 100644 --- a/doc/ref/api-evaluation.texi +++ b/doc/ref/api-evaluation.texi @@ -581,7 +581,7 @@ procedures in this section, for the same reason that it is often bad taste to use @code{eval}. By default, Guile automatically compiles any files it encounters that have not been compiled yet (@pxref{Invoking Guile, @code{--auto-compile}}). The compiler can also be invoked -explicitly from the shell as @code{guile-tools compile foo.scm}. +explicitly from the shell as @code{guild compile foo.scm}. (Why are calls to @code{eval} and @code{compile} usually in bad taste? Because they are limited, in that they can only really make sense for @@ -603,10 +603,10 @@ For more information on the compiler itself, see @ref{Compiling to the Virtual Machine}. For information on the virtual machine, see @ref{A Virtual Machine for Guile}. -The command-line interface to Guile's compiler is the @command{guile-tools +The command-line interface to Guile's compiler is the @command{guild compile} command: -@deffn {Command} {guile-tools compile} [@option{option}...] @var{file}... +@deffn {Command} {guild compile} [@option{option}...] @var{file}... Compile @var{file}, a source file, and store bytecode in the compilation cache or in the file specified by the @option{-o} option. The following options are available: @@ -673,7 +673,7 @@ computed by @code{(compiled-file-name @var{file})}. @xref{Compiling to the Virtual Machine}, for more information on these options, and on @var{env} and @var{opts}. -As with @command{guile-tools compile}, @var{file} is assumed to be +As with @command{guild compile}, @var{file} is assumed to be UTF-8-encoded unless it contains a coding declaration. @end deffn diff --git a/doc/ref/autoconf.texi b/doc/ref/autoconf.texi index 6edee5425..33aab7cac 100644 --- a/doc/ref/autoconf.texi +++ b/doc/ref/autoconf.texi @@ -165,10 +165,11 @@ In Makefile.in: @node Autofrisk @section Autofrisk -The @dfn{guile-tools autofrisk} command looks for the file @file{modules.af} +The @dfn{guild autofrisk} command looks for the file @file{modules.af} in the current directory and writes out @file{modules.af.m4} containing -autoconf definitions for @code{AUTOFRISK_CHECKS} and @code{AUTOFRISK_SUMMARY}. -@xref{Autoconf Background}, and @xref{Using Autoconf Macros}, for more info. +autoconf definitions for @code{AUTOFRISK_CHECKS} and +@code{AUTOFRISK_SUMMARY}. @xref{Autoconf Background}, and @xref{Using +Autoconf Macros}, for more info. The modules.af file consists of a series of configuration forms (Scheme lists), which have one of the following formats: @@ -238,10 +239,10 @@ Macros}) that does basically the same thing. @end example If the SRFI modules (@pxref{SRFI Support}) were a separate package, we could -use @code{guile-tools frisk} to find out its dependencies: +use @code{guild frisk} to find out its dependencies: @example -$ guile-tools frisk srfi/*.scm +$ guild frisk srfi/*.scm 13 files, 18 modules (13 internal, 5 external), 9 edges x (ice-9 and-let-star) diff --git a/doc/ref/mod-getopt-long.texi b/doc/ref/mod-getopt-long.texi index 17402151a..07fab813b 100644 --- a/doc/ref/mod-getopt-long.texi +++ b/doc/ref/mod-getopt-long.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2011 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -332,7 +332,7 @@ An option predicate fails. @end itemize @code{#:stop-at-first-non-option} is useful for command line invocations -like @code{guile-tools [--help | --version] [script [script-options]]} +like @code{guild [--help | --version] [script [script-options]]} and @code{cvs [general-options] command [command-options]}, where there are options at two levels: some generic and understood by the outer command, and some that are specific to the particular script or command diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi index 7a98884d8..f6eeefe02 100644 --- a/doc/ref/tools.texi +++ b/doc/ref/tools.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2011 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -9,13 +9,13 @@ @chapter Miscellaneous Tools Programming is more fun with a good tools. This chapter describes snarfing -tools, and the @code{guile-tools} program which can be used to invoke the rest +tools, and the @code{guild} program which can be used to invoke the rest of the tools (which are self-documenting). Some of these are used in Guile development, too. Imagine that! @menu * Snarfing:: Grepping the source in various ways. -* Executable Modules:: Modules callable via guile-tools. +* Executable Modules:: Modules callable via guild. @end menu @c --------------------------------------------------------------------------- @@ -298,26 +298,27 @@ is rather byzantine, so for now @emph{NO} doc snarfing programs are installed. @c --------------------------------------------------------------------------- @node Executable Modules @section Executable Modules +@cindex guild @cindex guile-tools @cindex modules, executable @cindex executable modules @cindex scripts When Guile is installed, in addition to the @code{(ice-9 FOO)} modules, a set -of @dfn{guile-tools modules} @code{(scripts BAR)} is also installed. Each is +of @dfn{guild modules} @code{(scripts BAR)} is also installed. Each is a regular Scheme module that has some additional packaging so that it can be -used by guile-tools, from the shell. For this reason, we sometimes use the +used by guild, from the shell. For this reason, we sometimes use the term @dfn{script} in this context to mean the same thing. -As a convenience, the @code{guile-tools} wrapper program is installed along w/ +As a convenience, the @code{guild} wrapper program is installed along w/ @code{guile}; it knows where a particular module is installed and calls it passing its args to the program. The result is that you need not augment your PATH. Usage is straightforward: @example -guile-tools --help -guile-tools --version -guile-tools [OPTION] PROGRAM [ARGS ...] +guild --help +guild --version +guild [OPTION] PROGRAM [ARGS ...] If PROGRAM is "list" or omitted, display contents of scripts dir, otherwise PROGRAM is run w/ ARGS. Options (only one of which may be used at a time): @@ -330,8 +331,8 @@ The modules are self-documenting. For example, to see the documentation for @code{lint}, use one (or both) of the shell commands: @example -guile-tools display-commentary '(scripts lint)' -guile-tools --source lint +guild display-commentary '(scripts lint)' +guild --source lint @end example The rest of this section describes the packaging that goes into creating an @@ -343,7 +344,7 @@ executable module. Feel free to skip to the next chapter. See template file @code{PROGRAM} for a quick start. -Programs must follow the @dfn{guile-tools} convention, documented here: +Programs must follow the @dfn{guild} convention, documented here: @itemize @@ -371,7 +372,7 @@ However, `main' must NOT be exported. @end itemize Following these conventions allows the program file to be used as module -@code{(scripts PROGRAM)} in addition to being invoked by guile-tools. Please +@code{(scripts PROGRAM)} in addition to being invoked by guild. Please also include a helpful Commentary section w/ some usage info. @c tools.texi ends here diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 6f2f79367..880028f38 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -698,7 +698,7 @@ posix.x: cpp-SIG.c load.x: libpath.h alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) -snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guile-tools snarf-check-and-output-texi +snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi dotdoc2texi = cat $(alldotdocfiles) | $(snarf2checkedtexi) guile.texi: $(alldotdocfiles) guile$(EXEEXT) diff --git a/meta/Makefile.am b/meta/Makefile.am index fe4aeb419..f26fc4436 100644 --- a/meta/Makefile.am +++ b/meta/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with Automake to create Makefile.in ## Jim Blandy --- September 1997 ## -## Copyright (C) 1998, 1999, 2001, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +## Copyright (C) 1998, 1999, 2001, 2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. ## ## This file is part of GUILE. ## @@ -20,11 +20,16 @@ ## write to the Free Software Foundation, Inc., 51 Franklin Street, ## Fifth Floor, Boston, MA 02110-1301 USA -bin_SCRIPTS = guile-config guile-tools +bin_SCRIPTS = guile-config guild EXTRA_DIST= \ guile.m4 ChangeLog-2008 \ guile-2.0.pc.in guile-2.0-uninstalled.pc.in \ - guile-tools.in guile-config.in + guild.in guile-config.in + +# What we now call `guild' used to be known as `guile-tools'. +install-data-hook: + cd $(DESTDIR)$(bindir) && rm -f guile-tools$(EXEEXT) && \ + $(LN_S) guild$(EXEEXT) guile-tools$(EXEEXT) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = guile-2.0.pc diff --git a/meta/guile-tools.in b/meta/guild.in similarity index 86% rename from meta/guile-tools.in rename to meta/guild.in index 2f335b8f7..bb9c37e05 100755 --- a/meta/guile-tools.in +++ b/meta/guild.in @@ -1,9 +1,9 @@ #!/bin/sh # -*- scheme -*- -exec guile $GUILE_FLAGS -e '(@@ (guile-tools) main)' -s "$0" "$@" +exec guile $GUILE_FLAGS -e '(@@ (guild) main)' -s "$0" "$@" !# -;;;; guile-tools --- running scripts bundled with Guile +;;;; guild --- running scripts bundled with Guile ;;;; Andy Wingo --- April 2009 ;;;; ;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. @@ -23,7 +23,7 @@ exec guile $GUILE_FLAGS -e '(@@ (guile-tools) main)' -s "$0" "$@" ;;;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;;;; Boston, MA 02110-1301 USA -(define-module (guile-tools) +(define-module (guild) #:use-module (ice-9 getopt-long) #:autoload (ice-9 format) (format)) @@ -39,16 +39,16 @@ exec guile $GUILE_FLAGS -e '(@@ (guile-tools) main)' -s "$0" "$@" (define (display-help) (display "\ -Usage: guile-tools --version - guile-tools --help - guile-tools PROGRAM [ARGS] +Usage: guild --version + guild --help + guild PROGRAM [ARGS] If PROGRAM is \"list\" or omitted, display available scripts, otherwise PROGRAM is run with ARGS. ")) (define (display-version) - (format #t "guile-tools (GNU Guile ~A) ~A + (format #t "guild (GNU Guile ~A) ~A Copyright (C) 2010 Free Software Foundation, Inc. License LGPLv3+: GNU LGPL version 3 or later This is free software: you are free to change and redistribute it. @@ -82,7 +82,7 @@ There is NO WARRANTY, to the extent permitted by law. (cdr args)))))) (else (format (current-error-port) - "guile-tools: unknown script ~s~%" (car args)) + "guild: unknown script ~s~%" (car args)) (format (current-error-port) - "Try `guile-tools --help' for more information.~%") + "Try `guild --help' for more information.~%") (exit 1)))))))) diff --git a/module/Makefile.am b/module/Makefile.am index ecae83bbe..b21b73c77 100644 --- a/module/Makefile.am +++ b/module/Makefile.am @@ -82,7 +82,7 @@ ice-9/psyntax-pp.scm.gen: ice-9/psyntax-pp.go: ice-9/psyntax.scm ice-9/psyntax-pp.scm $(AM_V_GUILEC) GUILE_AUTO_COMPILE=0 \ $(top_builddir)/meta/uninstalled-env \ - guile-tools compile $(GUILE_WARNINGS) -o "ice-9/psyntax-pp.go" "$(srcdir)/ice-9/psyntax.scm" + guild compile $(GUILE_WARNINGS) -o "ice-9/psyntax-pp.go" "$(srcdir)/ice-9/psyntax.scm" SCHEME_LANG_SOURCES = \ language/scheme/spec.scm \ diff --git a/module/scripts/README b/module/scripts/README index cb397f5d2..0f5bea583 100644 --- a/module/scripts/README +++ b/module/scripts/README @@ -4,7 +4,7 @@ Overview and Usage This directory contains Scheme programs, some useful in maintaining Guile. On "make install", these programs are copied to PKGDATADIR/VERSION/scripts. -You can use guile-tools to invoke a program from the shell, or alternatively, +You can use guild to invoke a program from the shell, or alternatively, load its file as a Guile Scheme module, and use its exported procedure(s) from Scheme code. Typically for any PROGRAM: @@ -38,7 +38,7 @@ How to Contribute See template file PROGRAM for a quick start. -Programs must follow the "guile-tools" convention, documented here: +Programs must follow the "guild" convention, documented here: - The module name must be "(scripts PROGRAM)". A procedure named PROGRAM w/ signature "(PROGRAM . args)" must be exported. Basically, use some variant @@ -56,7 +56,7 @@ Programs must follow the "guile-tools" convention, documented here: However, `main' must NOT be exported. Following these conventions allows the program file to be used as module -(scripts PROGRAM) in addition to being invoked by guile-tools. Please also +(scripts PROGRAM) in addition to being invoked by guild. Please also include a helpful Commentary section w/ some usage info. diff --git a/module/scripts/lint.scm b/module/scripts/lint.scm index b4a7f530a..aa74fb6a7 100644 --- a/module/scripts/lint.scm +++ b/module/scripts/lint.scm @@ -1,6 +1,6 @@ ;;; lint --- Preemptive checks for coding errors in Guile Scheme code -;; Copyright (C) 2002, 2006 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2006, 2011 Free Software Foundation, Inc. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public License @@ -64,7 +64,7 @@ ;; Note: most of the unresolved variables found in this example are ;; false positives, as you would hope. => scope for improvement. ;; -;; $ guile-tools lint `guile-tools` +;; $ guild lint `guild` ;; No unresolved free variables in PROGRAM ;; No unresolved free variables in autofrisk ;; No unresolved free variables in display-commentary diff --git a/module/scripts/list.scm b/module/scripts/list.scm index 046d8f5b8..c4891b6a8 100644 --- a/module/scripts/list.scm +++ b/module/scripts/list.scm @@ -1,4 +1,4 @@ -;;; List --- List scripts that can be invoked by guile-tools -*- coding: iso-8859-1 -*- +;;; List --- List scripts that can be invoked by guild -*- coding: iso-8859-1 -*- ;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. ;;;; @@ -21,7 +21,7 @@ ;; Usage: list ;; -;; List scripts that can be invoked by guile-tools. +;; List scripts that can be invoked by guild. ;;; Code: From 715146aa15982b0d38b242f7811ac64addeb7ecc Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 31 May 2011 22:36:52 +0200 Subject: [PATCH 5/5] add guild docs * doc/ref/scheme-using.texi (Using Guile Tools): Add some optimistic guild docs. --- doc/ref/guile.texi | 1 + doc/ref/scheme-using.texi | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index dfadd139c..ad7c0c605 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -228,6 +228,7 @@ etc. that make up Guile's application programming interface (API), * Guile Scripting:: How to write Guile scripts. * Using Guile Interactively:: Guile's REPL features. * Using Guile in Emacs:: Guile and Emacs. +* Using Guile Tools:: A guild of scheming wizards. @end menu @include scheme-intro.texi diff --git a/doc/ref/scheme-using.texi b/doc/ref/scheme-using.texi index 7995c8c04..f338127cc 100644 --- a/doc/ref/scheme-using.texi +++ b/doc/ref/scheme-using.texi @@ -695,6 +695,34 @@ See Geiser's web page at @uref{http://www.nongnu.org/geiser/}, for more information. +@node Using Guile Tools +@section Using Guile Tools + +@cindex guild +@cindex guile-tools +@cindex wizards +Guile also comes with a growing number of command-line utilities: a +compiler, a disassembler, some module inspectors, and in the future, a +system to install Guile packages from the internet. These tools may be +invoked using the @code{guild} program. + +@example +$ guild compile -o foo.go foo.scm +wrote `foo.go' +@end example + +This program used to be called @code{guile-tools}, and for backward +compatibility it still may be called as such. However we changed the +name to @code{guild}, not only because it is pleasantly shorter and +easier to read, but also because this tool will serve to bind Guile +wizards together, by allowing hackers to share code with each other +using a CPAN-like system. + +@xref{Compilation}, for more on @code{guild compile}. + +A complete list of guild scripts can be had by invoking @code{guild +list}, or simply @code{guild}. + @c Local Variables: @c TeX-master: "guile.texi" @c End: