summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2019-12-25 15:41:39 +0100
committerPhilipp Stephani <phst@google.com>2019-12-25 15:42:20 +0100
commit28268e47d844215b11f9a731d2bedb58bee0b343 (patch)
tree320b5f1b359451f8ad7dc60da56d2b221c371b84 /src/lread.c
parent7c5d6a2afc6c23a7fff8456f506ee2aa2d37a3b9 (diff)
downloademacs-28268e47d844215b11f9a731d2bedb58bee0b343.tar.gz
Support .dylib suffix for modules on macOS (Bug#36226).
On macOS, shared libraries typically have the suffix .dylib. This commit switches the module suffix to .dylib on Darwin to account for that. To also support the .so suffix, introduce the concept of a secondary module suffix. * configure.ac: Switch MODULES_SUFFIX to .dylib for Darwin, introduce MODULES_SECONDARY_SUFFIX. * src/lread.c (Fload, syms_of_lread): Also use MODULES_SECONDARY_SUFFIX if defined. * test/src/emacs-module-tests.el (module-darwin-secondary-suffix): New unit test.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c
index 7b3686b3d71..6329172f4b4 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1199,6 +1199,9 @@ Return t if the file exists and loads successfully. */)
|| suffix_p (file, ".elc")
#ifdef HAVE_MODULES
|| suffix_p (file, MODULES_SUFFIX)
+#ifdef MODULES_SECONDARY_SUFFIX
+ || suffix_p (file, MODULES_SECONDARY_SUFFIX)
+#endif
#endif
)
must_suffix = Qnil;
@@ -1268,7 +1271,12 @@ Return t if the file exists and loads successfully. */)
}
#ifdef HAVE_MODULES
- bool is_module = suffix_p (found, MODULES_SUFFIX);
+ bool is_module =
+ suffix_p (found, MODULES_SUFFIX)
+#ifdef MODULES_SECONDARY_SUFFIX
+ || suffix_p (found, MODULES_SECONDARY_SUFFIX)
+#endif
+ ;
#else
bool is_module = false;
#endif
@@ -4856,9 +4864,16 @@ This list should not include the empty string.
`load' and related functions try to append these suffixes, in order,
to the specified file name if a suffix is allowed or required. */);
#ifdef HAVE_MODULES
+#ifdef MODULES_SECONDARY_SUFFIX
+ Vload_suffixes = list4 (build_pure_c_string (".elc"),
+ build_pure_c_string (".el"),
+ build_pure_c_string (MODULES_SUFFIX),
+ build_pure_c_string (MODULES_SECONDARY_SUFFIX));
+#else
Vload_suffixes = list3 (build_pure_c_string (".elc"),
build_pure_c_string (".el"),
build_pure_c_string (MODULES_SUFFIX));
+#endif
#else
Vload_suffixes = list2 (build_pure_c_string (".elc"),
build_pure_c_string (".el"));