Skip to content

Commit

Permalink
make android build happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
u0u0 committed Oct 10, 2013
1 parent cbe79de commit 067c913
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ endif(UNIX)


if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set( CMAKE_C_FLAGS "-Wall -Werror -O4 -fvisibility=hidden ${CMAKE_C_FLAGS}" )
set( CMAKE_C_FLAGS "-Wall -O4 -fvisibility=hidden ${CMAKE_C_FLAGS}" )
endif ()

source_group("Headers Private" FILES ${HDR_PRIVATE})
Expand Down
24 changes: 10 additions & 14 deletions README
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
This is the libwebsockets C library for lightweight websocket clients and
servers. For support, visit
TO build lib, need install cmake.

http://libwebsockets.org
iOS:
$cd libwebsockets/ios
$./build_framework.py buildname

and consider joining the project mailing list at

http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
Android:
$export ANDROID_NDK=/absolute/path/to/the/android-ndk
$cd libwebsockets/android
$./scripts/cmake_android_armeabi.sh

You can get the latest version of the library from git
If you Android NDK is x86_64, you may need put below code to android.toolchain.cmake

http://git.libwebsockets.org
https://github.com/warmcat/libwebsockets

for more information:

README.build - information on building the library
README.coding - information for writing code using the library
README.test-apps - information about the test apps built with the library
set( ANDROID_NDK_HOST_X64 1 CACHE BOOL "Try to use 64-bit compiler toolchain" )

10 changes: 5 additions & 5 deletions test-server/test-ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ int main(int argc, char **argv)
char ip[30];
#ifndef WIN32
struct sigaction sa;
struct winsize w;
//struct winsize w;
#endif
struct timeval tv;
unsigned long oldus = 0;
Expand Down Expand Up @@ -420,10 +420,10 @@ int main(int argc, char **argv)
}

#ifndef WIN32
if (isatty(STDOUT_FILENO))
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
if (w.ws_col > 0)
screen_width = w.ws_col;
//if (isatty(STDOUT_FILENO))
// if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
// if (w.ws_col > 0)
// screen_width = w.ws_col;
#endif

info.port = CONTEXT_PORT_NO_LISTEN;
Expand Down

0 comments on commit 067c913

Please sign in to comment.