Development with Eclipse/ru

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(New page: {{Languages| Development with Eclipse}} A graphical Openmoko application is a gnome-based X application. Hence it is usually easy to build, run and debug it as program for the desktop comp...)
 
m
Line 12: Line 12:
 
Eclipse allows to add the custom builder to the project. These builders can be either Ant scripts or the executable shell scripts. These possibilities can be used to force the Openmoko toolchain to produce the phone executable without leaving the Eclipse IDE.
 
Eclipse allows to add the custom builder to the project. These builders can be either Ant scripts or the executable shell scripts. These possibilities can be used to force the Openmoko toolchain to produce the phone executable without leaving the Eclipse IDE.
  
== Set up Freerunner build Config ==  
+
== Установка конфигурации создания Freerunner==  
  
# install [[Toolchain]]
+
# уссновите [[Toolchain]]
# open 'Properties' for your C or C++ Project
+
# откройте 'Properties' для вашего проекта C или C++
# select 'C/C++ Build'->'Tool Settings'
+
# выберите 'C/C++ Build'->'Tool Settings'
# click on 'Configuration'->'Manage' and create new configuration eg. Freerunner (copy settings from 'Relase' configuration)
+
# Кликните на 'Configuration'->'Manage' и создайте новую конфигурацию например. Freerunner (скопируйте настройки с конфигурации 'Relase' )
# change GCC C||C++||Assembler Compiler command to /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as
+
# измените GCC C||C++||Assembler Compiler command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as
# change GCC Linker Command to /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc (g++ for C++ project)
+
# измените GCC Linker Command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc (g++ для проектов C++)
# go to 'Build Steps' and add ". /usr/local/openmoko/arm/setup-env" to 'Pre-build step'
+
# идите 'Build Steps' и добавьте ". /usr/local/openmoko/arm/setup-env" к 'Pre-build step'
# click Ok and select 'Freerunner' in 'Active Build Configuration' for your Project
+
# щелкните на Ok и выберите 'Freerunner' в 'Active Build Configuration' для вашего проекта
  
You can copy your binary to Freerunner by adding Post-Build command in 'Build Steps' eg.  
+
вы можеет скопировать свои бинарники на  Freerunner через добавление команды Post-Build в 'Build Steps' так.  
  
  scp ${project_name} root@neo:/home/root/dev_app/
+
  scp ${имя_проекта} root@neo:/home/root/dev_app/
  
or you can Run you application on Freerunner by adding Run configuration
+
или вы можете запустить ваше приложение на Freerunner добавив в конфигурацию Run
  
 
  C/C++ Application: /usr/bin/ssh
 
  C/C++ Application: /usr/bin/ssh

Revision as of 19:33, 11 September 2008

A graphical Openmoko application is a gnome-based X application. Hence it is usually easy to build, run and debug it as program for the desktop computer, uploading to the mobile phone only for the final stage of debugging. Even from the mobile phone, it is possible execute the program on the phone and still use the screen, mouse and keyboard of the desktop computer to observe its work. This article describes instructions for Debian, but they will likely work with any non broken Linux distribution.

Eclipse recently has the C/C++ development plug-in. You will need the recent Eclipse, this plug-in and you may need to upgrade the GTK development packages. The easiest way to get the simple application running is to create the managed C project and add `pkg-config --cflags --libs gtk+-2.0` both to the compiler options and to linker flags. After that, go to GTK tutorial and try, using it, to compose a simple application.

This approach not only shortens development cycle from minutes to seconds, but also allows to use the Eclipse debugger for C development, stepping through the code and watching variables.

The executable for the mobile phone can usually be produced from the same source files using the Openmoko toolchain. As all surroundings of these files for Eclipse and Openmoko project are not the same, the most straightforward approach is just to set two development environments and put the symbolic links of the source files into the Openmoko project directory.

After producing the Openmoko executable, it may be reasonable to try it via X, using the keyboard, mouse and screen of the desktop computer. All you need is to use the -X option in the ssh command when you log in into the connected mobile phone. After that, you should be able to run the application inside the phone but have its X window on a screen of the desktop machine. This way you can check the actual execution speed and have access to the mobile phone devices that are not present on PC.

Eclipse allows to add the custom builder to the project. These builders can be either Ant scripts or the executable shell scripts. These possibilities can be used to force the Openmoko toolchain to produce the phone executable without leaving the Eclipse IDE.

Установка конфигурации создания Freerunner

  1. уссновите Toolchain
  2. откройте 'Properties' для вашего проекта C или C++
  3. выберите 'C/C++ Build'->'Tool Settings'
  4. Кликните на 'Configuration'->'Manage' и создайте новую конфигурацию например. Freerunner (скопируйте настройки с конфигурации 'Relase' )
  5. измените GCC C||C++||Assembler Compiler command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as
  6. измените GCC Linker Command на /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc (g++ для проектов C++)
  7. идите 'Build Steps' и добавьте ". /usr/local/openmoko/arm/setup-env" к 'Pre-build step'
  8. щелкните на Ok и выберите 'Freerunner' в 'Active Build Configuration' для вашего проекта

вы можеет скопировать свои бинарники на Freerunner через добавление команды Post-Build в 'Build Steps' так.

scp ${имя_проекта} root@neo:/home/root/dev_app/

или вы можете запустить ваше приложение на Freerunner добавив в конфигурацию Run

C/C++ Application: /usr/bin/ssh
Arguments: root@neo "cd dev_app && DISPLAY=:0 ./${project_name}"

--PipBoy2000 22:30, 9 September 2008 (UTC)

Personal tools

A graphical Openmoko application is a gnome-based X application. Hence it is usually easy to build, run and debug it as program for the desktop computer, uploading to the mobile phone only for the final stage of debugging. Even from the mobile phone, it is possible execute the program on the phone and still use the screen, mouse and keyboard of the desktop computer to observe its work. This article describes instructions for Debian, but they will likely work with any non broken Linux distribution.

Eclipse recently has the C/C++ development plug-in. You will need the recent Eclipse, this plug-in and you may need to upgrade the GTK development packages. The easiest way to get the simple application running is to create the managed C project and add `pkg-config --cflags --libs gtk+-2.0` both to the compiler options and to linker flags. After that, go to GTK tutorial and try, using it, to compose a simple application.

This approach not only shortens development cycle from minutes to seconds, but also allows to use the Eclipse debugger for C development, stepping through the code and watching variables.

The executable for the mobile phone can usually be produced from the same source files using the Openmoko toolchain. As all surroundings of these files for Eclipse and Openmoko project are not the same, the most straightforward approach is just to set two development environments and put the symbolic links of the source files into the Openmoko project directory.

After producing the Openmoko executable, it may be reasonable to try it via X, using the keyboard, mouse and screen of the desktop computer. All you need is to use the -X option in the ssh command when you log in into the connected mobile phone. After that, you should be able to run the application inside the phone but have its X window on a screen of the desktop machine. This way you can check the actual execution speed and have access to the mobile phone devices that are not present on PC.

Eclipse allows to add the custom builder to the project. These builders can be either Ant scripts or the executable shell scripts. These possibilities can be used to force the Openmoko toolchain to produce the phone executable without leaving the Eclipse IDE.

Set up Freerunner build Config

  1. install Toolchain
  2. open 'Properties' for your C or C++ Project
  3. select 'C/C++ Build'->'Tool Settings'
  4. click on 'Configuration'->'Manage' and create new configuration eg. Freerunner (copy settings from 'Relase' configuration)
  5. change GCC C||C++||Assembler Compiler command to /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc||g++||as
  6. change GCC Linker Command to /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/bin/gcc (g++ for C++ project)
  7. go to 'Build Steps' and add ". /usr/local/openmoko/arm/setup-env" to 'Pre-build step'
  8. click Ok and select 'Freerunner' in 'Active Build Configuration' for your Project

You can copy your binary to Freerunner by adding Post-Build command in 'Build Steps' eg.

scp ${project_name} root@neo:/home/root/dev_app/

or you can Run you application on Freerunner by adding Run configuration

C/C++ Application: /usr/bin/ssh
Arguments: root@neo "cd dev_app && DISPLAY=:0 ./${project_name}"

--PipBoy2000 22:30, 9 September 2008 (UTC)