Commit Graph
82 Commits
Author SHA1 Message Date
obgm e1491dee77 Merge pull request #226 from mrdeep1/logging-doc
New coap_logging(3) and updated Doxygen comments for logging
2018-07-26 14:08:25 +02:00
Olaf Bergmann 315067add0 configure.ac: add creation of tests/oss-fuzz/Makefile.ci 2018-07-26 12:29:13 +02:00
Jon Shallow c695dea7cd New coap_logging(3) and updated Doxygen comments for logging
Documentation changes/updates only - no code changes.

configure.ac
include/coap/coap_dtls.h
include/coap/coap_session.h
include/coap/debug.h
man/Makefile.am
man/coap.txt.in
man/coap_context.txt.in
man/coap_logging.txt.in (new)
2018-07-25 09:48:02 +01:00
Jon Shallow 9a1f0ab475 man pages: New coap_encryption(3) and coap_session(3)
Split out old coap_context(3) into coap_context(3), coap_encryption(3) and
coap_session(3) with coap_encryption(3) primarily updated to reflect the
updated PKI configuration options.

coap-client.txt.in
coap-server.txt.in

Update with new options making use of updated PKI interface
2018-07-24 14:49:04 +01:00
Jon Shallow af84f2049b configure.ac: Add -Wcast-qual to WARNING_OPTIONS 2018-05-25 14:11:04 +01:00
Olaf Bergmann a2d263356e configure.ac: enable -Wwrite-strings
As discussed in bug #185 [1], const strings should be protected
from being overwritten. This change adds -Wwrite-strings to the
compiler warning flags and fixes resulting warnings by making
static strings const.

[1] https://github.com/obgm/libcoap/issues/185
2018-05-19 09:27:50 +02:00
Jon Shallow c187fbd508 man/coap_pdu_setup.txt.in: New man page
Updated man/coap.txt.in

Updated configure.ac

Updated man/Makefile.am
Also include the man pages where there are more than 9 definitions in the
SYNOPSIS as we are limited to 10 in hte NAMES section
2018-05-17 19:00:40 +01:00
Olaf Bergmann 072357c780 configure.ac: check if a2x can be used for manual page creation
This change adds a new m4 macro AX_CHECK_A2X_TO_MANPAGE that
invokes the a2x program passed in the environment variable A2X
to create a minimal manual page. If A2X is set correctly, failing
this test is a good indicator that the docbook DTD or the
docbook XSL stylesheets are missing.
2018-05-03 13:56:25 +02:00
Jon Shallow ae5765af2f configure.ac: Bump LIBCOAP_API_VERSION and create LIBCOAP_NAME_SUFFIX
Make LIBCOAP_API_VERSION=2

Set LIBCOAP_NAME_SUFFIX to be $LIBCOAP_API_VERSION{-openssl,-gnutls,-tinydtls}
as appropriate based on the configure build options.

This means that library files will be named
libcoap-2-openssl.a
libcoap-2-openssl.so*
libcoap-2-gnutls.a
libcoap-2-gnutls.so*
libcoap-2-tinydtls.a
libcoap-2.a
libcoap-2.so*

Fix some typos

Use $withval instead of yes so that, say, --without-openssl works as expected.
2018-04-13 08:43:37 +01:00
Jon Shallow d21e0532bc configure.ac: Add in man page building with --enable-manpages
Create a new --enable-doxygen

Make --enable-documentation include both --enable-manpages and --enable-doxygen
and --disable-documentation include --disable-manpages and --disable-doxygen
2018-04-07 11:34:44 +01:00
Diego Santa Cruz fde93fca90 configure.ac: fix linker version script detection
The detection of linker's support for version scripts fails
when building outside the source tree due to missing source
path to the linker script.
2017-09-20 10:54:02 +02:00
Olaf Bergmann 9b76de1a3c configure.ac: Add tinydtls configuration option
The new option '--with-tinydtls' allows selecting tinydtls as
DTLS implementation. This option must be combined with '--disable-shared'
as tinydtls supports only static linkage. Unlike GnuTLS and OpenSSL,
tinydtls is not enabled automatically during configuration.
2017-07-10 15:35:45 +02:00
Olaf Bergmann a070a8b3bc Merge remote-tracking branch 'tijuca/4upstream' into develop 2017-07-10 14:11:34 +02:00
Carsten Schoenert 383a636cdd configure.ac: using more variables for binary versions
Adjusting version numbers in various places for dot and doxygen is
tedious and error prune. So set up the required versions right before
the code block for those checks.
2017-06-30 20:46:05 +02:00
Carsten Schoenert c8a97f91e2 configure.ac: fix up typos and indentation
No technical changes, only correction of typos and indentation oon some
parts.
2017-06-30 20:46:05 +02:00
Carsten Schoenert 7286a52474 DTLS support: export and use related flags to main Makefile
To be able to use the collected CFLAGS and LIBS variables in the main
Makefile substitute DTLS_CFLAGS and DTLS_LIBS with the found values from
previous made checks and exporting them to autoconfigure.
Also define the found development crypto library into the configuration
header file 'coap_config.h.

We may need to add the flags also to examples/Makefiles.am too.
2017-06-30 20:45:10 +02:00
Carsten Schoenert 9b2505772e configure.ac: adding info output about DTLS configuration
Giving some more information to the user than the output of the
configure with it's calls itself. By adding this output function the
user will see which library with which version etc will be used.
2017-06-30 20:25:11 +02:00
Carsten Schoenert 4bbf6b8a08 configure.ac: adding logic and options for dtls support
DTLS features are needing external cryptographic libraries for proper
working. There are some possibilities to use existing libraries of that
kind.
Based on discussions on the ML and also the issue tracker on GitHub we
found some consensus to use and support GnuTLS and OpenSSL at least in
the beginning of implementing DTLS support. The added code is using
GnuTLS 3.2.0 and OpenSSL 1.1.0 as required minimum versions.

This commit is adding a new configure option '--enable-dtls' which is
turned on by default to build libcoap by default with DTLS
functionality.
It's adding also two more additional options that let the user decide
which cryptographic library should be used for DTLS support. The two
optional options are '--with-gnutls' and '--with-openssl'.

These two options are optional and a user doesn't need to set any of
them if he doesn't care which library should be used. If these options
are not given the logic will first try to find the GnuTLS library for
usage and if not found do a fallback to OpenSSL.

The following behaviour is now implemented into configure by this commit:

  $ ./configure --disable-dtls
   or
  $ ./configure --enable-dtls=no

   Both options configuring the source to not implement any DTLS
   support.

  $ ./configure     # without additionally options '--with-gnutls' or '--with-openssl'

   The configure script is trying first to find GnuTLS for DTLS.
   If the system hasn't GnuTLS development files the configure script is
   moving over to OpenSSL and try to find the development files of
   OpenSSL. If any files can't be found the script will break with a error
   message.

  $ ./configure --with-gnutls

   The development files for GnuTLS will be explicit searched and used even
   if also OpenSSL is available and usable.

  $ ./configure --with-openssl

   Like before but with the needing for OpenSSL development files. A
   optional availability of GnuTLS on the host will be ignored.
2017-06-30 20:24:50 +02:00
jcmichelou b159565774 Add check for ioctl header file. 2017-06-24 16:20:18 +02:00
jcmichelou 1c79a4b977 Merge remote-tracking branch 'remotes/obgm/dtls' into dtls-dev with tinydtls support
# Conflicts:
#	Makefile.am
#	configure.ac
#	examples/client.c
#	examples/coap-rd.c
#	examples/coap-server.c
#	include/coap/address.h
#	include/coap/coap_io.h
#	include/coap/net.h
#	include/coap/prng.h
#	libcoap-1.map
#	libcoap-1.sym
#	src/net.c
#	src/platform/posix/coap_io.c
2017-06-12 17:26:25 +02:00
Carsten Schoenert aafb87e50d configure.ac: fix broken ctags detection
While adding the freebsd platform into the supported build environments
the check for the needed ctags binary was modified
(aa7256a812), unfortunately the changes
made aren't correct and due this the target check_ctags in the toplevel
makefile was always assuming the correct ctags binary is around.

This was resulting in broken libcoap-1.{map,sym} files if 'make dist'
was called in case the user hasn't installed exuberant-ctags like ctags.
2017-06-06 15:38:36 +02:00
Carsten Schoenert 0dafde8564 configure.ac: adjust the library vision +1
We are going into a new release cycle which will provide new so we need
new symbols and interfaces. Because of the new added symbols we need to
increase LT_LIBCOAP_CURRENT to '1'.
And we will be backward compatible and existing binaries linked against
the previous version will also working with that new planned library
release. To show this setting tune LT_LIBCOAP_AGE also to '1' as we are
now one version backward compatible.
2017-05-30 10:33:05 +02:00
Carsten Schoenert 90270db356 configure.ac: be more helpful on the libtool versioning
The versioning by libtool is sometimes a bit confusing and seems
complex. But it's really important to do a proper versioning of the
library.
Rephrase the part about how to check the needed versioning to be a bit
more informative how to do that.

Some more in deep explanation about the meaning of the libtool version
number can be found on:

* https://autotools.io/libtool/version.html
* http://www.informit.com/articles/article.aspx?p=19553
* https://developer.gnome.org/programming-guidelines/stable/versioning.html.en
2017-05-30 10:32:29 +02:00
Carsten Schoenert b432fa5f26 configure.ac: adding a release-state string
To do a more finely graduated versioning a extra new field for the
release-state is added. The purpose is mainly to add some extra
information about the development state of libcoap like a alpha state
right after a final release or marking the state as a release candidate
before a planned release.

Starting with a string 'alpha' as we are in a really early development
state for the upcoming release.
2017-05-30 10:31:25 +02:00
Carsten Schoenert 9aa7ee9d3a configure.ac: bumping version to 4.2.0
The next version will be 4.2.0 with some more new features and a license
change as well. More to come later.
2017-05-30 10:26:44 +02:00
tijuca 1ba4fd0cec Cross compilation issue (#31)
The error that happen while cross compiling is quite logical if you
know what the check AC_FUNC_MALLOC is made for. The behavior isn't
really wrong (for me) because autoconf can't really test the created
code due it's for another platform. Some nice explanation about the
whole problem can be found here:
http://wiki.buici.com/xwiki/bin/view/Programing+C+and+C%2B%2B/Autoconf+and+RPL_MALLOC

As long as libcoap uses malloc from the libc we need a check for
the proper implementation for this cases. So removing AC_FUNC_MALLOC
isn't solving the problem. We need at least a check for a malloc
functionality which can be done by AC_CHECK_FUNC(S).

(cherry picked from commit 04d806fe4d)
2017-04-18 16:39:27 +02:00
Anton Glukhov bbe8ffab7f Fix big/little endian alignment
Signed-off-by: Anton Glukhov <anton.a.glukhov@gmail.com>
2016-12-08 15:00:02 +01:00
Carsten Schoenert 72eec07777 configure.ac: adding detection of kfreebsd platforms
kFreeBSD is a modificated FreeBSD system by Debian with a FreeBSD kernel
and GNU C library (libc) used for the applications. After adding FreeBSD
support for libcoap no more changes needed to get libcoap compiled with
a kFreeBSD installation.
2016-11-25 09:29:10 +01:00
Olaf Bergmann c4b5d93ac2 configure.ac: remove cunit version check 2016-10-26 18:56:04 +02:00
Carsten Schoenert 65090de7c8 configure.ac: adapt the output of doxygen compare check
Adapting the text output on the doxygen version compare to the dot check
so the user is seeing more informative things on configure run.
2016-10-26 10:46:50 +02:00
Carsten Schoenert af48b3b31a configure.ac: let configure found the sed binary 2016-10-26 10:46:50 +02:00
Carsten Schoenert 524381eafe configure.ac: normalize helping output for AC_ARG_ENABLE
To get more in sync with the existing output from the default helping
text by various autotools/automake stuff improving a little bit the
existing helper text of some configure arguments.
2016-10-26 10:46:50 +02:00
Carsten Schoenert 2be9ec9dff configure.ac: simplify the CUnit check by pkg-config
The old behaviour on testing for CUnit library and header files (that
are needed while building the internal testbinary) was done on manually
search for the header and the library file without a real need because
CUnit ships a pkg-config file with a version for longer time.

By using the PKG_CHECK_MODULES macro the check is much easier as the
pkg-config file is serving all the needed information like the search
path for the header files as also LDFLAGS for linking against. This
ensures the environment variables are always setup correctly.

Note that FreeBSD uses for example /usr/include and /user/local/include
for the header files, the pkg-config files can be found in
/usr{/local}/libdata/pkgconfig. The pkg-config file will pick up the
right places then.
2016-10-26 10:46:50 +02:00
Carsten Schoenert de80514661 configure.ac: improve the ERROR message if a2x is missed
Giving the user a better hint if the a2x check isn't succesfull.
2016-10-26 10:46:50 +02:00
Carsten Schoenert 87e30a4e25 configure.ac: adjust a specific FreeBSD test for dot
As FreeBSD uses default the csh (C-shell) or the tcsh (Tennex-shell)
with some different output redirection than bash for example, and the
user might have installed a other shell we need to grep the version from
the dot binary by a csh shell call because this shell be always available.

Happily the 'dot -V' command is quite the same on FreeBSD and Linux
systems. Maybe we need to change this in the future again.
2016-10-26 10:46:50 +02:00
Carsten Schoenert c95e1f0917 configure.ac: adding FreeBSD to the detectable platforms 2016-10-26 10:46:50 +02:00
Carsten Schoenert aa7256a812 configure.ac: splitting ctags check into freebsd specific detection
On FreeBSD the default ctags binary isn't usable for getting the tags
from the header files, we need to take the binary exctags explicitly.
Also before the check can be done we need to know on which platform we
running.
2016-10-26 10:46:50 +02:00
Carsten Schoenert 717b19cede configure.ac: changing tabs into spaces
No technical changes.
We have mixed indention styles, there are spaces and tabs used,
switching all tab indentions into spaces.
This increasing readability of configure.ac on systems with especially
tabwidth>4.
2016-10-26 10:46:50 +02:00
Olaf Bergmann 6a5b12a775 configure.ac: fix CFLAGS append
Some autotools/m4 versions seem to lack support of '+=' for appending
data to existing variables. This modification fixes this for the
final CFLAGS construction.
2016-07-07 12:11:57 +02:00
Thomas Petazzoni 748b788e72 configure: only add -Wunused-result if supported by the compiler
Old gcc versions such as 4.3.x do not support -Wunused-result, so
instead of unconditionally using this warning, only use it if supported
by the compiler.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-06-21 16:16:02 +02:00
tijuca 04d806fe4d Cross compilation issue (#31)
The error that happen while cross compiling is quite logical if you
know what the check AC_FUNC_MALLOC is made for. The behavior isn't
really wrong (for me) because autoconf can't really test the created
code due it's for another platform. Some nice explanation about the
whole problem can be found here:
http://wiki.buici.com/xwiki/bin/view/Programing+C+and+C%2B%2B/Autoconf+and+RPL_MALLOC

As long as libcoap uses malloc from the libc we need a check for
the proper implementation for this cases. So removing AC_FUNC_MALLOC
isn't solving the problem. We need at least a check for a malloc
functionality which can be done by AC_CHECK_FUNC(S).
2016-04-25 12:59:03 +02:00
c.schoenert@t-online.de 7d5ac9edaf configure.ac: fixup small typo in option description
To: libcoap-developers <libcoap-developers@lists.sourceforge.net>
Date: Sat,  9 Apr 2016 21:50:45 +0200 (1 day, 11 hours, 38 minutes ago)

From: Carsten Schoenert <c.schoenert@t-online.de>
2016-04-11 11:57:40 +02:00
Olaf Bergmann 4b9b38cdc9 configure.ac: bugfix: removed empty AC_SEARCH_LIBS 2016-04-08 15:14:20 +02:00
Olaf Bergmann 39698f7ba7 dtls: added initial boilerplate for dtls support
coap_dtls.h defines a generic API for DTLS communication. The
initial version will use tinydtls as implementation.
2016-04-08 15:14:20 +02:00
Olaf Bergmann cadfe3df62 configure.ac: Test for sys/select.h 2016-04-08 15:14:20 +02:00
Olaf Bergmann 96d572d309 prng.c: move platform-specific PRNG invocation into separate files
This change introduces a new subtree in the library's directory structure.
Platform-specific code now should be placed into the corresponding directory
in src/platform/. To illustrate this, prng.h has been split into three
distinct files, one for each platform (contiki, lwip, posix) and moved into
the respective subdirectory.
2016-04-08 15:14:20 +02:00
Carsten Schoenert 90e245e9fe remarking the change of the projects homepage
As started with other commits put on some more variables with the
changed location of the project.

in addition to 7452d7d50f
2016-01-15 23:33:53 +01:00
Carsten Schoenert a0b31e74d1 configure.ac: increase dep on Autoconf 2.64 2015-12-16 16:09:34 +01:00
Olaf Bergmann 2da31de732 configure.ac: fix disable options
The options --disable-documentation and --disable-examples did
not have the desired effect in some configurations. Now, if any
of documentation or examples is disabled, the manual pages in
the examples folder are not created.
2015-09-30 19:46:34 +02:00
Olaf Bergmann 838d5ce37b configure.ac: make A2X precious
A2X is explicitly declared with AC_ARG_VAR to allow users to pass
a custom value to configure. Thus, users who do not have a2x
installed can invoke

  A2X=/bin/true ./configure --enable-examples

to prevent configure stopping on the a2x check.
2015-06-27 15:38:32 +02:00