recv revert treating zero as hangup
[platform/upstream/libwebsockets.git] / README.build.md
index 7be216e..b188a59 100644 (file)
@@ -86,6 +86,14 @@ Building on Unix:
        $ LD_LIBRARY_PATH=/usr/local/ssl/lib libwebsockets-test-server --ssl
     ```
 
+       **NOTE5**:
+       To build with debug info and _DEBUG for lower priority debug messages
+       compiled in, use
+
+    ```bash
+       $ cmake .. -DCMAKE_BUILD_TYPE=DEBUG
+    ````
+
 4. Finally you can build using the generated Makefile:
 
     ```bash
@@ -129,6 +137,15 @@ Building on Windows (Visual Studio)
 4. Now you should have a generated Visual Studio Solution in  your
    `<path to src>/build` directory, which can be used to build.
 
+5. Some additional deps may be needed
+
+ - iphlpapi.lib
+ - psapi.lib
+ - userenv.lib
+
+6. If you're using libuv, you must make sure to compile libuv with the same multithread-dll / Mtd attributes as libwebsockets itself
+
+
 Building on Windows (MinGW)
 ---------------------------
 1. Install MinGW: http://sourceforge.net/projects/mingw/files
@@ -139,19 +156,21 @@ Building on Windows (MinGW)
 
    a) Add the following lines to C:\MinGW\include\winsock2.h:
    
-#if(_WIN32_WINNT >= 0x0600)
+   ```c
+   #if(_WIN32_WINNT >= 0x0600)
 
-typedef struct pollfd {
+   typedef struct pollfd {
 
-    SOCKET  fd;
-    SHORT   events;
-    SHORT   revents;
+       SOCKET  fd;
+       SHORT   events;
+       SHORT   revents;
 
-} WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD;
+   } WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD;
 
-WINSOCK_API_LINKAGE int WSAAPI WSAPoll(LPWSAPOLLFD fdArray, ULONG fds, INT timeout);
+   WINSOCK_API_LINKAGE int WSAAPI WSAPoll(LPWSAPOLLFD fdArray, ULONG fds, INT timeout);
 
-#endif // (_WIN32_WINNT >= 0x0600)
+   #endif // (_WIN32_WINNT >= 0x0600)
+   ```
 
    b) Create C:\MinGW\include\mstcpip.h and copy and paste the content from following link into it:
     
@@ -214,6 +233,49 @@ Then to set an option and build (for example turn off SSL support):
 or
        cmake -DLWS_WITH_SSL:BOOL=OFF ..
 
+Building on mbed3
+-----------------
+MBED3 is a non-posix embedded OS targeted on Cortex M class chips.
+
+https://www.mbed.com/
+
+It's quite unlike any other Posixy platform since the OS is linked statically
+in with lws to form one binary.
+
+At the minute server-only is supported and due to bugs in mbed3 network support,
+the port is of alpha quality.  However it can serve the test html, favicon.ico
+and logo png and may be able to make ws connections.  The binary for that
+including the OS, test app, lws and all the assets is only 117KB.
+
+0) Today mbed3 only properly works on FRDM K64F $35 Freescale Dev Board with
+1MB Flash, 256KB SRAM and Ethernet.
+
+http://www.freescale.com/products/arm-processors/kinetis-cortex-m/k-series/k6x-ethernet-mcus/freescale-freedom-development-platform-for-kinetis-k64-k63-and-k24-mcus:FRDM-K64F
+
+1) Get a working mbed3 environment with arm-none-eabi-cs toolchain
+(available in Fedora, Ubuntu and other distros)
+
+2) Confirm you can build things using yotta by following the getting started guide here
+
+https://docs.mbed.com/docs/getting-started-mbed-os/en/latest/
+
+3)
+
+git clone https://github.com/warmcat/lws-test-server
+
+and cd into it
+
+4) mkdir -p yotta_modules ; cd yotta_modules
+
+5) git clone https://github.com/warmcat/libwebsockets ; mv libwebsockets websockets ; cd ..
+
+6) yotta target frdm-k64f-gcc
+
+7) yotta install
+
+8) yotta build
+
+
 Unix GUI
 --------
 If you have a curses-enabled build you simply type: