aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2019-12-25 15:41:39 +0100
committerPhilipp Stephani2019-12-25 15:42:20 +0100
commit28268e47d844215b11f9a731d2bedb58bee0b343 (patch)
tree320b5f1b359451f8ad7dc60da56d2b221c371b84 /src
parent7c5d6a2afc6c23a7fff8456f506ee2aa2d37a3b9 (diff)
downloademacs-28268e47d844215b11f9a731d2bedb58bee0b343.tar.gz
emacs-28268e47d844215b11f9a731d2bedb58bee0b343.zip
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')
-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. */)
1199 || suffix_p (file, ".elc") 1199 || suffix_p (file, ".elc")
1200#ifdef HAVE_MODULES 1200#ifdef HAVE_MODULES
1201 || suffix_p (file, MODULES_SUFFIX) 1201 || suffix_p (file, MODULES_SUFFIX)
1202#ifdef MODULES_SECONDARY_SUFFIX
1203 || suffix_p (file, MODULES_SECONDARY_SUFFIX)
1204#endif
1202#endif 1205#endif
1203 ) 1206 )
1204 must_suffix = Qnil; 1207 must_suffix = Qnil;
@@ -1268,7 +1271,12 @@ Return t if the file exists and loads successfully. */)
1268 } 1271 }
1269 1272
1270#ifdef HAVE_MODULES 1273#ifdef HAVE_MODULES
1271 bool is_module = suffix_p (found, MODULES_SUFFIX); 1274 bool is_module =
1275 suffix_p (found, MODULES_SUFFIX)
1276#ifdef MODULES_SECONDARY_SUFFIX
1277 || suffix_p (found, MODULES_SECONDARY_SUFFIX)
1278#endif
1279 ;
1272#else 1280#else
1273 bool is_module = false; 1281 bool is_module = false;
1274#endif 1282#endif
@@ -4856,9 +4864,16 @@ This list should not include the empty string.
4856`load' and related functions try to append these suffixes, in order, 4864`load' and related functions try to append these suffixes, in order,
4857to the specified file name if a suffix is allowed or required. */); 4865to the specified file name if a suffix is allowed or required. */);
4858#ifdef HAVE_MODULES 4866#ifdef HAVE_MODULES
4867#ifdef MODULES_SECONDARY_SUFFIX
4868 Vload_suffixes = list4 (build_pure_c_string (".elc"),
4869 build_pure_c_string (".el"),
4870 build_pure_c_string (MODULES_SUFFIX),
4871 build_pure_c_string (MODULES_SECONDARY_SUFFIX));
4872#else
4859 Vload_suffixes = list3 (build_pure_c_string (".elc"), 4873 Vload_suffixes = list3 (build_pure_c_string (".elc"),
4860 build_pure_c_string (".el"), 4874 build_pure_c_string (".el"),
4861 build_pure_c_string (MODULES_SUFFIX)); 4875 build_pure_c_string (MODULES_SUFFIX));
4876#endif
4862#else 4877#else
4863 Vload_suffixes = list2 (build_pure_c_string (".elc"), 4878 Vload_suffixes = list2 (build_pure_c_string (".elc"),
4864 build_pure_c_string (".el")); 4879 build_pure_c_string (".el"));