Commit Graph
37 Commits
Author SHA1 Message Date
Olaf Bergmann cc2a3d3d28 api-version-bump.sh: Add missing files to update
.gitignore, autogen.sh, and Dockerfiles
2021-04-21 16:06:22 +02:00
Olaf Bergmann 6d8aaa9b90 scripts/api-version-bump.sh: fix missing file
Fix API version in files generated from man/examples-code-check.c.

Call autoreconf after updating configure.ac to ensure configure is
re-run the next time make is executed.
2021-04-15 12:04:56 +02:00
Olaf Bergmann 8efab74066 scripts/api-version-bump.sh: require explicit version parameter
To avoid accidentally changing the API version, the script now aborts
if no new version other than the current API version has been
specified.
2021-04-14 13:06:15 +02:00
Olaf Bergmann 145d86f96d scripts/api-version-bump.sh: Adjust hard-coded API version
This script is called from the package's top directory to adjust
all places where the current API version is hard-coded. The
current version is detected from the LIBCOAP_API_VERSION in
configure.ac. The target version is LIBCOAP_API_VERSION + 1 if no
parameter is provided on the command line. Otherwise, the given
value is used as target version.

Note that calling this script also results in 'git mv' operations.
git commit must be called manually after running this script.
2021-04-08 14:32:52 +02:00
Jon Shallow a524b2341c build: Add in Visual Studio build
Update Windows build files to include a build that does not use OpenSSL
(called NoTLS).

Include this build in the github workflow.
2021-03-17 16:55:07 +00:00
Jon Shallow dc6c5e6b00 workflow: Add in distribution and CMake checks
.github/workflows/main.yml:

Do a 'make check' for matrix builds.
Move documentation into separate job to reduce matrix build times
Add in CMake job.
Add in distribution job.
Add in tinydtls job.
Add in contiki/lwip job.

scripts/github_dist.sh:

Do the distribution checks using a script.

examples/etsi_iot_01.c:
examples/tiny.c:

Fix include coap.h directory in old examples.

README.md:

Update status badges to get only the branch actions and remove CMake
status badge.
2021-02-24 18:15:25 +00:00
Olaf Bergmann 57a5a7e089 [CI] main.yml: basic build steps 2021-02-12 12:09:01 +01:00
Jon Shallow 7812efb1eb Man examples: Add in support to check that the man example's code compiles
There needs to be an easy way to validate that the examples provided in the
man pages compile without errors.

This PR provides a new executable examples-code-check that can be run against
the .txt.in files that are in the man directory.  It abstracts the code for
each example and then runs the compiler against that stub code reporting errors
and warnings as appropriate for subsequent fixing in the man page.

.gitignore:

Ignore the new executable and the files it generates.

Makefile.am:
configure.ac:

Remove MAN_DIR and hard code in the man directory so that examples-code-check
is always built.

autogen.sh:

Make sure that all the temporary stub code files are cleaned up.

man/Makefile.am:

Support building and clean-up of the new examples-code-check.

man/examples-code-check.c: (new)

The code that parses the man pages, looking for examples and the gets
the examples compiled, testing for errors.
The function definitions in the SYNOPSIS section are also included in the
compilation of the examples.

scripts/build.sh:

If WITH_TESTS is set, check that the man page examples compile.

man/coap_encryption.txt.in:
man/coap_io.txt.in:
man/coap_observe.txt.in:
man/coap_pdu_setup.txt.in:
man/coap_resource.txt.in:
man/coap_session.txt.in:

Correct the SYNOPSIS function definitions.
2020-05-04 14:47:36 +01:00
Carlos Gomes Martinho e191e2d726 build: add cmake support 2020-04-22 17:07:24 +02:00
Jon Shallow 8abd8fa677 Add mbedtls build into Travis builds
.travis.yml
build-env/Dockerfile.build-env
build-env/Dockerfile.develop
scripts/build.sh
scripts/dist.sh

Update with mbedtls information
2020-01-16 09:38:43 +00:00
Olaf Bergmann 4a13437b69 scripts/build.sh: Additional options for epoll and small stack
* Passing EPOLL=no disables the epoll interface usage. Other values
  default to yes, i.e. epoll is used if available.
* Passing SMALL_STACK=yes enables some values stored in static
variables instead pushing on the stack. This usually requires
mutex support in the operating system.
2019-09-13 12:44:55 +02:00
Olaf Bergmann d873b1f752 scripts/build.sh: Disable silent rules by default
As discussed in PR #370 [1], silent rules are disabled for travis
builds.

[1] https://github.com/obgm/libcoap/pull/370
2019-07-02 09:33:38 +02:00
Jon Shallow ff8f8d2c6b Stop valgrind errors when using OpenSSL 1.1.1c
Issue introduced by OpenSSL 1.1.1c causes valgrind errors to be reported.  See
https://www.mail-archive.com/openssl-commits@openssl.org/msg21701.html and
https://github.com/openssl/openssl/pull/8606 which did not make 1.1.1c

scripts/build.sh:
tests/valgrind_suppression:

Temporarily suppress valgrind errors when SSL_CTS_new() is called when running
the tests.

Note: This suppression will also need to be applied when running valgrind
against other CoAP executables using OpenSSL 1.1.1c to prevent the valgrind
errors getting reported.

src/coap_openssl.c:

memset cookie_secret to 0 to stop valgrind warning.
2019-06-25 20:26:43 +01:00
Jon Shallow 40c1ddbb24 Travis tests/testdriver fails with libtinydtls.so missing error
When building tinydtls version, Travis fails with the following error

tests/testdriver: error while loading shared libraries: libtinydtls.so:
cannot open shared object file: No such file or directory

The new version of TinyDTLS now builds a libtinydtls.so file which is
linked against in preference to libtinydtls.a when using -ltinydtls,
but Travis does not have an installed version libtinydtls.so to load
during execution of tests/testbriver - hence failure.

scripts/build.sh:

Add in LD_LIBRARY_PATH=ext/tinydtls if building tinydtls.

BUILDING:
configure.ac:

With libtinydtls.so being available, there is no need to enforce
--disable-shared for tinydtls.  Remove this requirement.
If --disable-shared is set, link in with libtinydtls.a.
2019-03-30 13:04:04 +00:00
Jon Shallow 0bcbd3fb5c Update scripts/build.sh to build coap-etsi_iot_01 and coap-tiny examples
Travis now checks exmples continue to build, even if there is an API
change.
2018-12-07 20:22:56 +00:00
Jon Shallow e172e6865b Include GnuTLs in the Travis build
.travis.yml

Add in the gnutls build.

build-env/Dockerfile.build-env
build-env/Dockerfile.develop

Add in libgnutls28-dev to the apt-get list.

scripts/build.sh
scripts/dist.sh

Support TLS set to gnutls for building.
2018-11-27 15:33:52 +00:00
Olaf Bergmann 5bd36c1526 scripts/dist.sh: CI-script for testing make dist
This script creates a libcoap archive, unpacks it and does an
out-of-tree build and installation afterwards. The environment
variables PLATFORM, TESTS, TLS and DOCS control the build
configuration. Suggested invocation from travis CI is:

  PLATFORM=posix TESTS=yes TLS=no DOCS=yes scripts/dist.sh
2018-10-26 17:46:08 +02:00
Olaf Bergmann 3c2413eac7 build.sh: control documentation build
If the environment variable DOCS is set to yes, --enable-documentation
will be set during configure, --disable-documentation otherwise (the
previous default).
2018-10-26 17:45:04 +02:00
Jon Shallow d766f9d8ee Update code to build LwIP and Contiki from the examples directory
Update code to use new APIs
[Some code changes modelled on PR #202, some code being moved between files]
Remove #ifdef WITH_LWIP from coap_io.c as file is not used
Add in resource time to lwip
Update for Travis build
Report on Contiki memory allocate failures to ease debugging
Make the different memory type counts configurable by using the -D option
included in a CFLAGS definition to the ./configure command line

.travis.yml
BUILDING
Makefile.libcoap
examples/contiki/Makefile
examples/contiki/README     new
examples/contiki/server.c
examples/contiki/.gitignore (new)
examples/lwip/Makefile
examples/lwip/README
examples/lwip/lwipopts.h
examples/lwip/server-coap.c
examples/lwip/server.c
include/coap/address.h
include/coap/coap_io.h
include/coap/lwippools.h
include/coap/pdu.h
scripts/build.sh
src/address.c
src/coap_io.c
src/coap_io_lwip.c
src/coap_session.c
src/mem.c
src/net.c
src/pdu.c
2018-07-27 15:30:37 +01:00
Olaf Bergmann 93f9ee61b3 build.sh: integrate OSS-Fuzz syntax checks in CI build 2018-07-26 12:35:27 +02:00
Jon Shallow 96d8877606 Fix reported issues #212, #214 and refix #199, add in valgrind to do the testing
build-env/Dockerfile.build-env
scripts/build.sh

Add in valgrind testing of the tests

src/option.c

Issue #199 Better fix of ADVANCE_OPT_CHECK()

src/pdu.c

Issue #214 Validate token length in coap_pdu_parse_header()

src/uri.c

Issue #212 Check not reading off end of buffer in dots()

tests/test_pdu.c
tests/test_uri.c

Tests updated to include tests for #212 & #214
2018-07-12 15:30:17 +01:00
Olaf Bergmann 82c9ccc75b build.sh: bugfix for tinydtls build
When TLS=tinydtls is set, configure must be called with --disable-shared.

Thanks to Michael Zimmer for pointing this out.
2018-01-18 15:30:26 +01:00
Olaf Bergmann bea82fef30 build.sh: disable documentation to speedup continuous integration 2017-10-16 17:53:00 +02:00
Olaf Bergmann ced706e66d .travis.yml: added flag for TLS library selection
The environment variable TLS now controls the DTLS-specific configuration
options. The following values are defined:

  no       turn off DTLS support
  openssl  use OpenSSL library
  gnutls   use GnuTLS library
  tinydtls use tinydtls library

Any other value will be mapped to gnutls which is the default.
2017-08-31 14:01:26 +02:00
Olaf Bergmann 5a2d68f145 scripts/build.sh: re-enable pkg-config fix for CUnit
The Trusty build environment comes with a pkg-config file for CUnit
which lacks a version number and has a syntax error. The build script
now calls scripts/fix-cunit.sh to create a fixed version of the
existing cunit.pc file and point the configure script to this file.
2016-10-31 13:39:33 +01:00
Olaf Bergmann 4920a46021 scripts/build.sh: removed non-working cunit.pc fix
Now, PKG_CONFIG_PATH is not set to local version, hoping that the
installed version works without version check.

Added more debug output instead.
2016-10-26 18:56:27 +02:00
Olaf Bergmann 79212255a1 scripts/build.sh: more debug output
This change outputs the config.log when configure failed.
Moreover, a local cunit.pc will be output to see why the build still
fails.
2016-10-26 18:47:08 +02:00
Olaf Bergmann 58ff2feabb scripts/fix-unit.sh: make script executable
Forgot chmod +x scripts/fix-unit.sh.
2016-10-26 18:40:04 +02:00
Olaf Bergmann ab198868f1 scripts/build.sh: added fix for broken cunit.pc in travis CI environment
The pkgconfig specification for libcunit1-dev version 2.1-2 is
horribly broken. build.sh (invoked by the travis CI system,
see .travis.yml) now runs a new script fix-cunit.sh when TESTS is
set to 'yes'.
2016-10-26 18:32:44 +02:00
Olaf Bergmann 24500483f7 build.sh: bugfix: use LDLIBS for linking 2016-06-22 15:22:32 +02:00
Olaf Bergmann 4f24417d59 build.sh: set LDFLAGS=-lrt for glibc < 2.17 in lwip build
The link step for the native lwip build fails on platforms that
use a glibc version prior 2.17. The reason is that librt is needed
for clock_gettime() in that environment. configure detects this
correctly but the lwip example comes with a simple hand-craftet
Makefile that does not use the configure results.

This quick hack checks for the output of the check for clock_gettime()
and includes the required libraries in order to fix the travis build.
2016-06-22 14:26:46 +02:00
Olaf Bergmann ebbdc30a52 build.sh: split build steps for platform lwip
Apparently, the vpath magic in the lwip examples' Makefile requires
the lwip files to exist before the server is built. Thus, the build
script now calls make twice: First, to clone the lwip repositories,
and second, to create the actual server application.
2016-06-22 13:41:49 +02:00
Olaf Bergmann 40be72a350 CI: enable platform lwip 2016-06-22 13:22:48 +02:00
Olaf Bergmann 1bb223013c scripts/build.sh: fixed action for Contiki build
With the new Makefile layout, we can simply use the default
parameters for the build.
2016-02-16 14:27:14 +01:00
Olaf Bergmann 8bb7ec80e7 scripts/build.sh: bugfix: stay in top directory for non-posix platforms
When TESTS=yes is given, the scripts invokes the test driver from
the top build directory. Platform-specific actions hence must ensure
that they stay in that directory and keep the last exit code.
2016-02-16 12:13:18 +01:00
Olaf Bergmann 3afe2e94ac build.sh: pass exit code to caller 2016-02-15 18:25:00 +01:00
Olaf Bergmann 641b8ed196 scripts/build.sh: Added build script to facilitate CI
The build script invokes configure and make with different
parameters depending on the environment variables PLATFORM
and TESTS. PLATFORM currently must be one of 'posix', 'contiki', or
'lwip'. If TESTS is set to 'yes' or 'true', the option --enable-tests
will be passed to configure and tests/testdriver will be invoked
after configuration and make.
2016-02-15 16:04:59 +01:00