Android 移植之 iperf

來源:互聯網
上載者:User
1 .移植準備

       1 ,原始碼地址:

     http://sourceforge.net/projects/iperf/files/iperf/2.0.4%20source/iperf-2.0.4.tar.gz/download ,    下載 iperf-2.0.4.tar.gz ,並放到 Adroid_root/external ;

2 ,解壓到 Adroid_root/external/ iperf-2.0.4.tar.gz;

       tar –zxvf iperf-2.0.4.tar.gz

2.           建立 Android.mk

       cat Android.mk

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

 

LOCAL_SRC_FILES := /

compat/Thread.c /

compat/error.c /

compat/delay.cpp /

compat/gettimeofday.c /

compat/inet_ntop.c /

compat/inet_pton.c /

compat/signal.c /

compat/snprintf.c /

compat/string.c

 

LOCAL_SRC_FILES += /

src/Client.cpp /

src/Extractor.c /

src/Launch.cpp /

src/List.cpp /

src/Listener.cpp /

src/Locale.c /

src/PerfSocket.cpp /

src/ReportCSV.c /

src/ReportDefault.c /

src/Reporter.c /

src/Server.cpp /

src/Settings.cpp /

src/SocketAddr.c /

src/main.cpp /

src/sockets.c /

src/stdio.c /

src/tcp_window_size.c /

src/gnu_getopt.c /

src/gnu_getopt_long.c /

src/service.c

 

 

LOCAL_C_INCLUDES += /

$(LOCAL_PATH) /

$(LOCAL_PATH)/include

 

 

LOCAL_CFLAGS += -O2

 

LOCAL_CFLAGS += -DHAVE_CONFIG_H

 

 

 

LOCAL_LDLIBS += -lpthread

 

 

 

LOCAL_SHARED_LIBRARIES := libc libm libcutils libnetutils

 

 

 

LOCAL_MODULE := iperf

 

 

 

#LOCAL_FORCE_STATIC_EXECUTABLE := true

 

LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)

 

#LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)

 

#LOCAL_MODULE_TAGS := eng user

 

 

 

include $(BUILD_EXECUTABLE)

3.            先產生需要的標頭檔

       ./configure –host=arm

4.            代碼修改

將 external/testtools/iperf/src/Listener.cpp:382 行改成:

mreq.ipv6mr_ifindex = 0;

把 compact/signal.c 裡面的 #include "util.h"

改成 #include   “../include/util.h”

把 src/sockets.c 裡面的 #include "util.h"

改成 #include  “../include/util.h”

 

5.         編譯

$cd Adroid_root

$source build/envsetup.sh

$mmm external/iperf-2.0.4

 

6.         目標檔案

         在 Android_root/build/out/target/product/generic/symbols/system/bin/ 目錄下就可以看到你剛才編譯產生的檔案了;這個目錄裡的檔案是帶符號資訊的,方便調試

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.