Next: , Up: overview   [Contents][Index]


1.1 Linking code with the library

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([CCSTRUCTS],[ccstructs >= 0.1.0])

which will set the variables CCSTRUCTS_LIBS and CCSTRUCTS_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:

Alternatively we can use the raw GNU Autoconf macros:

AC_CHECK_LIB([ccstructs],[ccstructs_version_string],,
  [AC_MSG_FAILURE([test for CCStructs library failed])])
AC_CHECK_HEADERS([ccstructs.h],,
  [AC_MSG_FAILURE([test for CCStructs header failed])])

Next: , Up: overview   [Contents][Index]

This document describes version 0.3.0-devel.3 of CCStructs.