dependency introduced breaking change, how to workaround with automake
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
dependency introduced breaking change, how to workaround with automake
Hi
I am maintaining an application that I wrote a long time ago, in c++. I am facing an issue now in that a library I use has changed the signature of one of its functions. So the code I have builds on ubuntu (ubuntu has an old version of this library in its repos), but it does not build on archlinux (archlinux is bleeding edge). If I fix the code on archlinux, it breaks on ubuntu.
I have read that you can achieve that some defines can be created by the automake tool, depending on the version of the library that I could use in my c++ code. The way I imagine it is that I run ./configure, then it will detect the version of the library, will decide whether it is old or new and then it will define constants. So in my c++ code I can do this:
#ifdef NEWLIBRARY
libfunction(1,2,3); // new signature
#else
libfunction(1,2); // old signature
#endif
Could someone please describe how it works, and could you please give me a few pointers like an example that does this or some keywords that can be used in configure.ac to achieve this?
Using the page you have given I have solved it with versioning. Possibly the compiling thing would be a bit more robust, but for this, for now it does not matter.
BTW I find it amazing that ./configure can try to build small snippets to see if a function is supported on the user's PC. This is the best technology I have seen; automake has grown a lot in my eyes :-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.