On 3/7/19 10:34 PM, Ike Stoddard wrote:
> Do you have/know a developer working on it? Shell or m4 or whatever to
> fold detection in?
> The authors of these packages ought to have canonical tests for
> existence/version that can be included.

For C and C++ libraries, autoconf provides most of what you need
already. If you want *any* version of a library, then it might suffice
to check for the headers that you #include in your own program. The
AC_CHECK_HEADER macro can do that.

If you need a specific version, then usually that's because you want a
function that appeared in the new version. In that case, it's best to
test for the existence of the function rather than the version number.
The AC_SEARCH_LIBS macro can do that.

A good example for those two macros is the following:

https://git.sagemath.org/sage.git/commit?id=20c3d7a1b87cf650dcec54133d9f9cee05e82677

In essence that whole macro is very simple if you can ignore the
compile-test in the middle.

The "modern" way to do an existence/version check is through pkg-config.
Not everyone integrates with pkg-config; but if they do, then autoconf
has a PKG_CHECK_MODULES macro that can check for existence of specific
versions.

The "Autotools Mythbuster" at https://autotools.io/ is a good reference
for this stuff, but none of them are perfect. You'll still need the
official autotools docs, and a good bit of trial and error if my own
experience is typical.

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

Reply via email to