windows打包ipa?x86架构和arm架构?Toolchain(3)

电脑杂谈  发布时间:2016-07-06 05:00:23  来源:网络整理


If you want to install this project on host for staging usage later, a shared library, for example, you can do the following to install it into a given configured prefix.

om-conf --prefix=/usr/local/openmoko openmoko-sample2 cd openmoko-sample2 make install

How to create your own project from the sample project

In order to build your own project by using openmoko-sample2 files, some changes are needed:

  • copy the downloaded sample application source
  • cp -r /usr/local/openmoko/source/openmoko-sample2 ~/
  • rename the folder with the name of your project (in this example your-project-name) and delete old sample files
  • mv openmoko-sample2 your-project-name cd your-project-name cd src rm *.c
  • copy your sources (in this example your-sources) into src/
  • cp your-sources . cd ..
  • now in the main folder modify autogen.sh by updating the following lines
  • PKG_NAME="your-project-name"
  • modify configure.ac by updating the following lines ('main.c' should be the main file in your project)
  • AC_INIT(your-project-name, 0.0.1, ) AC_CONFIG_SRCDIR(src/main.c)
  • go into data/ folder and rename these files with the name of your project
  • cd data mv openmoko-sample.png your-project-name.png mv openmoko-sample.desktop your-project-name.desktop
  • modify Makefile.am inside data/ by updating the following lines
  • dist_desktop_DATA = your-project-name.desktop dist_appicon_DATA = your-project-name.png
  • modify Makefile.in inside data/ by updating the following lines
  • dist_desktop_DATA = your-project-name.desktop dist_appicon_DATA = your-project-name.png
  • modify your-project-name.desktop by updating the following lines
  • Name=your-project-name Encoding=UTF-8 Version=0.0.1 Type=Application Exec=your-project-name
  • and by adding the following line
  • Icon=your-project-name
  • move into src/ folder
  • cd .. cd src
  • modify Makefile.am by updating the following lines
  • bin_PROGRAMS = your-project-name your_project_name_SOURCES = \ main.c your_project_name_LDADD = @DEPENDENCIES_LIBS@
  • be sure to put instead of main.c all your .c and .h files and modify all the '-' characters with '_' in the variable names
  • Packaging your application

    We have included a script to make an ipkg out of your application. Note that this is not needed to test your application on the Neo (for that you can just scp the resulting binary and data over), however it's very handy if you want to distribute your application to others.

    om-make-ipkg openmoko-sample2

    Now you got openmoko-sample2_0.1_armv4t.ipk , you can `scp' it to your Neo and install it:

    scp openmoko-sample2_0.1_armv4t.ipk root@192.168.0.202: ssh root@192.168.0.202 opkg install openmoko-sample2_0.1_armv4t.ipk

    Note that while you can redistribute the generated ipkg, be aware that this is a bare-bones ipk that contains no further information, i.e. you will lack library dependencies. See below how to fix this.

    You can also supply the version number, a description, and an author / contacts string in a control file:

    om-make-ipkg myapp myapp_control

    A template of myapp_control:

    Package: $appname Version: 0.1 Description: package built by openmoko toolchain Section: openmoko/applications Priority: optional Maintainer: $USER Architecture: armv4t Homepage: Depends: Source: ${SRC}

    Where to go from here

    Using the external toolchain is an easy way to build applications for your Neo. If you are familiar with this procedure, you might also want to look into

  • Using Qemu to test your applications in an emulated environment
  • Ubuntu users might prefer to look at Automatic_emulation_in_Ubuntu
  • Using host-based development to improve your efficiency
  • Using OpenEmbedded to customize your Openmoko distribution image
  • Advanced topics

    Building Openmoko Kernel from git repo using toolchain

    Explained in more detail at .

    Using toolchain provided libraries

    Add the necessary libraries to the _LDADD field in src/Makefile.am, for example:

    openmoko_sample2_LDADD = @DEPENDENCIES_LIBS@ -lmokogsmd2

    make sure to run om-conf again after this.

    Installing additional libraries into the toolchain

    Sooner or later you will want to compile an application that has dependencies which can't be fulfilled by the precompiled toolchain, e.g. some obscure libraries.

    In that case, feel free to request the inclusion of additional libraries into the next release of the Openmoko toolchain. Until then, here is how you enhance your already installed toolchain. Say, we want to add the library called liburiparse:

    cd ~/source wget tar xjf uriparser-0.6.0.tar.bz2 cd uriparser-0.6.0 ./configure --host=arm-angstrom-linux-gnueabi \ --prefix=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr make make install

    That's it.

    Getting your application packaged by OE


    本文来自电脑杂谈,转载请注明本文网址:
    https://www.pc-fly.com/a/ruanjian/article-12004-3.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      • 李亚娟
        李亚娟

        对胆敢侵犯中国领土领海主权的行为必须敢于斗争

      • 王树鑫
        王树鑫

        懂得珍惜

      热点图片
      拼命载入中...