Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android開發 >> 初級開發 >> ubuntu9.10 下的android源碼下載及編譯

ubuntu9.10 下的android源碼下載及編譯

編輯:初級開發

apt-get install git

apt-get install git-core

就OK了!

sudo apt-get install git-core curl sudo apt-get install gcc g++ flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind 
Java 代碼
  • ubuntu9.04是libsdl-dev  
  • ubuntu9.04是libsdl-dev

    加上jdk5的源,ubuntu9.10默認是沒有jdk5的源的 
    Java 代碼 <embed width="14" height="15" pluginspage="http://www.Macromedia.com/go/getflashplayer" type="application/x-shockwave-Flash" allowscriptAccess="always" quality="high" Flashvars="clipboard=deb%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty%20main%20restricted%20universe%20multiverse%0Adeb-src%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty%20main%20restricted%20universe%20multiverse%0Adeb%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty-updates%20main%20restricted%20universe%20multiverse%0Adeb-src%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty-updates%20main%20restricted%20universe%20multiverse%0Adeb%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty-backports%20main%20restricted%20universe%20multiverse%0Adeb-src%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty-backports%20main%20restricted%20universe%20multiverse%0Adeb%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty-security%20main%20restricted%20universe%20multiverse%0Adeb-src%20http%3A%2F%2Frun.hit.edu.cn%2Fubuntu%2F%20jaunty-security%20main%20restricted%20universe%20multiverse%0A%0Aupdate%E4%B9%8B%E5%90%8E%EF%BC%8C%E7%94%A8sudo%20apt-get%20install%20sun-java5-jdk%20%0A" src="http://android.group.javaeye.com/Javascripts/syntaxhighlighter/clipboard_new.swf">
  • deb http://run.hit.edu.cn/ubuntu/ jaunty main restricted universe multiverse  
  • deb-src http://run.hit.edu.cn/ubuntu/ jaunty main restricted universe multiverse  
  • deb http://run.hit.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse  
  • deb-src http://run.hit.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse  
  • deb http://run.hit.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse  
  • deb-src http://run.hit.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse  
  • deb http://run.hit.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse  
  • deb-src http://run.hit.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse  
  •   
  • update 之後,用sudo apt-get install sun-Java5-jdk   
  • deb http://run.hit.edu.cn/ubuntu/ jaunty main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ jaunty main restricted universe multiverse deb http://run.hit.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse deb http://run.hit.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse deb http://run.hit.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse  update之後,用sudo apt-get install sun-Java5-jdk

    加載JDK的環境變量: 
    Java 代碼
  • sudo gedit /etc/profile  
  • export JAVA_HOME=/usr/lib/jvm/Java-5-sun  
  • export PATH=$PATH:$Java_HOME/bin  
  • export CLASSPATH=$Java_HOME/lib  
  • sudo gedit /etc/profile export JAVA_HOME=/usr/lib/jvm/java-5-sun export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=$Java_HOME/lib

    創建一個存放Andorid的目錄,然後在裡面建個bin的目錄。 
    Java 代碼
  • mkdir android  
  • cd android  
  • mkdir bin  
  • cd bin  
  • curl http://android.git.kernel.org/repo > repo  
  • sudo chmod a+x repo//修改權限  
  • cd ..//返回上一層:返回到android目錄下  
  • mkdir android cd android mkdir bin cd bin curl http://android.git.kernel.org/repo > repo sudo chmod a+x repo//修改權限 cd ..//返回上一層:返回到android目錄下
    然後在Android目錄下創建一個源碼的保存目錄,我的名字為androidsrc。 
    mkdir androidsrc 
    cd androidsrc 
    ../bin/repo init -u git://android.git.kernel.org/platform/manifest.git ../bin/repo sync 加載android 環境變量: 
    Java 代碼
  • sudo gedit /etc/profile  
  • export android_JAVA_HOME=$Java_HOME  
  • export PATH=$PATH:/home/heji/android/androidsrc/out/host/Linux-x86/bin  
  • export ANDROID_PRODUCT_OUT=/home/heji/android/androidsrc/out/target/product/generic  
  • sudo gedit /etc/profile export android_JAVA_HOME=$Java_HOME export PATH=$PATH:/home/heji/android/androidsrc/out/host/Linux-x86/bin export ANDROID_PRODUCT_OUT=/home/heji/android/androidsrc/out/target/product/generic
    Java 代碼
  • sudo gedit /home/heji/.bashrc  
  • export PATH=$PATH:~/android/androidsrc/out/host/Linux-x86/bin  
  • export ANDROID_PRODUCT_OUT=~/android/androidsrc/out/target/product/generic  
  • sudo gedit /home/heji/.bashrc export PATH=$PATH:~/android/androidsrc/out/host/Linux-x86/bin export ANDROID_PRODUCT_OUT=~/android/androidsrc/out/target/product/generic
    源碼編譯: 
    下載完後進入androidsrc目錄,make,編譯源碼,編譯SDK是make sdk 進入androidsrc目錄下,輸入命令:emulator 模塊編譯: 
    先在androidsrc目錄下執行:. build/envsetup.sh(必須) 
    mmm packages/aPPS/Contacts/編譯 Contacts 目錄out/target/product/generic/system/app/Contacts.apk 
    為了可以直接測試改動,需要生成新的system.img,在android目錄下執行: 
    make snod(androidsrc目錄下) 
    當然,如果你改動的是emulator或者其它外圍相關的,而非系統內部的東西,就不只是要重新生成system.img了 roject build/ diff --git a/core/main.mk b/core/main.mk index f761ba5..4ee4bf9 100644 --- a/core/main.mk +++ b/core/main.mk @@ -68,7 +68,7 @@ $(info Checking build tools versions...) ifeq ($(BUILD_OS),Linux) build_arch := $(shell uname -m) -ifneq (64,$(findstring 64,$(build_arch))) +ifneq (i686,$(findstring i686,$(build_arch))) $(warning ************************************************************) $(warning You are attempting to build on a 32-bit system.) $(warning Only 64-bit build environments are supported beyond froyo/2.2.) project external/clearsilver/ diff --git a/cgi/Android.mk b/cgi/Android.mk index 21c534b..37b8246 100644 --- a/cgi/android.mk +++ b/CGI/Android.mk @@ -13,8 +13,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. LOCAL_CFLAGS := -fPIC # This forces a 64-bit build for Java6 -LOCAL_CFLAGS += -m64 -LOCAL_LDFLAGS += -m64 +LOCAL_CFLAGS += -m32 +LOCAL_LDFLAGS += -m32 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true diff --git a/cs/Android.mk b/cs/Android.mk index 9f0e30a..275845d 100644 --- a/cs/Android.mk +++ b/cs/Android.mk @@ -9,8 +9,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. LOCAL_CFLAGS := -fPIC # This forces a 64-bit build for Java6 -LOCAL_CFLAGS += -m64 -LOCAL_LDFLAGS += -m64 +LOCAL_CFLAGS += -m32 +LOCAL_LDFLAGS += -m32 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true diff --git a/java-jni/Android.mk b/java-jni/Android.mk index 21b4fd1..c1d38d2 100644 --- a/java-jni/Android.mk +++ b/java-jni/Android.mk @@ -34,8 +34,8 @@ LOCAL_C_INCLUDES := \ LOCAL_CFLAGS += -fPIC # This forces a 64-bit build for Java6 -LOCAL_CFLAGS += -m64 -LOCAL_LDFLAGS += -m64 +LOCAL_CFLAGS += -m32 +LOCAL_LDFLAGS += -m32 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true diff --git a/util/Android.mk b/util/Android.mk index 386f379..b694ef4 100644 --- a/util/Android.mk +++ b/util/android.mk @@ -18,8 +18,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. LOCAL_CFLAGS := -fPIC # This forces a 64-bit build for Java6 -LOCAL_CFLAGS += -m64 -LOCAL_LDFLAGS += -m64 +LOCAL_CFLAGS += -m32 +LOCAL_LDFLAGS += -m32 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
    1. 上一頁:
    2. 下一頁:
    熱門文章
    閱讀排行版
    Copyright © Android教程網 All Rights Reserved