Cross Compile Player with Openembedded and BitBake

From The Player Project

Jump to: navigation, search
(Added a makefile showing how to cross compile player drivers using the OpenEmbedded toolchain, but avoiding the overhead of bitbake.)
(Undo revision 4636 by Bejer (talk))
Line 32: Line 32:
[http://docs.openembedded.org/usermanual/usermanual.html#recipes_introduction OpenEmbedded Manual] (very useful resource)
[http://docs.openembedded.org/usermanual/usermanual.html#recipes_introduction OpenEmbedded Manual] (very useful resource)
-
 
-
 
-
The following Makefile shows the principals of cross compiling player drivers (as plugins) outside OpenEmbedded / bitbake, but still make use of the generated toolchain for cross compiling to the Gumstix board. You will most likely have to modify the variables/paths to fit your particular system, but that is the easy part :)
 
-
<pre>
 
-
# ${OVEROTOP} is pointing to where you installed overo-oe / OpenEmbedded (probably ~/overo-oe/)
 
-
PLAYER_VERSION=player-3.1.0-r0
 
-
CROSS_COMPILE_SYSROOT := ${OVEROTOP}/tmp/sysroots/armv7a-angstrom-linux-gnueabi
 
-
PLAYER_INCLUDE_DIR := ${OVEROTOP}/tmp/work/armv7a-angstrom-linux-gnueabi/${PLAYER_VERSION}/package/usr/include/player-3.1
 
-
CXX := ${OVEROTOP}/tmp/sysroots/x86_64-linux/usr/armv7a/bin/arm-angstrom-linux-gnueabi-g++
 
-
 
-
all: libnxt_sense_touch_driver.so
 
-
 
-
%.o: %.cpp
 
-
$(CXX) -Wall -fpic -g3 --sysroot=${CROSS_COMPILE_SYSROOT} -I${PLAYER_INCLUDE_DIR} -c $<
 
-
 
-
libnxt_sense_touch_driver.so: nxt_sense_touch.o
 
-
$(CXX) -shared -fpic --sysroot=${CROSS_COMPILE_SYSROOT} -o $@ $^
 
-
 
-
clean:
 
-
rm -f *.o *.so
 
-
</pre>
 
-
It is recommended to manually inspect the pkg-config flags for playercore (where the information going into PLAYER_INCLUDE_DIR came from). They can be found in playercore.pc, e.g. ${OVEROTOP}/tmp/work/armv7a-angstrom-linux-gnueabi/player-3.1.0-r0/package/usr/lib64/pkgconfig/playercore.pc for my build. Using "find ${OVEROTOP} -name 'playercore.pc'" should show you where it is located. An alternative could be to set the environment variable PKG_CONFIG_PATH to point to the pkgconfig directory e.g. export PKG_CONFIG_PATH=${OVEROTOP}/tmp/work/armv7a-angstrom-linux-gnueabi/player-3.1.0-r0/package/usr/lib64/pkgconfig  and use `pkg-config --cflags playercore` to obtain the same information.
 
Line 165: Line 143:
[[Category:Documentation]]
[[Category:Documentation]]
[[Category:Tutorials]]
[[Category:Tutorials]]
-
code.google.com/p/beagleboard/wiki/HowToGetAngstromRunning Getting Angstrom Running] guide to get the feel for how to get Angstrom running.  To set up the build environment, refer to the [http://elinux.org/BeagleBoardAndOpenEmbeddedGit OpenEmbedded and Git] guide.
 
-
 
-
More information on OpenEmbedded can be found in the [http://docs.openembedded.org/usermanual/html/chapter_getting_oe.html Openembedded Manual]
 
-
 
-
For more information on the BitBake tool, view the [http://bitbake.berlios.de/manual/ BitBake manual] at Berlios.de.
 
-
 
-
 
-
== Compiling custom programs ==
 
-
 
-
[http://www.gumstix.net/User-How-To-s/view/Build-system-overview/Hello-world-tutorial/110.html Gumstix tutorial] (note slightly outdated and designed for the verdex, take note of the following changes:
 
-
 
-
*Ipkg is now opkg
 
-
*Directory structure is differerent
 
-
*packages is now recipes
 
-
*gumstix-oe is now overo-oe
 
-
*com.gumstix.collection and org.openembedded.snapshot have been combined into org.openembedded.dev
 
-
*arm5 is now arm7
 
-
 
-
 
-
[http://docs.openembedded.org/usermanual/usermanual.html#recipes_introduction OpenEmbedded Manual] (very useful resource)
 
-
 
-
 
-
The following Makefile shows the principals of cross compiling player drivers (as plugins) outside OpenEmbedded / bitbake, but still makes use of the generated toolchain for cross compiling to the Gumstix board. You will most likely have to modify the variables/paths to fit your particular system, but that is the easy part :)
 

Revision as of 22:12, 17 December 2011

Personal tools