* 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().
The helper functions decode_segment() and check_segment() are private
functions in uri.c and thus should not be accessible from outside. For
simplicity, these functions have been copied to client.c.
As the libcoap sources have been moved to the sub-directory src it
must be added to the vpath. The header files now reside in include/coap,
so we need an additional -I compiler flag for this.
The root path for libcoap is derived from the variable APPDS which is
set by $(CONTIKI)/Makefile.include. This is a bit fragile but the best
we have...
Made vpath %.c point to ../../src and repaired include path.
The common part of the Makefile has been moved to Makefile.common
to leverage Makefile creation for other platforms such as econotag.
Some compilers (clang, e.g.) just emit a warning that the tested
flags are not supported. As the macro does not recognize this,
we must pass -Werror as EXTRA_FLAG to exclude the unknown flags.
For Solaris, XPG4v2 must be enabled for ancillary data while the compiler flag
-std=c99 restricts the code to C99 and nothing else. To make this work anyway,
we have to use the following compiler flags:
-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=600 -D__EXTENSIONS__=1
clang has dropped support for this warning and therefore emits
warnings when it is used as a compiler flag.
configure now uses AX_CHECK_COMPILE_FLAG[0] to check for compiler support.
[0] http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
Because local m4 macros are located in the sub-directory m4, autogen.sh
must not remove that directory but only clean the libtool-generated files.
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.
This option is used to extract function names from C header files
but is not supported by all versions of ctags. In particular, the
version included with GNU Emacs does not recognize it. This simple
test checks if '--c-kinds=f' is recognized and emits a warning
otherwise.
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.
Adding a configure option to enable the build of the unit test binary.
This commit is just the configure option, the implementation into the
folder tests/ will follow!
Doxygen supports the creation of DOT graphics, but this depends on the
existence of the 'dot' binary on the build host. Adding a check for dot
and disable the support within the Doxygen file for DOT graphics if dot
can't be found.
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.
Starting to add some checks while configure runs. We are starting with
support for the classical linux system, kFreeBSD would be fine to
supporting too!
To reduce the places to define the package versions setting up the
version string by m4_define macros.
The complete substitution through the config files will be done
automatically by autoconf.
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'.
On some systems we must the struct in_pktinfo and in6_pktinfo defining
by ourself. But on POSIX systems the definition is made by the header
netinet/in.h, so check if there is a flag HAVE_NETINET_IN_H been set and
skip the self made definition.
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.
The autotools will generate the *.in files automatically. We have to
move the current files out of the way to not look later probably into
the old files while re creating the build maintaining config.
In preparation for changing the make buildsystem to a fully autotools
controlled system moving the core libcoap source files to a better logical
place.
All the library related header files moving to include/coap/ to get
all the public and local header files in a separate place. Also moving
the C source files of the libcoap library to the folder src/.