主题 : Fedora 15 64位编译Android 2.3.4系统 复制链接 | 浏览器收藏 | 打印
级别: 骑士
UID: 42149
精华: 2
发帖: 201
金钱: 1115 两
威望: 223 点
贡献值: 2 点
综合积分: 442 分
注册时间: 2011-04-05
最后登录: 2013-03-29
楼主  发表于: 2011-07-26 21:16

 Fedora 15 64位编译Android 2.3.4系统

管理提醒: 本帖被 xoom 设置为精华(2011-10-19)
android开发使用指南中,使用的是Fedora 14 32位系统对Android系统进行编译的,因为我的系统为Fedora 15 64,不想折腾系统,所以就在下面做了。Fedora 14 64系统应该类似。
一、准备工作,安装编译过程中需要的32位库,需要使用root用户权限操作,我直接su,然后进行下面的安装命令
# yum install gperf

# yum install glibc.i686
# yum install glibc-deve.i686
# yum install libstdc++.686
# yum install zlib_devel.i686
# yum install ncurses-devel.i686
# yum install libX11-devel.i686
# yum install libXext.i686
# yum install libao.i686
# yum install alsa.i686
# yum install readline-devel.i686 readline.i686
# yum install libgcc.i686
# yum install mesa-libGL-devel.i686 measa-libGL.i686
二、降级安装make 3.82 到 3.81
yum downgrade releasever=13 make --nogpgcheck
三、修改 frameworks/base/libs/utils/Android.mk

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
改为
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)  -fpermissive
四、修改 build-android
因为源码里面的JDK1.6.0_23是32位版本,所以不能使用。将3-5,15行注释掉,在15行下增加一行,重新加入你的JDK目录,如果本身环境变量已经有了,可以不加
我改成了如下的内容
export PATH=/usr/java/jdk1.6.0_25/bin:PATH
五、其它步骤按照手册的做就可以了。
[ 此帖被tingjie在2011-08-01 07:33重新编辑 ]
级别: 风云使者
UID: 36096
精华: 3
发帖: 2536
金钱: 14075 两
威望: 2815 点
贡献值: 3 点
综合积分: 5132 分
注册时间: 2011-01-11
最后登录: 2015-11-15
1楼  发表于: 2011-07-27 07:10
牛人啊,不过我用ubuntu 32位的
极度缺钱,求捐赠……支付宝兼邮箱:huming2207@qq.com
级别: 骑士
UID: 42149
精华: 2
发帖: 201
金钱: 1115 两
威望: 223 点
贡献值: 2 点
综合积分: 442 分
注册时间: 2011-04-05
最后登录: 2013-03-29
2楼  发表于: 2011-07-27 09:56
补充一下,使用mktools时还需要安装两个包:
# yum install lzo-devel.i686
# yum install libuuid.i686
级别: 圣骑士
UID: 44407
精华: 0
发帖: 388
金钱: 1945 两
威望: 389 点
贡献值: 0 点
综合积分: 776 分
注册时间: 2011-04-25
最后登录: 2014-08-25
3楼  发表于: 2011-07-27 18:59
感謝LZ,自從升級到Android2.3.4後,都沒有辦法成功make,
我的driver更不用說是否build成功....


LOCAL_CFLAGS +"+" -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)  -fpermissive

是不是筆誤?
[ 此帖被kazaya在2011-07-29 13:58重新编辑 ]
^很多问题的背后都是简单的原因......
级别: 荣誉会员
UID: 34780
精华: 0
发帖: 1220
金钱: 6230 两
威望: 1246 点
贡献值: 0 点
综合积分: 2440 分
注册时间: 2010-12-21
最后登录: 2017-09-18
4楼  发表于: 2011-07-28 09:48
好帖....支持一下~
级别: 骑士
UID: 42149
精华: 2
发帖: 201
金钱: 1115 两
威望: 223 点
贡献值: 2 点
综合积分: 442 分
注册时间: 2011-04-05
最后登录: 2013-03-29
5楼  发表于: 2011-08-01 07:32
引用第3楼kazaya于2011-07-27 18:59发表的  :
感謝LZ,自從升級到Android2.3.4後,都沒有辦法成功make,
我的driver更不用說是否build成功....


LOCAL_CFLAGS +"+" -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)  -fpermissive
.......


是的,多谢提醒,原帖已更正。
级别: 新手上路
UID: 52473
精华: 0
发帖: 11
金钱: 55 两
威望: 11 点
贡献值: 0 点
综合积分: 22 分
注册时间: 2011-07-19
最后登录: 2011-08-03
6楼  发表于: 2011-08-01 11:04
SamSung开发板技术交流群41033921,欢迎业内和三星爱好者的到来。
级别: 圣骑士
UID: 44407
精华: 0
发帖: 388
金钱: 1945 两
威望: 389 点
贡献值: 0 点
综合积分: 776 分
注册时间: 2011-04-25
最后登录: 2014-08-25
7楼  发表于: 2011-08-01 17:54
適用
編譯環境:FC12/14/15 32bit  (現在在FC12編譯)
Kernel 2.6.32.24
Target平台:Mini6410/Tiny6410
源碼版本:Android-2.3.4/Android2.3
HD space: 30G at least

請注意:FriendlyARM 的平台的CROSS_COMPILE
本例arm-eabi-gcc在Mini6410上使用應為:arm-linux-gcc(請依照自己的環境路徑自行修改....)


先前準備:
tar zxvf android-2.3.4-fs-20110722.tar.gz -C /home
tar zxvf android-kernel-2.6.36-20110721.tar.gz -C /home/Android-2.3.4
cp -r /home/Android-2.3.4/linux-2.6.36-android/config_android_n43  /home/Android-2.3.4/linux-2.6.36-android/.config
tar zxvf /home/Android-2.3.4/jdk1.6.0_23.tar.gz

一、準備工作,安裝編譯過程中需要的32位Library,需要使用root用戶權限操作安裝命令

yum install alsa-firmware.noarch alsa-lib.i686 alsa-lib-devel.i686 alsa-tools.i686 alsa-tools-firmware.i686 audiofile-devel.i686 cups-devel.i686 dbus-devel.i686 esound-devel.i686 \
fontconfig-devel.i686 freetype.i686 freetype-devel.i686 giflib-devel.i686 hal-devel.i686 \
lcms-devel.i686 libICE-devel.i686 libjpeg-devel.i686 libpng-devel.i686 libSM-devel.i686 \
libusb-devel.i686 libX11-devel.i686 libXau-devel.i686 libXcomposite-devel.i686 \
libXcursor-devel.i686 libXext-devel.i686 libXi-devel.i686 libXinerama-devel.i686 \
libxml2-devel.i686 libXrandr-devel.i686  libXrender-devel.i686 libxslt-devel.i686 \
libXt-devel.i686 libXv-devel.i686 libXxf86vm-devel.i686 measa-libGL.i686 mesa-libGL-devel.i686  mesa-libGLU.i686 mesa-libGLU-devel.i686 \
ncurses-devel.i686 openldap-devel.i686 openssl-devel.i686 zlib-devel.i686 sane-backends-devel.i686 \
xorg-x11-proto-devel glibc.i686 glibc-devel.i686 prelink libstdc++-devel.i686 pulseaudio-libs-devel.i686 \
gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel.i686 isdn4k-utils-devel.i686 \
gsm-devel.i686 libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 \
gperf flex bison git-core gnupg gcc make libstdc++.i686 SDL SDL-devel libao.i686 readline-devel readline \
libgcc.i686 lzo-devel.i686 libuuid.i686 libXrandr.i686 libXext.i686 gettext

二、修改 frameworks/base/libs/utils/Android.mk

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
改為
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)  -fpermissive
三、修改 build-android
因為源碼裡面的JDK1.6.0_23是32位版本,所以不能使用。將3-5,15行注釋掉,在15行下增加一行,重新加入你的JDK目錄,如果本身環境變量已經有了,可以不加
我改成了如下的內容
export PATH=/usr/java/jdk1.6.0_25/bin:PATH

四、修改build/core/main.mk(32bit請修改)
#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.)
+#$(warning ************************************************************)


五、編譯Android Kernel

cd /home/Android-2.3.4/linux-2.6.36-android

複制.config_android_n43 為.config
export ARCH=arm
#export CROSS_COMPILE=arm-eabi-
#make CC=arm-eabi-gcc -j2
export CROSS_COMPILE=arm-linux-
make CC=arm-linux-gcc -j2


六、到執行路徑

cd /home/Android-2.3.4



七、將PATH貼到终端機(命令視窗)

#PATH="/home/Android-2.3.4/jdk1.6.0_23/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/Android-2.3.4/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin"
PATH="/home/Android-2.3.4/jdk1.6.0_23/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/Android-2.3.4/prebuilt/linux-x86/toolchain/4.5.1/bin"
export JAVA_HOME=/home/Android-2.3.4/jdk1.6.0_23
export ANDROID_JAVA_HOME=$JAVA_HOME
export JAVA_BIN=/home/Android-2.3.4/jdk1.6.0_23/bin
export CLASSPATH=/home/Android-2.3.4/jdk1.6.0_23/lib/dt.jar:/home/Android-2.3.4/jdk1.6.0_23/lib/tools.jar
export ANDROID_PRODUCT_OUT=/home/Android-2.3.4/out/target/product/generic
export PATH=$PATH:/home/Android-2.3.4/out/target/product/generic
export PATH=$PATH:/home/Android-2.3.4/out/host/linux-x86/bin
source /home/Android-2.3.4/build/envsetup.sh
./setenv
export ECLIPSE_HOME=/home/eclipse


八、修改frameworks/base/services/camera/libcameraservice/Android.mk

錯誤:
make: *** No rule to make target 'out/target/product/generic/obj/lib/libcamera.so', needed by 'out/target/product/generic/obj/SHARED_LIBRARIES/libcameraservice_intermediates/LINKED/libcameraservice.so'.  Stop.
make: *** Waiting for unfinished jobs....
解決:
修改 /home/Android-2.3.4/frameworks/base/services/camera/libcameraservice/Android.mk,USE_CAMERA_STUB:=false ->ture


LOCAL_PATH:= $(call my-dir)

# Set USE_CAMERA_STUB if you don't want to use the hardware camera.

# force these builds to use camera stub only
ifneq ($(filter sooner generic sim,$(TARGET_DEVICE)),)
  USE_CAMERA_STUB:=true
endif

USE_CAMERA_STUB:=false->true

ifeq ($(USE_CAMERA_STUB),)
  USE_CAMERA_STUB:=false
endif



九、複制OpenSLESUT.h檔案到system/media/opensles/include/SLES/OpenSLESUT.h

target Strip: AudioInRecord (out/target/product/generic/obj/EXECUTABLES/AudioInRecord_intermediates/AudioInRecord)
target thumb C++: BufferQueue_test <= system/media/opensles/tests/automated/BufferQueue_test.cpp
system/media/opensles/tests/automated/BufferQueue_test.cpp:34:29: error: SLES/OpenSLESUT.h: No such file or directory
system/media/opensles/tests/automated/BufferQueue_test.cpp: In function 'void CheckErr(SLresult)':
system/media/opensles/tests/automated/BufferQueue_test.cpp:55: error: 'slesutResultToString' was not declared in this scope
make: *** [out/target/product/generic/obj/EXECUTABLES/BufferQueue_test_intermediates/BufferQueue_test.o] Error 1

BufferQueue_test.cpp內容的參考檔少OpenSLESUT.h, 直接複制到system/media/opensles/include/SLES/OpenSLESUT.h

#include <unistd.h>
#include "SLES/OpenSLES.h"
#include "SLES/OpenSLESUT.h"
#include <gtest/gtest.h>
cp /home/Android-2.3.4/system/media/opensles/libopensles/OpenSLESUT.h /home/Android-2.3.4/system/media/opensles/include/SLES/OpenSLESUT.h



十、配置Android支持WIFI

在 build/target/board/generic/BoardConfig.mk 中添加:
BOARD_HAVE_WIFI := true
BOARD_WPA_SUPPLICANT_DRIVER := WEXT
  
這將在external/wpa_supplicant/Android.mk設置WPA_BUILD_SUPPLICANT為true,
默認使用驅動driver_wext.c。

如果使用定制的wpa_supplicant驅動(例如 madwifi),可以設置:
BOARD_WPA_SUPPLICANT_DRIVER := MADWIFI

將在external/wpa_supplicant/common.c 中的MSG_INFO,改為MSG_DEBUG以增加輸出更多信息

wpa_debug_level = MSG_DEBUG;

#define wpa_printf宏中的
if ((level) >= MSG_INFO)
改為
if ((level) >= MSG_DEBUG)

external\wpa_supplicant\.config

# CONFIG_NO_WPA=y
CONFIG_OS=unix
CONFIG_IEEE8021X_EAPOL=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_PSK=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_PKCS12=y
CONFIG_SMARTCARD=y
CONFIG_WIRELESS_EXTENSION=y
CONFIG_CTRL_IFACE=y
CONFIG_DRIVER_WEXT=y

hardware/libhardware_legacy/wifi/wifi.c
將驅動直接編譯進內核
int wifi_load_driver()
{
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for completion */
LOGE("wifi driver loaded !");
return 0;
}
int wifi_unload_driver()
{
int count = 20; /* wait at most 10 seconds for completion */
LOGE("wifi driver unloaded by rockie!");
return 0;
注意這個定義static const char IFACE_DIR[] = "/data/system/wpa_supplicant";

編譯整個android系統,確認編譯完bin目錄中含有wpa_supplicant、wpa_cli





./build-android

make


這樣 "./build-android" 或 "make" 就會OK了


PS.另外編譯WIFI驅動為module或kernel built in請參考:

http://blog.csdn.net/louiswangbing/article/details/6618734
http://blog.csdn.net/zhenwenxian/article/details/6624575

関於
wpa_supplicant.conf 範例:/data/misc/wifi/wpa_supplicant.conf

# wpa_supplicant -dd -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf &



ctrl_interface=DIR=/data/misc/wifi
ctrl_interface_group=wifi
update_config=1


# Let wpa_supplicant search and select AP
ap_scan=1

# WPA-PSK, PSK use ASCII
#network={
#  ssid="Test1"
#  psk="1111111111"
#   #Higher priority use first
#  priority=5
#}

# The same as above, assign SSID for AP without brocast SSID
#network={
#  ssid="second ssid"
#  scan_ssid=1
#  psk="very secret passphrase"
#  priority=2
#}

# Allow WPA-PSK only. Allow any valid password set
#network={
#  ssid="example"
#  proto=WPA
#  key_mgmt=WPA-PSK
#  pairwise=CCMP TKIP
#  group=CCMP TKIP WEP104 WEP40
#  psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
#  priority=2
#}

# Plaintext( Not use 802.1X )
#network={
#  ssid="plaintext-test"
#  key_mgmt=NONE
#}

# Shared WEP, Not use IEEE 802.11 Shared Key
#network={
#  ssid="Test1"
#  key_mgmt=NONE
#  wep_key0='abcde'
#  wep_key1='abcde'
#  wep_key2='abcde'
#  wep_tx_keyidx=0
#  priority=5
#}

#Shared WEP, Use IEEE 802.11 Shared Key
#network={
#  ssid="Test1"
#  key_mgmt=NONE
#  wep_key0="aaaaa"
#  wep_key1="aaaaa"
#  wep_key2="aaaaa"
#  wep_key3="aaaaa"
#  wep_tx_keyidx=0
#  priority=5
#  auth_alg=SHARED
#}

#IBSS/ad-hoc with WPA-None/TKIP
#network={
#  ssid="test adhoc"
#  mode=1
#  proto=WPA
#  key_mgmt=WPA-NONE
#  pairwise=NONE
#  group=TKIP
#  psk="secret passphrase"
#}

[ 此帖被kazaya在2012-01-09 17:56重新编辑 ]
级别: 骑士
UID: 42149
精华: 2
发帖: 201
金钱: 1115 两
威望: 223 点
贡献值: 2 点
综合积分: 442 分
注册时间: 2011-04-05
最后登录: 2013-03-29
8楼  发表于: 2011-08-03 14:55
需要错误前相关的提示。
级别: 圣骑士
UID: 44407
精华: 0
发帖: 388
金钱: 1945 两
威望: 389 点
贡献值: 0 点
综合积分: 776 分
注册时间: 2011-04-25
最后登录: 2014-08-25
9楼  发表于: 2011-08-08 14:42
適用
編譯環境:Ubuntu 10.x/11.x 32bit  
Kernel 2.6.32.24
Target平台:Mini6410/Tiny6410
源碼版本:Android-2.3.4/Android2.3
HD space: 30~50G at least

Ubuntu 10.10/kernel 2.6.35-22-generic會出現這個問題

重新編譯Kernel 2.6.32.24(www.kernel.org下載)

錯誤:
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
解決:
Ubuntu install kernel 2.6.32.24
sudo apt-get install libncurses5-dev
make menuconfig
make -j2
make modules_install
make install
update-grub
重新開機
進入2.6.32.24選項





先前準備:
tar zxvf android-2.3.4-fs-20110722.tar.gz -C /home
tar zxvf android-kernel-2.6.36-20110721.tar.gz -C /home/Android-2.3.4
cp -r /home/Android-2.3.4/linux-2.6.36-android/config_android_n43  /home/Android-2.3.4/linux-2.6.36-android/.config
tar zxvf /home/Android-2.3.4/jdk1.6.0_23.tar.gz

一、準備工作,安裝編譯過程中需要的32位Library,需要使用root用戶權限操作安裝命令

Ubuntu
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline5-dev libreadline5 libz-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos  uuid  liblzo2-2 liblzo2-dev



二、修改 frameworks/base/libs/utils/Android.mk

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
改為
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)  -fpermissive
三、修改 build-android
因為源碼裡面的JDK1.6.0_23是32位版本,所以不能使用。將3-5,15行注釋掉,在15行下增加一行,重新加入你的JDK目錄,如果本身環境變量已經有了,可以不加
我改成了如下的內容
export PATH=/usr/java/jdk1.6.0_25/bin:PATH

四、修改build/core/main.mk(32bit請修改)
#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.)
+#$(warning ************************************************************)





五、編譯Android Kernel

複制.confign_android_n43 為.config
export ARCH=arm
#export CROSS_COMPILE=arm-eabi-
#make CC=arm-eabi-gcc -j2
export CROSS_COMPILE=arm-linux-
make CC=arm-linux-gcc -j2


六、到執行路徑

cd /home/Android-2.3.4



七、將PATH貼到终端機(命令視窗)

#PATH="/home/Android-2.3.4/jdk1.6.0_23/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/Android-2.3.4/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin"
PATH="/home/Android-2.3.4/jdk1.6.0_23/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/Android-2.3.4/prebuilt/linux-x86/toolchain/4.5.1/bin"
export JAVA_HOME=/home/Android-2.3.4/jdk1.6.0_23
export ANDROID_JAVA_HOME=$JAVA_HOME
export JAVA_BIN=/home/Android-2.3.4/jdk1.6.0_23/bin
export CLASSPATH=/home/Android-2.3.4/jdk1.6.0_23/lib/dt.jar:/home/Android-2.3.4/jdk1.6.0_23/lib/tools.jar
export ANDROID_PRODUCT_OUT=/home/Android-2.3.4/out/target/product/generic
export PATH=$PATH:/home/Android-2.3.4/out/target/product/generic
export PATH=$PATH:/home/Android-2.3.4/out/host/linux-x86/bin
source /home/Android-2.3.4/build/envsetup.sh
./setenv
export ECLIPSE_HOME=/home/eclipse


八、修改frameworks/base/services/camera/libcameraservice/Android.mk

錯誤:
make: *** No rule to make target 'out/target/product/generic/obj/lib/libcamera.so', needed by 'out/target/product/generic/obj/SHARED_LIBRARIES/libcameraservice_intermediates/LINKED/libcameraservice.so'.  Stop.
make: *** Waiting for unfinished jobs....
解決:
修改 /home/Android-2.3.4/frameworks/base/services/camera/libcameraservice/Android.mk,USE_CAMERA_STUB:=false ->ture


LOCAL_PATH:= $(call my-dir)

# Set USE_CAMERA_STUB if you don't want to use the hardware camera.

# force these builds to use camera stub only
ifneq ($(filter sooner generic sim,$(TARGET_DEVICE)),)
  USE_CAMERA_STUB:=true
endif

USE_CAMERA_STUB:=false->true

ifeq ($(USE_CAMERA_STUB),)
  USE_CAMERA_STUB:=false
endif



九、複制OpenSLESUT.h檔案到system/media/opensles/include/SLES/OpenSLESUT.h

target Strip: AudioInRecord (out/target/product/generic/obj/EXECUTABLES/AudioInRecord_intermediates/AudioInRecord)
target thumb C++: BufferQueue_test <= system/media/opensles/tests/automated/BufferQueue_test.cpp
system/media/opensles/tests/automated/BufferQueue_test.cpp:34:29: error: SLES/OpenSLESUT.h: No such file or directory
system/media/opensles/tests/automated/BufferQueue_test.cpp: In function 'void CheckErr(SLresult)':
system/media/opensles/tests/automated/BufferQueue_test.cpp:55: error: 'slesutResultToString' was not declared in this scope
make: *** [out/target/product/generic/obj/EXECUTABLES/BufferQueue_test_intermediates/BufferQueue_test.o] Error 1

BufferQueue_test.cpp內容的參考檔少OpenSLESUT.h, 直接複制到system/media/opensles/include/SLES/OpenSLESUT.h

#include <unistd.h>
#include "SLES/OpenSLES.h"
#include "SLES/OpenSLESUT.h"
#include <gtest/gtest.h>
cp /home/Android-2.3.4/system/media/opensles/libopensles/OpenSLESUT.h /home/Android-2.3.4/system/media/opensles/include/SLES/OpenSLESUT.h



十、配置Android支持WIFI

在 build/target/board/generic/BoardConfig.mk 中添加:
BOARD_HAVE_WIFI := true
BOARD_WPA_SUPPLICANT_DRIVER := WEXT
  
這將在external/wpa_supplicant/Android.mk設置WPA_BUILD_SUPPLICANT為true,
默認使用驅動driver_wext.c。

如果使用定制的wpa_supplicant驅動(例如 madwifi),可以設置:
BOARD_WPA_SUPPLICANT_DRIVER := MADWIFI

將在external/wpa_supplicant/common.c 中的MSG_INFO,改為MSG_DEBUG以增加輸出更多信息

wpa_debug_level = MSG_DEBUG;

#define wpa_printf宏中的
if ((level) >= MSG_INFO)
改為
if ((level) >= MSG_DEBUG)

external\wpa_supplicant\.config

# CONFIG_NO_WPA=y
CONFIG_OS=unix
CONFIG_IEEE8021X_EAPOL=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_PSK=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_PKCS12=y
CONFIG_SMARTCARD=y
CONFIG_WIRELESS_EXTENSION=y
CONFIG_CTRL_IFACE=y
CONFIG_DRIVER_WEXT=y

hardware/libhardware_legacy/wifi/wifi.c
將驅動直接編譯進內核
int wifi_load_driver()
{
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for completion */
LOGE("wifi driver loaded !");
return 0;
}
int wifi_unload_driver()
{
int count = 20; /* wait at most 10 seconds for completion */
LOGE("wifi driver unloaded by rockie!");
return 0;
注意這個定義static const char IFACE_DIR[] = "/data/system/wpa_supplicant";

編譯整個android系統,確認編譯完bin目錄中含有wpa_supplicant、wpa_cli





./build-android

make


這樣 "./build-android" 或 "make" 就會OK了


PS.另外編譯WIFI驅動為module或kernel built in請參考:

http://blog.csdn.net/louiswangbing/article/details/6618734
http://blog.csdn.net/zhenwenxian/article/details/6624575

関於
wpa_supplicant.conf 範例:/data/misc/wifi/wpa_supplicant.conf

# wpa_supplicant -dd -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf &



ctrl_interface=DIR=/data/misc/wifi
ctrl_interface_group=wifi
update_config=1


# Let wpa_supplicant search and select AP
ap_scan=1

# WPA-PSK, PSK use ASCII
#network={
#  ssid="Test1"
#  psk="1111111111"
#   #Higher priority use first
#  priority=5
#}

# The same as above, assign SSID for AP without brocast SSID
#network={
#  ssid="second ssid"
#  scan_ssid=1
#  psk="very secret passphrase"
#  priority=2
#}

# Allow WPA-PSK only. Allow any valid password set
#network={
#  ssid="example"
#  proto=WPA
#  key_mgmt=WPA-PSK
#  pairwise=CCMP TKIP
#  group=CCMP TKIP WEP104 WEP40
#  psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
#  priority=2
#}

# Plaintext( Not use 802.1X )
#network={
#  ssid="plaintext-test"
#  key_mgmt=NONE
#}

# Shared WEP, Not use IEEE 802.11 Shared Key
#network={
#  ssid="Test1"
#  key_mgmt=NONE
#  wep_key0='abcde'
#  wep_key1='abcde'
#  wep_key2='abcde'
#  wep_tx_keyidx=0
#  priority=5
#}

#Shared WEP, Use IEEE 802.11 Shared Key
#network={
#  ssid="Test1"
#  key_mgmt=NONE
#  wep_key0="aaaaa"
#  wep_key1="aaaaa"
#  wep_key2="aaaaa"
#  wep_key3="aaaaa"
#  wep_tx_keyidx=0
#  priority=5
#  auth_alg=SHARED
#}

#IBSS/ad-hoc with WPA-None/TKIP
#network={
#  ssid="test adhoc"
#  mode=1
#  proto=WPA
#  key_mgmt=WPA-NONE
#  pairwise=NONE
#  group=TKIP
#  psk="secret passphrase"
#}



錯誤:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] 錯誤 1
解決:
sudo apt-get install libc6-dev-i386
錯誤:
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] error 1
解決:
  sudo apt-get install g++-multilib

錯誤:
external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] Error 1

解決:
sudo apt-get install zlib1g-dev

錯誤:
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

解決:
sudo apt-get install lib32z1-dev


錯誤:
bison -d -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127

解決:
sudo apt-get install bison


錯誤:
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127

解決:
sudo apt-get install flex


錯誤:
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

解決:
sudo apt-get install lib32ncurses5-dev


錯誤:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/Android/main-common.o] Error 1

解決:
sudo apt-get install libx11-dev

錯誤:
sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 96.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'

解決:

sudo apt-get install gperf

運行emulat以後錯誤:

SDL init failure, reason is: No available video device: On Ubuntu64

apt-get install ia32-libs lib32stdc++6


錯誤:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] 錯誤 1
解決:
  sudo apt-get install libc6-dev-i386

錯誤:
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] error 1

解決:
  sudo apt-get install g++-multilib

錯誤:
external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] Error 1

解決:
sudo apt-get install zlib1g-dev


錯誤:
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

解決:
sudo apt-get install lib32z1-dev


錯誤:
bison -d  -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127

解決:
sudo apt-get install bison


錯誤:
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127

解決:
sudo apt-get install flex


錯誤:
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

解決:
sudo apt-get install lib32ncurses5-dev


錯誤:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error: X11/Xlib.h: No such file or directory
compilation terminated.
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/Android/main-common.o] Error 1

解決:
sudo apt-get install libx11-dev

錯誤:
sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 96.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'

解決:
sudo apt-get install gperf




錯誤訊息:
usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `PC'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `tgetflag'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `tgetent'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `UP'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `tputs'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `tgoto'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `tgetnum'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `BC'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../libreadline.so: undefined reference to `tgetstr'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/sqlite3_intermediates/sqlite3] Error 1
make: *** Waiting for unfinished jobs....

解決:

在google以及同事的幫助下找到發現這個問題的解釋,原因是由於沒有鏈接 ncurses庫,只要加上 -lncurses就可以了,解法如下:
由於與readline有關係,所以用以下指令查詢相關的.mk files:
find . -name "*.mk" -exec grep -nH lreadline {} \;
找到兩個相關檔
./external/wpa_supplicant/Android.mk:553:LIBS_c += -lncurses -lreadline
./external/sqlite/dist/Android.mk:105:LOCAL_LDLIBS += -lreadline

於是,我們修改./external/sqlite/dist/Android.mk中的第105行,
LOCAL_LDLIBS += -lncurses -lreadline

apt-get install lib32readline5-dev
[ 此帖被kazaya在2012-01-09 17:57重新编辑 ]