Commit Graph
612 Commits
Author SHA1 Message Date
Olaf Bergmann 8894f2ffec Fixed a couple of warnings from doxygen. 2015-03-09 14:53:01 +01:00
Olaf Bergmann 284f4afb84 Added missing macro ax_check_link_flag.m4 2015-03-08 21:40:14 +01:00
Olaf Bergmann 4ca91190d6 Revised time-related functions to get rid of clock_offset for POSIX platform.
* 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().
2015-03-08 15:14:43 +01:00
Olaf Bergmann a31981b95b Implement decode_segment() and check_segment(), LWS cleanup
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.
2015-03-08 15:09:22 +01:00
Olaf Bergmann fa3f09cdb7 Fix warnings in unit tests 2015-03-04 15:10:09 +01:00
Olaf Bergmann 853049fe47 Make private functions static 2015-03-04 14:57:26 +01:00
Olaf Bergmann 71de08ac5f Fix warnings in resource.c
Internal functions are now static. print_wellknown() is exported
as coap_print_wellknown() to make it accessible from net.c and
for unit tests.
2015-03-04 14:55:26 +01:00
Olaf Bergmann e297a0ca76 Fix warnings in net.[hc]
Internal functions are now static. wellknown_response() is exported
as coap_wellknown_response() to make it accessible for unit tests.
2015-03-04 14:43:42 +01:00
Olaf Bergmann 8ba8d2a288 Exclude m4/ax_* from .gitignore 2015-03-04 13:48:11 +01:00
Olaf Bergmann f1b8a48bfc Fix source path and include flag for Contiki build
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...
2015-03-04 13:22:05 +01:00
Olaf Bergmann 4b249f3739 coap_list.c was moved to examples 2015-03-04 13:19:56 +01:00
Olaf Bergmann 78b96e606d Fix lwip example 2015-03-03 22:03:37 +01:00
Olaf Bergmann 124d871cc8 Fixed path to source and header path
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.
2015-03-03 21:53:26 +01:00
Olaf Bergmann 5a7300f5c2 Add Darwin to known platforms 2015-03-03 20:10:09 +01:00
Olaf Bergmann 9c7d45a924 Invoke AX_CHECK_COMPILE_FLAG with -Werror
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.
2015-03-03 20:03:50 +01:00
Olaf Bergmann 53f35526db Define SOL_IP to IPPROTO_IP for platforms that do not have it 2015-03-03 19:21:44 +01:00
Olaf Bergmann 0af74b7cd6 Add Solaris to known platforms
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
2015-03-03 19:21:44 +01:00
Olaf Bergmann 489df85c88 Check if linker supports scripts for versioning
Use ld's option --version-script where available and fall back
to plain symbol file otherwise. This check uses the m4 macro
AX_CHECK_LINK_FLAG <http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html>
2015-03-03 19:21:44 +01:00
Olaf Bergmann e3f555f396 Check if compiler supports -fdiagnostics-color
Newer compilers such as clang or gcc 4.9 can emit colorized
diagnostics. For gcc, this flag must be present to switch
coloring on.
2015-03-03 19:21:44 +01:00
Olaf Bergmann 81bc3dd9f5 Check if compiler supports -Wlogical-op
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.
2015-03-03 19:21:43 +01:00
Olaf Bergmann 101efbfe69 Create symbol file libcoap-$(LIBCOAP_API_VERSION).sym
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.
2015-03-03 19:21:43 +01:00
Olaf Bergmann fe1b34e78e Check if ctags supports option --c-kinds
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 96d875ab7a CFLAGS: reorder the various CFLAGS inside the files
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert c9c1a80271 adding the tests/ folder to the build environment
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 5e018950fc configure.ac: adding configure switch for test binary
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!
2015-03-03 19:21:43 +01:00
Carsten Schoenert d37e47e12c configure.ac: changing libtool behavior for library build
The unit test binary needs the static library to link against. So there
is a real need to not only build the dynamic version of libcoap library.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 700753e1d2 configure.ac: adding check for dot binary
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert e68e506f45 doc/Doxyfile.in: update to recent version compatibility
Update to doxygen 1.8.x, also enable creation of DOT graphics.
2015-03-03 19:21:43 +01:00
Carsten Schoenert e11842e033 .gitignore: adding some more file to ignore 2015-03-03 19:21:43 +01:00
Carsten Schoenert 80d74208ce adding the doc/ folder to the build environment
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 4da433ca06 configure.ac: adding check for hostsystem
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!
2015-03-03 19:21:43 +01:00
Carsten Schoenert dc2ada4323 adding check for ctags
We need ctags to run the make target 'update-map-file' so we better give
a warning out if ctags wasn't found.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 4dc6637525 libcoap-1.0.map: adding first symbol mapping file 2015-03-03 19:21:43 +01:00
Carsten Schoenert a42f35303c adding dynamic libtool versioning to libcoap
To not fight every time with the logic of libtool for needed versioning
info of libcoap adding some automatism into the autoconf files. So now
there are only three lines to change if a release is planned.
Please note and respect the instructions inside configure.ac to generate
a correct versioning for libtool. But libtool will tell you later if you
doing something wrong with the versions. :)

Some helpful informations can be found on the following websites as
well.

http://ftp.gnu.org/pub/old-gnu/Manuals/libtool-1.4.2/html_chapter/libtool_6.html
https://blog.flameeyes.eu/2010/10/linkers-and-names
https://blog.flameeyes.eu/2009/04/shared-object-version
https://phab.enlightenment.org/w/autotoolsintegration/
https://autotools.io/libtool/version.html
http://www.freesoftwaremagazine.com/articles/building_shared_libraries_once_using_autotools
https://www.sourceware.org/autobook/autobook/autobook_91.html
2015-03-03 19:21:43 +01:00
Carsten Schoenert d6bc9dba10 configure.ac: use m4 macros to define package version
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 45760a922d pkgconfig: adding related package files
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'.
2015-03-03 19:21:43 +01:00
Carsten Schoenert 0d1fa72073 src/coap_io.c: fix definition of struct in*_pktinfo
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert c7299d9c86 adding install target for public header
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!
2015-03-03 19:21:43 +01:00
Carsten Schoenert d20c658e2f adding a .gitignore file
To be not confused by the auto generated autoreconf files putting these
into a .gitignore file.
2015-03-03 19:21:43 +01:00
Carsten Schoenert b16b0a2767 adding some sanity checks to autogen.sh 2015-03-03 19:21:43 +01:00
Carsten Schoenert 9f06f77004 adding basic files for build environment creation
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert cda3b72f25 removing later auto generated files
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.
2015-03-03 19:21:43 +01:00
Carsten Schoenert fc9b47167a moving library related files to new folders
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/.
2015-03-03 19:21:43 +01:00
Olaf Bergmann fd86c02ac4 updated year in boilerplate text 2015-03-03 12:30:42 +01:00
Olaf Bergmann 8d664dd475 Fixed Contiki-specific Makefile 2015-03-03 12:30:42 +01:00
Olaf Bergmann 9d673c8cfd moved platform-specific Makefile.contiki into examples/contiki 2015-03-03 12:30:42 +01:00
Olaf Bergmann e3ed4c8529 updated change log
Changes have been logged in git so this file has been neglected for
so long.
2015-03-03 12:30:42 +01:00
Olaf Bergmann 3333393247 README was renamed to README.md to produce nice ouput 2015-03-03 12:29:13 +01:00
Olaf Bergmann 7e300c04d9 fix CoAP RFC number in comments 2015-03-03 12:29:13 +01:00
Olaf Bergmann eee68ae0b6 set new version number 4.1.2 2015-03-03 12:29:13 +01:00