Fix "Requires: " section in pkg-config file when libusb or libpcsclite were disabled.
This commit is contained in:
parent
6634d185bb
commit
e2dc2c133a
2 changed files with 13 additions and 1 deletions
12
configure.ac
12
configure.ac
|
@ -80,6 +80,8 @@ then
|
|||
fi
|
||||
AM_CONDITIONAL(LIBUSB_ENABLED, [test x"$enable_libusb" = xyes])
|
||||
|
||||
# Dependencies
|
||||
PKG_CONFIG_REQUIRES=""
|
||||
## libusb
|
||||
if test "x$enable_libusb" = "xyes"; then
|
||||
if test x"$PKG_CONFIG" = "x"; then
|
||||
|
@ -93,6 +95,10 @@ if test "x$enable_libusb" = "xyes"; then
|
|||
fi
|
||||
else
|
||||
PKG_CHECK_MODULES(LIBUSB, libusb, [WITH_USB=1], [WITH_USB=0])
|
||||
if test x"$PKG_CONFIG_REQUIRES" != x""; then
|
||||
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES,"
|
||||
fi
|
||||
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libusb"
|
||||
fi
|
||||
|
||||
if test x"$WITH_USB" = "x0"; then
|
||||
|
@ -115,12 +121,18 @@ if test "x$enable_pcsc_lite" = "xyes"; then
|
|||
if test x"$WITH_PCSC" = "x0" ; then
|
||||
AC_MSG_ERROR([libpcsclite is mandatory.])
|
||||
fi
|
||||
if test x"$PKG_CONFIG_REQUIRES" != x""; then
|
||||
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES,"
|
||||
fi
|
||||
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libpcsclite"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(LIBPCSCLITE_LIBS)
|
||||
AC_SUBST(LIBPCSCLITE_CFLAGS)
|
||||
fi
|
||||
|
||||
AC_SUBST(PKG_CONFIG_REQUIRES)
|
||||
|
||||
# Set C standard to C99
|
||||
# C99 standard support (default: yes)
|
||||
AC_ARG_ENABLE([std-c99],AS_HELP_STRING([--disable-std-c99],[Disable C99 standard when compiling]),[enable_std_c99=$enableval],[enable_std_c99="yes"])
|
||||
|
|
|
@ -5,6 +5,6 @@ includedir=@includedir@/@PACKAGE@
|
|||
Name: libnfc
|
||||
Description: Near Field Communication (NFC) library
|
||||
Version: @VERSION@
|
||||
Requires: libusb, libpcsclite
|
||||
Requires: @PKG_CONFIG_REQUIRES@
|
||||
Libs: -L${libdir} -lnfc
|
||||
Cflags: -I${includedir}
|
||||
|
|
Loading…
Reference in a new issue