Reply
Thread Tools
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#1
NITDROID WANTS YOU!
Get in the team I wrote a how-to-compile Nitdroid on Ubuntu 11.10 for errors and hints contact me and I'll update the guide

HOW TO COMPILE NITDROID GINGERBREAD AND ICS IN UBUNTU 64 BIT 11.10

***Let's begin with build environment***
1a) Open terminal as root
2a) add-apt-repository "deb http://archive.canonical.com/ lucid partner"
3a) add-apt-repository "ppa:ferramroberto/java" (thanks to mornage for hint)
4a) apt-get update
5a) apt-get install sun-java6-jdk
6a) apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev libreadline-gplv2-dev lib32z-dev lib32readline-gplv2-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils
7a) create a file /etc/udev/rules.d/51-android.rules, paste this and save:
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"

***Now, let's prepare Nitdroid environment...***
1b) Open a terminal as root
2b) mkdir ~/bin
3b) PATH=~/bin:$PATH
4b) curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
5b) chmod a+x ~/bin/repo
6b) cd /home/<username>/Documents (replace <username> with your Ubuntu username)
7b) mkdir nitdroid
8b) cd nitdroid

At this point my guide splits into two parts (one for gingerbread and one for the highly experimental ics branch).

As stated here:
http://e2e.ti.com/support/embedded/a...aspx?pi24527=2
the libs for AM35x are out, so SGX support for n14 is available now here but there is the need to tweak correctly the system to use them:
http://gitorious.org/rowboat/hardwar...gx_sdk-ddk_1.8


***Steps for Gingerbread Branch***

1c) repo init -u git://gitorious.org/android-n900/nitdroid_platform_manifest.git -b gingerbread
2c) repo sync
3c) source build/envsetup.sh
4c) lunch n900-userdebug
5c) gedit frameworks/base/libs/utils/Android.mk and replace:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
with:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
6c) gedit build/core/combo/HOST_linux-x86.mk and replace
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
with
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
7c) mv /hardware/alsa_sound/Android.mk /hardware/alsa_sound/Android.mkbk

***Steps for Ice Cream Sandwich Branch***

1c) repo init -u git://gitorious.org/android-n900/nitdroid_platform_manifest.git -b ics
2c) repo sync
3c) source build/envsetup.sh
4c) lunch full-userdebug (not sure about this, have to ask e-yes because n900-userdebug does not work in ics branch and I'm not sure that full-userdebug produce the same n14_dev_snapshot content)
5c) gedit frameworks/base/libs/utils/Android.mk and replace:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
with:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
6c) gedit build/core/combo/HOST_linux-x86.mk and replace
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
with
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
7c) gedit external/mesa3d/src/glsl/linker.cpp and add this:
#include <stddef.h>
after the other #include
8c) gedit external/oprofile/libpp/format_output.h and delete at line 94 only the word "mutable"
9c) gedit external/gtest/include/gtest/internal/gtest-param-util.h and add this:
#include <cstddef>
after the other include
10c) gedit external/llvm/lib/Support/Android.mk and add the following lines:
LOCAL_C_INCLUDES += system/core/include/cutils
LOCAL_SHARED_LIBRARIES := libcutil
in the section "for the host" and in the section "for the device"
11c) gedit external/llvm/lib/Support/Mutex.cpp and after the other include add this:
#include <threads.h>
12c) gedit external/llvm/llvm-host-build.mk and add:
LOCAL_LDLIBS := -lpthread -ldl
13c) gedit external/llvm/lib/Support/Threading.cpp and after the other include add this:
#include <threads.h>
14c) gedit frameworks/compile/slang/Android.mk and replace:
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
with
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
15c) gedit build/core/combo/javac.mk and replace:
COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -Xmaxerrs 9999999
with
COMMON_JAVAC := javac -J-Xmx512M -target 1.5 -source 1.5 -Xmaxerrs 9999999
16c) gedit libcore/luni/src/main/java/java/lang/Enum.java and replace:
return ordinal - o.ordinal
with
return ordinal - o.ordinal ();
17c) gedit external/gtest/include/gtest/internal/gtest-param-util.h and add, after #include vector:
#include <cstddef>

***The next steps are in common for both Gingerbread and Ics branch and have to be used AFTER the previous steps of my guide***

1d) make -j 3 (loooong time to compile all sources)
2d) Install Eclipse Classic from here:
http://www.eclipse.org/downloads/
3d) Open Eclipse, choose your workspace folder and go to "Help" -> Install New Software
4d) Click Add in the top-right corner
5d) In the Add Repository dialog write "ADT Plugin" in the field "Name" and the following URL for the field "Location":
https://dl-ssl.google.com/android/eclipse/
then click OK
6d) When the "Pending" text disappears, select the checkbox of Developer Tools and click "Next" (if it asks of unsigned software installation ignore the warning and let it continue the installation)
7d) In the next window click again Next
8d) In the next window accept all License Agreements and click on Finish
9d) Restart Eclipse.
10d) When Eclipse restart, it'll ask to download a version of Android SDK necessary for the ADT Plugin. Choose to download the latest version, not the 2.1
11d) To be able to access adb anytime and anywhere from Ubuntu's Terminal, add the following to the end of either your ~/.bashrc or ~/.profile or ~/.bash_profile configuration files:
export PATH=${PATH}:/home/<yourubuntuusername>/android-sdks/tools:/home/<yourubuntuusername>/android-sdks/platform-tools
12d) Turn on the N900 in Nitdroid/Gingerbread
13d) Connect the USB cable to PC
14d) Check that N900 is recognized by the PC by typing “adb devices” in terminal...it should respond:
0123456789ABCDEF device
15d) Make the desired changes to the branch
16d) To apply your changes, do "make -j 3" again
17d) adb -p ~/nitdroid/out/target/product/n900 sync
18d) restart N900

Everytime you update your work on nitdroid files, you have only to follow the steps from 12d to 18d

Hint1:
If it gives “adb: command not found” you don't have android sdk properly configured, follow steps 2d-11d.
If adb can't find your device, try to kill the adb server and start it again (adb kill-server and adb start-server, thanks to vakkov for hint)

Hint2 (tested only for gingerbread branch):
If it gives some errors about libcamera.so copy files from the zip attachment (taken from my 2.3.7 nitdroid) into out/target/product/n900/system/lib and run "make -j 3" again (thanks to vakkov for testing this solution)

Credits for this guide goes to:
e-yes, ammyt, Google (how-to prepare android build environment), CyanogenMod, blackjack4it, XeonDead, jdm13,vakkov,xda-developers and all the mantainers of the Nitdroid project. If I forgot someone tell me and I'll add to the credits
Attached Files
File Type: zip libcamera.zip (54.5 KB, 166 views)

Last edited by blackjack4it; 2012-06-05 at 12:00.
 

The Following 18 Users Say Thank You to blackjack4it For This Useful Post:
Boemien's Avatar
Posts: 770 | Thanked: 558 times | Joined on Mar 2010 @ Abidjan
#2
What is the aim of this How-To for noobs as me?? I don't even know any basis for coding! I prefer to wait for the next stable and maybe full functional release of NitDroid...even if the wait seems to be too long!
But thanks for this thread man, It could help some members out there!
EDIT: did you try it yet???
__________________
If you find this post useful for you, or for another member, just hit the Thanks! button

Last edited by Boemien; 2011-11-05 at 13:03.
 
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#3
I wrote that guide by myself explaining to any developers which steps I followed to build Nitdroid 2.3.7 that is actually on my n900 so, the answer to your question is yes and the aim is to let everyone that know Java to know how to compile and contribute to the project
 

The Following User Says Thank You to blackjack4it For This Useful Post:
Alfred's Avatar
Posts: 855 | Thanked: 612 times | Joined on Oct 2010 @ Germany
#4
Can you shortly describe new things at 2.3.7, comparing to the prev ones?
__________________
Reps are just one click away: Extras | Extras-Testing | Extras-Devel | My-Maemo | CSSU |
Transform your lock screen into a weather forecast Thanks button ================>
 
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#5
By the adb sync I've noticed that 43 files were updated and I have only took a look at the system version to check that was 2.3.7 so I need more time to discover new functions stay tuned
 

The Following 2 Users Say Thank You to blackjack4it For This Useful Post:
Posts: 1,397 | Thanked: 2,126 times | Joined on Nov 2009 @ Dublin, Ireland
#6
Are you using latest sources from e-eyes's Gitourious? and if so, do them include rear camera support?

I hope more people could contribute to Nitdroid as e-eyes is now tired of doing it alone.

Last edited by ivgalvez; 2011-11-06 at 15:16.
 
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#7
Yes I've compiled the latest source code available on e-yes gitorious but he haven't committed yet all of his recent updates so we'll wait for him I can help the project by using my knowledge in Java's coding for example !
 

The Following User Says Thank You to blackjack4it For This Useful Post:
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#8
Updated first post with the solution for ofono compiling problem (thanks goes to e-yes)

Last edited by blackjack4it; 2011-11-28 at 09:51.
 

The Following 2 Users Say Thank You to blackjack4it For This Useful Post:
Posts: 638 | Thanked: 1,692 times | Joined on Aug 2009
#9
...first of all ...thanks!

After this, as soon as you can, could you write a working/not working list of what you have built until now?
 
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#10
For now I'm just briefing the steps needed to build the latest Git release available, I know a bit of Java and also C++ and I'm talking with e-yes to help him in the project so as soon as we will have progress we will update you for sure ! If you know Java and C++ contact him, a help will be very appreciated
 

The Following 2 Users Say Thank You to blackjack4it For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 13:14.