Closed joakim-tjernlund closed 4 years ago
Hi @joakim-tjernlund , I am not sure exactly what the issues is. I have made a small patch that will only add -lpcap to the one executable that requires it instead of to all executable, this will still be done automatically if libpcap is detected. Does this help for you? If not can you please explain why you need to explicitly not link against libpcap? I would prefer not adding a configure option for this.
Hi @pabuhler
Your patch is a step in the right direction, only link pcap with apps that need it. Now one can see that pcap is only needed for test app(s). But this will still build against pcap if it is installed, I should/need to be able to control explicitly whether pcap should be used or not. If --enable-pcap is active one should get a configure error that pcap is missing and with --disable-pcap libsrtp should not build against pcap even if pcap is installed.
If you really want to keep the current auto dependency on pcap you could have enable, disable and auto(default)
Also, can build of test progs be configurable?
I don't wish to be difficult but I do not see the benefit of adding more configure options, they will just require maintenance. If you have a real reason to add them then please explain and we can consider it. ( even better create a PR) .
The make target make shared_library
will build just the shared library and no test apps. In general though I would recommend building the tests and running them.
The build system for this project is definitely not perfect but unless there is a good reason for change I do not plan to meddle to much.
Mainly this, I (or a distribution) should be able to build the same srtp pkg regardless if pcap is installed. Now a dep on pcap will sneak in just because it was installed.
In Gentoo there is a special test flag one can specify when building a pkg which then builds tests and runs them. So Gentoo wants to know the difference between a normal build and a test build.
So you are creating a pkg from the default make command that includes the test apps?
If we change the make target "all" to only build the static libsrtp2.a would that fix this for you?
One should be able to control linkage with libpcap, this patch is a start: