summaryrefslogtreecommitdiffstats
path: root/patches/libcoap-4.1.1
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-03-30 14:35:52 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2014-04-01 08:23:34 +0200
commite5732facd106fc1f32b3571de7eeb669db572e37 (patch)
tree76a6fd08212f7f5f466445b9a1f9d21408bcd963 /patches/libcoap-4.1.1
parentf582b9b2ff09be600516cc4d7e5e434f6f1b1a67 (diff)
downloadptxdist-e5732facd106fc1f32b3571de7eeb669db572e37.tar.gz
ptxdist-e5732facd106fc1f32b3571de7eeb669db572e37.tar.xz
libcoap: add new package
This patch adds the libcoap implementation [0]. The most common use of this library is to use it with contiki os. That's one reason why the current buildsystem isn't "well". The added patches replace the current buildsystem with a better one. The replacement had the goal to made less changes to the current libcoap implementation. The libcoap implementation do a include of autoconf "config.h" header file in the API headers. The patches adds a new libcoap_config.h with a LIBCOAP_ prefix to all defines and replace the use of these defines in the API headers. That's too not well but offers a workaround to make a clean install of this library and other autotools software can use it. I found in the current release some things which are broken like some disable features in configure call and others things which are not well. I don't fix it in the patches, I will try to send the fixes to the maintainer of this project and hopefully it's fixed in the next release. Libcoap is still the best known C implementation of the coap protocol, but also it's a bleeding edge implementation of a draft [1]. [0] http://sourceforge.net/projects/libcoap/ [1] http://tools.ietf.org/html/draft-ietf-core-coap-18 Signed-off-by: Alexander Aring <alex.aring@gmail.com> [mol: simplify first patch] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/libcoap-4.1.1')
-rw-r--r--patches/libcoap-4.1.1/0001-libcoap-remove-current-buildsystem.patch235
-rw-r--r--patches/libcoap-4.1.1/0002-libcoap-add-new-buildsystem.patch518
-rw-r--r--patches/libcoap-4.1.1/0003-libcoap-change-include-config.h-to-libcoap_config.h.patch148
-rw-r--r--patches/libcoap-4.1.1/0004-libcoap-add-LIBCOAP_-prefix-to-HAVE_-in-headers.patch132
-rw-r--r--patches/libcoap-4.1.1/0005-libcoap-add-LIBCOAP-prefix-to-COAP_MAX_PDU_SIZE.patch60
-rw-r--r--patches/libcoap-4.1.1/0006-libcoap-add-LIBCOAP-prefix-to-WITHOUT_ASYNC.patch49
-rw-r--r--patches/libcoap-4.1.1/0007-libcoap-add-LIBCOAP-prefix-to-NDEBUG.patch22
-rw-r--r--patches/libcoap-4.1.1/0008-client-fix-compiler-warning.patch22
l---------patches/libcoap-4.1.1/autogen.sh1
-rw-r--r--patches/libcoap-4.1.1/series11
10 files changed, 1198 insertions, 0 deletions
diff --git a/patches/libcoap-4.1.1/0001-libcoap-remove-current-buildsystem.patch b/patches/libcoap-4.1.1/0001-libcoap-remove-current-buildsystem.patch
new file mode 100644
index 000000000..5fe95a259
--- /dev/null
+++ b/patches/libcoap-4.1.1/0001-libcoap-remove-current-buildsystem.patch
@@ -0,0 +1,235 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sat, 29 Mar 2014 20:19:01 +0100
+Subject: [PATCH] libcoap: remove current buildsystem
+
+Upstream won't accept this, so do as little as possible and only remove
+files that won't be overwrite later in the build process.
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ configure.in | 98 -------------------------------------------------------
+ doc/Makefile.in | 45 -------------------------
+ tests/Makefile.in | 57 --------------------------------
+ 3 files changed, 200 deletions(-)
+ delete mode 100644 configure.in
+ delete mode 100644 doc/Makefile.in
+ delete mode 100644 tests/Makefile.in
+
+diff --git a/configure.in b/configure.in
+deleted file mode 100644
+index 77f6c8f..0000000
+--- a/configure.in
++++ /dev/null
+@@ -1,98 +0,0 @@
+-# -*- Autoconf -*-
+-# Process this file with autoconf to produce a configure script.
+-#
+-# Copyright (C) 2010--2014 Olaf Bergmann <bergmann@tzi.org>
+-#
+-# This file is part of the CoAP library libcoap. Please see
+-# README for terms of use.
+-
+-AC_PREREQ([2.65])
+-AC_INIT([libcoap], [4.1.1])
+-AC_CONFIG_SRCDIR([coap.h])
+-
+-# First check for Contiki build to quit configure before any other test
+-AC_ARG_WITH(contiki,
+- [AS_HELP_STRING([--with-contiki],[build libcoap for the Contiki OS])],
+- [cp -p Makefile.contiki Makefile
+- cp -p config.h.contiki config.h
+- AC_MSG_NOTICE([Contiki build prepared])
+- exit 0],
+- [])
+-
+-# Checks for programs.
+-AC_PROG_MAKE_SET
+-AC_PROG_CC
+-AC_PROG_RANLIB
+-AC_PATH_PROG(DOXYGEN, doxygen, [:])
+-AC_PATH_PROG(ETAGS, etags, [/bin/false])
+-
+-AC_C_BIGENDIAN
+-
+-# Checks for libraries.
+-AC_CHECK_LIB([coap], [coap_new_pdu])
+-
+-AC_SEARCH_LIBS([gethostbyname], [nsl])
+-AC_SEARCH_LIBS([socket], [socket])
+-
+-# configuration options that may change compile flags
+-AC_ARG_WITH(debug,
+- [AS_HELP_STRING([--without-debug],[disable all debug output and assertions])],
+- [CPPFLAGS="${CPPFLAGS} -DNDEBUG"],
+- [])
+-
+-AC_ARG_WITH(async,
+- [AS_HELP_STRING([--without-async],[disable handling of asynchronous transactions and observe])],
+- [CPPFLAGS="${CPPFLAGS} -DWITHOUT_ASYNC"],
+- [])
+-
+-AC_ARG_WITH(block,
+- [AS_HELP_STRING([--without-block],[disable block transfer])],
+- [CPPFLAGS="${CPPFLAGS} -DWITHOUT_BLOCK"],
+- [])
+-
+-AC_ARG_WITH(observe,
+- [AS_HELP_STRING([--without-observe],[disable resource observation])],
+- [CPPFLAGS="${CPPFLAGS} -DWITHOUT_OBSERVE"],
+- [])
+-
+-AC_ARG_WITH(query-filter,
+- [AS_HELP_STRING([--without-query-filter],[disable support for filters on /.well-known/core])],
+- [CPPFLAGS="${CPPFLAGS} -DWITHOUT_QUERY_FILTER"],
+- [])
+-
+-AC_ARG_WITH(tests,
+- [AS_HELP_STRING([--with-tests],[enable unit tests (requires cunit)])],
+- [TESTS="tests"],
+- [])
+-
+-AC_ARG_WITH(shared,
+- [AS_HELP_STRING([--with-shared],[build shared library])],
+- [BUILD_SO="BUILD_SO=1"],
+- [])
+-
+-# disambiguate between autoconf generated setups and contiki / lwip setups
+-# which use explicit config.h.* files
+-CPPFLAGS="${CPPFLAGS} -DWITH_POSIX"
+-
+-# Checks for header files.
+-AC_CHECK_HEADERS([assert.h arpa/inet.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h time.h unistd.h sys/unistd.h syslog.h])
+-
+-# Checks for typedefs, structures, and compiler characteristics.
+-AC_TYPE_SIZE_T
+-AC_TYPE_SSIZE_T
+-
+-# Checks for library functions.
+-AC_FUNC_MALLOC
+-AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo strnlen])
+-
+-AC_SUBST(TESTS)
+-AC_SUBST(BUILD_SO)
+-
+-AC_CONFIG_HEADERS([config.h])
+-
+-AC_CONFIG_FILES([Makefile
+- doc/Makefile
+- doc/Doxyfile
+- examples/Makefile
+- tests/Makefile])
+-AC_OUTPUT
+diff --git a/doc/Makefile.in b/doc/Makefile.in
+deleted file mode 100644
+index df72d6a..0000000
+--- a/doc/Makefile.in
++++ /dev/null
+@@ -1,45 +0,0 @@
+-# Makefile for libcoap
+-#
+-# Copyright (C) 2010 Olaf Bergmann <bergmann@tzi.org>
+-#
+-# This program is free software; you can redistribute it and/or
+-# modify it under the terms of the GNU General Public License
+-# as published by the Free Software Foundation; either version 2
+-# of the License, or (at your option) any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+-
+-# the library's version
+-VERSION:=@PACKAGE_VERSION@
+-
+-# tools
+-@SET_MAKE@
+-SHELL = /bin/sh
+-MKDIR = mkdir
+-DOXYGEN= @DOXYGEN@
+-
+-top_builddir = @top_builddir@
+-
+-DISTDIR?=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
+-FILES:=Makefile.in Doxyfile.in html
+-
+-doc: Doxyfile
+- $(DOXYGEN) $< >./doxygen.out 2>&1
+-
+-clean:
+- @rm -rf html
+-
+-distclean: clean
+- @rm -rf $(DISTDIR)
+- @rm -f *~
+-
+-dist: doc
+- test -d $(DISTDIR)/doc || mkdir $(DISTDIR)/doc
+- cp -r $(FILES) $(DISTDIR)/doc
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+deleted file mode 100644
+index 95da5c0..0000000
+--- a/tests/Makefile.in
++++ /dev/null
+@@ -1,57 +0,0 @@
+-# Makefile for libcoap
+-#
+-# Copyright (C) 2012 Olaf Bergmann <bergmann@tzi.org>
+-#
+-# This file is part of the CoAP library libcoap. Please see
+-# README for terms of use.
+-
+-# the library's version
+-VERSION:=@PACKAGE_VERSION@
+-
+-# tools
+-@SET_MAKE@
+-SHELL = /bin/sh
+-MKDIR = mkdir
+-
+-abs_builddir = @abs_builddir@
+-top_builddir = @top_builddir@
+-top_srcdir = @top_srcdir@
+-# files and flags
+-ifneq (,@TESTS@)
+- PROGRAMS:=testdriver
+-endif
+-SOURCES:= test_uri.c test_options.c test_pdu.c test_error_response.c \
+- test_sendqueue.c test_wellknown.c
+-HEADERS:=$(SOURCES:.c=.h)
+-OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
+-CFLAGS:=-g -Wall @CFLAGS@
+-CPPFLAGS:=-I$(top_srcdir) @CPPFLAGS@
+-DISTDIR?=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
+-FILES:=Makefile.in testdriver.c $(HEADERS) $(SOURCES)
+-LDFLAGS:=-L$(top_builddir) @LDFLAGS@
+-LDLIBS:=-lcunit @LIBS@
+-libcoap =$(top_builddir)/libcoap.a
+-
+-.PHONY: clean distclean
+-
+-.SUFFIXES:
+-.SUFFIXES: .c .o
+-
+-all: $(PROGRAMS)
+-
+-check:
+- echo DISTDIR: $(DISTDIR)
+- echo top_builddir: $(top_builddir)
+-
+-testdriver: $(OBJECTS) $(libcoap)
+-
+-clean:
+- @rm -f $(PROGRAMS) $(OBJECTS)
+-
+-distclean: clean
+- @rm -rf $(DISTDIR)
+- @rm -f *~
+-
+-dist: $(FILES)
+- test -d $(DISTDIR)/tests || mkdir $(DISTDIR)/tests
+- cp $(FILES) $(DISTDIR)/tests
diff --git a/patches/libcoap-4.1.1/0002-libcoap-add-new-buildsystem.patch b/patches/libcoap-4.1.1/0002-libcoap-add-new-buildsystem.patch
new file mode 100644
index 000000000..ad999e28c
--- /dev/null
+++ b/patches/libcoap-4.1.1/0002-libcoap-add-new-buildsystem.patch
@@ -0,0 +1,518 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sat, 29 Mar 2014 21:18:47 +0100
+Subject: [PATCH] libcoap: add new buildsystem
+
+This patch adds support for autotools buildsystem.
+
+The configure arguments can be:
+
+ --enable-debug
+ --disable-async
+ --disable-block
+ --disable-observe
+ --disable-query-filter
+
+the same like the real libcoap implementation.
+
+In addition I added a:
+
+ --with-max-pdu-size=COAP_MAX_PDU_SIZE
+
+to replace the COAP_MAX_PDU_SIZE define with a given number.
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ Makefile.am | 88 +++++++++++++++++++++
+ autogen.sh | 19 +++++
+ configure.ac | 107 +++++++++++++++++++++++++
+ examples/Makefile.am | 9 +++
+ libcoap.pc.in | 11 +++
+ m4/ax_prefix_config.m4 | 209 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 6 files changed, 443 insertions(+)
+ create mode 100644 Makefile.am
+ create mode 100755 autogen.sh
+ create mode 100644 configure.ac
+ create mode 100644 examples/Makefile.am
+ create mode 100644 libcoap.pc.in
+ create mode 100644 m4/ax_prefix_config.m4
+
+diff --git a/Makefile.am b/Makefile.am
+new file mode 100644
+index 0000000..c8f796c
+--- /dev/null
++++ b/Makefile.am
+@@ -0,0 +1,88 @@
++ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
++EXTRA_DIST =
++CLEANFILES =
++
++SUBDIRS = . examples
++
++AM_MAKEFLAGS = --no-print-directory
++
++AM_CFLAGS = \
++ -include $(top_builddir)/config.h \
++ -DSYSCONFDIR=\""$(sysconfdir)"\" \
++ -DLIBEXECDIR=\""$(libexecdir)"\" \
++ -I${top_srcdir} \
++ ${libcoap_CFLAGS} \
++ -ffunction-sections \
++ -fdata-sections
++
++AM_LDFLAGS = \
++ -Wl,--gc-sections \
++ -Wl,--as-needed
++
++SED_PROCESS = \
++ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
++ -e 's,@VERSION\@,$(VERSION),g' \
++ -e 's,@prefix\@,$(prefix),g' \
++ -e 's,@exec_prefix\@,$(exec_prefix),g' \
++ -e 's,@libdir\@,$(libdir),g' \
++ -e 's,@includedir\@,$(includedir)/coap,g' \
++ < $< > $@ || rm $@
++
++%.pc: %.pc.in Makefile
++ $(SED_PROCESS)
++
++LIBCOAP_CURRENT=4
++LIBCOAP_REVISION=1
++LIBCOAP_AGE=1
++
++nodist_pkginclude_HEADERS =\
++ libcoap_config.h
++
++pkginclude_HEADERS =\
++ address.h \
++ async.h \
++ bits.h \
++ block.h \
++ coap.h \
++ coap_list.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
++
++lib_LTLIBRARIES = libcoap.la
++
++libcoap_la_SOURCES =\
++ async.c \
++ block.c \
++ coap_list.c \
++ debug.c \
++ encode.c \
++ hashkey.c \
++ net.c \
++ option.c \
++ pdu.c \
++ resource.c \
++ str.c \
++ subscribe.c \
++ uri.c
++
++libcoap_la_LDFLAGS = $(AM_LDFLAGS) \
++ -version-info $(LIBCOAP_CURRENT):$(LIBCOAP_REVISION):$(LIBCOAP_AGE)
++
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = libcoap.pc
++EXTRA_DIST += libcoap.pc.in
++CLEANFILES += libcoap.pc
+diff --git a/autogen.sh b/autogen.sh
+new file mode 100755
+index 0000000..206f33e
+--- /dev/null
++++ b/autogen.sh
+@@ -0,0 +1,19 @@
++#!/bin/sh -e
++
++autoreconf --install --symlink
++
++libdir() {
++ echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
++}
++
++args="--prefix=/usr \
++--sysconfdir=/etc \
++--libdir=$(libdir /usr/lib)"
++
++echo
++echo "----------------------------------------------------------------"
++echo "Initialized build system. For a common configuration please run:"
++echo "----------------------------------------------------------------"
++echo
++echo "./configure CFLAGS='-g -O0' $args"
++echo
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..e721a77
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,107 @@
++AC_PREREQ(2.60)
++AC_INIT([coap],
++ [4.1.1],
++ [],
++ [coap],
++ [http://sourceforge.net/projects/libcoap/])
++AC_CONFIG_SRCDIR([./resource.c])
++AC_CONFIG_AUX_DIR([build-aux])
++AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
++AC_PROG_CC_STDC
++AC_USE_SYSTEM_EXTENSIONS
++AC_SYS_LARGEFILE
++AC_CONFIG_MACRO_DIR([m4])
++AM_SILENT_RULES([yes])
++LT_INIT([disable-static pic-only])
++
++AC_PROG_SED
++AC_PROG_MKDIR_P
++
++AC_ARG_ENABLE([debug],
++ AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
++ [enable_debug=$enableval], [enable_debug=no])
++AS_IF([test "x$enable_debug" = "xno"], [
++ AC_DEFINE(NDEBUG, [1], [Debug messages.])
++])
++
++AC_ARG_ENABLE([async],
++ AS_HELP_STRING([--enable-async], [enable handling of asynchronous transactions and observe @<:@default=enabled@:>@]),
++ [enable_async=$enableval], [enable_async=yes])
++AS_IF([test "x$enable_async" = "xno"], [
++ AC_DEFINE(WITHOUT_ASYNC, [1], [Asynchronous transactions.])
++])
++
++AC_ARG_ENABLE([block],
++ AS_HELP_STRING([--enable-block], [enable block transfer @<:@default=enabled@:>@]),
++ [enable_block=$enableval], [enable_block=yes])
++AS_IF([test "x$enable_block" = "xno"], [
++ AC_DEFINE(WITHOUT_BLOCK, [1], [Block tansfer.])
++])
++
++AC_ARG_ENABLE([observe],
++ AS_HELP_STRING([--enable-observe], [enable resource observation @<:@default=enabled@:>@]),
++ [enable_observe=$enableval], [enable_observe=yes])
++AS_IF([test "x$enable_observe" = "xno"], [
++ AC_DEFINE(WITHOUT_OBSERVE, [1], [Resource observation.])
++])
++
++AC_ARG_ENABLE([query-filter],
++ AS_HELP_STRING([--enable-query-filter], [enable support for filters on /.well-known/core @<:@default=enabled@:>@]),
++ [enable_query_filter=$enableval], [enable_query_filter=yes])
++AS_IF([test "x$enable_query_filter" = "xno"], [
++ AC_DEFINE(WITHOUT_QUERY_FILTER, [1], [Query filter.])
++])
++
++AC_ARG_WITH([max-pdu-size],[ --with-max-pdu-size=COAP_MAX_PDU_SIZE Max coap pdu size in bytes @<:@default=1400@:>@],
++ [max_pdu_size=$withval], [max_pdu_size=1400])
++AS_IF([test "x$max_pdu_size" = "xyes"], [
++ AC_MSG_ERROR([The max pdu size must be explicitly specified])
++])
++
++AC_DEFINE_UNQUOTED([COAP_MAX_PDU_SIZE], [$max_pdu_size],
++ [Define the max pdu size of a coap pdu in bytes.])
++
++
++# Checks for header files.
++AC_CHECK_HEADERS([assert.h arpa/inet.h limits.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h time.h unistd.h sys/unistd.h])
++
++# Checks for typedefs, structures, and compiler characteristics.
++AC_TYPE_SIZE_T
++AC_TYPE_SSIZE_T
++
++# Checks for library functions.
++AC_FUNC_MALLOC
++AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo strnlen])
++
++libcoap_CFLAGS="-Wall -DWITH_POSIX"
++AC_SUBST([libcoap_CFLAGS])
++
++AC_CONFIG_HEADERS(config.h)
++AX_PREFIX_CONFIG_H(libcoap_config.h, LIBCOAP)
++AC_CONFIG_FILES([
++ Makefile
++ examples/Makefile
++])
++
++AC_OUTPUT
++AC_MSG_RESULT([
++ $PACKAGE $VERSION
++ =====
++
++ prefix: ${prefix}
++ sysconfdir: ${sysconfdir}
++ libdir: ${libdir}
++ includedir: ${includedir}
++
++ compiler: ${CC}
++ cflags: ${CFLAGS}
++ ldflags: ${LDFLAGS}
++
++ max pdu size: ${max_pdu_size} bytes
++
++ debug: ${enable_debug}
++ async: ${enable_async}
++ block: ${enable_block}
++ observe: ${enable_observe}
++ query-filter: ${enable_query_filter}
++])
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+new file mode 100644
+index 0000000..1acbf31
+--- /dev/null
++++ b/examples/Makefile.am
+@@ -0,0 +1,9 @@
++AM_LDFLAGS = -L$(top_builddir) -lcoap
++AM_CFLAGS = -DWITH_POSIX -I$(top_builddir)
++
++bin_PROGRAMS = \
++ coap-client \
++ coap-server
++
++coap_client_SOURCES = client.c
++coap_server_SOURCES = server.c
+diff --git a/libcoap.pc.in b/libcoap.pc.in
+new file mode 100644
+index 0000000..4da8977
+--- /dev/null
++++ b/libcoap.pc.in
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: libcoap
++Description: Lightweight application-protocol for devices that are constrained their resources such as computing power, RF range, memory, bandwith, or network packet sizes. This protocol, CoAP, is developed in the IETF working group "CoRE", <http://6lowapp.net>.
++Version: @VERSION@
++Libs: -L${libdir} -lcoap
++Libs.private:
++Cflags: -DWITH_POSIX -I${includedir}
+diff --git a/m4/ax_prefix_config.m4 b/m4/ax_prefix_config.m4
+new file mode 100644
+index 0000000..c40d2df
+--- /dev/null
++++ b/m4/ax_prefix_config.m4
+@@ -0,0 +1,209 @@
++# ===========================================================================
++# http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
++#
++# DESCRIPTION
++#
++# This is a new variant from ac_prefix_config_ this one will use a
++# lowercase-prefix if the config-define was starting with a
++# lowercase-char, e.g. "#define const", "#define restrict", or "#define
++# off_t", (and this one can live in another directory, e.g.
++# testpkg/config.h therefore I decided to move the output-header to be the
++# first arg)
++#
++# takes the usual config.h generated header file; looks for each of the
++# generated "#define SOMEDEF" lines, and prefixes the defined name (ie.
++# makes it "#define PREFIX_SOMEDEF". The result is written to the output
++# config.header file. The PREFIX is converted to uppercase for the
++# conversions.
++#
++# Defaults:
++#
++# OUTPUT-HEADER = $PACKAGE-config.h
++# PREFIX = $PACKAGE
++# ORIG-HEADER, from AM_CONFIG_HEADER(config.h)
++#
++# Your configure.ac script should contain both macros in this order, and
++# unlike the earlier variations of this prefix-macro it is okay to place
++# the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation.
++#
++# Example:
++#
++# AC_INIT(config.h.in) # config.h.in as created by "autoheader"
++# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE
++# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in
++# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..
++# AC_MEMORY_H # makes "#undef NEED_MEMORY_H"
++# AC_C_CONST_H # makes "#undef const"
++# AC_OUTPUT(Makefile) # creates the "config.h" now
++# # and also mylib/_config.h
++#
++# if the argument to AX_PREFIX_CONFIG_H would have been omitted then the
++# default outputfile would have been called simply "testpkg-config.h", but
++# even under the name "mylib/_config.h" it contains prefix-defines like
++#
++# #ifndef TESTPKG_VERSION
++# #define TESTPKG_VERSION "0.1.1"
++# #endif
++# #ifndef TESTPKG_NEED_MEMORY_H
++# #define TESTPKG_NEED_MEMORY_H 1
++# #endif
++# #ifndef _testpkg_const
++# #define _testpkg_const _const
++# #endif
++#
++# and this "mylib/_config.h" can be installed along with other
++# header-files, which is most convenient when creating a shared library
++# (that has some headers) where some functionality is dependent on the
++# OS-features detected at compile-time. No need to invent some
++# "mylib-confdefs.h.in" manually. :-)
++#
++# Note that some AC_DEFINEs that end up in the config.h file are actually
++# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T
++# say that they "will define inline|const|off_t if the system does not do
++# it by itself". You might want to clean up about these - consider an
++# extra mylib/conf.h that reads something like:
++#
++# #include <mylib/_config.h>
++# #ifndef _testpkg_const
++# #define _testpkg_const const
++# #endif
++#
++# and then start using _testpkg_const in the header files. That is also a
++# good thing to differentiate whether some library-user has starting to
++# take up with a different compiler, so perhaps it could read something
++# like this:
++#
++# #ifdef _MSC_VER
++# #include <mylib/_msvc.h>
++# #else
++# #include <mylib/_config.h>
++# #endif
++# #ifndef _testpkg_const
++# #define _testpkg_const const
++# #endif
++#
++# LICENSE
++#
++# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++# Copyright (c) 2008 Marten Svantesson
++# Copyright (c) 2008 Gerald Point <Gerald.Point@labri.fr>
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation; either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 11
++
++AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl
++AC_PREREQ([2.62])
++AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl
++AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
++AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
++AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl
++AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl
++AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl
++AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl
++AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl
++m4_pushdef([_script],[conftest.prefix])dnl
++m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
++_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
++_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
++_PKG=`echo ifelse($2, , $PACKAGE, $2)`
++_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
++_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
++_INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'`
++if test ".$_INP" = "."; then
++ for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
++ case "$ac_file" in
++ *.h) _INP=$ac_file ;;
++ *)
++ esac
++ test ".$_INP" != "." && break
++ done
++fi
++if test ".$_INP" = "."; then
++ case "$_OUT" in
++ */*) _INP=`basename "$_OUT"`
++ ;;
++ *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`
++ ;;
++ *) _INP=config.h
++ ;;
++ esac
++fi
++if test -z "$_PKG" ; then
++ AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
++else
++ if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
++ _INP="$srcdir/$_INP"
++ fi fi
++ AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
++ if test -f $_INP ; then
++ AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/"]) > _script
++ AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/"]) >> _script
++ AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1\\"]) >> _script
++ AS_ECHO(["@%:@def[]ine $_UPP""_\\1\\2\\"]) >> _script
++ AS_ECHO(["@%:@endif/"]) >> _script
++ AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1\\"]) >> _script
++ AS_ECHO(["@%:@define $_LOW""_\\1\\2\\"]) >> _script
++ AS_ECHO(["@%:@endif/"]) >> _script
++ # now executing _script on _DEF input to create _OUT output file
++ echo "@%:@ifndef $_DEF" >$tmp/pconfig.h
++ echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
++ echo ' ' >>$tmp/pconfig.h
++ echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
++
++ sed -f _script $_INP >>$tmp/pconfig.h
++ echo ' ' >>$tmp/pconfig.h
++ echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h
++ echo "@%:@endif" >>$tmp/pconfig.h
++ if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then
++ AC_MSG_NOTICE([$_OUT is unchanged])
++ else
++ ac_dir=`AS_DIRNAME(["$_OUT"])`
++ AS_MKDIR_P(["$ac_dir"])
++ rm -f "$_OUT"
++ mv $tmp/pconfig.h "$_OUT"
++ fi
++ cp _script _configs.sed
++ else
++ AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
++ fi
++ rm -f conftest.*
++fi
++m4_popdef([_symbol])dnl
++m4_popdef([_script])dnl
++AS_VAR_POPDEF([_INP])dnl
++AS_VAR_POPDEF([_UPP])dnl
++AS_VAR_POPDEF([_LOW])dnl
++AS_VAR_POPDEF([_PKG])dnl
++AS_VAR_POPDEF([_DEF])dnl
++AS_VAR_POPDEF([_OUT])dnl
++],[PACKAGE="$PACKAGE"])])
+\ No newline at end of file
diff --git a/patches/libcoap-4.1.1/0003-libcoap-change-include-config.h-to-libcoap_config.h.patch b/patches/libcoap-4.1.1/0003-libcoap-change-include-config.h-to-libcoap_config.h.patch
new file mode 100644
index 000000000..d4c7b36fc
--- /dev/null
+++ b/patches/libcoap-4.1.1/0003-libcoap-change-include-config.h-to-libcoap_config.h.patch
@@ -0,0 +1,148 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sat, 29 Mar 2014 21:45:50 +0100
+Subject: [PATCH] libcoap: change include config.h to libcoap_config.h
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ address.h | 2 +-
+ async.h | 2 +-
+ coap.h | 2 +-
+ coap_time.h | 2 +-
+ debug.h | 2 +-
+ net.h | 2 +-
+ pdu.h | 2 +-
+ prng.h | 2 +-
+ resource.h | 2 +-
+ subscribe.h | 2 +-
+ 10 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/address.h b/address.h
+index 403240e..614f68f 100644
+--- a/address.h
++++ b/address.h
+@@ -14,7 +14,7 @@
+ #ifndef _COAP_ADDRESS_H_
+ #define _COAP_ADDRESS_H_
+
+-#include "config.h"
++#include "libcoap_config.h"
+
+ #ifdef HAVE_ASSERT_H
+ #include <assert.h>
+diff --git a/async.h b/async.h
+index a5168f8..9c43d89 100644
+--- a/async.h
++++ b/async.h
+@@ -15,7 +15,7 @@
+ #ifndef _COAP_ASYNC_H_
+ #define _COAP_ASYNC_H_
+
+-#include "config.h"
++#include "libcoap_config.h"
+ #include "net.h"
+
+ #ifndef WITHOUT_ASYNC
+diff --git a/coap.h b/coap.h
+index 3e2828c..edf2987 100644
+--- a/coap.h
++++ b/coap.h
+@@ -13,7 +13,7 @@
+ extern "C" {
+ #endif
+
+-#include "config.h"
++#include "libcoap_config.h"
+ #include "debug.h"
+ #include "mem.h"
+ #include "coap_list.h"
+diff --git a/coap_time.h b/coap_time.h
+index f039b87..1cec496 100644
+--- a/coap_time.h
++++ b/coap_time.h
+@@ -22,7 +22,7 @@ extern "C" {
+ #endif
+
+
+-#include "config.h"
++#include "libcoap_config.h"
+
+ /**
+ * @defgroup clock Clock Handling
+diff --git a/debug.h b/debug.h
+index dde660d..330b2d9 100644
+--- a/debug.h
++++ b/debug.h
+@@ -9,7 +9,7 @@
+ #ifndef _COAP_DEBUG_H_
+ #define _COAP_DEBUG_H_
+
+-#include "config.h"
++#include "libcoap_config.h"
+
+ #ifndef COAP_DEBUG_FD
+ #define COAP_DEBUG_FD stdout
+diff --git a/net.h b/net.h
+index f9afd48..33ee46b 100644
+--- a/net.h
++++ b/net.h
+@@ -13,7 +13,7 @@
+ extern "C" {
+ #endif
+
+-#include "config.h"
++#include "libcoap_config.h"
+
+ #ifdef HAVE_ASSERT_H
+ #include <assert.h>
+diff --git a/pdu.h b/pdu.h
+index a891086..48b0dc5 100644
+--- a/pdu.h
++++ b/pdu.h
+@@ -9,7 +9,7 @@
+ #ifndef _PDU_H_
+ #define _PDU_H_
+
+-#include "config.h"
++#include "libcoap_config.h"
+ #include "coap_list.h"
+ #include "uri.h"
+
+diff --git a/prng.h b/prng.h
+index ce4cb12..6377ada 100644
+--- a/prng.h
++++ b/prng.h
+@@ -14,7 +14,7 @@
+ #ifndef _COAP_PRNG_H_
+ #define _COAP_PRNG_H_
+
+-#include "config.h"
++#include "libcoap_config.h"
+
+ /**
+ * @defgroup prng Pseudo Random Numbers
+diff --git a/resource.h b/resource.h
+index 5504d43..6f21fae 100644
+--- a/resource.h
++++ b/resource.h
+@@ -14,7 +14,7 @@
+ #ifndef _COAP_RESOURCE_H_
+ #define _COAP_RESOURCE_H_
+
+-#include "config.h"
++#include "libcoap_config.h"
+ #include "t_list.h"
+
+ #if defined(HAVE_ASSERT_H) && !defined(assert)
+diff --git a/subscribe.h b/subscribe.h
+index 7eda74f..cb9592e 100644
+--- a/subscribe.h
++++ b/subscribe.h
+@@ -11,7 +11,7 @@
+ #ifndef _COAP_SUBSCRIBE_H_
+ #define _COAP_SUBSCRIBE_H_
+
+-#include "config.h"
++#include "libcoap_config.h"
+ #include "address.h"
+
+ /**
diff --git a/patches/libcoap-4.1.1/0004-libcoap-add-LIBCOAP_-prefix-to-HAVE_-in-headers.patch b/patches/libcoap-4.1.1/0004-libcoap-add-LIBCOAP_-prefix-to-HAVE_-in-headers.patch
new file mode 100644
index 000000000..1675c71f8
--- /dev/null
+++ b/patches/libcoap-4.1.1/0004-libcoap-add-LIBCOAP_-prefix-to-HAVE_-in-headers.patch
@@ -0,0 +1,132 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sat, 29 Mar 2014 21:07:12 +0100
+Subject: [PATCH] libcoap: add LIBCOAP_ prefix to HAVE_ in headers
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ address.h | 6 +++---
+ coap_time.h | 4 ++--
+ debug.h | 2 +-
+ encode.h | 2 +-
+ net.h | 8 ++++----
+ resource.h | 2 +-
+ 6 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/address.h b/address.h
+index 614f68f..66f92d7 100644
+--- a/address.h
++++ b/address.h
+@@ -16,7 +16,7 @@
+
+ #include "libcoap_config.h"
+
+-#ifdef HAVE_ASSERT_H
++#ifdef LIBCOAP_HAVE_ASSERT_H
+ #include <assert.h>
+ #else
+ #ifndef assert
+@@ -28,11 +28,11 @@
+ #include <string.h>
+ #include <stdint.h>
+
+-#ifdef HAVE_NETINET_IN_H
++#ifdef LIBCOAP_HAVE_NETINET_IN_H
+ #include <netinet/in.h>
+ #endif
+
+-#ifdef HAVE_NETINET_IN_H
++#ifdef LIBCOAP_HAVE_NETINET_IN_H
+ #include <sys/socket.h>
+ #endif
+
+diff --git a/coap_time.h b/coap_time.h
+index 1cec496..6f26239 100644
+--- a/coap_time.h
++++ b/coap_time.h
+@@ -107,7 +107,7 @@ extern time_t clock_offset;
+ #ifndef coap_clock_init
+ static inline void
+ coap_clock_init_impl(void) {
+-#ifdef HAVE_TIME_H
++#ifdef LIBCOAP_HAVE_TIME_H
+ clock_offset = time(NULL);
+ #else
+ # ifdef __GNUC__
+@@ -124,7 +124,7 @@ coap_clock_init_impl(void) {
+ #ifndef coap_ticks
+ static inline void
+ coap_ticks_impl(coap_tick_t *t) {
+-#ifdef HAVE_SYS_TIME_H
++#ifdef LIBCOAP_HAVE_SYS_TIME_H
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ *t = (tv.tv_sec - clock_offset) * COAP_TICKS_PER_SECOND
+diff --git a/debug.h b/debug.h
+index 330b2d9..c704e63 100644
+--- a/debug.h
++++ b/debug.h
+@@ -19,7 +19,7 @@
+ #define COAP_ERR_FD stderr
+ #endif
+
+-#ifdef HAVE_SYSLOG_H
++#ifdef LIBCOAP_HAVE_SYSLOG_H
+ #include <syslog.h>
+ typedef short coap_log_t;
+ #else
+diff --git a/encode.h b/encode.h
+index bdb7aa5..44f983d 100644
+--- a/encode.h
++++ b/encode.h
+@@ -24,7 +24,7 @@
+
+ #define COAP_PSEUDOFP_DECODE_8_4(r) (r < HIBIT ? r : (r & MMASK) << (r & EMASK))
+
+-#ifndef HAVE_FLS
++#ifndef LIBCOAP_HAVE_FLS
+ /* include this only if fls() is not available */
+ extern int coap_fls(unsigned int i);
+ #else
+diff --git a/net.h b/net.h
+index 33ee46b..ff62772 100644
+--- a/net.h
++++ b/net.h
+@@ -15,7 +15,7 @@ extern "C" {
+
+ #include "libcoap_config.h"
+
+-#ifdef HAVE_ASSERT_H
++#ifdef LIBCOAP_HAVE_ASSERT_H
+ #include <assert.h>
+ #else
+ #ifndef assert
+@@ -26,13 +26,13 @@ extern "C" {
+
+ #include <stdlib.h>
+ #include <string.h>
+-#ifdef HAVE_NETINET_IN_H
++#ifdef LIBCOAP_HAVE_NETINET_IN_H
+ #include <netinet/in.h>
+ #endif
+-#ifdef HAVE_TIME_H
++#ifdef LIBCOAP_HAVE_TIME_H
+ #include <time.h>
+ #endif
+-#ifdef HAVE_SYS_TIME_H
++#ifdef LIBCOAP_HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+
+diff --git a/resource.h b/resource.h
+index 6f21fae..b8dddbe 100644
+--- a/resource.h
++++ b/resource.h
+@@ -17,7 +17,7 @@
+ #include "libcoap_config.h"
+ #include "t_list.h"
+
+-#if defined(HAVE_ASSERT_H) && !defined(assert)
++#if defined(LIBCOAP_HAVE_ASSERT_H) && !defined(assert)
+ # include <assert.h>
+ #endif
+
diff --git a/patches/libcoap-4.1.1/0005-libcoap-add-LIBCOAP-prefix-to-COAP_MAX_PDU_SIZE.patch b/patches/libcoap-4.1.1/0005-libcoap-add-LIBCOAP-prefix-to-COAP_MAX_PDU_SIZE.patch
new file mode 100644
index 000000000..26dc11b9b
--- /dev/null
+++ b/patches/libcoap-4.1.1/0005-libcoap-add-LIBCOAP-prefix-to-COAP_MAX_PDU_SIZE.patch
@@ -0,0 +1,60 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sun, 30 Mar 2014 09:54:07 +0200
+Subject: [PATCH] libcoap: add LIBCOAP prefix to COAP_MAX_PDU_SIZE
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ block.h | 4 ++--
+ option.h | 2 +-
+ pdu.h | 6 +++---
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/block.h b/block.h
+index 283ba69..04b3131 100644
+--- a/block.h
++++ b/block.h
+@@ -22,12 +22,12 @@
+ /**
+ * The largest value for the SZX component in a Block option. Note
+ * that 1 << (COAP_MAX_BLOCK_SZX + 4) should not exceed
+- * COAP_MAX_PDU_SIZE.
++ * LIBCOAP_COAP_MAX_PDU_SIZE.
+ */
+ #define COAP_MAX_BLOCK_SZX 4
+ #endif /* COAP_MAX_BLOCK_SZX */
+
+-#if (COAP_MAX_PDU_SIZE - 6) < (1 << (COAP_MAX_BLOCK_SZX + 4))
++#if (LIBCOAP_COAP_MAX_PDU_SIZE - 6) < (1 << (COAP_MAX_BLOCK_SZX + 4))
+ #error "COAP_MAX_BLOCK_SZX too large"
+ #endif
+
+diff --git a/option.h b/option.h
+index 60fe225..b09df65 100644
+--- a/option.h
++++ b/option.h
+@@ -284,7 +284,7 @@ unsigned short coap_opt_delta(const coap_opt_t *opt);
+
+ /** @deprecated { Use coap_opt_encode() instead. } */
+ #define COAP_OPT_SETDELTA(opt,val) \
+- coap_opt_encode((opt), COAP_MAX_PDU_SIZE, (val), NULL, 0)
++ coap_opt_encode((opt), LIBCOAP_COAP_MAX_PDU_SIZE, (val), NULL, 0)
+
+ /**
+ * Returns the length of the given option. @p opt must point to an
+diff --git a/pdu.h b/pdu.h
+index 48b0dc5..ad9d81a 100644
+--- a/pdu.h
++++ b/pdu.h
+@@ -23,9 +23,9 @@
+ #define COAP_DEFAULT_MAX_RETRANSMIT 4 /* max number of retransmissions */
+ #define COAP_DEFAULT_PORT 5683 /* CoAP default UDP port */
+ #define COAP_DEFAULT_MAX_AGE 60 /* default maximum object lifetime in seconds */
+-#ifndef COAP_MAX_PDU_SIZE
+-#define COAP_MAX_PDU_SIZE 1400 /* maximum size of a CoAP PDU */
+-#endif /* COAP_MAX_PDU_SIZE */
++#ifndef LIBCOAP_COAP_MAX_PDU_SIZE
++#define LIBCOAP_COAP_MAX_PDU_SIZE 1400 /* maximum size of a CoAP PDU */
++#endif /* LIBCOAP_COAP_MAX_PDU_SIZE */
+
+ #define COAP_DEFAULT_VERSION 1 /* version of CoAP supported */
+ #define COAP_DEFAULT_SCHEME "coap" /* the default scheme for CoAP URIs */
diff --git a/patches/libcoap-4.1.1/0006-libcoap-add-LIBCOAP-prefix-to-WITHOUT_ASYNC.patch b/patches/libcoap-4.1.1/0006-libcoap-add-LIBCOAP-prefix-to-WITHOUT_ASYNC.patch
new file mode 100644
index 000000000..9c69aa589
--- /dev/null
+++ b/patches/libcoap-4.1.1/0006-libcoap-add-LIBCOAP-prefix-to-WITHOUT_ASYNC.patch
@@ -0,0 +1,49 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sun, 30 Mar 2014 10:03:02 +0200
+Subject: [PATCH] libcoap: add LIBCOAP prefix to WITHOUT_ASYNC
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ async.h | 2 +-
+ net.h | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/async.h b/async.h
+index 9c43d89..d51572c 100644
+--- a/async.h
++++ b/async.h
+@@ -18,7 +18,7 @@
+ #include "libcoap_config.h"
+ #include "net.h"
+
+-#ifndef WITHOUT_ASYNC
++#ifndef LIBCOAP_WITHOUT_ASYNC
+
+ /**
+ * @defgroup coap_async Asynchronous Messaging
+diff --git a/net.h b/net.h
+index ff62772..f85bd12 100644
+--- a/net.h
++++ b/net.h
+@@ -76,7 +76,7 @@ coap_queue_t *coap_new_node();
+
+ struct coap_resource_t;
+ struct coap_context_t;
+-#ifndef WITHOUT_ASYNC
++#ifndef LIBCOAP_WITHOUT_ASYNC
+ struct coap_async_state_t;
+ #endif
+
+@@ -99,10 +99,10 @@ typedef struct coap_context_t {
+ #ifndef WITH_CONTIKI
+ struct coap_resource_t *resources; /**< hash table or list of known resources */
+ #endif /* WITH_CONTIKI */
+-#ifndef WITHOUT_ASYNC
++#ifndef LIBCOAP_WITHOUT_ASYNC
+ /** list of asynchronous transactions */
+ struct coap_async_state_t *async_state;
+-#endif /* WITHOUT_ASYNC */
++#endif /* LIBCOAP_WITHOUT_ASYNC */
+ /**
+ * The time stamp in the first element of the sendqeue is relative
+ * to sendqueue_basetime. */
diff --git a/patches/libcoap-4.1.1/0007-libcoap-add-LIBCOAP-prefix-to-NDEBUG.patch b/patches/libcoap-4.1.1/0007-libcoap-add-LIBCOAP-prefix-to-NDEBUG.patch
new file mode 100644
index 000000000..bfd5764c5
--- /dev/null
+++ b/patches/libcoap-4.1.1/0007-libcoap-add-LIBCOAP-prefix-to-NDEBUG.patch
@@ -0,0 +1,22 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sun, 30 Mar 2014 10:03:46 +0200
+Subject: [PATCH] libcoap: add LIBCOAP prefix to NDEBUG
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ debug.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/debug.h b/debug.h
+index c704e63..8838317 100644
+--- a/debug.h
++++ b/debug.h
+@@ -47,7 +47,7 @@ void coap_log_impl(coap_log_t level, const char *format, ...);
+ #define coap_log(...) coap_log_impl(__VA_ARGS__)
+ #endif
+
+-#ifndef NDEBUG
++#ifndef LIBCOAP_NDEBUG
+
+ /* A set of convenience macros for common log levels. */
+ #define info(...) coap_log(LOG_INFO, __VA_ARGS__)
diff --git a/patches/libcoap-4.1.1/0008-client-fix-compiler-warning.patch b/patches/libcoap-4.1.1/0008-client-fix-compiler-warning.patch
new file mode 100644
index 000000000..733bef832
--- /dev/null
+++ b/patches/libcoap-4.1.1/0008-client-fix-compiler-warning.patch
@@ -0,0 +1,22 @@
+From: Alexander Aring <alex.aring@gmail.com>
+Date: Sat, 19 Oct 2013 14:49:11 +0200
+Subject: [PATCH] client: fix compiler warning
+
+Signed-off-by: Alexander Aring <alex.aring@gmail.com>
+---
+ examples/client.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/examples/client.c b/examples/client.c
+index 903685e..253d0c6 100644
+--- a/examples/client.c
++++ b/examples/client.c
+@@ -764,7 +764,7 @@ cmdline_proxy(char *arg) {
+ return 1;
+ }
+
+-inline void
++static inline void
+ cmdline_token(char *arg) {
+ strncpy((char *)the_token.s, arg, min(sizeof(_token_data), strlen(arg)));
+ the_token.length = strlen(arg);
diff --git a/patches/libcoap-4.1.1/autogen.sh b/patches/libcoap-4.1.1/autogen.sh
new file mode 120000
index 000000000..9f8a4cb7d
--- /dev/null
+++ b/patches/libcoap-4.1.1/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh \ No newline at end of file
diff --git a/patches/libcoap-4.1.1/series b/patches/libcoap-4.1.1/series
new file mode 100644
index 000000000..e9041dbde
--- /dev/null
+++ b/patches/libcoap-4.1.1/series
@@ -0,0 +1,11 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-libcoap-remove-current-buildsystem.patch
+0002-libcoap-add-new-buildsystem.patch
+0003-libcoap-change-include-config.h-to-libcoap_config.h.patch
+0004-libcoap-add-LIBCOAP_-prefix-to-HAVE_-in-headers.patch
+0005-libcoap-add-LIBCOAP-prefix-to-COAP_MAX_PDU_SIZE.patch
+0006-libcoap-add-LIBCOAP-prefix-to-WITHOUT_ASYNC.patch
+0007-libcoap-add-LIBCOAP-prefix-to-NDEBUG.patch
+0008-client-fix-compiler-warning.patch
+# 8c9d49a6488d4ccdb789d2e56196c1e7 - git-ptx-patches magic