In some cases it might be advantageous to install tinydtls to some
(system-wide) prefix (e.g. `/usr/local`) and use it from there.
Because the tinydtls headers require the header sub-directory (i.e.
`/usr/local/include/tinydtls` if the prefix is `/usr/local`) to be in the
header search path, software that uses tinydtls has to add `-I[HEADER_PATH]`
to its compiler flags (as well as the `-L[LIB_PATH] -ltinydtls` linker flags
if the prefix is not part of the standard library search path).
By providing a pkg-config file, it is possible for build scripts in dependent
projects to automatically set the appropiate compiler and linker flags for
tinydtls without having to manually find the tinydtls subdirectory in one of
its header search path entries.
The format of the pkg-config file follows the guide in
https://people.freedesktop.org/~dbn/pkg-config-guide.html, with the same
adjustments that were made in e.g. libcoap
(https://github.com/obgm/libcoap/blob/develop/libcoap-3.pc.in) to allow for
integration into autotools (e.g. setting the package name, URL and version
based on the values specified in `AC_INIT`).
Signed-off-by: Hugo Hakim Damer <hdamer@uni-bremen.de>
configure.ac:
Remove spurious ] from the CUNIT test
README:
Include autoreconf to handle configure.ac updates.
Signed-off-by: Jon Shallow <supjps-libcoap@jpshallow.com>
If '--enable-tests' is given and the CUnit library was found, the
pre-processor symbol TEST_INCLUDE is set to 1 to enable additional API
functions that allow calling static functions from unit tests. This
functionality is currently used in the ECC module.
Change-Id: I1d1a5a2028d339edd7f73ab14e5c8f2ef562b36e
Allow the user to disable shared library through --disable-shared.
Indeed, building of shared libraries is not supported by all toolchains
especially embedded ones
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
The new configure option --enable-tests checks for the presence
of the cunit test framework [1] and enables the unit tests if
available. The unit tests are disabled by default.
[1] https://cunit.sourceforge.net
Change-Id: I5393010190c3fb236bcfe4ab7498a8b24a8731fd
The ruby ffi gem doesn't seem to support static libraries.
This is a dirty hack since I don't know how GNU autotools works.
Change-Id: If1b23b770ec5f16562cde1f8874c6a4331c93929
Signed-off-by: Sören Tempel <tempel@uni-bremen.de>
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
When not using automake, invocation of autoreconf does not install
missing scripts such as install-sh but makes configure check for
an install script. As a workaround, this change creates an empty
file 'install-sh' in the current directory unless it is already
present.
Note that the Makefiles use 'cp' for installation.
Change-Id: Ief05a5672344c2e63f106c4442dc6f954d93983c
When configured for a different host, the variables CC, AR and
RANLIB have not been set correctly. With this fix, tinydtls can
be compiled for another platform when it is configured as a
submodule of an automake-enabled project.
For example, when the dtls branch of libcoap[1] can be cross-compiled
for the raspberry pi as follows:
./configure --with-host=arm-linux-gnueabihf --disable-shared
Note that cross-compilation does not yet work without automake as the
m4 macro AM_PROG_AR depends on automake.
[1] https://github.com/obgm/libcoap/tree/dtls
Change-Id: If23080dc7754a48434e7ac787c0bddda1dd9530b
The check for malloc usually is not required but can fail when
cross-compiling. In that case, autoconf looks for rpl_malloc()
which would need to be implemented by the application. A common
way of dealing with this is to remove AC_FUNC_MALLOC from
configure and have the user provide a malloc() wrapper if required.
Change-Id: I24ab688d0ffdcf7233db9f250a5d8255d72a9ad4