Fix to expose openssl dependency
[platform/upstream/libwebsockets.git] / README.build.md
index 889f5ff..dd3494a 100644 (file)
@@ -13,7 +13,7 @@ create elaborate clean scripts to get a clean source tree, instead you
 simply remove your build directory.
 
 Libwebsockets has been tested to build successfully on the following platforms
-with SSL support (both OpenSSL/wolfSSL):
+with SSL support (for OpenSSL/wolfSSL/BoringSSL):
 
 - Windows (Visual Studio)
 - Windows (MinGW)
@@ -93,6 +93,14 @@ To get it to build on latest openssl (2016-04-10) it needed this approach
        cmake .. -DLWS_WITH_HTTP2=1 -DLWS_OPENSSL_INCLUDE_DIRS=/usr/local/include/openssl -DLWS_OPENSSL_LIBRARIES="/usr/local/lib64/libssl.so;/usr/local/lib64/libcrypto.so"
 ```
 
+Mac users have reported
+
+```
+ $ export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2k; cmake ..; make -j4
+```
+
+worked for them when using "homebrew" OpenSSL
+
 **NOTE5**:
 To build with debug info and _DEBUG for lower priority debug messages
 compiled in, use
@@ -114,12 +122,25 @@ and libnsl, and only builds in 64bit mode.
        $ make
  ```
 
+@section lcap Linux Capabilities
+
+On Linux, lws now lets you retain selected root capabilities when dropping
+privileges.  If libcap-dev or similar package is installed providing
+sys/capabilities.h, and libcap or similar package is installed providing
+libcap.so, CMake will enable the capability features.
+
+The context creation info struct .caps[] and .count_caps members can then
+be set by user code to enable selected root capabilities to survive the
+transition to running under an unprivileged user.
+
 @section cmq Quirk of cmake
 
 When changing cmake options, for some reason the only way to get it to see the
 changes sometimes is delete the contents of your build directory and do the
 cmake from scratch.
 
+deleting build/CMakeCache.txt may be enough.
+
 
 @section cmw Building on Windows (Visual Studio)
 
@@ -168,7 +189,7 @@ cmake from scratch.
 
 2. Fix up MinGW headers
 
-   a) Add the following lines to C:\MinGW\include\winsock2.h:
+   a) If still necessary, sdd the following lines to C:\MinGW\include\winsock2.h:
 ```
        #if(_WIN32_WINNT >= 0x0600)
 
@@ -184,9 +205,16 @@ cmake from scratch.
 
        #endif // (_WIN32_WINNT >= 0x0600)
 ```
+
+       Update crtdefs.h line 47 to say:
+
+```
+       typedef __int64 ssize_t;
+```
+
    b) Create C:\MinGW\include\mstcpip.h and copy and paste the content from following link into it:
-    
-   http://wine-unstable.sourcearchive.com/documentation/1.1.32/mstcpip_8h-source.html
+
+   https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/mstcpip.h
 
 3. Install CMake 2.6 or greater: http://cmake.org/cmake/resources/software.html
 
@@ -223,51 +251,19 @@ cmake from scratch.
        $ make install
 ```
 
-@section mbed3 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
+@section optee Building for OP-TEE
 
-1) Get a working mbed3 environment with arm-none-eabi-cs toolchain
-(available in Fedora, Ubuntu and other distros)
+OP-TEE is a "Secure World" Trusted Execution Environment.
 
-2) Confirm you can build things using yotta by following the getting started guide here
+Although lws is only part of the necessary picture to have an https-enabled
+TA, it does support OP-TEE as a platform and if you provide the other
+pieces, does work very well.
 
-https://docs.mbed.com/docs/getting-started-mbed-os/en/latest/
+Select it in cmake with `-DLWS_PLAT_OPTEE=1`
 
-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
 
 @section cmco Setting compile options
 
-
 To set compile time flags you can either use one of the CMake gui applications
 or do it via the command line.
 
@@ -327,6 +323,26 @@ this to work.
 
 **NOTE**: On windows use the .lib file extension for `LWS_CYASSL_LIBRARIES` instead.
 
+@section esp32 Building for ESP32
+
+Step 1, get ESP-IDF with lws integrated as a component
+
+```
+    $ git clone --int --recursive https://github.com/lws-team/lws-esp-idf
+```
+
+Step 2: Get Application including the test plugins
+
+```
+    $ git clone https://github.com/lws-team/lws-esp32
+```
+
+Set your IDF_PATH to point to the esp-idf you downloaded in 1)
+
+There's docs for how to build the lws-esp32 test app and reproduce it in the README.md here
+
+https://github.com/lws-team/lws-esp32/blob/master/README.md
+
 
 @section extplugins Building plugins outside of lws itself
 
@@ -395,7 +411,7 @@ The commandline to configure for cross with this would look like
 ```
        $ cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr \
                 -DCMAKE_TOOLCHAIN_FILE=../cross-arm-linux-gnueabihf.cmake \
-                -DWITHOUT_EXTENSIONS=1 -DWITH_SSL=0
+                -DLWS_WITHOUT_EXTENSIONS=1 -DLWS_WITH_SSL=0
 ```
 The example shows how to build with no external cross lib dependencies, you
 need to provide the cross libraries otherwise.