On 20/07/16 22:05, Michael Labuda wrote:
Hi,

I am trying to build a driver in C to communicate with a VFD unit (Get status info, etc.) using a serial interface. I have the code responsible for the communication to the drive located in a separate static library (.a) file. The HAL driver file is only one c source file which I would like to compile using comp, but comp does not (to my knowledge anyway) allow me to specify any linker parameters so that I can link against my library file. Any ideas on how I can make this work?

Sorry, didn't see this when it was posted, my ISP has been rather unreliable recently

There are 2 undocumented options in comp which assist here.
I proposed a change some years ago in linuxcnc, which was then changed to something more `jeppleresque`
but that got carried over when the Machinekit project was forked.

https://github.com/machinekit/machinekit/blob/master/src/hal/utils/comp.g#L663

shows how extra arguments can be injected into the build of userspace components

Example:
If you have in your .comp file

option extra_compile_args = "02"
option extra_link_args = "-L/usr/local/lib/mylibs -lmylib"

for instance

The code would be compiled with optimisation (not recommended generally)
and linked against /usr/local/lib/mylibs/libmylib.so

Hope this helps

Thanks,

Michael
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to