Commit Graph

361 Commits

Author SHA1 Message Date
Maxim Biro b0aec02225 Split daemon's logging backends in separate modules 2017-06-04 16:07:03 -04:00
iphydf 1e8fa85aad Add a monolith_test that includes all toxcore sources.
This requires that every symbol, even if static (file-scope), is unique.
The idea is that we can easily run "whole" program static analysis on
programs that include monolith.h ("whole" is in quotes, as we don't
include dependencies like libsodium in this static analysis).
2017-06-04 17:48:23 +00:00
iphydf b782ef5d8e Fix formatting and spelling in version-sync script.
Also some minor reformatting and fixes to the hstox sut driver.
2017-06-04 12:07:43 +00:00
iphydf d4be41a3ad Use new encoding of Maybe in msgpack results.
The new encoding is `0` for `Nothing` and `[1, x]` for `Just x`.
2017-06-03 23:32:46 +00:00
Maxim Biro f6285d7a60 Fix markdown formatting 2017-04-19 20:22:28 -04:00
iphydf c780d25e3e Retry autotools tests the same way as cmake tests. 2017-03-26 19:03:43 +00:00
iphydf 9ff60ceb31 Reduce ctest timeout to 2 minutes from 5 minutes.
Fixes #411.
2017-03-26 19:03:25 +00:00
Diadlo 50c526e1a5 Move c_sleep to helpers.h and misc_tools.h
Also fix a mistake with forgotten braces around parameter
2017-03-25 20:40:34 +03:00
Maxim Biro 10deb2ab5f Fix Travis always succeeding despite tests failing 2017-03-12 08:34:53 -04:00
Maxim Biro aaca8251c8 Remove dependency on strings.h 2017-03-01 20:43:30 -05:00
Diadlo b19a9e5464 Add part of platform-independent network API implementation
socket      -> net_socket
htons       -> net_htons
htonl       -> net_htonl
connect     -> net_connect
sendto      -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
2017-02-26 23:16:16 +03:00
iphydf 6ae33c16cf Add VLA compatibility macro for C89-ish compilers. 2017-01-28 20:49:12 +00:00
iphydf f58dbe2503 Limit number of retries to 3. 2017-01-19 15:58:03 +00:00
iphydf a74ab7cd1a Make Travis tests slightly more robust by re-running them. 2017-01-19 12:35:22 +00:00
iphydf 8f96ca6d86 Update license headers and remove redundant file name comment.
"All rights reserved" was incorrect. The project was licensed under GPL3,
which means a lot of rights are licensed to everybody in the world, i.e.
not reserved to the "Tox Project".
2017-01-19 00:01:44 +00:00
iphydf 6d6a4e1e3a Add tutorial and "danger: experimental" banner to README. 2017-01-18 18:13:31 +00:00
iphydf a22f5e7c6f Clarify how the autotools build is done on Travis. 2017-01-18 10:56:16 +00:00
Carsten Brandt 86e67f805a decouple version-sync script from cmake 2017-01-18 11:20:07 +01:00
Carsten Brandt 3520eee05d SO versions for cmake and libtool
this updates the version-sync script to generate proper SO versions
which will be used by cmake and libtool to create version symlinks
on the system when a library is installed as well as setting the SO
version in the binary.

To see what this does, you have to configure tox with a prefix:

    ./configure --prefix=/tmp/tox-with-libtool
    mkdir cbuild && cd cbuild && cmake -DCMAKE_INSTALL_PREFIX=/tmp/tox-with-cmake ..

Then run `make && make install`.

in both instances you should see the following installed in `lib/`:

    libtoxcore.so -> libtoxcore.so.1.4.0
    libtoxcore.so.1 -> libtoxcore.so.1.4.0
    libtoxcore.so.1.4.0

inside the binary the soname should be the one with .1 and it should not
contain the full version:

    $ objdump -p libtoxcore.so.1.4.0 | grep SONAME
      SONAME               libtoxcore.so.1
2017-01-18 11:20:07 +01:00
iphydf 20be9a8c5b Fix NaCl build: tar was called incorrectly.
tar -jxf expects a file.
2017-01-08 16:37:56 +00:00
iphydf 8f1dbaa2c5 Set up autotools build to build against vanilla NaCl.
Fixes #363.
2017-01-08 15:27:26 +00:00
iphydf bec03de2ba Run windows tests but ignore their failures.
This way we can at least see what fails in which way.
2017-01-07 22:59:25 +00:00
David Zero 8ef1f35ca7 Revert "Revert "Portability fixes""
This reverts commit 59e2a844f0, and
defines _DARWIN_C_SOURCE in toxcore/network.c
2017-01-06 04:20:00 -08:00
iphydf 08cd61387e Add an OSX build that doesn't run tests.
This one is not allowed to fail and ensures that toxcore can at least be
built for OSX.
2017-01-06 00:40:29 +00:00
endoffile78 59e2a844f0 Revert "Portability fixes"
This reverts commit f3469070fe.
2017-01-05 15:16:56 -06:00
iphydf 0a61d11085 Test a few cmake option combinations before the build.
This takes a few seconds but allows us to cover cases that aren't checked
often.
2017-01-05 12:34:52 +00:00
David Zero f3469070fe Portability fixes
- CFLAG gnu99 was changed to c99.
- CXXFLAG c++98 was changed to c++11.
- CFLAG -pedantic-errors was added so that non-ISO C now throws errors.
- _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3
  and c99 definitions in modules that required them.
- Fixed tests (and bootstrap daemon logging) that were failing due to
  the altered build flags.
- Avoid string suffix misinterpretation; explicit narrowing conversion.
- Misc. additions to .gitignore to make sure build artifacts don't wind
  up in version control.
2017-01-04 13:44:39 -08:00
Sergey 'Jin' Bostandzhyan 4c9ed8f5a0 Add a separate configure switch for DHT_bootstrap
closes #319
2017-01-03 20:42:07 +00:00
iphydf 4e731bb435 Fix SSL verification in coveralls. 2017-01-02 23:43:42 +00:00
iphydf ce29c8e7ec Wrap all sodium/nacl functions in crypto_core.c. 2016-12-22 10:26:59 +00:00
iphydf bbdd798256 Fix unresolved reference in toxencryptsave API.
Also, make sure this won't happen again by checking for it in
format-source.
2016-12-14 11:35:43 +00:00
iphydf b14b8d07fa Add compatibility pkg-config modules: libtoxcore, libtoxav.
These were generated by the autotools build. Some clients may depend on
these files instead of the newer split pkg-config files. New clients
should be using the toxcore, toxav, toxencryptsave, and toxdns modules.
2016-12-13 20:58:32 +00:00
iphydf 4cf69996cc Add apidsl file for toxencryptsave.
This breaks the toxencryptsave API. It hides the Tox_Pass_Key struct
definition.
2016-12-13 14:24:40 +00:00
iphydf 2dc2ac52b9 Fix --enable-logging flag in autotools configure script.
We also never really tested this, because we run make distcheck, which
does another configure with default flags instead of the ones we passed.

Fixes #317.
2016-12-13 00:52:58 +00:00
GDR! c684499375 Move -ltoxcore to be the first linked library 2016-12-12 14:09:34 +01:00
iphydf d8ae726d0a Don't build nTox by default.
Build it on Travis. It won't be built on the windows builds regardless
of having it enabled globally.

Fixes #292.
2016-12-05 22:02:30 +00:00
Maxim Biro f0f53dbd55 Don't error on warnings by default
Having -Werror set by default causes users' builds to fail because
toxcore is not warning-free. Failing on errors is appropriate for the
development phase, e.g. when building it in a CI enviroment, but it
doesn't make much sense to fail builds for users and let them figure out
that they need to pass -DWARNINGS=OFF to make the library build.
2016-11-28 15:13:01 -05:00
Gregory Mullen (grayhatter) ad517eb1df add NAT hole punching level to Tox API 2016-11-24 17:38:34 -08:00
iphydf 8bbde23f48 Use apidsl for the crypto_core API.
This allows us to use apidsl features like namespaces to enforce a
naming standard.
2016-11-12 11:55:40 +00:00
iphydf b2dd50f9fc Work around Travis issue that causes build failures.
Travis seems to no longer set $TERM, which breaks opam. We now manually
set it to some hopefully sane value.
2016-11-10 23:45:48 +00:00
endoffile78 3f53090c1d Remove assoc 2016-11-06 09:14:53 -06:00
iphydf 7b6b47a610 Enable address sanitizer on the cmake build. 2016-11-06 12:19:34 +00:00
iphydf 96c672aef5 Compile as C++ for windows builds.
Compiling as C++ changes nothing semantically, but ensures that we don't
break C++ compatibility while also retaining C compatibility.

C++ compatibility is useful for tooling and additional diagnostics and
analyses.
2016-11-02 18:50:41 +00:00
iphydf de966cdf90 Error if format_test can't be executed.
This ensures that on Travis, format_test will always be executed, or the
build fails.
2016-10-26 13:34:29 +01:00
iphydf 0fb79c54b8 Set log level for DEBUG=ON to LOG_DEBUG.
We use TRACE=ON (cmake flag) to enable LOG_TRACE. This way, a regular
build can enable DEBUG while not paying the price of TRACE. This is
particularly important for FFI bindings (especially Python), where
invoking callbacks can be an expensive operation.
2016-10-06 15:15:42 +01:00
Maxim Biro 02e9cd38f1 Add option to build tox-bootstrapd
When cross-compiling to <target> from Linux, cmake might find native Linux
libconfig and decide to build tox-bootstrapd. If the target is Windows, this
will fail, as tox-bootstrapd can't be built for Windows in the first place. If
the target is Linux of some other architecture, then using host native
libconfig will fail too. Thus an option is needed to guard against this.
2016-10-05 23:47:39 -04:00
Maxim Biro 90123c803a Align things nicer 2016-10-04 15:44:46 -04:00
Maxim Biro bf42872bb3 Use TEST_TIMEOUT_SECONDS cmake flag on Travis 2016-10-04 15:32:38 -04:00
iphydf b8b9789a69 Rebuild apidsl'd headers in cmake.
- Moved apidsl headers next to their generated versions. In the future,
  perhaps all (or most) headers will be apidsl-generated, so the sources
  should stay together.
- Try to find apidsl/apigen binary and astyle binary and use it for the
  format test. Don't run the format test if these can't be found.
2016-10-02 23:54:03 +01:00
iphydf 6d2b85ed06 Minor documentation fixes.
- Fixed incorrect parameter names (documented name didn't match code
  name).
- Removed `@return` from functions that return `void`.
- Make sure every parameter is documented. This required moving the
  planes and strides documentation to the function docs.
2016-10-01 11:17:57 +01:00