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

270 commits

Author SHA1 Message Date
Andy Wingo
f740445a9b run finalizers asynchronously in asyncs
* libguile/finalizers.c: New excitement!  We'll be running finalizers
  asynchronously, from asyncs.  This will make it safer to allocate
  while holding a mutex.
  (GC_set_finalizer_notifier): Add back-compat shim.

* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
  during boot.

* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
  on demand.
  (scm_gc): Explicitly run finalizers here.

* libguile/threads.c (guilify_self_2): Run finalizers here if
  queue_finalizer_async happened to run during guilify_self_1.

* configure.ac: Add check for GC_set_finalizer_notifier.
2012-03-08 13:12:10 +01:00
Andy Wingo
0858753e82 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/gc-malloc.c
	libguile/ports.c
2012-02-08 11:48:08 +01:00
Ludovic Courtès
a0919aefee i18n: Use Gnulib's `nl_langinfo' module.
* configure.ac: Remove checks for <langinfo.h> and <nl_types.h>, and
  `nl_langinfo'.

* libguile/i18n.c: Remove #ifdefs for HAVE_LANGINFO_H, HAVE_NL_TYPES_H,
  HAVE_NL_ITEM, and HAVE_LANGINFO_CODESET.
  (SCM_VALIDATE_OPTIONAL_LOCALE_COPY): Use `SCM_UNBNDP'.

* m4/gnulib-cache.m4 (gl_MODULES): Add `nl_langinfo'.

* module/ice-9/i18n.scm (define-vector-langinfo-mapping): Remove
  `defaults' parameter; assume (provided? 'nl-langinfo) is always true.
  Update users accordingly.
  (define-simple-langinfo-mapping): Likewise.
  (define-monetary-langinfo-mapping): Likewise, but do not assume
  LOCAL-ITEM and INTL-ITEM are always defined.
2012-02-03 14:14:14 +01:00
Ludovic Courtès
eb4a14ed47 Use Gnulib's `regex' module.
This should help with regex portability, as reported in
<http://bugs.gnu.org/10684> for Darwin 8.11.

* m4/gnulib-cache.m4 (gl_MODULES): Add `regex'.

* configure.ac: Remove header checks for regex.h, rxposix.h, and
  rx/rxposix.h.  Remove check for the `regcomp' function.  Remove
  definition of `HAVE_REGCOMP'.  Define `ENABLE_REGEX'.

* libguile/init.c: Check for `ENABLE_REGEX' instead of `HAVE_REGCOMP'.

* libguile/regex-posix.c: Always include <regex.h>.  Remove #ifdefs for
  rxposix.h and co.
2012-02-03 10:51:46 +01:00
Andy Wingo
dfadcf85cb Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/debug.h
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/tree-il/peval.scm
	module/language/tree-il/primitives.scm
2012-01-30 20:27:35 +01:00
Ludovic Courtès
f5ea0499a4 Build with `-fno-strict-aliasing' when available.
* configure.ac (POTENTIAL_GCC_CFLAGS): Add `-fno-strict-aliasing'.
  Suggested by Mark H. Weaver.
2012-01-27 22:02:31 +01:00
Andy Wingo
0bdd43515e Merge commit 'f78a1ccede' 2012-01-10 00:23:49 +01:00
Andy Wingo
c1d5d6d755 freebsd implementation of get_thread_stack_base
* configure.ac: Check for pthread_np.h and pthread_attr_get_np.  Patch
  by Jim Pryor.
* libguile/threads.c (get_thread_stack_base): Provide an implementation
  for FreeBSD.
2011-12-22 10:28:23 -05:00
Andy Wingo
34cf38c3a2 stdlib.h, not malloc.h
* configure.ac: Remove check for malloc.h.

* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/mallocs.c:
* libguile/smob.c: Use stdlib instead of malloc.h.
2011-12-22 09:54:24 -05:00
Andy Wingo
bfe35b90ff Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
2011-12-13 10:20:44 +01:00
Chris K. Jester-Young
4eb286127c fix compilation with gc 7.1
* configure.ac: Add checks for GC_gcollect_and_unmap and
  GC_get_unmapped_bytes.
* libguile/gc-malloc.c (scm_realloc): GC_gcollect() if we don't have
  GC_gcollect_and_unmap.
* libguile/gc.c (GC_get_heap_usage_safe): Likewise, don't
  GC_get_unmapped_bytes if the function doesn't exist.
2011-12-08 21:14:06 +01:00
Andy Wingo
b2208d2e98 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/fluids.c
	libguile/gc.c
	libguile/gc.h
	libguile/objcodes.c
	libguile/procprop.c
	libguile/vm.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
2011-12-01 23:31:50 +01:00
Andy Wingo
6360beb28a increase garbage collection rate if the process is growing
* configure.ac: Check for GC_get_free_space_divisor.
* libguile/gc.c (GC_get_free_space_divisor): Define an implementation,
  if needed.
  (accumulate_gc_timer): Fix indentation.
  (get_image_size): New terrible hack.  Needs implementations on other
  platforms.
  (adjust_gc_frequency): Attempt to adjust the GC frequency based on
  process image growth.  Needs more comments.
  (scm_init_gc): Add the adjust_gc_frequency to the after_gc_c_hook.
2011-11-29 10:12:22 +01:00
Andy Wingo
14294ce0df get heap stats with GC_get_heap_usage_safe, if available.
* configure.ac: Check for GC_get_heap_usage_safe.
* libguile/gc.c (SCM_DEFINE): Use GC_get_heap_usage_safe.
2011-11-28 19:58:53 +01:00
Andy Wingo
3dc9f41900 support for new GC_move_disappearing_link
* configure.ac: Check for GC_move_disappearing_link.
* libguile/weak-set.c (move_weak_entry):
* libguile/weak-table.c (move_disappearing_links):
  (move_weak_entry): Use GC_move_disappearing_link if available.
2011-11-24 11:47:36 +01:00
Ludovic Courtès
1c1f7a3223 configure: Make sure $GUILE_FOR_BUILD is suitable.
* acinclude.m4 (GUILE_CHECK_VERSION, GUILE_CHECK_GUILE_FOR_BUILD): New
  macros.

* configure.ac: Remove $GUILE_FOR_BUILD tests.  Use
  `GUILE_CHECK_GUILE_FOR_BUILD'.
2011-11-23 22:05:53 +01:00
Andy Wingo
ab4bc85398 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	test-suite/tests/srfi-4.test
2011-07-25 18:26:37 +02:00
Ludovic Courtès
f4b7d918ef guild: Close over `$bindir/guile'.
* configure.ac: Substitute `guile_program_name'.

* meta/guild.in: Use `@bindir@/@guile_program_name@' by default.

* meta/uninstalled-env.in: Define $GUILE.
2011-07-23 22:43:38 +02:00
Ludovic Courtès
0adcd1bd93 configure: Build a tar.xz' in addition to tar.gz'.
* configure.ac: Explicitly require Automake 1.11.  Add Automake option
  `dist-xz'.
2011-07-06 16:01:22 +02:00
Andy Wingo
8a562c697b Merge remote-tracking branch 'local-2.0/stable-2.0'
Conflicts:
	libguile/deprecated.c
	module/ice-9/psyntax-pp.scm
2011-06-30 13:47:46 +02:00
Andy Wingo
08969a2407 fix --disable-modules build
* configure.ac (HAVE_MODULES): Define HAVE_MODULES iff
  --enable-modules.

* libguile/deprecated.c (scm_dynamic_args_call)
* libguile/extensions.c (load_extension):
* libguile/init.c (scm_i_init_guile): Use HAVE_MODULES in a few places.
2011-06-30 12:26:31 +02:00
Andy Wingo
43adb591f4 allow gc <= 7.1 to stop the signal delivery thread
* configure.ac: Add a check for GC_get_suspend_signal().
* libguile/scmsigs.c (GC_get_suspend_signal): Define a fallback
  implementation if one isn't available.
  (signal_delivery_thread): Unmask the suspend signal so that GC can
  stop the world.  Fixes test-pthread-create on libgc 7.1 and earlier.
  Thanks to Frank Terbeck <ft@bewatermyfriend.org> for the report.
2011-06-23 11:31:03 +02:00
Andy Wingo
236f901b0e update stack growth direction check
* configure.ac: Pull stack growth direction check from upstream
  autoconf.  See
  http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00035.html
  for a discussion.
2011-06-20 10:03:35 +02:00
Ludovic Courtès
d1f2417102 Comment on the Gnulib `clock-gettime' workaround.
* acinclude.m4: Remove `clock_time.m4' serial.

* configure.ac: Add URL of the discussion about `clock-gettime'.
2011-06-19 16:39:22 +02:00
Ludovic Courtès
10c29ebde5 configure: Factorize code checking for `iconveh_' constants; use the cache.
* configure.ac: Remove code that determines the values of the `iconveh_'
  constants.  Use `GUILE_UNISTRING_ICONVEH_VALUES'. instead.

* acinclude.m4 (GUILE_UNISTRING_CONSTANT,
  GUILE_UNISTRING_ICONVEH_VALUES): New macros.
2011-06-19 16:30:56 +02:00
Andy Wingo
78f0ef20a7 Merge remote-tracking branch 'local-2.0/stable-2.0'
Conflicts:
	module/ice-9/psyntax-pp.scm
	module/language/tree-il/compile-glil.scm
2011-06-18 01:07:20 +02:00
Andy Wingo
ad0fedbf82 fix AC_LANG_SOURCE warnings
* configure.ac: Fix annoying AC_LANG_SOURCE warnings.
2011-06-17 11:37:11 +02:00
Andy Wingo
074f39c7bc check for clock_getcpuclockid in gl_CLOCK_TIME
* acinclude.m4 (gl_CLOCK_TIME): It could be that clock_gettime is in
  libc but clock_getcpuclockid is not, so check for that explicitly.
2011-06-17 11:31:12 +02:00
Andy Wingo
95643853d7 remove win32-dirent.[ch]
* libguile/win32-dirent.c:
* libguile/win32-dirent.h: Remove these files.  MinGW has opendir and
  readdir support, I hear.

* configure.ac:
* libguile/filesys.c:
* libguile/Makefile.am: Adapt.
2011-06-17 00:20:56 +02:00
Andy Wingo
46da7909e1 Merge remote-tracking branch 'local-2.0/stable-2.0'
Conflicts:
	meta/Makefile.am
2011-06-02 22:49:33 +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
Andy Wingo
891a1851a1 Merge remote-tracking branch 'origin/stable-2.0' 2011-05-05 14:09:29 +02:00
Andy Wingo
e3b8bce8f4 build support for detecting clock_gettime, with -lrt if needed
* acinclude.m4 (gl_CLOCK_TIME):
* configure.ac: Locally include gl_CLOCK_TIME.  To be fixed properly
  when gnulib updates their license to reflect the actual BSD state of
  things.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS):
  Add -lrt for clock_gettime, if needed.
* meta/guile-2.0-uninstalled.pc.in:
* meta/guile-2.0.pc.in: Likewise, in Libs.private.
2011-05-04 20:19:11 +02:00
Andy Wingo
ad378da975 check for iconveh values at configure-time
* configure.ac: Check for the iconveh values here, instead of relying on
  gen-scmconfig to know them.  That doesn't work in general because
  gen-scmconfig runs on the build machine, not the target machine.

* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Revert rule to the
  revision before 533d8212.

* libguile/gen-scmconfig.h.in (SCM_I_GSC_ICONVEH_ERROR):
  (SCM_I_GSC_ICONVEH_QUESTION_MARK):
  (SCM_I_GSC_ICONVEH_ESCAPE_SEQUENCE):
* libguile/gen-scmconfig.c: Use configure-time substitutions to set
  SCM_ICONVEH_ERROR_HANDLER et al.
2011-04-28 22:39:20 +02:00
Andy Wingo
1903eae4c9 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
2011-04-28 15:53:35 +02:00
Ludovic Courtès
dd7d0148f2 Update Gnulib to v0.0-5158-g7d06b32; remove strcase' and version-etc-fsf'.
* m4/gnulib-cache.m4: Remove `strcase' and `version-etc-fsf'.

* configure.ac (POTENTIAL_GCC_CFLAGS): Remove `-Wundef'.

* libguile/script.c: Don't include <version-etc.h>.
2011-04-25 23:59:37 +02:00
Ludovic Courtès
969bb92e9b Turn the libunistring/iconv configure check into a macro.
* acinclude.m4 (GUILE_LIBUNISTRING_WITH_ICONV_SUPPORT): New macro.

* configure.ac: Use it.
2011-04-22 16:59:08 +02:00
Ludovic Courtès
a508fbdb01 Fix typo in `configure.ac'.
* configure.ac: Add missing comma in `AC_RUN_IFELSE' invocation.
2011-04-22 16:59:07 +02:00
Andy Wingo
514ff6ea07 add test that libunistring was built with iconv support
* configure.ac: Add check that libunistring was built with iconv
  support.  Thanks to Mark Weaver for the debugging and test program.
2011-04-21 16:02:09 +02:00
Andy Wingo
66b229d56e pre-GC_set_start_callback compatibility
* configure.ac: Add a check for GC_set_start_callback.

* libguile/gc.c (scm_i_gc): If we don't have GC_set_start_callback, run
  the before-gc hook manually here.
  (scm_init_gc): Otherwise set it as a start callback.

* libguile/hashtab.c (weak_gc_callback, weak_gc_hook)
  (weak_gc_finalizer, scm_c_register_weak_gc_callback): Fix to work
  either way, with or without GC_set_start_callback.
2011-04-15 18:31:06 +02:00
Ludovic Courtès
073167ef7b Allow compilation with `--disable-posix'.
Reported by Dmitry Dzhus <dima@dzhus.org>.

* configure.ac: Remove `AC_LIBOBJ([filesys])'.  Document
  `--disable-posix' as omitting non-essential POSIX interfaces.

* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Add `filesys.c'.
  (DOT_DOC_FILES): Add `filesys.doc'.
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Remove
  `filesys.c'.

* libguile/posix.c (scm_mkstemp, scm_access): Move to `filesys.c'.
  (scm_init_posix): Move `R_OK' etc. to `filesys.c'.

* libguile/filesys.c (scm_chown, scm_chmod, scm_umask, scm_open_fdes,
  scm_open, scm_close, scm_close_fdes, scm_link, scm_tc16_dir,
  scm_directory_stream_p, scm_opendir, scm_readdir, scm_rewinddir,
  scm_closedir, scm_dir_print, scm_dir_free, scm_chdir, scm_getcwd,
  set_element, fill_select_type, get_element, retrieve_select_type,
  scm_select, scm_fcntl, scm_fsync, scm_symlink, scm_readlink,
  scm_lstat, scm_copy_file): Conditionalize on HAVE_POSIX.
  (scm_mkstemp, scm_access): New functions.
  (scm_init_filesys): Conditionalize `scm_tc16_dir', `O_RDONLY', etc. on
  HAVE_POSIX.  Define `R_OK', `W_OK', etc.

* libguile/fports.c (fport_print): Use `scm_ttyname' only when
  HAVE_POSIX.

* libguile/i18n.c (lock_locale_mutex, unlock_locale_mutex): New
  functions.  Update users of `scm_i_locale_mutex' to use them.

* libguile/init.c (scm_i_init_guile): Always call `scm_init_filesys'.

* meta/guile-tools.in (main): Use `setlocale' only when it is defined.

* module/ice-9/boot-9.scm: Always load `ice-9/posix'.
2011-04-15 00:09:16 +02:00
Ludovic Courtès
22072f2155 Include <sched.h> in `posix.c'.
* configure.ac: Check for <sched.h>.

* libguile/posix.c [HAVE_SCHED_H]: Include <sched.h>, for
  `sched_setaffinity' & co.
  Reported by Marco Maggi <marco.maggi-ipsu@poste.it>.
2011-04-14 23:16:21 +02:00
Andy Wingo
0c81a0c13a bump effective version to 2.2
* .gitignore:
* GUILE-VERSION (GUILE_EFFECTIVE_VERSION):
* configure.ac:
* doc/example-smob/Makefile (CFLAGS, LIBS):
* doc/guile.1:
* doc/ref/libguile-concepts.texi:
* doc/ref/srfi-modules.texi:
* doc/ref/vm.texi:
* meta/Makefile.am (EXTRA_DIST, pkgconfig_DATA):
* meta/guile-config.in (guile-module):
* meta/guile-2.2-uninstalled.pc.in:
* meta/guile-2.2.pc.in: Bump effective version to 2.2.
2011-04-11 23:45:04 +02:00
Andy Wingo
90fed973ab pthread-threads.h: only redirect to GC_pthread_sigmask if it is present
* configure.ac: Check for pthread_sigmask.
* libguile/gen-scmconfig.c: Create SCM_HAVE_GC_PTHREAD_SIGMASK.
* libguile/pthread-threads.h (scm_i_pthread_sigmask): Only redirect to
  GC_pthread_sigmask if GC_pthread_sigmask is present.
2011-04-03 22:03:56 +02:00
Andy Wingo
13a78b0fd7 support loading objcode even if mmap(2) is unavailable
* configure.ac: Check for sys/mman.h.

* libguile/objcodes.c (verify_cookie): Factor cookie verification out to
  a helper function.
  (make_objcode_from_file): Rename from make_objcode_by_mmap.  If mmap
  is unavailable, just read(2) to a bytevector.
2011-04-01 12:34:21 +02:00
Michael Gran
4000d0641f check for GC_allow_register_threads
This is not present in earlier versions of BDW-GC

* configure.ac: check for GC_allow_register_threads
* libguile/threads.c (scm_i_init_thread_for_guile): Only call
  GC_allow_register_threads if it is present.
2011-03-30 09:21:09 +02:00
Andy Wingo
8cf49d836f fix compilation with libgc 7.0, 7.1
* configure.ac: Check for GC_pthread_exit and GC_pthread_cancel.

* libguile/gen-scmconfig.c: Write HAVE_GC_PTHREAD_CANCEL and
  HAVE_GC_PTHREAD_EXIT into scmconfig.h.

* libguile/pthread-threads.h (scm_i_pthread_exit, scm_i_pthread_cancel):
  Only redefine to their GC_pthread_* variants if we have those
  functions, which is not the case in libgc < 7.2.
2011-03-29 13:21:44 +02:00
Neil Jerram
aab99f7b8b Make explicit that GUILE_FOR_BUILD is only used when cross-compiling
* configure.ac (GUILE_FOR_BUILD): Change normal build value to
  'this-value-will-never-be-used'.
2011-03-25 19:45:14 +00:00
Neil Jerram
08e6b25ca2 GUILE_FOR_BUILD is only needed by meta/guile.in, not by Makefiles
* configure.ac: Use AM_SUBST_NOTMAKE for GUILE_FOR_BUILD instead of
  AC_SUBST.
2011-03-25 19:45:14 +00:00
Andy Wingo
5f0d2951a0 bdw-gc 6.8 compatibility (hopefully)
* configure.ac (HAVE_GC_STACK_BASE): New check.

* libguile/threads.c (GC_UNIMPLEMENTED, GC_SUCCESS): Define if needed.
  (GC_register_my_thread, GC_unregister_my_thread)
  (GC_call_with_stack_base): Define shims if needed.
2011-03-24 20:34:31 +01:00