This package installs a data file for pkg-config
, so when searching for the installed
library with the GNU Autotools, we can add the following macro use to configure.ac:
PKG_CHECK_MODULES([CRE2],[cre2 >= 0.1.0])
which will set the variables CRE2_LIBS
and CRE2_CFLAGS
. The macros for
GNU Autoconf installed by pkg-config
are documented in the manual page
pkg-config(1)
. To avoid problems with pkg-config
, we need to remember that:
PKG_CHECK_MODULES
is installed by the package pkg-config
; such
file usually is in one of the locations:
aclocal
, which in turn is installed by the package GNU
Automake; aclocal
is used by autoreconf
. We must make sure that
aclocal
finds all the installed macro files; for this purpose we can use the environment
variable ACLOCAL_PATH
. To include all the common possible directories, we can add the
following chunk of Bourne shell code to our shell profile file:
ACLOCAL_PATH= for dir in \ /share/aclocal \ /usr/share/aclocal \ /usr/local/share/aclocal do if test -d "$dir" then if test -n "$ACLOCAL_PATH" then ACLOCAL_PATH=${dir}:${ACLOCAL_PATH} else ACLOCAL_PATH=${dir} fi fi done export ACLOCAL_PATH
pkg-config
searches for the package data files in a set of directories; we
can configure the search path with the environment variable PKG_CONFIG_PATH
. To include all
the common possible directories, we can add the following chunk of Bourne shell code to our shell
profile file:
PKG_CONFIG_PATH= for dir in \ /lib/pkgconfig \ /lib64/pkgconfig \ /share/pkgconfig \ /usr/lib/pkgconfig \ /usr/lib64/pkgconfig \ /usr/share/pkgconfig \ /usr/local/lib/pkgconfig \ /usr/local/lib64/pkgconfig \ /usr/local/share/pkgconfig do if test -d "$dir" then if test -n "$PKG_CONFIG_PATH" then PKG_CONFIG_PATH=${dir}:${PKG_CONFIG_PATH} else PKG_CONFIG_PATH=${dir} fi fi done export PKG_CONFIG_PATH
Alternatively we can use the raw GNU Autoconf macros:
AC_CHECK_LIB([cre2],[cre2_version_string],, [AC_MSG_FAILURE([test for C wrapper for RE2 library failed])]) AC_CHECK_HEADERS([cre2.h],, [AC_MSG_FAILURE([test for C wrapper for RE2 header failed])])
This document describes version 0.4.0-devel.2 of CRE2.