-
gcc 5.4.0 or a compiler able to compile -std=c++11
-
cmake 3.0.2
-
duktape 2.2.1 http://duktape.org/duktape-2.2.1.tar.xz
-
libwebsockets version 3.0 stable https://github.com/warmcat/libwebsockets
-
libarchive release (3.2.2) https://github.com/libarchive/libarchive
-
boost 1.61.0 boost::filesystem and boost::dll (header)
-
libdl on systems other than Windows
Some of these requirements are not absolute lower boundaries but rather tested versions
Duktape doesn't need to be complied separately (it is compiled with the program), thus only the files are required.
Inside duktape folder configure duktape.
python2 tools/configure.py --output-directory src -UDUK_USE_FATAL_HANDLER -UDUK_USE_VERBOSE_ERRORS -UDUK_USE_CPP_EXCEPTIONS
Duktape default path can be configured with env DUKTAPE_PATH and extras path can be controlled with evn DUKTAPE_EXTRAS_DIR. Paths to both duktape env variables are treated as relative paths. Default configure should work but it is not tested properly
CMake assumes that duktape is located at "../duktape-2.2.1/" so one might want to look at the path if that's not the case. Might change in later releases.
mkdir build && cd build
cmake ..
make
sudo make install
will try to install the package globally if that's needed
- Copy examples/example_config.json
cp examples/example_config.json build/config.json
- Change all
hostname
andport
parameters accordingly (these are mandatory) - Change
url
parameters (only used for visibility and might be needed to communicate from outside) - Everything else important is generated automatically (although only device id will be overwritten if not apppropriate)
- All string parameters will be saved as string (only native configs can be other than string)
- Only parameters used in example_config.json are natively used (although other parameters will be visible eg.
"device" : { "serial":"asdf" }
)
Check for "examples/test" and "examples/test2" for example applications that are using the features supported by current runtime.
The runtime should start properly even when configuration is not correct.
To enable debug prints one should use -DCMAKE_BUILD_TYPE=Debug
in cmake flags.