dependency introduced breaking change, how to workaround with automake
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:
libfunction(1,2,3); // new signature
libfunction(1,2); // old signature
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?
Thank you and best regards,