1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 11:10:32 +02:00
guile/module
Michael Gran 7b41294049 Improve DLL search strategy for load-foreign-library
The new non-libltdl foreign library loading algorithm from 3.0.6
fails to cover common cases regarding how libtool names and installs
DLL files.  Notably, it fails to recognize when libtool has added the
major version number into the filename itself, such as libfoo-1.dll
Also, it does not search in binary directories and the PATH for DLL
files, where libtool is likely to install DLLs.

This adds the option to search for dlls with major version numbers
in the filename, and modifies the search strategy for DLL-using
OSs to check bindir and PATH.

For MSYS, libraries are installed with the 'msys-' prefix. So this
modifies load-foreign-library to handle that prefix as well.
It changes the #:rename-on-cygwin? option to #:host-type-rename? to
better reflect that is works on both Cygwin and MSYS.

Partially based on a patch by Hannes Müller.

* NEWS: updated
* doc/ref/api-foreign.texi: document updates to load-foreign-library
  and system-dll-path
* module/system/foreign-library.scm (is-integer-string?): new utility function
  (dll-name-match?): new utility function
  (find-best-dll-from-matches): new utility function
  (dll-exists-with-version): new function that implements new dll search logic
  (file-exists-with-extension): add flag argument to allow new dll search
  (file-exists-in-path-with-extension): add flag argument to all new dll search
  (system-dll-path): new parameter
  (lib->msys): new helper function
  (load-foreign-library): add new optarg flag #:allow-dll-version-suffix?
    Pass new flag to library search functions.
    Implement new search strategy for #:search-system-paths? on DLL systems'
    replace #:rename-on-cygwin? with #:host-type-rename?
        Use that option to rename both MSYS and Cygwin libraries.
  (guile-system-extensions-path): prefer bindir to libdir on DLL systems
* test-suite/tests/foreign.test ("dll-name-match?"): new test category
  ("find-best-dll-from-matches"): new test category
  ("lib->msys"): new unit tests
2025-03-22 07:05:31 -07:00
..
ice-9 Fix make-custom-port in case encoding is #f 2025-02-28 22:12:03 +01:00
language Fix string-utf8-length to have unboxed representation 2025-02-20 12:38:28 +01:00
oop Bugfix: Recursively use method*, not method, in method* 2024-11-27 13:27:46 +01:00
rnrs Implement R6RS custom textual ports 2023-06-08 10:21:02 +02:00
scheme Update set of decimal zeroes for Unicode 15.1.0 2023-11-02 11:31:32 +01:00
scripts Bump user-visible copyright years to 2024. 2024-01-24 10:49:27 +01:00
srfi srfi-19: Fix ~V converter in date->string. 2025-02-28 10:28:06 +01:00
sxml Fix typos in comments. 2025-02-28 09:58:29 +01:00
system Improve DLL search strategy for load-foreign-library 2025-03-22 07:05:31 -07:00
texinfo Fix typo in transform-string docstring 2025-03-20 13:36:58 -05:00
web Allow trailing "." in urls 2025-03-02 21:18:19 +01:00
Makefile.am Rework bootstrap to be reproducible 2022-02-01 14:50:40 +01:00
rnrs.scm Define top-level bindings for aux syntax: else, =>, _, ... 2019-09-12 21:50:51 +02:00
statprof.scm Fix typos throughout codebase. 2024-05-06 11:51:53 +02:00
texinfo.scm texinfo: Add basic support for @w{...}. 2020-06-18 00:30:30 +02:00