Add the libusb dependency to the pkg-config file.

When linking dynamically, the shared library contains a reference to all
external dependencies, and the linker can easily resolve them. However
when linking statically, all external dependencies have to be specified
explicitly. This rule also applies to dependencies that are not exposed
through the public api.

The pkg-config Requires.private field is used to support both static and
dynamic linking correctly.
This commit is contained in:
Jef Driesen 2011-09-24 14:11:10 +02:00
parent b7a6be15ca
commit eda03255a8
2 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,7 @@ AM_CONDITIONAL([OS_WIN32], [test "$os_win32" = "yes"])
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], [have_libusb=yes], [have_libusb=no]) PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], [have_libusb=yes], [have_libusb=no])
if test "$have_libusb" = "yes"; then if test "$have_libusb" = "yes"; then
AC_DEFINE([HAVE_LIBUSB], [1], [libusb support]) AC_DEFINE([HAVE_LIBUSB], [1], [libusb support])
AC_SUBST([DEPENDENCIES], [libusb-1.0])
fi fi
# Checks for IrDA support. # Checks for IrDA support.

View File

@ -6,5 +6,6 @@ includedir=@includedir@
Name: libdivecomputer Name: libdivecomputer
Description: A library for communication with various dive computers. Description: A library for communication with various dive computers.
Version: @VERSION@ Version: @VERSION@
Requires.private: @DEPENDENCIES@
Libs: -L${libdir} -ldivecomputer Libs: -L${libdir} -ldivecomputer
Cflags: -I${includedir}/libdivecomputer Cflags: -I${includedir}/libdivecomputer