[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic loading progress
From: |
Aurélien Aptel |
Subject: |
Re: Dynamic loading progress |
Date: |
Fri, 10 Oct 2014 17:05:06 +0200 |
On Thu, Oct 9, 2014 at 7:27 PM, Eli Zaretskii <address@hidden> wrote:
> Well, how about removing this issue by using lt_dlopenext?
I use the .so extension to know whether a file is a binary module or
elisp (compiled or source). In order to let libltdl guess & try
various extensions with dlopenext I have to leave `load-suffixes'
alone and try to load the file as a module everytime. If it's actually
a module, continue loading it, else load as elisp. I find this messy.
What Stefan is proposing is to add the plateform specific suffixes in
`load-suffixes' at compilation time. Somehing like this:
/*
Somwhere in a platform abstraction header (which one?)
(I don't know the actual system defines)
*/
#ifdef HAVE_LTDL
#if defined(WINDOWS)
#define MODULE_SUFFIX ".dll"
#elif defined(UNIX)
#define MODULE_SUFFIX ".so"
#elif defined(MAC)
#define MODULE_SUFFIX ".dylib"
#else
#error "Modules not supported on this system"
#endif
#endif
/*
Now in `load-suffixes' definition
*/
#ifdef HAVE_LTDL
Vload_suffixes = list3 (build_pure_c_string (MODULE_SUFFIX),
build_pure_c_string (".elc"),
build_pure_c_string (".el"));
#else
Vload_suffixes = list2 (build_pure_c_string (".elc"),
build_pure_c_string (".el"));
#endif
I'm not familiar enough with every system but having only one
extension per system is maybe limiting. After a quick search I found
that Mac OSX use both .so and .dylib.
Another solution would be to define a new Lisp variable
`load-module-suffixes' with every possible module extensions (system
specific or not) and use that to test if a file is a module or not.
Re: Dynamic loading progress,
Aurélien Aptel <=
- Re: Dynamic loading progress, Eli Zaretskii, 2014/10/10
- Re: Dynamic loading progress, Stefan Monnier, 2014/10/10
- Re: Dynamic loading progress, Eli Zaretskii, 2014/10/10
- Re: Dynamic loading progress, Stefan Monnier, 2014/10/11
- Re: Dynamic loading progress, Aurélien Aptel, 2014/10/13
- Re: Dynamic loading progress, Stefan Monnier, 2014/10/14
- Re: Dynamic loading progress, Aurélien Aptel, 2014/10/16
- Re: Dynamic loading progress, Stefan Monnier, 2014/10/16
- Re: Dynamic loading progress, Stephen Leake, 2014/10/18