[Top][All Lists]

[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"
    #error "Modules not supported on this system"

  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"));
  Vload_suffixes = list2 (build_pure_c_string (".elc"),
                          build_pure_c_string (".el"));

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]