Next: overview exceptions, Up: overview [Contents][Index]
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([CCTESTS],[cctests >= 0.1.0])
which will set the variables CCTESTS_LIBS and CCTESTS_CFLAGS. 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([cctests],[cctests_version_string],, [AC_MSG_FAILURE([test for CCTests library failed])]) AC_CHECK_HEADERS([cctests.h],, [AC_MSG_FAILURE([test for CCTests header failed])])
Next: overview exceptions, Up: overview [Contents][Index]
This document describes version 0.4.1-devel.1 of CCTests.