I've previously posted about building against bundles in SVN to get the latest BUG software. This is a followup with special attention paid to the jni bundles. I assume a certain knowledge of the SDK, our build system, and eclipse. You'll need eclipse (3.3.2), subclipse, CDT, and CTE plugins installed.
- eclipse 3.3.2: http://archive.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800/index.php
- subclipse: http://subclipse.tigris.org/update_1.4.x
- CDT update site: http://download.eclipse.org/tools/cdt/releases/europa
- CTE update site: http://concierge.sourceforge.net/cte/update
As of RC1.4.1 of the BUG software stack, control of the hardware is done by using JNI to do the various ioctls natively. That means that we have bundles in /usr/share/java/ on the root filesystem which use libraries (in /usr/lib/jni) to perform these functions. For example, IVonHippelModuleControl's methods to toggle LEDs and the like are implemented in C. There may be occasions where you would like to tweak these or add your own features to control the hardware. In that case you'll likely want to build them on your system locally, then move them onto your BUG. Unfortunately to build these libraries you need access to the headers and libraries that are part of the entire BUG. Our Makefiles assume that you have certain environment variables set to point to the relevant include and lib directories. Here are the last few lines of my .bashrc
- Assuming you've looked at and built using the instructions in the wiki on our build system, add similar entries to your .bashrc pointing at the corresponding directories. You'll need to have built linux-bug and phoneme-advanced-personal.
- Start a new shell type env and make sure you see BUG_LINUX_SRC, ROOTFS_BUG etc in your environment
- Start eclipse from the command line so it sees the environment variables from your .bashrc
- Using subclipse, check com.buglabs.bug.jni.vonhippel out of svn://svn.buglabs.net/bug/trunk
- Using subclipse, check com.buglabs.bug.jni.common out of svn://svn.buglabs.net/bug/trunk
- Switch to the C/C++ perspective of CDT
- Right click on com.buglabs.bug.jni.common project in your project view and select "Properties"
- Expand C/C++ build, and select Environment
- Click Manage Configurations
- Highlight "BUG" and click Set Active, hit OK
- Select BUG in the Configuration drop-down box and hit OK
- Clean your project (Project->Clean in the menu)
- Go to the Make Targets view and expand com.buglabs.bug.jni.common
- Double click "all"
- Look at the console and make sure everything builds
- Repeat steps 7 through 15 for com.buglabs.bug.jni.vonhippel
That's it, you should find the libVonHippel.so shared library in the lib directory within the com.buglabs.bug.jni.vonhippel project.