Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gnucap:user:build_system_for_plugins [2016/10/17 17:37]
felixs update on work in progress
gnucap:user:build_system_for_plugins [2018/03/27 22:52] (current)
felixs GNUCAP_PLUGPATH
Line 4: Line 4:
   - Device models, compiled locally, simulation based   - Device models, compiled locally, simulation based
   - Plugins from other sources, compiled out-of-tree, installable.   - Plugins from other sources, compiled out-of-tree, installable.
 +
 +NOTE: this is slightly outdated. gnucap now uses the GNUCAP_PLUGPATH environment variable to locate plugins. RPATH, LD_LIBRARY_PATH (raw dlopen) is only used as a fallback & for backwards compatibility.
  
 Assume (upstream) gnucap ships a plugin (s_fancy.so). what would a user want to do? load it. that means, she expects the command "load s_fancy.so" to load the module, just like she would type "modprobe fancy" when loading a kernel module. thus, two things must match: the path where plugins are installed to, and the path where gnucap is looking for modules. the install path is nothing seriously exotic, and already implemented in autotools, it's called "pkglibdir". gnucap uses 'dlopen' (see dlopen(3)) to load modules. that means it looks for dynamic libraries, where the system keeps dynamic libraries, which is in /lib, /usr/lib etc. the common way to make it look for modules in pkglibdir is linking with the rpath flag, which sets RPATH, see chrpath(1). basically this means, the path where plugins lie around is hardcoded in the gnucap binary. which totally makes sense, esp. if you want to have more than one gnucap, lets say for developing purposes. Assume (upstream) gnucap ships a plugin (s_fancy.so). what would a user want to do? load it. that means, she expects the command "load s_fancy.so" to load the module, just like she would type "modprobe fancy" when loading a kernel module. thus, two things must match: the path where plugins are installed to, and the path where gnucap is looking for modules. the install path is nothing seriously exotic, and already implemented in autotools, it's called "pkglibdir". gnucap uses 'dlopen' (see dlopen(3)) to load modules. that means it looks for dynamic libraries, where the system keeps dynamic libraries, which is in /lib, /usr/lib etc. the common way to make it look for modules in pkglibdir is linking with the rpath flag, which sets RPATH, see chrpath(1). basically this means, the path where plugins lie around is hardcoded in the gnucap binary. which totally makes sense, esp. if you want to have more than one gnucap, lets say for developing purposes.
gnucap/user/build_system_for_plugins.txt · Last modified: 2018/03/27 22:52 by felixs
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki