CAPS Universe documentation  1.0.4
All you need to know to be successful
Using libcapsppd

The regular user who wants to print something isn't the audience of this section. Here the user is the developer of a different CAPS component, which just use libcapsppd.

Use pkg-config

Don't try to be smart, use pkg-config instead to retrieve the information you need to compile and link your application against libcapsppd.

To compile your code, just include its header:

#include <libcapsppd-api.h>
API declaration to read-in external PPD files and handle PPD file creation on-the-fly.

And ask pkg-config what include path is required to find this header file.

pkg-config --cflags libcapsppd

To link your application against libcapsppd ask pkg-config as well. Use the output of this command to parametrize the linker:

pkg-config --libs libcapsppd
Note
Whenever you call a function from libcapsppd in your application you also must link it against libcapsppd. Different libraries you use may already be linked against libcapsppd, but that does not work for your application when the linker option --as-needed is in use (which is the default in the CAPS universe).

Use autotools

Don't invent your own Makefile to build your package. Use the autotools or something similar to manage your buildsystem.

For the autotools just use the PKG_CHECK_MODULES m4 macro in your configure.ac to get the information you need to use libcapsppd:

PKG_CHECK_MODULES([LIBCAPSPPD], [libcapsppd >= 1.3.0])

And then just refer this information in your Makefile.am:

my_application_CPPFLAGS = \
     @LIBCAPSPPD_CFLAGS@
my_application_LDADD = \
     @LIBCAPSPPD_LIBS@

Refer Base functions for details.