ctags is being used to create the symbol maps for dynamic library
generation. Exported symbols from other platforms such as LWIP
must be excluded from these maps to avoid linker errors for undefined
symbols.
This modification adds the LWIP-specific function coap_socket_send_pdu()
to the exclusion list.
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.
Deleting the pkg-config file and also the *.map and *.sym file in a
clean-local target isn't correct as we have no default automatic way to
regenerate *.map and *.sym files before the build of the libcoap is
starting.
Currently there is no need for such a automatic rebuild, the user
normaly doesn't need to do anything on those files. They even don't
should be rebuild by the users in normal cases.
Adding or removing symbols is a sensible thing and the maintenance is
probably up to the developers. Beside that there is the target
'update-map-file' that is used by the developers to (re)build this two
files if needed.
This commit is also adding a new helper target 'dist-local' with a
depency on 'update-map-file' so we are sure to have actual *.map and
*.sym file if we create a tarball for a release.
Moving the .PHONY targets to the end of the Makefile.am as this is the
typical place.
The build environment was lacking the possibility to get libcoap
buildable out of tree, simply checkable by the running 'make distcheck'.
Without this fix the users are impossible to build libcoap in a own
folder that's independed from the source containing folder. Typical use
case would be:
$ mkdir libcoap-build && cd libcoap-build
$ /path/to/libcoap-source/configure \
--srcdir=/path/to/libcoap-source \
--prefix=/somethere/to-install
This commit enables the out of tree build by adding and changing some
needed variables.
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.
As automake processing prevents using makefile variables in prefixed
automake constructs such as *la_SOURCES, platform-specific locations
must be spelled out literally.
This fixes issue #30, see https://github.com/obgm/libcoap/issues/30
An application can register a callback function of type
coap_event_handler_t that will be called by the library on certain
events. Currently, the DTLS implementation invokes coap_handle_event()
with session-specific events such as session close or
renegotiation.
coap_keystore.[hc] provides a simple data structure for managing
credentials to be used during DTLS handshake. Each coap_context_t
has its own keystore object that is independent of the actual
DTLS context. Applications can access the keystore during the
entire lifetime of the coap context. The existing implementation
is not thread-safe.
Endpoints will be attached to the context object using a new function
coap_attach_endpoint(). The sockfd component has been removed from
coap_context_t as it is accessible by the endpoint.
coap_endpoint_t has a new field 'context' that refers to the context
object the respective endpoint has been associated with, or NULL
if it is not attached to any context. An endpoint can be attached
to at least one context at a time.
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.
The Makefile uses ctags to build a list of global identifiers
that should be exported in a dynamic library. As ctags has a
very simplistic way of handling preprocessor conditionals, it
cannot detect symbols that are not present on platform POSIX.
In particular, the Solaris ld chokes on the following:
Undefined first referenced
symbol in file
coap_pdu_from_pbuf ../.libs/libcoap-1.0.so
coap_packet_extract_pbuf ../.libs/libcoap-1.0.so
The easiest way to fix this is to tell ctags that is should
ignore these identifiers with option -I.
After including the doc/ and the tests/ folder under the hood of the
autotools now adding the examples/ foolder too.
The user is now able to add the build of the example binarys if
configure is called with '--enable-examples' as option. The example
binarys will not be build by default!
Currently only 'coap-client', 'coap-server' and 'rd' is build.
Calling a shellscript within a Makefile is not POSIX compliant, it's
possible that it would not work on all platforms. But using the check
for ctags as a seperate target within the main Makefile is no problem
and easy to change.
This commit is a addition to 101efbfe69
* Removed tne preprocessor defines for coap_tick() and coap_clock_init() --
this made the code less readable and seemed to be of little use.
* Introduced the new type coap_time_t to represent wall clock time. On POSIX,
this is the number of seconds since the epoch, while on embedded systems
without a real time clock, this could be the number of seconds since the
last reboot. The new function coap_ticks_to_rt() is used to convert
coap_tick_t to coap_time.h. Currently, this is a division by COAP_TICKS_PER_SECOND
on all platforms.
* POSIX: coap_tick_t is now defined as unsigned long to avoid overflows in
coap_ticks().
As not all versions of ld support linker scripts, we need plain
symbol files as fallback. This commit extends the Makefile target
'update-map-file' to create a .sym file in addition to the .map
file.
Doing up some housekeeping around the used CFLAGS.
To be more generic put the default declaration for additional warning
CFLAGS into configure.ac and clean up the Makefile.am's.
There are the default CFLAGS variable that is a global variable if not
re adjusted inside the different targets.
The second variable for CFLAGS is the AM_CFLAGS definition that is used
inside a Makefile as a global variable.
There is also the possibility to graduate the CFLAGS for a single
target. But currently there are nothing more than one target within each
Makefile so we can set for now the target specific CFLAGS to the
AM_CFLAGS.
A new variable called WARNING_CFLAGS is inside the configure.ac created,
this variable holds all the warnings flags inside. The Makefile.am's are
taking the values and is setting the variable AM_CFLAGS which is used in
the target specific CFLAGS. Also the options 'DWITH_POSIX' and
'D_GNU_SOURCE' are now appended to the CFLAGS if the configure script is
detecting a *-[uc]linux* system.
To let the previous added configure option '--enable-tests' really build
the testdriver binary adding the needed changes to the files in the main
folder.
Finally adding a new Makefile.am within the tests/ folder.
To install the doxygen output, which is generated within doc/html/,
adding the needed checks for the doxygen binary to configure.ac and also
adding the needed doc/Makefile.am file.
Finally tuning doc/Doxyfile.in to let the autotools write the needed
informations into this file while generating the finally created
doc/Doxyfile.
To help the users of the libcoap and especially the linker on the users
machines adding a libcoap.pc file that will be installed while the call
of 'make install'.
To develop something libcoap related people need the public header files
to include the function definitions into their projects.
The public libcoap headers will be installed into the system by the
current order like
.
└── include
└── coap
├── address.h
├── async.h
├── bits.h
├── block.h
├── coap.h
├── coap_io.h
├── coap_time.h
├── debug.h
├── encode.h
├── hashkey.h
├── mem.h
├── net.h
├── option.h
├── pdu.h
├── prng.h
├── resource.h
├── str.h
├── subscribe.h
├── t_list.h
├── uri.h
├── uthash.h
└── utlist.h
That's not final! Currently the public header files include the locally
by the autoconf generated coap_config.h header file. These includes have
to be removed before we can call the header really public headers!
Start adding basic files for generating all the needed files to create a
working build environment by the autotools. By this currently only the
shared library of libcoap is build.
There is no API version implemented! This has to be done later.