Hello! Sorry for cross-posting but this somehow touches both applications. LibSWD is a standalone library that can generate SWD operations, then flush them into device driver. This driver (some function set) is application specific, so it cannot be compiled in into libswd, but rather linked with libswd during application compilation. However libswd then complains about missing driver functions at linking time.
For UrJTAG I have copied sources of libswd into application source tree and passed proper source file with driver functions to compile everything and then link with urjtag binary. This was fine until I included LibSWD as OpenOCD submodule, because now it requires its own empty drivers to compile, and those drivers override openocd's drivers. When I removed template drivers from libswd source tree so it can be linked with drivers already compiled and provided by openocd, there are some unresolved dependencies in libswd.la submodule. This is the only thing that keeps me from running libswd on openocd :-) So the question is - how to create/implement universal driver function set that would allow libswd to compile cleanly, but also allow external applications (such UrJTAG and OpenOCD) to provide its own driver functions. The only sensible way for me seems to be using function pointers that will be set at library initialization by the external function... Maybe there is some more smart approach? Best regads! :-) Tomek -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ UrJTAG-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/urjtag-development
