Re: If you wanted to distribute a dll
- Posted by xecronix Sep 12, 2015
- 1703 views
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" }