Commit Graph
603 Commits
Author SHA1 Message Date
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
Olaf Bergmann b6c92bb927 use fixpoint arithmetic for retransmission timeout calculation
It was noted on the mailing list that the changed retransmission
timeout calculation in commit 1a28b3 may yield to inefficient code
on embedded systems which have no fpu. This change now uses
fixed point arithmetic instead. By default, it represents ACK_TIMEOUT
and ACK_RANDOM_FACTOR as Q2.6 numbers and uses Q0.8 for the
randomness parameter. The resulting timeout value is represented in
system ticks (i.e. a multiple of COAP_TICKS_PER_SECOND) as an
unsigned integer.
2015-02-21 16:34:10 +01:00
Olaf Bergmann a81a37b29d bugfix: CLIENT_OBJS in Makefile.in unknown
This variable has been renamed to client_OBJECTS but the change was
missing in target coap-client.
2015-02-21 16:32:35 +01:00
Olaf Bergmann aa3a050641 Replaced custom list implementation with linked lists from utlist.h
coap_insert() now appends every item at the list's end, sorting must
be done explicitly using LL_SORT. As a side-effect, the new
implementation makes valgrind happy :-)
2015-02-20 13:30:32 +01:00
Olaf Bergmann f4f4ffd900 Moved coap_list.[hc] to examples
The list implementation in coap_list.c is only used in client.c
hence it was moved into the examples sub-directory.
2015-02-20 13:10:04 +01:00
Olaf Bergmann 5fb5a7bbb6 fixed omitted word in comment 2015-02-19 17:57:08 +01:00
Olaf Bergmann 1a28b3b6d9 Fixed retransmission timeout calculation
The retransmission timeout is more accurate now by using floating point
arithmetic.

For better readability, the parameter names from RFC 7252 are used.
2015-02-19 14:18:10 +01:00
Olaf Bergmann 9e193ba65f uthash.h: Add missing default statement in HASH_JEN
With -Wswitch-default enabled, gcc complains about the missing default in
macro HASH_JEN. The default is not required but included to shut gcc up.
2015-02-18 15:29:21 +01:00
Olaf Bergmann e15d6ff3ab moved to uthash 1.9.9
Replaced 1.9.3 version of uthash.h and utlist.h by latest files from
https://github.com/troydhanson/uthash with many fixes and improvements.
2015-02-18 15:18:55 +01:00
Olaf Bergmann 961b5e0719 fix compiler warning for strnlen()
strnlen() is used for formatting messages in debug.c. As strnlen() is
unknown in C99, the compiler emits a warning even if configure has
detected the presence of strnlen() in glibc and has set HAVE_STRNLEN
accordingly. To overcome this, the symbol _GNU_SOURCE now is set when
HAVE_STRNLEN and __GNUC__ are defined but not _GNU_SOURCE. This works
not only for glibc prior 2.10 but also for newer versions that conform
to POSIX.1-2008 (see strnlen(1)).
2015-02-18 13:18:18 +01:00