aboutsummaryrefslogtreecommitdiffstats
path: root/test/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 /test/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 'test/src')
-rw-r--r--test/src/emacs-module-tests.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 18766081c0a..322500ff604 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -384,4 +384,22 @@ Interactively, you can try hitting \\[keyboard-quit] to quit."
384 (ert-info ((format "input: %d" input)) 384 (ert-info ((format "input: %d" input))
385 (should (= (mod-test-double input) (* 2 input)))))) 385 (should (= (mod-test-double input) (* 2 input))))))
386 386
387(ert-deftest module-darwin-secondary-suffix ()
388 "Check that on Darwin, both .so and .dylib suffixes work.
389See Bug#36226."
390 (skip-unless (eq system-type 'darwin))
391 (should (member ".dylib" load-suffixes))
392 (should (member ".so" load-suffixes))
393 ;; Preserve the old `load-history'. This is needed for some of the
394 ;; other unit tests that indirectly rely on `load-history'.
395 (let ((load-history load-history)
396 (dylib (concat mod-test-file ".dylib"))
397 (so (concat mod-test-file ".so")))
398 (should (file-regular-p dylib))
399 (should-not (file-exists-p so))
400 (add-name-to-file dylib so)
401 (unwind-protect
402 (load so nil nil :nosuffix :must-suffix)
403 (delete-file so))))
404
387;;; emacs-module-tests.el ends here 405;;; emacs-module-tests.el ends here