ithewei / libhv

🔥 比libevent/libuv/asio更易用的网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket/MQTT client/server.
https://github.com/ithewei/libhv/wiki
BSD 3-Clause "New" or "Revised" License
6.7k stars 1.22k forks source link

How to compile for android on mac? #159

Closed sergeymild closed 2 years ago

sergeymild commented 2 years ago

He, maybe you can help me? i have receive this error: /bin/sh: arm-linux-gnueabi-gcc: command not found

make[1]: [Makefile.in:275: clean] Error 1 (ignored)
#-rm -r 2>/dev/null lib
#-rm -r 2>/dev/null bin
make[1]: Leaving directory '/Users/sergeigolishnikov/develpment/libhv'
rm -r 2>/dev/null examples/*.o examples/*/*.o
make: [Makefile:72: clean] Error 1 (ignored)
rm -r 2>/dev/null include/hv
make: [Makefile:73: clean] Error 1 (ignored)
ithewei commented 2 years ago

Use arm-linux-gnueabi-gcc for android? You should install ndk in order to compile for android,the specific compilation steps can be found in BUILD.md

sergeymild commented 2 years ago

I did everything by BUILD.md for android, but i still receive this errors

make -f Makefile.in clean SRCDIRS=". base ssl event event/kcp util cpputil evpp protocol http http/client http/server mqtt"
make[1]: Entering directory '/Users/sergeigolishnikov/Downloads/libhv'
Android (7019983 based on r365631c3) clang version 9.0.9 (https://android.googlesource.com/toolchain/llvm-project a2a1e703c0edb03ba29944e529ccbf457742737b) (based on LLVM 9.0.9svn)
OS   = Android
ARCH = aarch64
MAKE = make
CC   = aarch64-linux-android-gcc
CXX  = aarch64-linux-android-g++
CFLAGS   = -O2 -fPIC -std=c99
CXXFLAGS = -O2 -fPIC -std=c++11
CPPFLAGS = -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Ievent/kcp -Iutil -Icpputil -Ievpp -Iprotocol -Ihttp -Ihttp/client -Ihttp/server -Imqtt
LDFLAGS  = -Llib -L3rd/lib -L3rd/lib/aarch64-unknown-linux-android21  -lstdc++ -lm -llog -ldl
TARGET           = test
TARGET_TYPE      = EXECUTABLE
TARGET_PLATFORM  = aarch64-unknown-linux-android21
BUILD_TYPE       = RELEASE
SRCS=base/hbase.c base/hmain.c base/herr.c base/hversion.c base/hsocket.c base/hlog.c base/rbtree.c base/htime.c ssl/wintls.c ssl/hssl.c ssl/mbedtls.c ssl/gnutls.c ssl/openssl.c ssl/appletls.c ssl/nossl.c event/select.c event/iocp.c event/kqueue.c event/noevent.c event/overlapio.c event/unpack.c event/nio.c event/hevent.c event/epoll.c event/hloop.c event/rudp.c event/nlog.c event/poll.c event/evport.c event/kcp/hkcp.c event/kcp/ikcp.c util/base64.c util/md5.c util/sha1.c cpputil/iniparser.cpp cpputil/hurl.cpp cpputil/hpath.cpp cpputil/ifconfig.cpp cpputil/ThreadLocalStorage.cpp cpputil/RAII.cpp cpputil/hstring.cpp cpputil/hdir.cpp cpputil/hasync.cpp protocol/icmp.c protocol/smtp.c protocol/ftp.c protocol/dns.c http/websocket_parser.c http/httpdef.c http/http_parser.c http/multipart_parser.c http/wsdef.c http/Http2Parser.cpp http/HttpMessage.cpp http/http_content.cpp http/Http1Parser.cpp http/WebSocketParser.cpp http/HttpParser.cpp http/client/http_client.cpp http/client/AsyncHttpClient.cpp http/client/WebSocketClient.cpp http/server/HttpService.cpp http/server/http_page.cpp http/server/HttpServer.cpp http/server/FileCache.cpp http/server/HttpHandler.cpp mqtt/mqtt_protocol.c mqtt/mqtt_client.c
OBJS=base/hbase.o base/hmain.o base/herr.o base/hversion.o base/hsocket.o base/hlog.o base/rbtree.o base/htime.o ssl/wintls.o ssl/hssl.o ssl/mbedtls.o ssl/gnutls.o ssl/openssl.o ssl/appletls.o ssl/nossl.o event/select.o event/iocp.o event/kqueue.o event/noevent.o event/overlapio.o event/unpack.o event/nio.o event/hevent.o event/epoll.o event/hloop.o event/rudp.o event/nlog.o event/poll.o event/evport.o event/kcp/hkcp.o event/kcp/ikcp.o util/base64.o util/md5.o util/sha1.o cpputil/iniparser.o cpputil/hurl.o cpputil/hpath.o cpputil/ifconfig.o cpputil/ThreadLocalStorage.o cpputil/RAII.o cpputil/hstring.o cpputil/hdir.o cpputil/hasync.o protocol/icmp.o protocol/smtp.o protocol/ftp.o protocol/dns.o http/websocket_parser.o http/httpdef.o http/http_parser.o http/multipart_parser.o http/wsdef.o http/Http2Parser.o http/HttpMessage.o http/http_content.o http/Http1Parser.o http/WebSocketParser.o http/HttpParser.o http/client/http_client.o http/client/AsyncHttpClient.o http/client/WebSocketClient.o http/server/HttpService.o http/server/http_page.o http/server/HttpServer.o http/server/FileCache.o http/server/HttpHandler.o mqtt/mqtt_protocol.o mqtt/mqtt_client.o
rm -r 2>/dev/null base/hbase.o base/hmain.o base/herr.o base/hversion.o base/hsocket.o base/hlog.o base/rbtree.o base/htime.o ssl/wintls.o ssl/hssl.o ssl/mbedtls.o ssl/gnutls.o ssl/openssl.o ssl/appletls.o ssl/nossl.o event/select.o event/iocp.o event/kqueue.o event/noevent.o event/overlapio.o event/unpack.o event/nio.o event/hevent.o event/epoll.o event/hloop.o event/rudp.o event/nlog.o event/poll.o event/evport.o event/kcp/hkcp.o event/kcp/ikcp.o util/base64.o util/md5.o util/sha1.o cpputil/iniparser.o cpputil/hurl.o cpputil/hpath.o cpputil/ifconfig.o cpputil/ThreadLocalStorage.o cpputil/RAII.o cpputil/hstring.o cpputil/hdir.o cpputil/hasync.o protocol/icmp.o protocol/smtp.o protocol/ftp.o protocol/dns.o http/websocket_parser.o http/httpdef.o http/http_parser.o http/multipart_parser.o http/wsdef.o http/Http2Parser.o http/HttpMessage.o http/http_content.o http/Http1Parser.o http/WebSocketParser.o http/HttpParser.o http/client/http_client.o http/client/AsyncHttpClient.o http/client/WebSocketClient.o http/server/HttpService.o http/server/http_page.o http/server/HttpServer.o http/server/FileCache.o http/server/HttpHandler.o mqtt/mqtt_protocol.o mqtt/mqtt_client.o
make[1]: [Makefile.in:275: clean] Error 1 (ignored)
#-rm -r 2>/dev/null lib
#-rm -r 2>/dev/null bin
make[1]: Leaving directory '/Users/sergeigolishnikov/Downloads/libhv'
rm -r 2>/dev/null examples/*.o examples/*/*.o
make: [Makefile:72: clean] Error 1 (ignored)
rm -r 2>/dev/null include/hv
make: [Makefile:73: clean] Error 1 (ignored)

and if i skip this and make make libhv i receive:

mkdir -p 2>/dev/null lib
make -f Makefile.in TARGET=libhv TARGET_TYPE="SHARED|STATIC" SRCDIRS=". base ssl event util cpputil evpp http http/server http/client"
make[1]: Entering directory '/Users/sergeigolishnikov/Downloads/libhv'
Android (7019983 based on r365631c3) clang version 9.0.9 (https://android.googlesource.com/toolchain/llvm-project a2a1e703c0edb03ba29944e529ccbf457742737b) (based on LLVM 9.0.9svn)
OS   = Android
ARCH = aarch64
MAKE = make
CC   = aarch64-linux-android-gcc
CXX  = aarch64-linux-android-g++
CFLAGS   = -O2 -fPIC -std=c99
CXXFLAGS = -O2 -fPIC -std=c++11
CPPFLAGS = -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client
LDFLAGS  = -Llib -L3rd/lib -L3rd/lib/aarch64-unknown-linux-android21  -lstdc++ -lm -llog -ldl
TARGET           = libhv
TARGET_TYPE      = SHARED|STATIC
TARGET_PLATFORM  = aarch64-unknown-linux-android21
BUILD_TYPE       = RELEASE
SRCS=base/hbase.c base/hmain.c base/herr.c base/hversion.c base/hsocket.c base/hlog.c base/rbtree.c base/htime.c ssl/wintls.c ssl/hssl.c ssl/mbedtls.c ssl/gnutls.c ssl/openssl.c ssl/appletls.c ssl/nossl.c event/select.c event/iocp.c event/kqueue.c event/noevent.c event/overlapio.c event/unpack.c event/nio.c event/hevent.c event/epoll.c event/hloop.c event/rudp.c event/nlog.c event/poll.c event/evport.c util/base64.c util/md5.c util/sha1.c cpputil/iniparser.cpp cpputil/hurl.cpp cpputil/hpath.cpp cpputil/ifconfig.cpp cpputil/ThreadLocalStorage.cpp cpputil/RAII.cpp cpputil/hstring.cpp cpputil/hdir.cpp cpputil/hasync.cpp http/websocket_parser.c http/httpdef.c http/http_parser.c http/multipart_parser.c http/wsdef.c http/Http2Parser.cpp http/HttpMessage.cpp http/http_content.cpp http/Http1Parser.cpp http/WebSocketParser.cpp http/HttpParser.cpp http/server/HttpService.cpp http/server/http_page.cpp http/server/HttpServer.cpp http/server/FileCache.cpp http/server/HttpHandler.cpp http/client/http_client.cpp http/client/AsyncHttpClient.cpp http/client/WebSocketClient.cpp
OBJS=base/hbase.o base/hmain.o base/herr.o base/hversion.o base/hsocket.o base/hlog.o base/rbtree.o base/htime.o ssl/wintls.o ssl/hssl.o ssl/mbedtls.o ssl/gnutls.o ssl/openssl.o ssl/appletls.o ssl/nossl.o event/select.o event/iocp.o event/kqueue.o event/noevent.o event/overlapio.o event/unpack.o event/nio.o event/hevent.o event/epoll.o event/hloop.o event/rudp.o event/nlog.o event/poll.o event/evport.o util/base64.o util/md5.o util/sha1.o cpputil/iniparser.o cpputil/hurl.o cpputil/hpath.o cpputil/ifconfig.o cpputil/ThreadLocalStorage.o cpputil/RAII.o cpputil/hstring.o cpputil/hdir.o cpputil/hasync.o http/websocket_parser.o http/httpdef.o http/http_parser.o http/multipart_parser.o http/wsdef.o http/Http2Parser.o http/HttpMessage.o http/http_content.o http/Http1Parser.o http/WebSocketParser.o http/HttpParser.o http/server/HttpService.o http/server/http_page.o http/server/HttpServer.o http/server/FileCache.o http/server/HttpHandler.o http/client/http_client.o http/client/AsyncHttpClient.o http/client/WebSocketClient.o
mkdir -p 2>/dev/null bin lib
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/hbase.o base/hbase.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/hmain.o base/hmain.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/herr.o base/herr.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/hversion.o base/hversion.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/hsocket.o base/hsocket.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/hlog.o base/hlog.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/rbtree.o base/rbtree.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o base/htime.o base/htime.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o ssl/wintls.o ssl/wintls.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o ssl/hssl.o ssl/hssl.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o ssl/mbedtls.o ssl/mbedtls.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o ssl/gnutls.o ssl/gnutls.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o ssl/openssl.o ssl/openssl.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o ssl/appletls.o ssl/appletls.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o ssl/nossl.o ssl/nossl.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/select.o event/select.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/iocp.o event/iocp.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/kqueue.o event/kqueue.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/noevent.o event/noevent.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/overlapio.o event/overlapio.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/unpack.o event/unpack.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/nio.o event/nio.c
event/nio.c:515:17: warning: format specifies type 'int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                len, (unsigned int)(remain.len - remain.offset),
                ^~~
base/hlog.h:158:68: note: expanded from macro 'hlogw'
#define hlogw(...) __android_log_print(ANDROID_LOG_WARN,  LOG_TAG, __VA_ARGS__)
                                                                   ^~~~~~~~~~~
1 warning generated.
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/hevent.o event/hevent.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/epoll.o event/epoll.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/hloop.o event/hloop.c
event/hloop.c:184:31: warning: format specifies type 'unsigned long long' but the argument has type 'unsigned long' [-Wformat]
        loop->pid, loop->tid, loop->cur_hrtime - loop->start_hrtime, loop->loop_cnt,
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
base/hlog.h:156:68: note: expanded from macro 'hlogd'
#define hlogd(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
                                                                   ^~~~~~~~~~~
event/hloop.c:184:70: warning: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Wformat]
        loop->pid, loop->tid, loop->cur_hrtime - loop->start_hrtime, loop->loop_cnt,
                                                                     ^~~~~~~~~~~~~~
base/hlog.h:156:68: note: expanded from macro 'hlogd'
#define hlogd(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
                                                                   ^~~~~~~~~~~
2 warnings generated.
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/rudp.o event/rudp.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/nlog.o event/nlog.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/poll.o event/poll.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o event/evport.o event/evport.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o util/base64.o util/base64.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o util/md5.o util/md5.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o util/sha1.o util/sha1.c
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/iniparser.o cpputil/iniparser.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/hurl.o cpputil/hurl.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/hpath.o cpputil/hpath.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/ifconfig.o cpputil/ifconfig.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/ThreadLocalStorage.o cpputil/ThreadLocalStorage.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/RAII.o cpputil/RAII.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/hstring.o cpputil/hstring.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/hdir.o cpputil/hdir.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o cpputil/hasync.o cpputil/hasync.cpp
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/websocket_parser.o http/websocket_parser.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/httpdef.o http/httpdef.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/http_parser.o http/http_parser.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/multipart_parser.o http/multipart_parser.c
aarch64-linux-android-gcc -O2 -fPIC -std=c99 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/wsdef.o http/wsdef.c
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/Http2Parser.o http/Http2Parser.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/HttpMessage.o http/HttpMessage.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/http_content.o http/http_content.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/Http1Parser.o http/Http1Parser.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/WebSocketParser.o http/WebSocketParser.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/HttpParser.o http/HttpParser.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/server/HttpService.o http/server/HttpService.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/server/http_page.o http/server/http_page.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/server/HttpServer.o http/server/HttpServer.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/server/FileCache.o http/server/FileCache.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/server/HttpHandler.o http/server/HttpHandler.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/client/http_client.o http/client/http_client.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/client/AsyncHttpClient.o http/client/AsyncHttpClient.cpp
aarch64-linux-android-g++ -O2 -fPIC -std=c++11 -DNDEBUG  -Iinclude -I3rd -I3rd/include -I. -Ibase -Issl -Ievent -Iutil -Icpputil -Ievpp -Ihttp -Ihttp/server -Ihttp/client  -c -o http/client/WebSocketClient.o http/client/WebSocketClient.cpp
aarch64-linux-android-gcc -shared base/hbase.o base/hmain.o base/herr.o base/hversion.o base/hsocket.o base/hlog.o base/rbtree.o base/htime.o ssl/wintls.o ssl/hssl.o ssl/mbedtls.o ssl/gnutls.o ssl/openssl.o ssl/appletls.o ssl/nossl.o event/select.o event/iocp.o event/kqueue.o event/noevent.o event/overlapio.o event/unpack.o event/nio.o event/hevent.o event/epoll.o event/hloop.o event/rudp.o event/nlog.o event/poll.o event/evport.o util/base64.o util/md5.o util/sha1.o cpputil/iniparser.o cpputil/hurl.o cpputil/hpath.o cpputil/ifconfig.o cpputil/ThreadLocalStorage.o cpputil/RAII.o cpputil/hstring.o cpputil/hdir.o cpputil/hasync.o http/websocket_parser.o http/httpdef.o http/http_parser.o http/multipart_parser.o http/wsdef.o http/Http2Parser.o http/HttpMessage.o http/http_content.o http/Http1Parser.o http/WebSocketParser.o http/HttpParser.o http/server/HttpService.o http/server/http_page.o http/server/HttpServer.o http/server/FileCache.o http/server/HttpHandler.o http/client/http_client.o http/client/AsyncHttpClient.o http/client/WebSocketClient.o -o lib/libhv.so -Llib -L3rd/lib -L3rd/lib/aarch64-unknown-linux-android21  -lstdc++ -lm -llog -ldl
aarch64-linux-android-ar rv lib/libhv.a base/hbase.o base/hmain.o base/herr.o base/hversion.o base/hsocket.o base/hlog.o base/rbtree.o base/htime.o ssl/wintls.o ssl/hssl.o ssl/mbedtls.o ssl/gnutls.o ssl/openssl.o ssl/appletls.o ssl/nossl.o event/select.o event/iocp.o event/kqueue.o event/noevent.o event/overlapio.o event/unpack.o event/nio.o event/hevent.o event/epoll.o event/hloop.o event/rudp.o event/nlog.o event/poll.o event/evport.o util/base64.o util/md5.o util/sha1.o cpputil/iniparser.o cpputil/hurl.o cpputil/hpath.o cpputil/ifconfig.o cpputil/ThreadLocalStorage.o cpputil/RAII.o cpputil/hstring.o cpputil/hdir.o cpputil/hasync.o http/websocket_parser.o http/httpdef.o http/http_parser.o http/multipart_parser.o http/wsdef.o http/Http2Parser.o http/HttpMessage.o http/http_content.o http/Http1Parser.o http/WebSocketParser.o http/HttpParser.o http/server/HttpService.o http/server/http_page.o http/server/HttpServer.o http/server/FileCache.o http/server/HttpHandler.o http/client/http_client.o http/client/AsyncHttpClient.o http/client/WebSocketClient.o
aarch64-linux-android-ar: creating lib/libhv.a
a - base/hbase.o
a - base/hmain.o
a - base/herr.o
a - base/hversion.o
a - base/hsocket.o
a - base/hlog.o
a - base/rbtree.o
a - base/htime.o
a - ssl/wintls.o
a - ssl/hssl.o
a - ssl/mbedtls.o
a - ssl/gnutls.o
a - ssl/openssl.o
a - ssl/appletls.o
a - ssl/nossl.o
a - event/select.o
a - event/iocp.o
a - event/kqueue.o
a - event/noevent.o
a - event/overlapio.o
a - event/unpack.o
a - event/nio.o
a - event/hevent.o
a - event/epoll.o
a - event/hloop.o
a - event/rudp.o
a - event/nlog.o
a - event/poll.o
a - event/evport.o
a - util/base64.o
a - util/md5.o
a - util/sha1.o
a - cpputil/iniparser.o
a - cpputil/hurl.o
a - cpputil/hpath.o
a - cpputil/ifconfig.o
a - cpputil/ThreadLocalStorage.o
a - cpputil/RAII.o
a - cpputil/hstring.o
a - cpputil/hdir.o
a - cpputil/hasync.o
a - http/websocket_parser.o
a - http/httpdef.o
a - http/http_parser.o
a - http/multipart_parser.o
a - http/wsdef.o
a - http/Http2Parser.o
a - http/HttpMessage.o
a - http/http_content.o
a - http/Http1Parser.o
a - http/WebSocketParser.o
a - http/HttpParser.o
a - http/server/HttpService.o
a - http/server/http_page.o
a - http/server/HttpServer.o
a - http/server/FileCache.o
a - http/server/HttpHandler.o
a - http/client/http_client.o
a - http/client/AsyncHttpClient.o
a - http/client/WebSocketClient.o
make[1]: Leaving directory '/Users/sergeigolishnikov/Downloads/libhv'
mkdir -p 2>/dev/null include/hv
cp -r 2>/dev/null hv.h hconfig.h hexport.h base/hplatform.h base/hdef.h base/hatomic.h base/herr.h base/htime.h base/hmath.h base/hbase.h base/hversion.h base/hsysinfo.h base/hproc.h base/hthread.h base/hmutex.h base/hsocket.h base/hssl.h base/hlog.h base/hbuf.h base/hmain.h base/hendian.h  ssl/hssl.h event/hloop.h event/nlog.h  util/base64.h util/md5.h util/sha1.h  cpputil/hmap.h cpputil/hstring.h cpputil/hfile.h cpputil/hpath.h cpputil/hdir.h cpputil/hurl.h cpputil/hscope.h cpputil/hthreadpool.h cpputil/hasync.h cpputil/hobjectpool.h cpputil/ifconfig.h cpputil/iniparser.h cpputil/json.hpp cpputil/singleton.h cpputil/ThreadLocalStorage.h  evpp/Buffer.h evpp/Channel.h evpp/Event.h evpp/EventLoop.h evpp/EventLoopThread.h evpp/EventLoopThreadPool.h evpp/Status.h evpp/TcpClient.h evpp/TcpServer.h evpp/UdpClient.h evpp/UdpServer.h  http/httpdef.h http/wsdef.h http/http_content.h http/HttpMessage.h http/HttpParser.h http/WebSocketParser.h http/WebSocketChannel.h  http/server/HttpServer.h http/server/HttpService.h http/server/HttpContext.h http/server/HttpResponseWriter.h http/server/WebSocketServer.h  http/client/http_client.h http/client/requests.h http/client/axios.h http/client/WebSocketClient.h  include/hv
make: [Makefile:82: libhv] Error 1 (ignored)
ithewei commented 2 years ago

Error 1 (ignored) This is an error that can be ignored,include and lib/libhv.so is OK.

sergeymild commented 2 years ago

Yes it's working) and one more question how to build for all architectures for example i need x86_64, arm64-v8a and armeabi-v7a. Thanks)

ithewei commented 2 years ago

This is not something libhv should teach. Maybe you can google some cross-compilation problems. As far as I know, it is not possible to compile all architectures into a dynamic library on android platform. You can only compile for these architectures separately,aarch64-linux-android-gcc for arm64,arm-linux-android-gcc for arm,and x86_64-linux-android-gcc for x86_64.

sergeymild commented 2 years ago

thank you for answering.

sergeymild commented 2 years ago

also i started receive this error:

base/hmain.c:567:57: error: implicit declaration of function 'gettid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    hlogi("worker_thread pid=%ld tid=%ld", hv_getpid(), hv_gettid());