0001-build-use-pkg-config-to-discover-libusb.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 1eed2b65eff4c66b80eab0ec46c6705de19bdb9d Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Thu, 21 Jan 2016 23:54:03 +0100
  4. Subject: [PATCH] build: use pkg-config to discover libusb
  5. This allows to remove hardcoded paths to libusb headers.
  6. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  7. ---
  8. Makefile.am | 4 ++--
  9. configure.in | 3 +--
  10. 2 files changed, 3 insertions(+), 4 deletions(-)
  11. diff --git a/Makefile.am b/Makefile.am
  12. index 73fed2e..3a4e899 100644
  13. --- a/Makefile.am
  14. +++ b/Makefile.am
  15. @@ -92,8 +92,8 @@ libhpmud_la_SOURCES += io/hpmud/musb_libusb01.c
  16. libhpmud_la_LDFLAGS += -lusb
  17. else
  18. libhpmud_la_SOURCES += io/hpmud/musb.c
  19. -libhpmud_la_CFLAGS += -I/usr/include/libusb-1.0
  20. -libhpmud_la_LDFLAGS += -lusb-1.0
  21. +libhpmud_la_CFLAGS += $(LIBUSB_CFLAGS)
  22. +libhpmud_la_LDFLAGS += $(LIBUSB_LIBS)
  23. endif
  24. if NETWORK_BUILD
  25. diff --git a/configure.in b/configure.in
  26. index 3706645..8b06428 100755
  27. --- a/configure.in
  28. +++ b/configure.in
  29. @@ -542,8 +542,7 @@ if test "$hpijs_only_build" = "no" && test "$hpcups_only_build" = "no"; then
  30. AC_CHECK_LIB([usb], [usb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb support], 2)])
  31. AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)])
  32. else
  33. - AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)])
  34. - AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)])
  35. + PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
  36. fi
  37. fi
  38. --
  39. 2.6.4