[Rpm-maint] [rpm-software-management/rpm] Add RPM_CHECK_LIB to acinclude.m4 (#257)
Jeff Johnson
notifications at github.com
Tue Jul 18 13:32:33 UTC 2017
Projects that use autoconf are expected to detect build prerequisites and libraries.
This usually leads to a set of ad hoc de facto m4 macros that deal with various details like API and path incompatibilities, much of which is platform and os and distro dependent.
Various standard tools (like pkgconfig) to find these details have been devised; meanwhile there is still a great deal of diversity, particularly between platforms like linux and *BSD, that often makes portability more difficult than it needs to be.
One useful approach -- particularly when maintaining a project like RPM -- is RPM_CHECK_LIB that does all the usual operations and permits a compact specification of 3rd part library details.
Here is the blurb from the RPM_CHECK_LIB m4 macro (I will send along the complete addition to acinclude.m4 later today):
```
dnl ##
dnl ## NAME:
dnl ## RPM_CHECK_LIB -- Check for third-party libraries
dnl ##
dnl ## COPYRIGHT
dnl ## Copyright (c) 2007 Ralf S. Engelschall <rse at engelschall.com>
dnl ##
dnl ## DESCRIPTION:
dnl ## This is a rather complex Autoconf macro for sophisticated
dnl ## checking the availability of third-party libraries and
dnl ## extending the build environment for correctly building
dnl ## against it.
dnl ##
dnl ## It especially supports the following particular features:
dnl ## - is aware of old-style [lib]<libname>-config style scripts
dnl ## - is aware of new-style pkg-config(1) [lib]<libname>.pc configuration files
dnl ## - searches under standard sub-directories "include", "lib", etc.
dnl ## - searches under arbitrary sub-areas of a tree like ".libs", etc.
dnl ## - searches in standard system locations (implicitly)
dnl ## - supports searching for function in multiple libraries
dnl ## - supports searching for multiple headers
dnl ## - supports multiple search locations (fallbacks!)
dnl ##
dnl ## USAGE:
dnl ## - configure.in:
dnl ## RPM_CHECK_LIB(
dnl ## <lib-real-name>, -- [$1] e.g. GNU bzip2
dnl ## <lib-tag-name>, -- [$2] e.g. bzip2
dnl ## <lib-link-name>, -- [$3] e.g. bz2
dnl ## <lib-function-name>, -- [$4] e.g. BZ2_bzlibVersion
dnl ## <lib-header-filename>, -- [$5] e.g. bzlib.h
dnl ## <with-arg-default>[, -- [$6] e.g. yes,external:internal:none
dnl ## <internal-subdir>[, -- [$7] e.g. lib/bzip2:include:src
dnl ## <action-success>[, -- [$8] e.g. AC_DEFINE(USE_BZIP2, 1, [...])
dnl ## <action-failure> -- [$9] e.g. AC_MSG_ERROR([...])
dnl ## ]]])
dnl ##
dnl ## - Makefile.in:
dnl ## top_srcdir = @top_srcdir@
dnl ## srcdir = @srcdir@
dnl ## WITH_<LIB-TAG-NAME> = @WITH_<LIB-TAG-NAME>@
dnl ## WITH_<LIB-TAG-NAME>_SUBDIR = @WITH_<LIB-TAG-NAME>_SUBDIR@
dnl ## CPPFLAGS = @CPPFLAGS@
dnl ## CFLAGS = @CFLAGS@
dnl ## LDFLAGS = @LDFLAGS@
dnl ## LIBS = @LIBS@
dnl ##
dnl ## - CLI:
dnl ## $ ./configure \
dnl ## --with-<lib-tag-name>[=<with-arg>]
dnl ## [...]
dnl ##
dnl ## SYNTAX:
dnl ## <with-arg> ::= <with-arg-mode> | <with-arg-location>
dnl ## <with-arg-default> ::= <with-arg-mode> "," <with-arg-location>
dnl ## <with-arg-mode> ::= "yes" | "no"
dnl ## <with-arg-location> ::= <with-arg-location> ":" <with-arg-location>
dnl ## | <directory-path>
dnl ## | "system"
dnl ## | "external"
dnl ## | "internal"
dnl ## | "none"
dnl ## <directory-path> ::= [...] /* valid arg for test(1) option "-d" */
dnl ##
dnl ##
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/257
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170718/b7dce301/attachment-0001.html>
More information about the Rpm-maint
mailing list