Re: If you wanted to distribute a dll

new topic     » goto parent     » topic index » view thread      » older message » newer message

This seems like a reasonable place to start:

namespace libhelper 
include std/filesys.e 
 
public function include_derived_ext_paths(sequence libdir, sequence lib) 
    sequence inc_paths = include_paths(1) 
    sequence retval = {} 
    retval = append(retval, sprintf("%s.%s", {lib, SHARED_LIB_EXT})) 
    sequence current = join_path({current_dir(), sprintf("%s.%s", {lib, SHARED_LIB_EXT})}) 
    retval = append(retval, current) 
    for i = 1 to length(inc_paths) do 
        sequence inc_path = inc_paths[i] 
        sequence last_char = {inc_path[$]} 
        if equal(last_char, SLASH) then 
            inc_path = inc_path[1..$-1] 
        end if 
        retval = append(retval, join_path({inc_path, libdir, "ext", sprintf("%s.%s", {lib, SHARED_LIB_EXT})})) 
    end for 
    return retval 
end function 

So passing

include_derived_ext_paths(coollib, coollib)  

yeilds

{ 
  "coollib.so", 
  "/home/ronald/my/current/working/dir/coollib.so", 
  "/home/ronald/my/current/working/dir/coollib/ext/coollib.so", 
  "/usr/local/share/euphoria/include/coollib/ext/coollib.so" 
} 

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu