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

419 commits

Author SHA1 Message Date
Daniel Llorens
bc7bd22267 Merge libguile/generalized-arrays.* into libguile/arrays.*
* libguile/arrays.h:
* libguile/arrays.c: As stated.
* libguile/init.c: Remove call to scm_init_generalized_arrays().

Elsewhere fix references to generalized-arrays.*.
2021-08-03 14:21:41 +02:00
Michael Gran
3f4d5d128c For MinGW use Windows filepaths in libpath.h
* configure.ac (MINGW_LIBPATH): new automake conditional and test
* libguile/Makefile.am (libpath.h) [MINGW_LIBPATH]: use Windows-style
    paths
2021-03-11 10:46:06 -08:00
Michael Gran
eb1bd8050e Enable option to prefer mini-gmp over libgmp
* configure.ac: rework gmp library detection. Add new flag.
* libguile.h: modify gmp header inclusion
* libguile/Makefile.am: add mini-gmp.[ch] files
* libguile/bytevectors.c: add mini-gmp headers
* libguile/gen-scmconfig.c: new #include variable GUILE_MINI_GMP
* libguile/init.c: add mini-gmp header
* libguile/mini-gmp.c: new file
* libguile/mini-gmp.h: new file
* libguile/numbers.c: add fallback for missing mpz_get_d_2exp
* libguile/numbers.h: yse mini-gmp header
* libguile/random.c: use mini-gmp header
* libguile/socket.c: use mini-gmp header
2021-03-02 06:18:32 -08:00
Andy Wingo
e9c5a1719b Move copy-tree to (ice-9 copy-tree); deprecate main binding
* doc/ref/api-data.texi (List Constructors):
* doc/ref/api-utility.texi (Copying): Update docs to mention module.
* libguile.h: Remove trees.h inclusion.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Remove trees.c,
  trees.h, and related files.
* libguile/init.c (scm_i_init_guile): Remove trees.h and the
  scm_init_trees call.
* libguile/trees.c:
* libguile/trees.h: Remove.
* module/Makefile.am (SOURCES): Add ice-9/copy-tree.scm.
* module/ice-9/copy-tree.scm: New file.
* module/ice-9/deprecated.scm (copy-tree*): Export as copy-tree,
  proxying to (ice-9 copy-tree).
* module/system/repl/common.scm:
* module/web/client.scm:
* test-suite/tests/elisp.test:
* test-suite/tests/srfi-1.test:
* module/oop/goops/save.scm: Use (ice-9 copy-tree).
* test-suite/Makefile.am (SCM_TESTS): Add copy-tree.test.
* test-suite/tests/copy-tree.test: New file; test pulled from
  eval.test.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_copy_tree): Deprecate.
2020-09-10 21:57:21 +02:00
Ludovic Courtès
491cc23f93 build: Actually install libguile-3.0-gdb.scm.
Reported by brandelune on #guile.

* libguile/libguile-2.2-gdb.scm: Rename to...
* libguile/libguile-3.0-gdb.scm: ... this.
* libguile/Makefile.am (install-data-hook): Replace hard-coded "2.2"
with @GUILE_EFFECTIVE_VERSION@.
2020-01-21 17:51:37 +01:00
Andy Wingo
f4ca107f7f Rebase throw/catch on top of raise-exception/with-exception-handler
* libguile/exceptions.c:
* libguile/exceptions.h: New files.
* libguile.h: Add exceptions.h.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add exceptions.c and
  exceptions.h.
* libguile/init.c (scm_i_init_guile): Initialize exceptions.
* libguile/threads.c (scm_spawn_thread): Use new names for
  scm_i_make_catch_handler and scm_c_make_thunk.
* libguile/throw.c: Rewrite to be implemented in terms of
  with-exception-handler / raise-exception.
* libguile/throw.h: Use data types from exceptions.h.  Move
  scm_report_stack_overflow and scm_report_out_of_memory to
  exceptions.[ch].
* module/ice-9/boot-9.scm (&error, &programming-error)
  (&non-continuable, make-exception-from-throw, raise-exception)
  (with-exception-handler): New top-level definitions.
  (throw, catch, with-throw-handler): Rewrite in terms of
  with-exception-handler and raise-exception.
: New top-level definitions.
* module/ice-9/exceptions.scm: Adapt to re-export &error,
  &programming-error, &non-continuable, raise-exception, and
  with-exception-handler from boot-9.
  (make-quit-exception, guile-quit-exception-converter): New exception
  converters.
  (make-exception-from-throw): Override core binding.
* test-suite/tests/eval.test ("inner trim with prompt tag"): Adapt to
  "with-exception-handler" being the procedure on the stack.
  ("outer trim with prompt tag"): Likewise.
* test-suite/tests/exceptions.test (throw-test): Use pass-if-equal.
* module/srfi/srfi-34.scm: Reimplement in terms of core exceptions, and
  make "guard" actually re-raise continuations with the original "raise"
  continuation.
2019-11-13 22:24:19 +01:00
Andy Wingo
63de1893c3 Merge remote-tracking branch 'lightening/master' 2019-05-23 10:04:52 +02:00
Andy Wingo
e9be4ea73d Adapt to lightning -> lightening name change
* libguile/jit.c: Include lightening.h.
* libguile/Makefile.am: Adapt.
2019-04-03 14:08:06 +02:00
Andy Wingo
d351f13bc2 Add subdir-objects option to libguile makefile.
* libguile/Makefile.am (AUTOMAKE_OPTIONS): Add subdir-objects, to allow
  for having two files named "jit.c".
2019-04-03 13:37:35 +02:00
Andy Wingo
985faf35c1 Replace GNU Lightning with Lightening 2019-04-03 13:28:13 +02:00
Andy Wingo
6cd9b3114f Fix use of uninstalled header by installed headers
* libguile/Makefile.am (libpath.h): Remove definition of
  SCM_EFFECTIVE_VERSION, which is defined in version.h.
* libguile/extensions.h: Remove libpath.h inclusion, as it's not
  installed.
* libguile/atomic.c:
* libguile/bytevectors.c:
* libguile/control.c:
* libguile/fdes-finalizers.c:
* libguile/foreign-object.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/goops.c:
* libguile/i18n.c:
* libguile/instructions.c:
* libguile/intrinsics.c:
* libguile/ioext.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/poll.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/programs.c:
* libguile/r6rs-ports.c:
* libguile/srfi-1.c:
* libguile/srfi-60.c:
* libguile/threads.c:
* libguile/unicode.c:
* libguile/vm.c:
* libguile/weak-vector.c: Include version.h for the
  SCM_EFFECTIVE_VERSION definition.
2018-10-07 15:15:02 +02:00
Andy Wingo
065efdd101 Fix in-tree builds
* libguile/Makefile.am (AM_CPPFLAGS): Use -iquote for $(builddir)
  instead of -I, to avoid having in-tree builds find libguile/poll.h for
  <poll.h>.
2018-08-23 10:47:00 +02:00
Daniel Llorens
01c14512d6 Add $(builddir) to include path in libguile/Makefile.am 2018-08-21 18:41:34 +02:00
Andy Wingo
41100f7786 Merge branch 'master' into lightning
This includes a manual cherry-pick of relevant stable-2.2 commits up to
4c91de3e45.
2018-08-07 12:43:25 +02:00
Ludovic Courtès
08041d216f build: Use 'sed' invocation compatible with BSD sed.
Fixes <https://bugs.gnu.org/30011>.
Reported by ilove zfs <ilovezfs@icloud.com>.

* libguile/Makefile.am (INSTANTIATE): Move '-i' first.
2018-08-07 11:39:35 +02:00
Andy Wingo
9fc5282ca5 Merge 'master' into 'lightning' 2018-07-20 11:41:54 +02:00
Andy Wingo
9338ef15c2 Wire up lightning into libguile build
* libguile/Makefile.am (AM_CPPFLAGS):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): If ENABLE_JIT, build
  lightning.
  (EXTRA_DIST): Add lightning files.
* libguile/lightning/lightning.am (lightning_extra_files): Add COPYING
  and related files to the dist.
* libguile/jit.c:
* libguile/jit.h: New files.
2018-07-02 11:08:57 +02:00
Andy Wingo
0465c8834e Refactor deps for built libpath.h
* libguile/Makefile.am (BUILT_INCLUDES): Move libpath.h here, from
  BUILT_SOURCES, so that .x files depend on it.  Thanks to Dale Smith
  for the report.
2018-07-01 12:18:32 +02:00
Andy Wingo
5448e5a4b0 Add intrinsic for foreign-call
* libguile/Makefile.am (noinst_HEADERS, modinclude_HEADERS): Change to
  not install intrinsics.h.
* libguile/intrinsics.h: Add an error if BUILDING_LIBGUILE isn't set, to
  catch any stray bad inclusions.  Add intrinsic for foreign-call.
* libguile/foreign.c (foreign_call): Rename from scm_i_foreign_call, and
  set as the foreign-call intrinsic.
* libguile/vm-engine.c (foreign-call): Use the intrinsic.  In the future
  we'll want to totally revamp the FFI, if we know that a JIT is
  available!
2018-06-26 09:22:07 +02:00
Andy Wingo
97cc65fee4 Rename __scm.h to scm.h
* libguile/scm.h: Rename.  Update all includers.
2018-06-20 16:33:33 +02:00
Andy Wingo
d04ff278f5 Remove unneeded memmove.c and strerror.c files
* libguile/memmove.c:
* libguile/strerror.c: Remove; these must be present for C99.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Remove files.
2018-06-20 14:35:06 +02:00
Andy Wingo
40ade0886e Remove _scm.h
* libguile/_scm.h: Remove.  An internal header, never installed.
* libguile/__scm.h: Remove horrible documentation.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Remove _scm.h.
* libguile/alist.c:
* libguile/array-handle.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/async.c:
* libguile/atomic.c:
* libguile/backtrace.c:
* libguile/bitvectors.c:
* libguile/boolean.c:
* libguile/bytevectors.c:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/debug-malloc.c:
* libguile/debug.c:
* libguile/deprecated.c:
* libguile/deprecation.c:
* libguile/dynl.c:
* libguile/dynstack.c:
* libguile/dynwind.c:
* libguile/eq.c:
* libguile/error.c:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/extensions.c:
* libguile/fdes-finalizers.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/finalizers.c:
* libguile/fluids.c:
* libguile/foreign-object.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/gen-scmconfig.c:
* libguile/generalized-arrays.c:
* libguile/generalized-vectors.c:
* libguile/gettext.c:
* libguile/goops.c:
* libguile/gsubr.c:
* libguile/guardians.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/hooks.c:
* libguile/i18n.c:
* libguile/init.c:
* libguile/instructions.c:
* libguile/intrinsics.c:
* libguile/ioext.c:
* libguile/keywords.c:
* libguile/list.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/macros.c:
* libguile/mallocs.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/net_db.c:
* libguile/null-threads.c:
* libguile/numbers.c:
* libguile/objprop.c:
* libguile/options.c:
* libguile/pairs.c:
* libguile/poll.c:
* libguile/ports-internal.h:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procprop.c:
* libguile/procs.c:
* libguile/programs.c:
* libguile/promises.c:
* libguile/r6rs-ports.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/simpos.c:
* libguile/smob.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srcprop.c:
* libguile/srfi-1.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/srfi-4.c:
* libguile/srfi-60.c:
* libguile/stackchk.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/strorder.c:
* libguile/strports.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/syntax.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/unicode.c:
* libguile/uniform.c:
* libguile/values.c:
* libguile/variable.c:
* libguile/vectors.c:
* libguile/version.c:
* libguile/vm.c:
* libguile/vports.c:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Remove _scm.h includes.
2018-06-20 14:26:01 +02:00
Andy Wingo
6f294ecc75 Devolve more validate macros
* libguile.h: Add chooks.h.
* libguile/Makefile.am: Add chooks.h and chooks.c.
* libguile/chooks.c:
* libguile/chooks.h: New files, for the C implementation of hooks.
  Broken out to avoid cycles in gc.h includes.
* libguile/gc.h:
* libguile/gc.c (scm_i_gc_admin_mutex, scm_i_sweep_mutex): Remove unused
  mutexes.  Include chooks instead of hooks in the main header.
* libguile/deprecated.h (scm_gc_running_p): Deprecate this macro always
  defined to 0.
  (SCM_VALIDATE_VECTOR_OR_DVECTOR): Deprecate this weird one too.
* libguile/array-map.c: Add procs.h include.
* libguile/threads.h:
* libguile/vm.c:
* libguile/r6rs-ports.c: Add smob.h include.
* libguile/atomic.h (SCM_VALIDATE_ATOMIC_BOX): Devolve.
* libguile/deprecation.c (scm_c_issue_deprecation_warning): Remove use
  of scm_gc_running_p.
* libguile/error.c (scm_error_scm): Remove use of scm_gc_running_p.
* libguile/filesys.h (SCM_VALIDATE_DIR)
* libguile/fluids.h (SCM_VALIDATE_FLUID)
* libguile/fports.h (SCM_VALIDATE_FPORT, SCM_VALIDATE_OPFPORT)
* libguile/generalized-arrays.h (SCM_VALIDATE_ARRAY)
* libguile/hooks.h (SCM_VALIDATE_HOOK)
* libguile/keywords.h (SCM_VALIDATE_KEYWORD)
* libguile/ports.h (SCM_VALIDATE_PORT, SCM_VALIDATE_INPUT_PORT)
  (SCM_VALIDATE_OUTPUT_PORT, SCM_VALIDATE_OPINPORT)
  (SCM_VALIDATE_OPENPORT, SCM_VALIDATE_OPPORT, SCM_VALIDATE_OPOUTPORT)
* libguile/procs.h (SCM_VALIDATE_PROC)
* libguile/random.h (SCM_VALIDATE_RSTATE)
* libguile/regex-posix.h (SCM_VALIDATE_RGXP)
* libguile/stacks.h (SCM_VALIDATE_STACK, SCM_VALIDATE_FRAME)
* libguile/strports.h (SCM_VALIDATE_OPOUTSTRPORT)
* libguile/struct.h (SCM_VALIDATE_STRUCT SCM_VALIDATE_VTABLE)
* libguile/symbols.h (SCM_VALIDATE_SYMBOL)
* libguile/variable.h (SCM_VALIDATE_VARIABLE)
* libguile/vectors.h (SCM_VALIDATE_VECTOR SCM_VALIDATE_VECTOR_LEN):
  Devolve.
* libguile/validate.h: It's empty now!

hooks squish
2018-06-18 10:50:17 +02:00
Andy Wingo
5176db70ca Move syscall-related private defines to their own header
* libguile/syscalls.h: New private header.
* libguile/Makefile.am
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Add syscalls.h.
* libguile/_scm.h: Remove SCM_SYSCALL and all the bits relating to
  e.g. stat versus stat64.
* libguile/filesys.c:
* libguile/fports.c:
* libguile/i18n.c:
* libguile/ioext.c:
* libguile/poll.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/socket.c:
* libguile/strports.c: Include syscalls.h.
2018-06-17 18:18:26 +02:00
Andy Wingo
4d530a94bb Add instrinsics to runtime
* libguile/intrinsics.c:
* libguile/intrinsics.h: New files.
* libguile/Makefile.am:
* libguile/init.c: Add new files to build.
2018-03-30 20:30:42 +02:00
Ludovic Courtès
81d2e35266 Allow GDB support to be used with GDB-linked-against-Guile-2.0.
* libguile/Makefile.am (INSTANTIATE): New variable.
(install-data-hook): Use it.
* libguile/libguile-2.2-gdb.scm: Autoload (system vm debug).
Augment %load-path and %load-compiled-path, and reload (system base
types).
* module/system/base/types.scm: Remove #:hide to be 2.0-compatible.
Use (system syntax internal) conditionally when on 2.2.
2017-11-05 18:21:35 +01:00
Andy Wingo
64c5cc58fc Add disjoint syntax object type
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, noinst_HEADERS): Add syntax.c and
  syntax.h.
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (class_syntax, scm_class_of, scm_goops_early_init):
* libguile/init.c (scm_init_guile):
* libguile/print.c (iprin1):
* libguile/tags.h (scm_tc7_syntax):
* module/oop/goops.scm (<syntax>):
* module/system/base/types.scm (%tc7-syntax, cell->object):
* module/system/vm/disassembler.scm (code-annotation): Wire up the new
  data type.
* libguile/syntax.c:
* libguile/syntax.h: New files.
* module/ice-9/boot-9.scm: Move new definitions to (system syntax
  internal).
* module/system/syntax.scm (print-syntax): New helper.
* module/system/vm/assembler.scm (statically-allocatable?)
  (intern-constant, link-data): Arrange to be able to write syntax
  objects into images.
* module/language/cps/types.scm (&syntax): New type.  Remove
  &hash-table; it was never detected, an internal binding, and we need
  the bit to avoid going into bignum territory.
2017-03-28 19:23:13 +02:00
Andy Wingo
c9910c6042 Fix finalizer resuscitation causing excessive GC
* libguile/finalizers.c (async_gc_finalizer):
  (scm_i_register_async_gc_callback): Replace "weak gc callback"
  mechanism with "async gc callback" mechanism.  Very similar but the
  new API is designed to be called a bounded number of times, to avoid
  running afoul of libgc heuristics.
* libguile/weak-list.h: New internal header.
* libguile/Makefile.am (noinst_HEADERS): Add weak-list.h.
* libguile/weak-set.c (vacuum_all_weak_sets):
  (scm_c_make_weak_set, scm_init_weak_set):
* libguile/weak-table.c (vacuum_all_weak_tables):
  (scm_c_make_weak_table, scm_init_weak_table): Arrange to vacuum all
  weak sets from a single async GC callback, and likewise for weak
  tables.

Thanks to Ludovic Courtès for tracking this bug down!
2017-03-13 15:47:51 +01:00
Ludovic Courtès
817a071209 build: Honor $SOURCE_DATE_EPOCH for the recorded timestamp.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>
at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20272#36>.

* libguile/Makefile.am (libpath.h): Honor 'SOURCE_DATE_EPOCH'.
2017-03-01 20:58:37 +01:00
Mark H Weaver
8f7ed8abf2 build: .x and .doc files depend on generated includes.
Fixes <https://bugs.gentoo.org/show_bug.cgi?id=590528>.

* libguile/Makefile.am (BUILT_INCLUDES): New variable.
(BUILT_SOURCES): Put generated .h to BUILT_INCLUDES.
(DOT_X_FILES, EXTRA_DOT_X_FILES, DOT_DOC_FILES, EXTRA_DOT_DOC_FILES):
Depend on $(BUILT_INCLUDES), in place of scmconfig.h which is included
in $(BUILT_INCLUDES).
2017-03-01 19:31:42 +01:00
Andy Wingo
aa84489d18 Reimplement dynamic states
There are two goals: one, to use less memory per dynamic state in order
to allow millions of dynamic states to be allocated in light-weight
threading scenarios.  The second goal is to prevent dynamic states from
being actively mutated in two threads at once.  This second goal does
mean that dynamic states object that escape into scheme are now copies
that won't receive further updates; an incompatible change, but one
which we hope doesn't affect anyone.

* libguile/cache-internal.h: New file.
* libguile/fluids.c (is_dynamic_state, get_dynamic_state)
  (save_dynamic_state, restore_dynamic_state, add_entry)
  (copy_value_table): New functions.
  (scm_i_fluid_print, scm_i_dynamic_state_print): Move up.
  (new_fluid): No need for a number.
  (scm_fluid_p: scm_is_fluid): Inline IS_FLUID uses.
  (fluid_set_x, fluid_ref): Adapt to dynamic state changes.
  (scm_fluid_set_x, scm_fluid_unset_x): Call fluid_set_x.
  (scm_swap_fluid): Rewrite in terms of fluid_ref and fluid_set.
  (swap_fluid): Use internal fluid_set_x.
  (scm_i_make_initial_dynamic_state): Adapt to dynamic state
  representation change.
  (scm_dynamic_state_p, scm_is_dynamic_state): Use new accessors.
  (scm_current_dynamic_state): Use make_dynamic_state.
  (scm_dynwind_current_dynamic_state): Use new accessor.
* libguile/fluids.h: Remove internal definitions.  Add new struct
  definition.
* libguile/threads.h (scm_i_thread): Use scm_t_dynamic_state for dynamic
  state.
* libguile/threads.c (guilify_self_1, guilify_self_2):
  (scm_i_init_thread_for_guile, scm_init_guile):
  (scm_call_with_new_thread):
  (scm_init_threads, scm_init_threads_default_dynamic_state): Adapt to
  scm_i_thread change.
  (scm_i_with_guile, with_guile): Remove "and parent" suffix.
  (scm_i_reset_fluid): Remove unneeded function.
* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Remove
  scm_make_dynamic_state docs.  Update current-dynamic-state docs.
* libguile/vm-engine.c (vm_engine): Update fluid-ref and fluid-set!
  inlined fast paths for dynamic state changes.
* libguile/vm.c (vm_error_unbound_fluid): Remove now-unused function.
* NEWS: Update.
* module/ice-9/deprecated.scm (make-dynamic-state): New definition.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_make_dynamic_state): Move here.
* libguile/__scm.h (scm_t_dynamic_state): New typedef.
* libguile/dynstack.h:
* libguile/dynstack.c (scm_dynstack_push_fluid):
  (scm_dynstack_unwind_fluid): Take raw dynstate in these internal
  functions.
* libguile/throw.c (catch): Adapt to dynstack changes.
2016-12-05 21:46:37 +01:00
Andy Wingo
dc2a560264 Deprecate dynamic roots
* libguile/root.h:
* libguile/root.c: Remove these files.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_internal_cwdr, scm_call_with_dynamic_root)
  (scm_dynamic_root, scm_apply_with_dynamic_root): Deprecate.

Remove all root.h usage, which was vestigial.

* module/ice-9/serialize.scm: Use (current-thread) instead
  of (dynamic-root).
2016-11-21 23:09:21 +01:00
Andy Wingo
56d8d9a257 Deprecate arbiters
* libguile/arbiters.c:
* libguile/arbiters.h:
* test-suite/tests/arbiters.test: Delete files.
* libguile/deprecated.c:
* libguile/deprecated.h: Move arbiters code here.
* doc/ref/api-scheduling.texi: Remove section on arbiters.
* libguile.h:
* libguile/Makefile.am:
* libguile/init.c:
* module/oop/goops.scm:
* test-suite/Makefile.am: Remove mention of arbiters.
* NEWS: Update.
2016-10-17 21:29:05 +02:00
Andy Wingo
3425290a7b Add atomic boxes
* doc/ref/api-scheduling.texi (Atomics): New manual section.
* libguile.h: Include atomic.h.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add atomic.
* libguile/atomic.c:
* libguile/atomic.h: New files.
* libguile/atomics-internal.h (scm_atomic_set_scm, scm_atomic_ref_scm)
  (scm_atomic_swap_scm, scm_atomic_compare_and_swap_scm): New
  facilities.
* libguile/goops.c (class_atomic_box, scm_sys_goops_early_init): Add
  support for <atomic-box>.  Remove duplicate <keyword> fetch.
* libguile/init.c (scm_i_init_guile): Call scm_register_atomic_box.
* libguile/print.c (iprin1): Add atomic box case.
* libguile/tags.h (scm_tc7_atomic_box): New tag.
* libguile/validate.h (SCM_VALIDATE_ATOMIC_BOX): New macro.
* module/Makefile.am (SOURCES): Add ice-9/atomic.scm.
* module/ice-9/atomic.scm: New file.
* module/oop/goops.scm (<atomic-box>): New var.
2016-09-06 11:16:53 +02:00
Andy Wingo
b8a53b98b3 Only ptob->close() after read/write finish
* libguile/Makefile.am (noinst_HEADERS): Add atomics-internal.h.
* libguile/atomics-internal.h: New file.
* libguile/ports-internal.h (refcount): New member.
* libguile/ports.c (release_port, scm_dynwind_acquire_port): New
  facility for acquiring a port within a dynwind.
  (scm_port_poll, scm_i_read_bytes, scm_setvbuf, scm_end_input)
  (scm_i_write_bytes, scm_char_ready_p, scm_seek)
  (scm_truncate_file, trampoline_to_c_read)
  (trampoline_to_c_write): Acquire port.
  (scm_c_make_port_with_encoding): Init refcount to 1.
  (scm_close_port): Release port.
* doc/ref/api-io.texi (I/O Extensions): Add documentation
2016-08-31 19:10:35 +02:00
Andy Wingo
2fa2e50a0f Add file descriptor finalizers
* doc/ref/posix.texi (Ports and File Descriptors): Document new
  interfaces.
* libguile/filesys.c (scm_close, scm_close_fdes)
* libguile/fports.c (fport_close):
* libguile/ioext.c (scm_primitive_move_to_fdes): Call
  scm_run_fdes_finalizers.
* module/ice-9/fdes-finalizers.scm:
* test-suite/tests/fdes-finalizers.test:
* libguile/fdes-finalizers.h:
* libguile/fdes-finalizers.c: New files.
* module/Makefile.am:
* test-suite/Makefile.am:
* libguile/Makefile.am:
* libguile.h:
* libguile/init.c: Wire up new files.
2016-08-30 23:35:10 +02:00
Andy Wingo
b2d77c38c4 Rename win32-uname.[ch] to posix-w32.[ch]
* libguile/posix-w32.c:
* libguile/posix-w32.h: Rename from win32-uname.c and win32-uname.h.
* libguile/posix.c:
* libguile/Makefile.am
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES)
  (noinst_HEADERS): Adapt.
2016-07-25 11:41:50 +02:00
Andy Wingo
38f23e75a5 Add meta/build-env
* meta/build-env.in: New file which sets up an environment that does not
  inherit GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH (unless
  cross-compiling).
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.go):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* am/bootstrap.am (.scm.go):
* am/guilec (.scm.go): Use build-env.
* configure.ac: Create build-env.
2016-07-10 14:10:26 +02:00
Andy Wingo
0ef4b76221 Remove a stale variable use in libguile/Makefile.am
* libguile/Makefile.am (BUILT_SOURCES): Remove a use of a variable that
  doesn't exist in 2.2.
2016-06-22 16:47:40 +02:00
Ludovic Courtès
7c36145075 build: Remove libguile/mkstemp.c, redundant with Gnulib.
Fixes <http://bugs.gnu.org/21425>.
Reported by Kouhei Sutou <kou@cozmixng.org>.

* configure.ac: Remove 'AC_REPLACE_FUNCS' for 'mkstemp'.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Remove mkstemp.c.
* libguile/mkstemp.c: Remove.
2016-05-22 19:50:35 +02:00
David Michael
41f28a9b0e Remove SIGEV constant definitions.
* libguile/Makefile.am (chknew-E chknew-SIG): Anchor the end of the
  signal/error name pattern to only match alphanumeric symbols.
* libguile/cpp-SIG.syms (SIGEV_MAX_SIZE, SIGEV_NONE): Remove.
  (SIGEV_PAD_SIZE, SIGEV_SIGNAL, SIGEV_THREAD): Likewise.
  (SIGEV_THREAD_ID): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-05-22 19:50:27 +02:00
David Michael
99555262a9 Fix the rule to check for new signals and errors
Fixes <http://bugs.gnu.org/21114>.

* libguile/Makefile.am (chknew-E chknew-SIG): Remove the line
  continuation after the targets, and include numbers in the
  recipe's signal/error regexp to catch names like E2BIG.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-05-22 19:50:07 +02:00
Andy Wingo
e5bccb6e5d Fix distcheck issues
* bootstrap/Makefile.am:
* libguile/Makefile.am: Fix distcheck issues.
2015-10-25 14:25:56 +00:00
Andy Wingo
c5ea75534c Add (ice-9 unicode) module
* libguile/unicode.c:
* libguile/unicode.h:
* test-suite/tests/unicode.test:
* module/ice-9/unicode.scm: New files.

* module/Makefile.am:
* libguile/Makefile.am:
* test-suite/Makefile.am:
* libguile/init.c: Wire new files into the build.

* doc/ref/api-data.texi: Add docs.
2014-09-12 17:00:59 +02:00
Andy Wingo
d7a67c3e91 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	.gitignore
	doc/example-smob/Makefile
	doc/ref/api-smobs.texi
	doc/ref/libguile-concepts.texi
	doc/ref/libguile-smobs.texi
	libguile.h
	libguile/finalizers.c
	libguile/finalizers.h
	libguile/goops.c
	module/language/tree-il/compile-glil.scm
	module/oop/goops.scm
2014-04-28 18:51:21 +02:00
Andy Wingo
a7ee7f7cbf New foreign object facility, to replace SMOBs
* libguile/foreign-object.c:
* libguile/foreign-object.h:
* module/system/foreign-object.scm:
* test-suite/standalone/test-foreign-object-c.c:
* test-suite/standalone/test-foreign-object-scm: New files.

* test-suite/standalone/Makefile.am:
* module/Makefile.am:
* libguile/Makefile.am: Add new files.

* libguile.h: Add foreign-object.h.
* libguile/init.c (scm_i_init_guile): Call scm_register_foreign_object.
2014-04-28 10:59:11 +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
17d4daa8bd Include <config.h> in gen-scmconfig even when cross-compiling.
Partially reverts 8cb0d6d7fa.

* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Remove
  -DCROSS_COMPILING=1 from cross-compiling case.
* libguile/gen-scmconfig.c: Include <config.h> regardless of
  whether CROSS_COMPILING is defined.
2014-03-13 23:27:16 -04:00
Ludovic Courtès
21a7ba9b7e build: Remove libguile-2.0-gdb.scm and $infodir/dir upon uninstall.
* libguile/Makefile.am (uninstall-data-hook): New target.
2014-03-12 16:22:15 +01:00
Ludovic Courtès
de32a951c0 build: Install libguile-2.0-gdb.scm after libguile-2.0.so.
* libguile/Makefile.am (install-data-local): Rename to...
  (install-data-hook): ... this.  This guarantees that the rule runs
  after libguile-2.0.so has been installed.
2014-03-12 15:18:27 +01:00