46 lines
1.6 KiB
Diff
46 lines
1.6 KiB
Diff
From 143f7a8517c7aa3d9bf4de35a71b81ef4399e4d3 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
Date: Thu, 21 Jan 2016 23:54:03 +0100
|
|
Subject: [PATCH 1/5] build: use pkg-config to discover libusb
|
|
|
|
This allows to remove hardcoded paths to libusb headers.
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
---
|
|
Makefile.am | 4 ++--
|
|
configure.in | 3 +--
|
|
2 files changed, 3 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/Makefile.am b/Makefile.am
|
|
index b77327f..c111be6 100644
|
|
--- a/Makefile.am
|
|
+++ b/Makefile.am
|
|
@@ -110,8 +110,8 @@ libhpmud_la_SOURCES += io/hpmud/musb_libusb01.c
|
|
libhpmud_la_LDFLAGS += -lusb
|
|
else
|
|
libhpmud_la_SOURCES += io/hpmud/musb.c
|
|
-libhpmud_la_CFLAGS += -I/usr/include/libusb-1.0
|
|
-libhpmud_la_LDFLAGS += -lusb-1.0
|
|
+libhpmud_la_CFLAGS += $(LIBUSB_CFLAGS)
|
|
+libhpmud_la_LDFLAGS += $(LIBUSB_LIBS)
|
|
endif
|
|
|
|
|
|
diff --git a/configure.in b/configure.in
|
|
index 8965d3d..c738d89 100644
|
|
--- a/configure.in
|
|
+++ b/configure.in
|
|
@@ -623,8 +623,7 @@ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$hpcu
|
|
AC_CHECK_LIB([usb], [usb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb support], 2)])
|
|
AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)])
|
|
else
|
|
- AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)])
|
|
- AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)])
|
|
+ PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
|
|
fi
|
|
fi
|
|
|
|
--
|
|
2.20.1
|
|
|