build: Adjust autogen.sh to 'libtoolize' name on Darwin.

Reported by Daniel Llorens.

* autogen.sh: Use 'glibtoolize' on Darwin.
Thank Per Bothner.

* THANKS: Add Per Bothner to the "libraries" section (for SRFI-64).
scm_boot_guile: Gracefully handle the case where argc == 0.

Fixes <http://bugs.gnu.org/18680>.
Reported by Nala Ginrut <nalaginrut@gmail.com>.

* libguile/init.c (scm_boot_guile): Do not canonicalize argv[0] unless
  argc > 0.
* THANKS: Add Nala Ginrut to the fixes section.
i18n: Add HAVE_USELOCALE as a requirement for USE_GNU_LOCALE_API.

* configure.ac: Check for uselocale.
* libguile/i18n.c: Add HAVE_USELOCALE to the list of requirements
  before defining USE_GNU_LOCALE_API.
Use on-stack or GC-managed memory in 'search-path'.

* libguile/load.c (stringbuf_free): Remove.
  (stringbuf_grow): Use 'scm_gc_malloc_pointerless' instead of 'scm_realloc'.
  (search_path): Use stack-allocated INITIAL_BUFFER instead of
  'scm_malloc'.  Remove use of 'stringbuf_free'.
Reduce C heap allocations in 'search-path'.

* libguile/load.c (scm_c_string_has_an_ext): Rename to...
  (string_has_an_ext): ... this.  Add docstring.  Change
  'str' to be an SCM, and remove 'len' parameter.  Change loop body to
  use 'scm_string_suffix_p'.
  (search_path): Update accordingly.
Fix strerror error handling when given a non-integer argument.

Fixes <http://bugs.gnu.org/18065>.
Reported and fixed by Glenn Michaels <gmichaels@Safe-mail.net>.

* libguile/error.c (scm_strerror): Convert the argument to a C integer
  outside of the critical section, to avoid deadlock on error.
* THANKS: Add Glenn Michaels to the fixes section.
Avoid bash-specific '==' comparison operator in guile.m4.

Fixes <http://bugs.gnu.org/18898>.

* meta/guile.m4 (GUILE_PROGS): Use '=' instead of the bash-specific '=='
  comparison operator in 'test' call.
Fix bytevector-copy when applied to SRFI-4 homogeneous numeric vectors.

Fixes <http://bugs.gnu.org/18866>.
Reported by tantalum <sph@posteo.eu>.

* libguile/bytevectors.c (scm_bytevector_copy): Always create a VU8
  bytevector.

* test-suite/tests/bytevectors.test: Add test.
Add SCM_VALIDATE_SIZE_COPY and SCM_NUM2SIZE.

* libguile/validate.h (SCM_VALIDATE_SIZE_COPY, SCM_NUM2SIZE): New
  macros.
Avoid signed overflow and use size_t in bytevectors.c.

* libguile/bytevectors.c (ULONG_MAX): Remove (unportable) fallback
  definition.  It is no longer used.
  (scm_make_bytevector): Use 'size_t' instead of 'unsigned' for
  indices.  Use 'scm_t_uint8' instead of 'signed char' for elements
  and c_fill.  Previously relied on GNU-C-specific behavior when
  casting integers in the range 128-255 to signed char.
  (GENERIC_INTEGER_ACCESSOR_PROLOGUE, INTEGER_LIST_TO_BYTEVECTOR)
  (scm_bytevector_eq_p, scm_bytevector_copy_x, scm_bytevector_copy)
  (scm_bytevector_to_u8_list, scm_u8_list_to_bytevector)
  (scm_bytevector_fill_x): Use 'size_t' instead of 'unsigned' for
  indices.  Use 'scm_t_uint8' for elements.
Fix bytevector-fill! to accept fill arguments greater than 127.

Fixes <http://bugs.gnu.org/19027>.

* libguile/bytevectors.c (scm_bytevector_fill_x): Accept fill arguments
  between -128 and 255.

* test-suite/tests/bytevectors.test ("2.2 General Operations"): Add
  tests.
Recognize m68k, s390x, and sh4 as compilation targets

* module/system/base/target.scm (cpu-endianness, triplet-pointer-size):
  Add cases for "m68k", "sh4", and "s390x".

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
doc: Clarify behavior of 'select' in the presence of signal interruptions.

Fixes <http://bugs.gnu.org/18988>.
Reported by Chris Vine <chris@cvine.freeserve.co.uk>.

* libguile/filesys.c (scm_select): Clarify handling of signal
  interruptions.
* doc/ref/posix.texi (Ports and File Descriptors): Adjust accordingly.
Implement SRFI 28: Basic Format Strings.

* module/srfi/srfi-28.scm: New module.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-28.scm.
* doc/ref/srfi-modules.texi (SRFI-28): New node.
doc: Tell when 'GUILE_INSTALL_LOCALE' first appeared.

* doc/ref/guile-invoke.texi (Environment Variables): Add footnote about
  the Guile version where 'GUILE_INSTALL_LOCALE' appeared.
Update (system base lalr) from upstream.

Suggested by Jan Nieuwenhuizen <janneke@gnu.org>.

* module/system/base/lalr.upstream.scm: Update from
  <https://github.com/schemeway/lalr-scm.git>, commit 4c4f149.
Add the 'guild' and 'guile' variables to 'guile-2.0.pc'.

* configure.ac: Remove meta/guile-2.0.pc and
  meta/guile-2.0-uninstalled.pc from 'AC_CONFIG_FILES'.
* meta/Makefile.am (substitute): New variable.
  (guile-2.0.pc, guile-2.0-uninstalled.pc): New targets.
  (guile-config, guild): Use $(substitute) instead of duplicated sed
  script.
  (CLEANFILES): Add the .pc files.
* meta/guile-2.0.pc.in (bindir, guild, guile): New variables.
* doc/ref/libguile-parallel.texi (Parallel Installations): Document the
  'guild' and 'guile' pkg-config variables.
doc: Clarify the unit of the 'offset' argument of 'seek'.

Reported in <http://bugs.gnu.org/18520>
by David Kastrup <dak@gnu.org>.

* doc/ref/api-io.texi (Random Access): Clarify the unit of the 'offset'
  argument to 'seek'.
build: Add missing substitutions for 'guile-2.0.pc'.

This is a followup to 5fac1a7.

* meta/Makefile.am (substitute): Add GUILE_* and LIBGUILE_* substitutions,
  and $(dependency_substitutions).
  (dependency_substitutions): New variable.