Discussion:
detect libtool
Peter Johansson
2013-11-23 02:26:48 UTC
Permalink
Hello,

My apologies if this is more suited for libtool@

I'm writing a macro to provide some flags for users of our library. I
now realized that I would like to assign the falgs different values
depending on whether users are using libtool or not. What is the best
way to detect whether libtool is used or not? Detected at autoconf or
configure time doesn't really matter but I suppose autoconf is always
preferable if possible.

Thanks,
Peter
Eric Blake
2013-11-23 02:39:02 UTC
Permalink
Post by Peter Johansson
Hello,
I'm writing a macro to provide some flags for users of our library. I
now realized that I would like to assign the falgs different values
depending on whether users are using libtool or not. What is the best
way to detect whether libtool is used or not? Detected at autoconf or
configure time doesn't really matter but I suppose autoconf is always
preferable if possible.
You, as a macro writer, can write your macro to detect at autoconf time
whether the package writer of configure.ac that is using your macro is
also using libtool, by doing something like:

dnl Check for both modern and obsolete witness macros that are only
dnl defined when libtool's macros are in use
m4_if(m4_ifdef([LT_INIT], [-])m4_ifdef([AM_PROG_LIBTOOL], [-], [],
[code when libtool not in use],
[code when libtool is in use])
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Loading...