Android 交叉编译 IPerf3

I Config

$ cd iperf/

$ export PATH=/home/osa/android-ndk/bin:$PATH
$ ./configure --host=arm-linux CC=arm-linux-androideabi-gcc CXX=arm-linux-androideabi-g++ CFLAGS=-static CXXFLAGS=-static
 

II Edit net.c

--- net.c       2015-04-20 14:34:34.610766731 +0900

+++ net.c.org   2015-04-20 14:34:21.050766682 +0900
@@ -37,7 +37,7 @@
 #include <assert.h>
 #include <netdb.h>
 #include <string.h>
-#include <fcntl.h>
+#include <sys/fcntl.h>
 
 #ifdef HAVE_SENDFILE
 #ifdef linux
 

IV Edit iperf_api.c

--- iperf_api.c     2015-04-20 14:39:40.682767820 +0900

+++ iperf_api.c.org 2015-04-20 14:39:25.010767765 +0900
@@ -2570,7 +2570,7 @@
 {
     int i;
     struct iperf_stream *sp;
-    char template[] = "/data/local/tmp/iperf3.XXXXXX";
+    char template[] = "/tmp/iperf3.XXXXXX";
     h_errno = 0;
 

V Edit  src/Makefile

--- Makefile     2015-04-20 14:45:35.246769083 +0900

+++ Makefile.org 2015-04-20 14:45:25.982769050 +0900
@@ -596,9 +596,9 @@
 iperf3_profile_SOURCES = main.c
        $(libiperf_la_SOURCES)
 
-iperf3_profile_CFLAGS = -g
+iperf3_profile_CFLAGS = -pg -g
 iperf3_profile_LDADD = libiperf.la
-iperf3_profile_LDFLAGS = -g
+iperf3_profile_LDFLAGS = -pg -g
 
 # Specify the sources and various flags for the test cases
 t_timer_SOURCES = t_timer.c
 

VI Make

Ignore fatal error: sysexits.h: No such file or directory. and src/iperf3 is created
原文地址:https://www.cnblogs.com/blowing-in-the-wind/p/6037848.html