Creates a custom pkg-config script. The script supports
--cflags, --libs and --version options.
This macro saves you all the typing for a pkg-config.in script;
you don't even need to distribute one along. Place this macro
in your configure.ac, et voila, you got one that you want to install.
The options:
$1 = LIBRARY e.g. gtk, ncurses
$2 = DESCRIPTION one line description of library
$3 = DESTINATION directory path, e.g. src/scripts
It is suggested that the following CFLAGS and LIBS variables are
used in your configure.ac. library_libs is *essential*.
library_cflags is important, but not always needed. If they do not
exist, defaults will be taken from LIBRARY_CFLAGS, LIBRARY_LIBS
(should be -llibrary *only*) and LIBRARY_LIBDEPS (-l options for
libraries your library depends upon.
LIBLIBRARY_LIBS is simply $LIBRARY_LIBS $LIBRARY_LIBDEPS.
NB. LIBRARY and library are the name of your library, in upper and
lower case repectively e.g. GTK, gtk.
LIBRARY_CFLAGS: cflags for compiling libraries and example progs
LIBRARY_LIBS: libraries for linking programs
LIBRARY_LIBDEPS*: libraries for linking libraries against (needed
to link -static
LIBRARY_REQUIRES: packages required by your library
LIBRARY_CONFLICTS: packages to conflict with your library
library_cflags*: cflags to store in library-config
library_libs*: libs to store in library-config
LIBLIBRARY_LIBS: libs to link programs IN THIS PACKAGE ONLY against
LIBRARY_VERSION*: the version of your library (x.y.z recommended)
*=required if you want sensible output, otherwise they will be
*guessed* (DWIM, but usually correct)
There is also an AC_SUBST(LIBRARY_PKGCONFIG) that will be set to
the name of the file that we output in this macro. Use as:
install-data-local: install-pkgconfig
install-pkgconfig:
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(INSTALL_DATA) @LIBRARY_PKGCONFIG@ $(DESTDIR)$(prefix)/lib/pkgconfig
Or, if using automake:
pkgconfigdatadir = $(prefix)/lib/pkgconfig
pkgconfigdata_DATA = gimpprint.pc = @LIBRARY_PKGCONFIG@
Example usage:
GIMPPPRINT_LIBS="-lgimpprint"
AC_CHECK_LIB(m,pow,
GIMPPRINT_DEPLIBS="${GIMPPRINT_DEPLIBS} -lm")
AC_CONFIG_PKGCONFIG_IN([gimpprint], [GIMP Print Top Quality Printer Drivers], [src/main])