diff --git a/configure.ac b/configure.ac index 5971a4c..b0907dc 100644 --- a/configure.ac +++ b/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"]) diff --git a/libnfc.pc.in b/libnfc.pc.in index 18fbfe9..a22958b 100644 --- a/libnfc.pc.in +++ b/libnfc.pc.in @@ -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}