summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2008-12-18 20:09:14 +0100
committerKoen Kooi <koen@openembedded.org>2008-12-18 20:09:14 +0100
commit26102276cb26e256186d841390988460c52bde8a (patch)
treec82ded6f0e3a5ea9ca63f93358f32c4688ac0741
parent73f61225efed9f3af1a1f5f3d491aa5e87f2641f (diff)
gnuradio: fix packaging and python detection
-rw-r--r--packages/gnuradio/gnuradio.inc28
-rw-r--r--packages/gnuradio/gnuradio/acinclude.m490
-rw-r--r--packages/gnuradio/gnuradio_3.1.3.bb4
3 files changed, 112 insertions, 10 deletions
diff --git a/packages/gnuradio/gnuradio.inc b/packages/gnuradio/gnuradio.inc
index 26005e653b..30a4ee8154 100644
--- a/packages/gnuradio/gnuradio.inc
+++ b/packages/gnuradio/gnuradio.inc
@@ -11,12 +11,12 @@ RDEPENDS_${PN} = "python-core python-audio python-threading python-codecs python
RDEPENDS_gnuradio-usrp = "python-core"
-inherit autotools pkgconfig
+inherit distutils-base autotools pkgconfig
-CXXFLAGS_powerpc += "-lstdc++"
+export BUILD_SYS
+export HOST_SYS=${MULTIMACH_TARGET_SYS}
-export BUILD_SYS := "${BUILD_SYS}"
-export HOST_SYS := "${HOST_SYS}"
+CXXFLAGS_powerpc += "-lstdc++"
EXTRA_OECONF = " \
--disable-gr-atsc \
@@ -29,28 +29,40 @@ EXTRA_OECONF = " \
PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/python2.5 \
"
+do_configure_prepend() {
+if [ -e ${WORKDIR}/acinclude.m4 ] ; then
+ cp ${WORKDIR}/acinclude.m4 ${S}
+fi
+}
+
do_configure_append() {
find ${S} -name Makefile | xargs sed -i s:'-I/usr/include':'-I${STAGING_INCDIR}':g
}
PACKAGES =+ "libpmt libpmt-qa \
libmblock libmblock-qa \
- libgr-audio-alsa \
+ libgr-audio-alsa libgr-audio-oss libgr-audio-jack\
libusrp libusrp-inband libusrp-inband-qa \
libgromnithread \
libgnuradio-core libgnuradio-core-qa \
- gnuradio-usrp-dbg gnuradio-usrp"
+ gnuradio-usrp-dbg gnuradio-usrp gnuradio-examples"
+
+
+FILES_gnuradio-examples = "${datadir}/gnuradio/examples"
FILES_libpmt = "${libdir}/libpmt.so"
FILES_libpmt-qa = "${libdir}/libpmt-qa.so"
FILES_libmblock = "${libdir}/libmblock.so"
FILES_libmblock-qa = "${libdir}/libmblock-qa.so"
-FILES_libgr-audio-alsa = "${libdir}/libgr_audio_alsa.so"
+FILES_libgr-audio-alsa = "${libdir}/libgr_audio_alsa.so ${sysconfdir}/gnuradio/conf.d/gr-audio-alsa.conf"
+FILES_libgr-audio-oss = "${libdir}/libgr_audio_oss.so ${sysconfdir}/gnuradio/conf.d/gr-audio-oss.conf"
+FILES_libgr-audio-jack = "${libdir}/libgr_audio_jack.so ${sysconfdir}/gnuradio/conf.d/gr-audio-jack.conf"
+
FILES_libusrp = "${libdir}/libusrp.so.*"
FILES_libusrp-inband = "${libdir}/libusrp_inband.so.*"
FILES_libusrp-inband-qa = "${libdir}/libusrp_inband-qa.so"
-FILES_libgnuradio-core = "${libdir}/libgnuradio-core.so.*"
+FILES_libgnuradio-core = "${libdir}/libgnuradio-core.so.* ${sysconfdir}/gnuradio/conf.d/*core*"
FILES_libgnuradio-core-qa = "${libdir}/libgnuradio-core-qa.so.*"
FILES_libgromnithread = "${libdir}/libgromnithread.so*"
diff --git a/packages/gnuradio/gnuradio/acinclude.m4 b/packages/gnuradio/gnuradio/acinclude.m4
new file mode 100644
index 0000000000..53518fb2eb
--- /dev/null
+++ b/packages/gnuradio/gnuradio/acinclude.m4
@@ -0,0 +1,90 @@
+## this one is commonly used with AM_PATH_PYTHONDIR ...
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module containing a given symbol is visible to python.
+AC_DEFUN(AM_CHECK_PYMOD,
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+ import $1
+except ImportError:
+ sys.exit(1)
+except:
+ sys.exit(0)
+sys.exit(0)"], [prog="
+import $1
+$1.$2"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+ then
+ eval "py_cv_mod_$py_mod_var=yes"
+ else
+ eval "py_cv_mod_$py_mod_var=no"
+ fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], [],, [$3
+])dnl
+else
+ AC_MSG_RESULT(no)
+ ifelse([$4], [],, [$4
+])dnl
+fi
+])
+
+dnl a macro to check for ability to create python extensions
+dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+AC_ARG_WITH(python-includes,
+ [ --with-python-includes=DIR path to Python includes], py_exec_prefix=$withval)
+if test x$py_exec_prefix != x; then
+PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+else
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl
+dnl JH_ADD_CFLAG(FLAG)
+dnl checks whether the C compiler supports the given flag, and if so, adds
+dnl it to $CFLAGS. If the flag is already present in the list, then the
+dnl check is not performed.
+AC_DEFUN([JH_ADD_CFLAG],
+[
+case " $CFLAGS " in
+*@<:@\ \ @:>@$1@<:@\ \ @:>@*)
+ ;;
+*)
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ AC_MSG_CHECKING([whether [$]CC understands $1])
+ AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
+ AC_MSG_RESULT($jh_has_option)
+ if test $jh_has_option = no; then
+ CFLAGS="$save_CFLAGS"
+ fi
+ ;;
+esac])
diff --git a/packages/gnuradio/gnuradio_3.1.3.bb b/packages/gnuradio/gnuradio_3.1.3.bb
index 2fbe0fd36a..9c41b9b2f8 100644
--- a/packages/gnuradio/gnuradio_3.1.3.bb
+++ b/packages/gnuradio/gnuradio_3.1.3.bb
@@ -1,8 +1,8 @@
require gnuradio.inc
-PR = "r0"
+PR = "r1"
SRC_URI = "ftp://ftp.gnu.org/gnu/gnuradio/gnuradio-${PV}.tar.gz \
# file://gnuradio-libusb.patch;patch=1 \
- "
+ file://acinclude.m4"