[oe-commits] Koen Kooi : gnuradio: add hack to build a private copy of libusb ( the gnarly old one) and statically link that since gnuradio is using private methods of libusb that libusb-compat won 't provide

git version control git at git.openembedded.org
Mon Jun 1 22:11:53 UTC 2009


Module: openembedded.git
Branch: xora/angstrom-srcpv
Commit: 71e69ad8b551aa06f63160232d1bd87b8d801a1d
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=71e69ad8b551aa06f63160232d1bd87b8d801a1d

Author: Koen Kooi <koen at openembedded.org>
Date:   Mon Jun  1 15:39:06 2009 +0200

gnuradio: add hack to build a private copy of libusb (the gnarly old one) and statically link that since gnuradio is using private methods of libusb that libusb-compat won't provide

---

 recipes/gnuradio/gnuradio.inc      |   18 ++++++++++++++++++
 recipes/gnuradio/gnuradio_3.1.3.bb |   11 ++++++++---
 recipes/gnuradio/gnuradio_svn.bb   |   11 +++++++++--
 3 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/recipes/gnuradio/gnuradio.inc b/recipes/gnuradio/gnuradio.inc
index 8846240..2688636 100644
--- a/recipes/gnuradio/gnuradio.inc
+++ b/recipes/gnuradio/gnuradio.inc
@@ -26,6 +26,24 @@ EXTRA_OECONF = " \
 
 GR_CPU_SELECTION_armv7a = " --with-md-cpu=arm "
 
+# This is an awful hack to allow GNU Radio to use libusb-0.12, regardless
+# of what is used by the rest of OE
+
+export USB_CFLAGS=""
+export USB_LIBS="-L${WORKDIR}/libusb-0.1.12/.libs/ -l:libusb-gnur.a"
+
+do_buildlibusb() {
+    cd ${WORKDIR}/libusb-0.1.12
+    sed -e 's/AC_LANG_CPLUSPLUS/AC_PROG_CXX/' -i configure.in
+    sed -e s:tests::g -i Makefile.am
+    sed -e s:tests::g -i Makefile.in || true
+    ./configure --build=${BUILD_SYS} --host=${HOST_SYS} --target=${TARGET_SYS} --prefix=${prefix} --exec_prefix=${exec_prefix} --bindir=${bindir} --sbindir=${sbindir} --libexecdir=${libexecdir} --datadir=${datadir} --sysconfdir=${sysconfdir} --sharedstatedir=${sharedstatedir} --localstatedir=${localstatedir} --libdir=${libdir} --includedir=${includedir} --oldincludedir=${oldincludedir} --infodir=${infodir} --mandir=${mandir} --disable-shared --disable-build-docs
+    make
+    mv .libs/libusb.a .libs/libusb-gnur.a || true
+    cd ${WORKDIR}
+}
+
+
 do_configure_prepend() {
 	if [ -e ${WORKDIR}/acinclude.m4 ] ; then
 		cp ${WORKDIR}/acinclude.m4 ${S}
diff --git a/recipes/gnuradio/gnuradio_3.1.3.bb b/recipes/gnuradio/gnuradio_3.1.3.bb
index 17089dd..437e62f 100644
--- a/recipes/gnuradio/gnuradio_3.1.3.bb
+++ b/recipes/gnuradio/gnuradio_3.1.3.bb
@@ -1,8 +1,13 @@
 require gnuradio.inc
 
-PR = "r3"
+PR = "r4"
 
 SRC_URI = "ftp://ftp.gnu.org/gnu/gnuradio/gnuradio-${PV}.tar.gz \
-#           file://gnuradio-libusb.patch;patch=1 \
-	   file://acinclude.m4"
+	   file://acinclude.m4 \
+      ${SOURCEFORGE_MIRROR}/libusb/libusb-0.1.12.tar.gz \
+"
+# This is an awful hack to allow GNU Radio to use libusb-0.12, regardless
+# of what is used by the rest of OE
+
+addtask buildlibusb before do_configure after do_unpack
 
diff --git a/recipes/gnuradio/gnuradio_svn.bb b/recipes/gnuradio/gnuradio_svn.bb
index 56db918..73348bf 100644
--- a/recipes/gnuradio/gnuradio_svn.bb
+++ b/recipes/gnuradio/gnuradio_svn.bb
@@ -5,14 +5,21 @@ DEFAULT_PREFERENCE = "-1"
 DEPENDS += " gsl "
 
 PV = "3.1.3+svnr${SRCREV}"
-PR = "r6"
+PR = "r7"
 
 EXTRA_OECONF += "--with-boost=${STAGING_DIR_TARGET}/usr CXXFLAGS=-DBOOST_SP_USE_PTHREADS --disable-usrp1 --disable--usrp2"
 
 SRC_URI = "svn://gnuradio.org/svn/gnuradio/;module=trunk;proto=http \
     file://no-usrp2.patch;patch=1 \
     file://gnuradio-neon.patch;patch=1;pnum=0 \
-	   "
+     ${SOURCEFORGE_MIRROR}/libusb/libusb-0.1.12.tar.gz \
+"
+
+# This is an awful hack to allow GNU Radio to use libusb-0.12, regardless
+# of what is used by the rest of OE
+
+addtask buildlibusb before do_configure after do_unpack
+
 
 S="${WORKDIR}/trunk"
 





More information about the Openembedded-commits mailing list