* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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>.
* 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.
* 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.
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.
* 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.
* configure.ac: Strip anything beyond `-I' from $GUILE_CFLAGS so that
`guile-2.0.pc' does not export them to the user. Reported and fixed
by Bruno Haible <bruno@clisp.org>.
* configure.ac: Detect when struct sockaddr_in has a sin_len field.
Remove obsolete comment.
* libguile/socket.c (scm_to_sockaddr, scm_fill_sockaddr): Set the
sin_len field in our struct sockaddr_in when it exists.
* libguile/dynl.c (augment_env): New function.
(sysdep_dynl_init): Use it instead of `lt_dladdsearchdir'.
* configure.ac: Define `SHARED_LIBRARY_PATH_VARIABLE'.
Guile's configure script takes fairly long. On a system without
automatic build dependency installation, it is amplified by the fact
that your user might be both impatient and not read the build
instructions, thus needs to rerun configure several times only to find
out there is another dependency to install. Still, there is help even
for such kinds of misguided figures such as me: save the temporary
config.cache file (if one is used anyway) before embarking upon the set
of tests that are likely to error out. That way, the second and further
reruns are much faster.
The downside of this patch is that, when fixing the errors requires
changing to precious variables (such as CPPFLAGS or so), the user will
need to 'rm -f config.cache' to keep configure happy.
* configure.ac: Call AC_CACHE_SAVE before the gmp tests.
* configure.ac (HAVE_SHARED_LIBRARIES): New Automake conditional.
* test-suite/standalone/Makefile.am (check_SCRIPTS): Add `test-asmobs',
`test-ffi', and `test-extensions' only when `HAVE_SHARED_LIBRARIES'.
* configure.ac: Check for GC_call_with_gc_active.
* libguile/threads.h (scm_i_thread): Remove "top", as it's not used.
* libguile/threads.c (with_gc_inactive, with_gc_active): Define shims to
GC_do_blocking and GC_call_with_gc_active.
(scm_i_init_thread_for_guile): Don't do thread base adjustment here,
do it in scm_i_with_guile_and_parent. The previous logic would never
be run.
(scm_i_with_guile_and_parent): If we enter Guile mode, leave it too.
Take care of adjusting the thread stack base here too. Also, call
with_gc_active.
(scm_without_guile): Refactor.
* configure.ac: Add checks for `sched_setaffinity' and
`sched_getaffinity'.
* doc/ref/posix.texi (Processes): Document `getaffinity' and
`setaffinity'.
* libguile/posix.c (cpu_set_to_bitvector,
scm_getaffinity)[HAVE_SCHED_GETAFFINITY]: New functions.
(scm_setaffinity)[HAVE_SCHED_SETAFFINITY]: New function.
* libguile/posix.h (scm_getaffinity, scm_setaffinity): New declarations.
* test-suite/tests/posix.test ("affinity"): New test prefix.
* configure.ac: Relax the sizeof(long)==sizeof(void*) restriction,
instead asserting that the sizeof(long)<=sizeof(void*). There will
still be problems on nonstandard platforms related to the interface
with gmp, but those are confined to numbers.c.