Finally, everytime you want to use this toolchain, you need to alter some environment variables, so that your tools will be found. The toolchain provides a script to do that, so the only thing you need to do is to source it.
Note that if you are not using a "sh" or "bash" shell (check with "echo $SHELL") that you need
to start "sh" or "bash" first.
. /usr/local/openmoko/arm/bin/setup-env
Workaround 64bit:
The current version does not contain this file. Get the 32bit version and extract the file from there. Put it to the location mentioned above and continue with the execution described above.
At least, you should add /usr/local/openmoko/arm/bin to your $PATH variable, otherwise the next steps won't work (om-conf and make).
export PATH=$PATH:/usr/local/openmoko/arm/bin
Note: This is will only last for your current session. Add it to your shell startup scripts to make it permanent (~/.bashrc for instance).
Installing New Libraries
Openmoko toolchain doesn't include many libraries by default. However, it can download and install libraries that already exist in the Openmoko repository. It refers to the Testing Repository by default. There are wrong address in /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf. Check what you have, and modify if needed. You can check with your browser what you want to use:
#Some working example. /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/etc/opkg.conf
src oe
arch all 1
src oe-all
arch any 6
arch noarch 11
arch arm 16
arch armv4t 21
src oe-armv4t
arch om-gta02 36
src oe-om-gta02
You need to alter some environment variables before you download libraries.
. /usr/local/openmoko/arm/environment-setup
First, update the opkg database (Notice, you should use alias opkg-target and not opkg. If you get an "Could not obtain administrative lock" error, try to become root with "sudo su" and don't forget to rerun the scripts to set your environment variables if necessary.)
opkg-target update
If download fails and you get error 0, likely that you have installed 32bit version but have 64bit os
Second, select a package that you want. Let's use edje as an example. If you want to develop a project which use edje of Enlightenment, you can use opkg-target list to print out how many packages you can have. Of course, command grep will help you a lot. (Remember, you should install the -dev package and not only libedje.)
opkg-target list |grep edje-dev
Third, install it
opkg-target install libedje-dev
Fourth, have a cup of coffee and wait.
Building a sample project
To build the sample project you need to install libmokoui2-dev and gconf-dbus-dev in your opkg environment. Setup your environment like described there . Now install the libraries with the following command:
opkg-target install libmokoui2-dev gconf-dbus-dev
In a chosen destination directory (in this example ~/):
copy the downloaded sample application source:
cp -r /usr/local/openmoko/source/openmoko-sample2 ~/
Remember to set the proper environment variables (again with "sh" or "bash") for openmoko:
. /usr/local/openmoko/arm/bin/setup-env
One can chown -R <your-name>.<your-name> /usr/local/openmoko/arm, and
everything should work under the non-root account. Here is a useful link if you have problems with the command below ( https://kerneltrap.org/mailarchive/openmoko-devel/2008/9/17/3318834 )
You need to create a build configuration for this application. This also checks if all needed libraries, tools, etc.. is available on your system. If this fails see the notes about the needed packages in the section "Prerequisites" mentioned earlier.
om-conf openmoko-sample2
Optionally now you can modify the source code in openmoko-sample2/src. Before the next step, go into the sample directory.
cd openmoko-sample2
If you are using an older version of the toolchain, you may have to create the makefile by running "./autogen.sh". Otherwise, to build the application from the source code just type:
make
If there are errors (i.e. "You need to install gnome-common from the GNOME CVS") deal with them. Also see "Troubleshooting" section at the end of this page for known issues.
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/ruanjian/article-12004-2.html
这东西