2012-10-29 06:12:39 +00:00
|
|
|
Serval DNA Build and Test
|
|
|
|
=========================
|
2016-09-19 04:01:49 +00:00
|
|
|
[Serval Project][], September 2016
|
2013-03-06 01:13:44 +00:00
|
|
|
|
2014-02-14 07:23:31 +00:00
|
|
|
Supported Architectures
|
|
|
|
-----------------------
|
2012-10-29 06:12:39 +00:00
|
|
|
|
2014-02-14 07:23:31 +00:00
|
|
|
These instructions will build [Serval DNA][] successfully for the following platforms:
|
2012-10-29 06:12:39 +00:00
|
|
|
|
2016-09-19 04:01:49 +00:00
|
|
|
* Debian Linux, ix86 and x86\_64, kernel versions 2.6 to 4.6, using [gcc
|
|
|
|
4.4][] and later, [gcc 5][] and [gcc 6][]
|
|
|
|
* Mac OS-X x86\_64, releases 10.7 “Lion” to 10.11 “El Capitan”, using
|
|
|
|
[Xcode][] versions 3.2 to 8, and GNU tools available from [homebrew][]
|
2016-01-26 13:26:27 +00:00
|
|
|
* Oracle SunOs 5.10 (Solaris), Sparc, using [gcc 4.4][] and GNU tools
|
|
|
|
installed
|
2014-02-14 07:23:31 +00:00
|
|
|
|
|
|
|
[Serval DNA][] also runs on the following platforms, to which these build
|
|
|
|
instructions do not apply:
|
|
|
|
|
|
|
|
* [Android 2.2 “Froyo”][], Arm, Linux kernels 2.6.x and 3.x, using [gcc 4.4][]
|
|
|
|
supplied as part of [Android NDK][] Revision 7b
|
2014-03-05 04:56:28 +00:00
|
|
|
* [OpenWRT][] (as used by the [Serval Mesh Extender][], the [Mesh Potato][],
|
|
|
|
and the [Commotion Wireless][] project)
|
2012-10-29 06:12:39 +00:00
|
|
|
|
2013-05-29 03:51:41 +00:00
|
|
|
Download
|
|
|
|
--------
|
|
|
|
|
|
|
|
Serval DNA source code is available from the [serval-dna][] repository on
|
2014-02-14 07:23:31 +00:00
|
|
|
GitHub. You can use [Git][] to download the latest version:
|
2013-05-29 03:51:41 +00:00
|
|
|
|
|
|
|
$ cd $HOME/src
|
|
|
|
$ git clone -q git://github.com/servalproject/serval-dna.git
|
|
|
|
$ cd serval-dna
|
|
|
|
$
|
|
|
|
|
2012-10-30 04:19:50 +00:00
|
|
|
Dependencies
|
|
|
|
------------
|
|
|
|
|
|
|
|
The dependencies for build are expressed in [configure.in](./configure.in).
|
2013-05-29 03:51:41 +00:00
|
|
|
Most mandatory dependencies are present in the standard Linux development
|
|
|
|
environment.
|
2012-10-30 04:19:50 +00:00
|
|
|
|
|
|
|
Mandatory dependencies:
|
|
|
|
|
2016-09-06 07:57:02 +00:00
|
|
|
* standard C library **libc** and standard headers
|
|
|
|
* standard math library **libm** and headers `<math.h>` `<float.h>`
|
|
|
|
* network services library **libnsl** and headers
|
|
|
|
* dynamic link library **libdl** and header `<dlfcn.h>`
|
|
|
|
* Native Posix Threads Library **libpthread** and header `<pthread.h>`
|
|
|
|
* elliptic curve encryption library **libsodium** and header `<sodium.h>`,
|
|
|
|
version 1.0.2 or greater
|
|
|
|
* on Solaris, the realtime library **librt** (for the `nanosleep()` function)
|
|
|
|
* **autoconf** 2.67-2.69 (2.70 may work but has not been tested)
|
|
|
|
* **automake** 1.15
|
|
|
|
|
|
|
|
The **libsodium** development files are available on Debian/Ubuntu systems in
|
|
|
|
the `libsodium-dev` package. On other systems, like Mac OS-X, it must be
|
|
|
|
compiled from source. The [Notes for Developers](./doc/Development.md) give
|
|
|
|
more details.
|
2012-10-30 04:19:50 +00:00
|
|
|
|
|
|
|
Optional:
|
|
|
|
|
|
|
|
* Java compiler and SDK (mandatory for Android's **libservald.so**)
|
|
|
|
* ALSA sound library and headers (only present on Linux not Android)
|
|
|
|
|
2014-01-06 02:41:54 +00:00
|
|
|
Test dependencies:
|
|
|
|
|
|
|
|
* bash 3.2.48 or later
|
2016-09-06 07:57:02 +00:00
|
|
|
* GNU grep, sed and awk (on Mac OS-X and Solaris, as ggrep, gsed and gawk)
|
2014-01-06 02:41:54 +00:00
|
|
|
* jq 1.3 or later
|
|
|
|
* curl
|
|
|
|
|
2016-09-08 09:49:41 +00:00
|
|
|
**Bash** and **curl** are both provided by the [XCode][] package for Mac OS X.
|
|
|
|
**GNU grep**, **GNU sed**, **GNU awk** and **jq** can all be installed on Mac
|
|
|
|
OS-X using the [homebrew][] package manager. The [Notes for
|
|
|
|
Developers](./doc/Development.md) give more details.
|
2016-01-26 13:26:27 +00:00
|
|
|
|
2013-05-29 03:51:41 +00:00
|
|
|
Build
|
|
|
|
-----
|
|
|
|
|
2014-05-28 08:10:47 +00:00
|
|
|
To compile a native (ie, not cross-compiled) Serval DNA from source, run the
|
|
|
|
following commands:
|
2013-05-29 03:51:41 +00:00
|
|
|
|
|
|
|
$ cd $HOME/src/serval-dna
|
2016-01-11 06:10:15 +00:00
|
|
|
$ autoreconf -f -i -I m4
|
2013-05-29 03:51:41 +00:00
|
|
|
$ ./configure
|
|
|
|
$ make
|
|
|
|
$
|
|
|
|
|
|
|
|
A successful session should appear something like:
|
|
|
|
|
|
|
|
$ cd $HOME/src/serval-dna
|
2016-01-11 06:10:15 +00:00
|
|
|
$ autoreconf -f -i -I m4
|
|
|
|
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
|
2013-05-29 03:51:41 +00:00
|
|
|
$ ./configure
|
|
|
|
checking build system type... i686-pc-linux-gnu
|
|
|
|
checking host system type... i686-pc-linux-gnu
|
|
|
|
checking target system type... i686-pc-linux-gnu
|
|
|
|
checking for pkg-config... /usr/bin/pkg-config
|
|
|
|
checking pkg-config is at least version 0.9.0... yes
|
|
|
|
checking for gcc... gcc
|
|
|
|
...
|
|
|
|
checking for library containing strlcpy... no
|
|
|
|
configure: creating ./config.status
|
|
|
|
config.status: creating Makefile
|
|
|
|
config.status: creating testconfig.sh
|
|
|
|
$ make
|
2016-04-12 06:13:56 +00:00
|
|
|
SERVALD CC conf.c
|
|
|
|
SERVALD CC cli.c
|
2013-05-29 03:51:41 +00:00
|
|
|
...
|
2014-05-28 08:10:47 +00:00
|
|
|
CC cli.c
|
|
|
|
CC commandline.c
|
|
|
|
...
|
2013-05-29 03:51:41 +00:00
|
|
|
CC xprintf.c
|
|
|
|
LINK servald
|
|
|
|
LINK libmonitorclient.so
|
|
|
|
AR libmonitorclient.a
|
|
|
|
CC tfw_createfile.c
|
|
|
|
LINK tfw_createfile
|
|
|
|
$
|
|
|
|
|
|
|
|
On Solaris, the system `make` command may not be GNU Make, and the system
|
|
|
|
`cc` command may not be GNU Gcc. The following may work:
|
|
|
|
|
|
|
|
$ cd $HOME/src/serval-dna
|
2016-01-11 06:10:15 +00:00
|
|
|
$ autoreconf -f -i -I m4
|
2013-05-29 03:51:41 +00:00
|
|
|
$ CC=gcc
|
|
|
|
$ export CC
|
|
|
|
$ ./configure
|
|
|
|
$ gmake
|
|
|
|
$
|
|
|
|
|
2016-09-06 07:57:02 +00:00
|
|
|
In the event of a build failure:
|
|
|
|
|
|
|
|
* ensure that all the [dependencies](#dependencies) are present
|
|
|
|
* consult the [Notes for Developers](./doc/Development.md)
|
|
|
|
* as a last resort, [contact the Serval Project][]
|
2016-01-11 06:10:15 +00:00
|
|
|
|
2012-10-30 04:19:50 +00:00
|
|
|
Built artifacts
|
2012-10-29 06:12:39 +00:00
|
|
|
---------------
|
|
|
|
|
2012-10-30 04:19:50 +00:00
|
|
|
The build process produces the following artifacts:
|
|
|
|
|
2014-05-28 08:10:47 +00:00
|
|
|
* **servald** is the main Serval DNA executable.
|
2012-10-29 06:12:39 +00:00
|
|
|
|
|
|
|
* **libservald.so** is a shared library built only for Android, which is linked
|
|
|
|
into the [batphone][] Java executable at run time to provide the [JNI][]
|
|
|
|
entry points to servald.
|
|
|
|
|
|
|
|
* **directory_service** is the executable for the Serval Infrastructure daemon.
|
|
|
|
|
|
|
|
* **libmonitorclient.a** and **libmonitorclient.so** are libraries implementing
|
|
|
|
the client end of the monitor interface with the servald daemon. They are
|
|
|
|
linked into the [batphone][] Java executable at run time and contain [JNI][]
|
|
|
|
entry points to functions for managing the client end of a monitor connection
|
|
|
|
with the servald daemon.
|
|
|
|
|
2014-05-28 08:10:47 +00:00
|
|
|
* **fakeradio** is a utility used by test scripts to simulate the serial
|
|
|
|
interface to the [RFD900][] packet radio used in the [Serval Mesh Extender][]
|
|
|
|
|
|
|
|
* **simulator** is a utility used by test scripts for simulating wireless
|
|
|
|
packet transmission under different conditions.
|
|
|
|
|
|
|
|
* **tfw_createfile** is a utility needed by test scripts for creating large
|
|
|
|
data files with unique, non-repeating content.
|
|
|
|
|
|
|
|
* **config_test** is a utility that will fail to link if any external
|
|
|
|
dependencies creep into the configuration subsystem.
|
|
|
|
|
2013-05-29 03:51:41 +00:00
|
|
|
Test scripts
|
|
|
|
------------
|
|
|
|
|
2014-05-28 08:10:47 +00:00
|
|
|
After building the native `servald` executable, run all the tests with the
|
|
|
|
following command:
|
2013-05-29 03:51:41 +00:00
|
|
|
|
|
|
|
$ ./tests/all
|
|
|
|
1 [PASS.] (logging) By default, only errors and warnings are logged to stderr
|
|
|
|
2 [PASS.] (logging) Configure all messages logged to stderr
|
|
|
|
3 [PASS.] (logging) Configure no messages logged to stderr
|
|
|
|
4 [PASS.] (logging) By Default, all messages are appended to a configured file
|
|
|
|
...
|
|
|
|
158 [PASS.] (rhizomeprotocol) One way direct pull bundle from configured peer
|
|
|
|
159 [PASS.] (rhizomeprotocol) Two-way direct sync bundles with configured peer
|
|
|
|
160 [PASS.] (directory_service) Publish and retrieve a directory entry
|
|
|
|
161 [PASS.] (directory_service) Ping via relay node
|
|
|
|
161 tests, 161 pass, 0 fail, 0 error
|
|
|
|
$
|
|
|
|
|
2014-05-28 08:10:47 +00:00
|
|
|
Every test run writes log files into the [testlog/all](./testlog/all/)
|
|
|
|
directory (relative to the current working directory), deleting any logs from
|
|
|
|
the previous run.
|
2013-05-29 03:51:41 +00:00
|
|
|
|
2014-05-28 08:10:47 +00:00
|
|
|
See [Serval DNA Testing](./doc/Testing.md) for more information on running and
|
|
|
|
developing test scripts.
|
2013-05-29 03:51:41 +00:00
|
|
|
|
|
|
|
Configure
|
|
|
|
---------
|
|
|
|
|
2016-01-11 06:10:15 +00:00
|
|
|
Before running `servald`, it must be configured correctly. The
|
|
|
|
[doc/Servald-Configuration](./doc/Servald-Configuration.md) document describes
|
|
|
|
the configuration of Serval DNA in detail.
|
2013-05-29 03:51:41 +00:00
|
|
|
|
|
|
|
About the examples
|
|
|
|
------------------
|
2012-10-29 06:12:39 +00:00
|
|
|
|
2013-05-29 03:51:41 +00:00
|
|
|
The examples in this document are [Bourne shell][] commands, using standard
|
|
|
|
quoting and variable expansion. Commands issued by the user are prefixed with
|
|
|
|
the shell prompt `$` to distinguish them from the output of the command.
|
|
|
|
Single and double quotes around arguments are part of the shell syntax, so are
|
|
|
|
not seen by the command. Lines ending in backslash `\` continue the command on
|
|
|
|
the next line.
|
2012-10-29 06:12:39 +00:00
|
|
|
|
2013-05-29 03:51:41 +00:00
|
|
|
The directory paths used in the examples are for illustrative purposes only,
|
|
|
|
and may need to be changed for your particular circumstances.
|
2012-10-29 06:12:39 +00:00
|
|
|
|
2014-05-20 05:22:57 +00:00
|
|
|
-----
|
2016-09-21 09:01:31 +00:00
|
|
|
**Copyright 2013-2015 Serval Project Inc.**
|
|
|
|
**Copyright 2016 Flinders University**
|
2014-05-20 05:22:57 +00:00
|
|
|
![CC-BY-4.0](./cc-by-4.0.png)
|
|
|
|
This document is available under the [Creative Commons Attribution 4.0 International licence][CC BY 4.0].
|
|
|
|
|
2012-10-29 06:12:39 +00:00
|
|
|
|
2013-05-29 03:51:41 +00:00
|
|
|
[Serval Project]: http://www.servalproject.org/
|
|
|
|
[Serval DNA]: ./README.md
|
|
|
|
[serval-dna]: https://github.com/servalproject/serval-dna
|
2012-10-29 06:12:39 +00:00
|
|
|
[batphone]: https://github.com/servalproject/batphone
|
|
|
|
[Android 2.2 “Froyo”]: http://developer.android.com/about/versions/android-2.2-highlights.html
|
|
|
|
[Android NDK]: http://developer.android.com/tools/sdk/ndk/index.html
|
2016-01-26 13:26:27 +00:00
|
|
|
[Xcode]: https://developer.apple.com/xcode/
|
2012-10-29 06:12:39 +00:00
|
|
|
[gcc 4.4]: http://gcc.gnu.org/gcc-4.4/
|
2016-09-19 04:01:49 +00:00
|
|
|
[gcc 5]: http://gcc.gnu.org/gcc-5/
|
|
|
|
[gcc 6]: http://gcc.gnu.org/gcc-6/
|
2014-02-14 07:23:31 +00:00
|
|
|
[OpenWRT]: ./doc/OpenWRT.md
|
2014-03-05 04:56:28 +00:00
|
|
|
[Serval Mesh Extender]: http://developer.servalproject.org/dokuwiki/doku.php?id=content:meshextender:
|
2016-01-11 06:10:15 +00:00
|
|
|
[contact the Serval Project]: http://developer.servalproject.org/dokuwiki/doku.php?id=content:contact
|
2014-05-28 08:10:47 +00:00
|
|
|
[RFD900]: http://rfdesign.com.au/index.php/rfd900
|
2014-03-05 04:56:28 +00:00
|
|
|
[Mesh Potato]: http://villagetelco.org/mesh-potato/
|
|
|
|
[Commotion Wireless]: http://commotionwireless.net/
|
2012-10-29 06:12:39 +00:00
|
|
|
[JNI]: http://en.wikipedia.org/wiki/Java_Native_Interface
|
|
|
|
[Bash]: http://en.wikipedia.org/wiki/Bash_(Unix_shell)
|
|
|
|
[GNU make]: http://www.gnu.org/software/make/
|
2013-05-29 03:51:41 +00:00
|
|
|
[Git]: http://git-scm.com/
|
2012-10-30 04:19:50 +00:00
|
|
|
[Subversion]: http://subversion.apache.org/
|
2013-05-29 03:51:41 +00:00
|
|
|
[Bourne shell]: http://en.wikipedia.org/wiki/Bourne_shell
|
2016-09-08 09:49:41 +00:00
|
|
|
[XCode]: https://developer.apple.com/xcode/
|
2016-01-26 13:26:27 +00:00
|
|
|
[homebrew]: http://brew.sh/
|
2014-05-21 07:59:22 +00:00
|
|
|
[CC BY 4.0]: ./LICENSE-DOCUMENTATION.md
|