This patch adds support for the pkgconfig tool. Developpers may need to reapply the autotools: libtoolize, autoreconf, autoconf, automake.
To use in an application's configure.ac (not tested):
dnl add @GPIB_CFLAGS@ in your application's Makefile.am
dnl add @GPIB_LIBS@ in your application's Makefile.am
dnl use the defined macro 'USE_GPIB_CODE' in the application's code
PKG_CHECK_MODULES([GPIB],[libgpib-3.2.18],
[AC_SUBST([GPIB_CFLAGS])
AC_SUBST([GPIB_LIBS])
AC_DEFINE([USE_GPIB_CODE],[1],[GPIB library detected])
dnl gives feedback at end of config
LIBGPIB_DETECTED="yes"],[LIBGPIB_DETECTED="no"])
replace [libgpib-3.2.18] above by [libgpib]
Here is a patch that actually works. Just tested against 3.2.19
To activate, apply, then enable by re-building build system:
./bootstrap
These:
pkg-config --libs libgpib
pkg-config --cflags libgpib
pkg-config --modversion libgpib
Should supply the correct parameters.
Last edit: rickyrockrat 2013-11-22