aboutsummaryrefslogtreecommitdiffstats
path: root/package/openocd/openocd-0001-fix-cross-compilation-host-libsub-was-used-before.patch
blob: caf1a8b6fc5d3731441a714a0703fe4c16c934d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 3728c4af7f6303ccedab56ec220797f8f290580e Mon Sep 17 00:00:00 2001
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Date: Wed, 10 Aug 2011 00:17:29 +0800
Subject: [PATCH] fix cross compilation: host libsub was used before

tested in buildroot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 configure.in |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index dfa1e8f..cfe2218 100644
--- a/configure.in
+++ b/configure.in
@@ -1046,8 +1046,11 @@ build_usb=no
 if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \
   $build_rlink = yes -o $build_ulink = yes -o $build_armjtagew = yes
 then
-  AC_CHECK_HEADERS([usb.h],[],
-  [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])])
+  dnl check for libusb
+  PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.11)
+  CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
+  LDFLAGS="$LDFLAGS $LIBUSB_LDFLAGS"
+  LIBS="$LIBS $LIBUSB_LIBS"
   build_usb=yes
 fi
 
-- 
1.7.5.4