[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#858063: marked as done (unblock: libcoap/4.1.2-1)



Your message dated Mon, 03 Apr 2017 14:56:00 +0000
with message-id <1f30350c-8040-dfed-cdfa-504da6247cf0@thykier.net>
and subject line Re: Bug#858063: unblock: libcoap/4.1.2-1
has caused the Debian Bug report #858063,
regarding unblock: libcoap/4.1.2-1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
858063: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858063
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package libcoap

Hello release team,

I wanted to request a unblocking of the libcoap package.
Upstream got finally released the version 4.1.2 about one month ago with
some small changes against the actual version 4.1.2~rc+git20161120 in
testing.

The libcoap package is as the name is telling providing a C library for
the implementation of the CoAP protocol, mainly used in devices around
a IoT environment.

libcoap has no actual reverse depends and popcon is right now rather
small which is probably reasoned in the not really existing IoT
environment in Debian.

The actual version 4.1.2-1 in unstable is a simple rebuild without
special fixing anything.

The srcdiff is massive and maybe not really helpfull to see the
reflecting changes on the packaging on a first view. The changed
configure script is the main change between both versions.

$ debdiff libcoap_4.1.2~rc+git20161120-7.dsc libcoap_4.1.2-1.dsc 
diff -Nru libcoap-4.1.2~rc+git20161120/coap_config.h.in libcoap-4.1.2/coap_config.h.in
--- libcoap-4.1.2~rc+git20161120/coap_config.h.in	2016-11-20 10:59:43.000000000 +0100
+++ libcoap-4.1.2/coap_config.h.in	2017-02-04 10:26:08.000000000 +0100
@@ -1,5 +1,8 @@
 /* coap_config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #undef HAVE_ARPA_INET_H
 
@@ -111,6 +114,18 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
+
 /* Define this to 1 for ancillary data on MacOS */
 #undef __APPLE_USE_RFC_3542
 
diff -Nru libcoap-4.1.2~rc+git20161120/configure libcoap-4.1.2/configure
--- libcoap-4.1.2~rc+git20161120/configure	2016-11-20 10:59:43.000000000 +0100
+++ libcoap-4.1.2/configure	2017-02-04 10:25:46.000000000 +0100
@@ -720,7 +720,6 @@
 LT_LIBCOAP_AGE
 LT_LIBCOAP_REVISION
 LT_LIBCOAP_CURRENT
-CPP
 LT_SYS_LIBRARY_PATH
 OTOOL64
 OTOOL
@@ -737,8 +736,6 @@
 DUMPBIN
 LD
 FGREP
-EGREP
-GREP
 host_os
 host_vendor
 host_cpu
@@ -748,6 +745,9 @@
 build_cpu
 build
 LIBTOOL
+EGREP
+GREP
+CPP
 ac_ct_AR
 AR
 SED
@@ -865,8 +865,8 @@
 LDFLAGS
 LIBS
 CPPFLAGS
-LT_SYS_LIBRARY_PATH
 CPP
+LT_SYS_LIBRARY_PATH
 CUNIT_CFLAGS
 CUNIT_LIBS
 A2X
@@ -1540,9 +1540,9 @@
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
   LT_SYS_LIBRARY_PATH
               User-defined run-time library search path.
-  CPP         C preprocessor
   CUNIT_CFLAGS
               C compiler flags for CUNIT, overriding pkg-config
   CUNIT_LIBS  linker flags for CUNIT, overriding pkg-config
@@ -1668,13 +1668,13 @@
 
 } # ac_fn_c_try_compile
 
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
   if { { ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -1682,7 +1682,48 @@
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
 $as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
   ac_status=$?
   if test -s conftest.err; then
     grep -v '^ *+' conftest.err >conftest.er1
@@ -1690,29 +1731,21 @@
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_retval=1
+    ac_retval=1
 fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
-} # ac_fn_c_try_link
+} # ac_fn_c_try_cpp
 
 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
 # -------------------------------------------------------
@@ -1745,20 +1778,21 @@
 
 } # ac_fn_c_check_header_compile
 
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
 $as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  (eval "$ac_link") 2>conftest.err
   ac_status=$?
   if test -s conftest.err; then
     grep -v '^ *+' conftest.err >conftest.er1
@@ -1766,63 +1800,29 @@
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
+	ac_retval=1
 fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
-} # ac_fn_c_try_run
+} # ac_fn_c_try_link
 
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
@@ -4398,6 +4398,628 @@
 esac
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
+	     #endif
+	     typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+	# Check for potential -arch flags.  It is not universal unless
+	# there are at least two -arch flags with different values.
+	ac_arch=
+	ac_prev=
+	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+	 if test -n "$ac_prev"; then
+	   case $ac_word in
+	     i?86 | x86_64 | ppc | ppc64)
+	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+		 ac_arch=$ac_word
+	       else
+		 ac_cv_c_bigendian=universal
+		 break
+	       fi
+	       ;;
+	   esac
+	   ac_prev=
+	 elif test "x$ac_word" = "x-arch"; then
+	   ac_prev=arch
+	 fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+	     #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+		     && LITTLE_ENDIAN)
+	      bogus endian macros
+	     #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+		#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+		 not big endian
+		#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+	      bogus endian macros
+	     #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+		 not big endian
+		#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then :
+  # Try to guess by grepping values from an object file.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+short int ascii_mm[] =
+		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+		short int ascii_ii[] =
+		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+		int use_ascii (int i) {
+		  return ascii_mm[i] + ascii_ii[i];
+		}
+		short int ebcdic_ii[] =
+		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+		short int ebcdic_mm[] =
+		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+		int use_ebcdic (int i) {
+		  return ebcdic_mm[i] + ebcdic_ii[i];
+		}
+		extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+	      ac_cv_c_bigendian=yes
+	    fi
+	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+	      if test "$ac_cv_c_bigendian" = unknown; then
+		ac_cv_c_bigendian=no
+	      else
+		# finding both strings is unlikely to happen, but who knows?
+		ac_cv_c_bigendian=unknown
+	      fi
+	    fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+	     /* Are we little or big endian?  From Harbison&Steele.  */
+	     union
+	     {
+	       long int l;
+	       char c[sizeof (long int)];
+	     } u;
+	     u.l = 1;
+	     return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_bigendian=no
+else
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
 # enable the automatically build of shared and static libraries, the unit
 # tests needs the static library
 case `pwd` in
@@ -4647,136 +5269,6 @@
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_GREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
 $as_echo_n "checking for fgrep... " >&6; }
 if ${ac_cv_path_FGREP+:} false; then :
@@ -7888,273 +8380,6 @@
     esac
 }
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
 for ac_header in dlfcn.h
 do :
   ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
@@ -13498,6 +13723,12 @@
     ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
     ;;
 
+    *kfreebsd*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: kFreeBSD" >&5
+$as_echo "kFreeBSD" >&6; }
+    ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
+    ;;
+
     *)
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ==> Currently unsupported operating system '${host}' !" >&5
 $as_echo "$as_me: WARNING: ==> Currently unsupported operating system '${host}' !" >&2;}
@@ -13654,6 +13885,7 @@
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+
 if test -z "${BUILD_DOCUMENTATION_TRUE}" && test -z "${BUILD_DOCUMENTATION_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_DOCUMENTATION\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff -Nru libcoap-4.1.2~rc+git20161120/configure.ac libcoap-4.1.2/configure.ac
--- libcoap-4.1.2~rc+git20161120/configure.ac	2016-11-13 19:15:38.000000000 +0100
+++ libcoap-4.1.2/configure.ac	2017-02-04 10:23:54.000000000 +0100
@@ -30,6 +30,8 @@
 m4_pattern_allow([AM_PROG_AR])
 AM_PROG_AR
 
+AC_C_BIGENDIAN
+
 # enable the automatically build of shared and static libraries, the unit
 # tests needs the static library
 LT_INIT([shared static])
@@ -347,6 +349,11 @@
     ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
     ;;
 
+    *kfreebsd*)
+    AC_MSG_RESULT([kFreeBSD])
+    ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
+    ;;
+
     *)
     AC_MSG_WARN([==> Currently unsupported operating system '${host}' !])
     AC_MSG_ERROR([==> If you can provide patches to support your operating system please write to 'libcoap-developers@lists.sourceforge.net'.])
diff -Nru libcoap-4.1.2~rc+git20161120/debian/changelog libcoap-4.1.2/debian/changelog
--- libcoap-4.1.2~rc+git20161120/debian/changelog	2017-01-16 19:42:32.000000000 +0100
+++ libcoap-4.1.2/debian/changelog	2017-02-05 16:57:44.000000000 +0100
@@ -1,3 +1,10 @@
+libcoap (4.1.2-1) unstable; urgency=medium
+
+  * [0cf302f] New upstream version 4.1.2
+  * [0173a50] rebuild patch queue from patchqueue branch
+
+ -- Carsten Schoenert <c.schoenert@t-online.de>  Sun, 05 Feb 2017 16:57:44 +0100
+
 libcoap (4.1.2~rc+git20161120-7) unstable; urgency=medium
 
   * [952c06c] debian/control: adding dependency to *-dev package
diff -Nru libcoap-4.1.2~rc+git20161120/debian/patches/configure.ac-adding-detection-of-kfreebsd-platforms.patch libcoap-4.1.2/debian/patches/configure.ac-adding-detection-of-kfreebsd-platforms.patch
--- libcoap-4.1.2~rc+git20161120/debian/patches/configure.ac-adding-detection-of-kfreebsd-platforms.patch	2017-01-14 10:31:53.000000000 +0100
+++ libcoap-4.1.2/debian/patches/configure.ac-adding-detection-of-kfreebsd-platforms.patch	1970-01-01 01:00:00.000000000 +0100
@@ -1,210 +0,0 @@
-From: Carsten Schoenert <c.schoenert@t-online.de>
-Date: Wed, 23 Nov 2016 19:36:41 +0100
-Subject: configure.ac: adding detection of kfreebsd platforms
-
-kFreeBSD is a modificated FreeBSD system by Debian with a FreeBSD kernel
-and GNU C library (libc) used for the applications. After adding FreeBSD
-support for libcoap no more changes needed to get libcoap compiled with
-a kFreeBSD installation.
----
- config.guess | 28 ++++++++++++++++++----------
- config.sub   | 22 ++++++++++++++++------
- configure    |  6 ++++++
- configure.ac |  5 +++++
- 4 files changed, 45 insertions(+), 16 deletions(-)
-
-diff --git a/config.guess b/config.guess
-index 0967f2a..2e9ad7f 100755
---- a/config.guess
-+++ b/config.guess
-@@ -2,7 +2,7 @@
- # Attempt to guess a canonical system name.
- #   Copyright 1992-2016 Free Software Foundation, Inc.
- 
--timestamp='2016-04-02'
-+timestamp='2016-10-02'
- 
- # This file is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by
-@@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- 	esac
- 	# The Operating System including object format, if it has switched
--	# to ELF recently, or will in the future.
-+	# to ELF recently (or will in the future) and ABI.
- 	case "${UNAME_MACHINE_ARCH}" in
--	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
-+	    earm*)
-+		os=netbsdelf
-+		;;
-+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- 		eval $set_cc_for_build
- 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- 			| grep -q __ELF__
-@@ -997,6 +1000,9 @@ EOF
- 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- 	;;
-+    mips64el:Linux:*:*)
-+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-+	exit ;;
-     openrisc*:Linux:*:*)
- 	echo or1k-unknown-linux-${LIBC}
- 	exit ;;
-@@ -1029,6 +1035,9 @@ EOF
-     ppcle:Linux:*:*)
- 	echo powerpcle-unknown-linux-${LIBC}
- 	exit ;;
-+    riscv32:Linux:*:* | riscv64:Linux:*:*)
-+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-+	exit ;;
-     s390:Linux:*:* | s390x:Linux:*:*)
- 	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- 	exit ;;
-@@ -1408,18 +1417,17 @@ esac
- cat >&2 <<EOF
- $0: unable to guess system type
- 
--This script, last modified $timestamp, has failed to recognize
--the operating system you are using. It is advised that you
--download the most up to date version of the config scripts from
-+This script (version $timestamp), has failed to recognize the
-+operating system you are using. If your script is old, overwrite
-+config.guess and config.sub with the latest versions from:
- 
-   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
- and
-   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
- 
--If the version you run ($0) is already up to date, please
--send the following data and any information you think might be
--pertinent to <config-patches@gnu.org> in order to provide the needed
--information to handle your system.
-+If $0 has already been updated, send the following data and any
-+information you think might be pertinent to config-patches@gnu.org to
-+provide the necessary information to handle your system.
- 
- config.guess timestamp = $timestamp
- 
-diff --git a/config.sub b/config.sub
-index 8d39c4b..dd2ca93 100755
---- a/config.sub
-+++ b/config.sub
-@@ -2,7 +2,7 @@
- # Configuration validation subroutine script.
- #   Copyright 1992-2016 Free Software Foundation, Inc.
- 
--timestamp='2016-03-30'
-+timestamp='2016-11-04'
- 
- # This file is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by
-@@ -117,7 +117,7 @@ case $maybe_os in
-   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
--  kopensolaris*-gnu* | \
-+  kopensolaris*-gnu* | cloudabi*-eabi* | \
-   storm-chaos* | os2-emx* | rtmk-nova*)
-     os=-$maybe_os
-     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-@@ -301,6 +301,7 @@ case $basic_machine in
- 	| open8 | or1k | or1knd | or32 \
- 	| pdp10 | pdp11 | pj | pjl \
- 	| powerpc | powerpc64 | powerpc64le | powerpcle \
-+	| pru \
- 	| pyramid \
- 	| riscv32 | riscv64 \
- 	| rl78 | rx \
-@@ -428,6 +429,7 @@ case $basic_machine in
- 	| orion-* \
- 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-+	| pru-* \
- 	| pyramid-* \
- 	| riscv32-* | riscv64-* \
- 	| rl78-* | romp-* | rs6000-* | rx-* \
-@@ -643,6 +645,14 @@ case $basic_machine in
- 		basic_machine=m68k-bull
- 		os=-sysv3
- 		;;
-+	e500v[12])
-+		basic_machine=powerpc-unknown
-+		os=$os"spe"
-+		;;
-+	e500v[12]-*)
-+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-+		os=$os"spe"
-+		;;
- 	ebmon29k)
- 		basic_machine=a29k-amd
- 		os=-ebmon
-@@ -1022,7 +1032,7 @@ case $basic_machine in
- 	ppc-* | ppcbe-*)
- 		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- 		;;
--	ppcle | powerpclittle | ppc-le | powerpc-little)
-+	ppcle | powerpclittle)
- 		basic_machine=powerpcle-unknown
- 		;;
- 	ppcle-* | powerpclittle-*)
-@@ -1032,7 +1042,7 @@ case $basic_machine in
- 		;;
- 	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- 		;;
--	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-+	ppc64le | powerpc64little)
- 		basic_machine=powerpc64le-unknown
- 		;;
- 	ppc64le-* | powerpc64little-*)
-@@ -1389,7 +1399,7 @@ case $os in
- 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- 	      | -chorusos* | -chorusrdb* | -cegcc* \
- 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
--	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-+	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- 	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-@@ -1399,7 +1409,7 @@ case $os in
- 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
--	      | -onefs* | -tirtos*)
-+	      | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
- 	# Remember, each alternative MUST END IN *, to match a version number.
- 		;;
- 	-qnx*)
-diff --git a/configure b/configure
-index 4b3ccce..cc0a231 100755
---- a/configure
-+++ b/configure
-@@ -13498,6 +13498,12 @@ $as_echo "FreeBSD-1x" >&6; }
-     ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
-     ;;
- 
-+    *kfreebsd*)
-+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: kFreeBSD" >&5
-+$as_echo "kFreeBSD" >&6; }
-+    ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
-+    ;;
-+
-     *)
-     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ==> Currently unsupported operating system '${host}' !" >&5
- $as_echo "$as_me: WARNING: ==> Currently unsupported operating system '${host}' !" >&2;}
-diff --git a/configure.ac b/configure.ac
-index 4221073..d81f376 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -347,6 +347,11 @@ case $host in
-     ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
-     ;;
- 
-+    *kfreebsd*)
-+    AC_MSG_RESULT([kFreeBSD])
-+    ADDITIONAL_CFLAGS="-D_GNU_SOURCE -DWITH_POSIX"
-+    ;;
-+
-     *)
-     AC_MSG_WARN([==> Currently unsupported operating system '${host}' !])
-     AC_MSG_ERROR([==> If you can provide patches to support your operating system please write to 'libcoap-developers@lists.sourceforge.net'.])
diff -Nru libcoap-4.1.2~rc+git20161120/debian/patches/series libcoap-4.1.2/debian/patches/series
--- libcoap-4.1.2~rc+git20161120/debian/patches/series	2017-01-14 10:31:53.000000000 +0100
+++ libcoap-4.1.2/debian/patches/series	2017-02-05 16:55:13.000000000 +0100
@@ -1,2 +1 @@
 add-field-revdate-to-asciidoc-files-for-manpages.patch
-configure.ac-adding-detection-of-kfreebsd-platforms.patch
diff -Nru libcoap-4.1.2~rc+git20161120/doc/Makefile.in libcoap-4.1.2/doc/Makefile.in
--- libcoap-4.1.2~rc+git20161120/doc/Makefile.in	2016-11-20 10:59:45.000000000 +0100
+++ libcoap-4.1.2/doc/Makefile.in	2017-02-04 10:25:45.000000000 +0100
@@ -383,8 +383,8 @@
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
-@HAVE_DOXYGEN_FALSE@distclean-local:
 @HAVE_DOXYGEN_FALSE@clean-local:
+@HAVE_DOXYGEN_FALSE@distclean-local:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool clean-local mostlyclean-am
diff -Nru libcoap-4.1.2~rc+git20161120/examples/client.c libcoap-4.1.2/examples/client.c
--- libcoap-4.1.2~rc+git20161120/examples/client.c	2016-11-20 10:58:59.000000000 +0100
+++ libcoap-4.1.2/examples/client.c	2017-02-04 10:23:54.000000000 +0100
@@ -426,11 +426,24 @@
       block_opt = coap_check_option(received, COAP_OPTION_BLOCK1, &opt_iter);
 
       if (block_opt) { /* handle Block1 */
-        block.szx = COAP_OPT_BLOCK_SZX(block_opt);
-        block.num = coap_opt_block_num(block_opt);
-
-        debug("found Block1, block size is %u, block nr. %u\n",
-        block.szx, block.num);
+        unsigned int szx = COAP_OPT_BLOCK_SZX(block_opt);
+        unsigned int num = coap_opt_block_num(block_opt);
+        debug("found Block1 option, block size is %u, block nr. %u\n", szx, num);
+        if (szx != block.szx) {
+          unsigned int bytes_sent = ((block.num + 1) << (block.szx + 4));
+          if (bytes_sent % (1 << (szx + 4)) == 0) {
+            /* Recompute the block number of the previous packet given the new block size */
+            block.num = (bytes_sent >> (szx + 4)) - 1;
+            block.szx = szx;
+            debug("new Block1 size is %u, block number %u completed\n", (1 << (block.szx + 4)), block.num);
+          } else {
+            debug("ignoring request to increase Block1 size, "
+            "next block is not aligned on requested block size boundary. "
+            "(%u x %u mod %u = %u != 0)\n",
+                  block.num + 1, (1 << (block.szx + 4)), (1 << (szx + 4)),
+                  bytes_sent % (1 << (szx + 4)));
+          }
+        }
 
         if (payload.length <= (block.num+1) * (1 << (block.szx + 4))) {
           debug("upload ready\n");
@@ -660,7 +673,16 @@
   }
 }
 
-static void
+/**
+ * Sets global URI options according to the URI passed as @p arg.
+ * This function returns 0 on success or -1 on error.
+ *
+ * @param arg             The URI string.
+ * @param create_uri_opts Flags that indicate whether Uri-Host and
+ *                        Uri-Port should be suppressed.
+ * @return 0 on success, -1 otherwise
+ */
+static int
 cmdline_uri(char *arg, int create_uri_opts) {
   unsigned char portbuf[2];
 #define BUFSIZE 40
@@ -687,7 +709,9 @@
                 (unsigned char *)arg));
 
   } else {      /* split arg into Uri-* options */
-      coap_split_uri((unsigned char *)arg, strlen(arg), &uri );
+    if (coap_split_uri((unsigned char *)arg, strlen(arg), &uri) < 0) {
+      return -1;
+    }
 
     if (uri.port != COAP_DEFAULT_PORT && create_uri_opts) {
       coap_insert(&optlist,
@@ -725,6 +749,8 @@
       }
     }
   }
+
+  return 0;
 }
 
 static int
@@ -929,20 +955,22 @@
     inputfile = stdin;
   } else {
     /* read from specified input file */
-    if (stat(filename, &statbuf) < 0) {
+    inputfile = fopen(filename, "r");
+    if ( !inputfile ) {
+      perror("cmdline_input_from_file: fopen");
+      return 0;
+    }
+
+    if (fstat(fileno(inputfile), &statbuf) < 0) {
       perror("cmdline_input_from_file: stat");
+      fclose(inputfile);
       return 0;
     }
 
     buf->length = statbuf.st_size;
     buf->s = (unsigned char *)coap_malloc(buf->length);
-    if (!buf->s)
-      return 0;
-
-    inputfile = fopen(filename, "r");
-    if ( !inputfile ) {
-      perror("cmdline_input_from_file: fopen");
-      coap_free(buf->s);
+    if (!buf->s) {
+      fclose(inputfile);
       return 0;
     }
   }
@@ -1119,9 +1147,12 @@
 
   coap_set_log_level(log_level);
 
-  if ( optind < argc )
-    cmdline_uri( argv[optind], create_uri_opts );
-  else {
+  if (optind < argc) {
+    if (cmdline_uri(argv[optind], create_uri_opts) < 0) {
+      coap_log(LOG_ERR, "invalid CoAP URI\n");
+      exit(1);
+    }
+  } else {
     usage( argv[0], PACKAGE_VERSION );
     exit( 1 );
   }
diff -Nru libcoap-4.1.2~rc+git20161120/examples/coap-server.c libcoap-4.1.2/examples/coap-server.c
--- libcoap-4.1.2~rc+git20161120/examples/coap-server.c	2016-11-13 19:15:38.000000000 +0100
+++ libcoap-4.1.2/examples/coap-server.c	2017-02-04 10:23:54.000000000 +0100
@@ -178,7 +178,8 @@
 
   resource->dirty = 1;
 
-  coap_get_data(request, &size, &data);
+  /* coap_get_data() sets size to 0 on error */
+  (void)coap_get_data(request, &size, &data);
 
   if (size == 0)        /* re-init */
     my_clock_base = clock_offset;
diff -Nru libcoap-4.1.2~rc+git20161120/include/coap/address.h libcoap-4.1.2/include/coap/address.h
--- libcoap-4.1.2~rc+git20161120/include/coap/address.h	2016-11-20 10:58:59.000000000 +0100
+++ libcoap-4.1.2/include/coap/address.h	2017-02-04 10:23:54.000000000 +0100
@@ -1,7 +1,7 @@
 /*
  * address.h -- representation of network addresses
  *
- * Copyright (C) 2010-2011,2015 Olaf Bergmann <bergmann@tzi.org>
+ * Copyright (C) 2010-2011,2015-2016 Olaf Bergmann <bergmann@tzi.org>
  *
  * This file is part of the CoAP library libcoap. Please see README for terms
  * of use.
@@ -89,22 +89,6 @@
 
   return 0;
 }
-
-static inline int
-_coap_is_mcast_impl(const coap_address_t *a) {
-  if (!a)
-    return 0;
-
- switch (a->addr.sa.sa_family) {
- case AF_INET:
-   return IN_MULTICAST(a->addr.sin.sin_addr.s_addr);
- case  AF_INET6:
-   return IN6_IS_ADDR_MULTICAST(&a->addr.sin6.sin6_addr);
- default:  /* fall through and signal error */
-   ;
-  }
- return 0;
-}
 #endif /* WITH_POSIX */
 
 /**
@@ -148,6 +132,13 @@
   return _coap_address_isany_impl(a);
 }
 
+#ifdef WITH_POSIX
+/**
+ * Checks if given address @p a denotes a multicast address. This function
+ * returns @c 1 if @p a is multicast, @c 0 otherwise.
+ */
+int coap_is_mcast(const coap_address_t *a);
+#else /* WITH_POSIX */
 /**
  * Checks if given address @p a denotes a multicast address. This function
  * returns @c 1 if @p a is multicast, @c 0 otherwise.
@@ -156,5 +147,6 @@
 coap_is_mcast(const coap_address_t *a) {
   return a && _coap_is_mcast_impl(a);
 }
+#endif /* WITH_POSIX */
 
 #endif /* _COAP_ADDRESS_H_ */
diff -Nru libcoap-4.1.2~rc+git20161120/libcoap-1.map libcoap-4.1.2/libcoap-1.map
--- libcoap-4.1.2~rc+git20161120/libcoap-1.map	2016-11-20 11:00:03.000000000 +0100
+++ libcoap-4.1.2/libcoap-1.map	2017-02-05 16:43:00.000000000 +0100
@@ -47,6 +47,7 @@
   coap_hash_path;
   coap_hash_request_uri;
   coap_insert_node;
+  coap_is_mcast;
   coap_log_impl;
   coap_malloc_type;
   coap_memory_init;
diff -Nru libcoap-4.1.2~rc+git20161120/libcoap-1.sym libcoap-4.1.2/libcoap-1.sym
--- libcoap-4.1.2~rc+git20161120/libcoap-1.sym	2016-11-20 11:00:03.000000000 +0100
+++ libcoap-4.1.2/libcoap-1.sym	2017-02-05 16:43:00.000000000 +0100
@@ -45,6 +45,7 @@
 coap_hash_path
 coap_hash_request_uri
 coap_insert_node
+coap_is_mcast
 coap_log_impl
 coap_malloc_type
 coap_memory_init
diff -Nru libcoap-4.1.2~rc+git20161120/README libcoap-4.1.2/README
--- libcoap-4.1.2~rc+git20161120/README	2016-11-13 19:15:38.000000000 +0100
+++ libcoap-4.1.2/README	2017-02-04 10:23:54.000000000 +0100
@@ -1,6 +1,9 @@
-libcoap: A C implementation of IETF Constrained Application Protocol (RFC 7252)
+# libcoap: A C implementation of the Constrained Application Protocol (RFC 7252)
 
-Copyright (C) 2010--2015 by Olaf Bergmann <bergmann@tzi.org>
+[![Build Status](https://travis-ci.org/obgm/libcoap.svg?branch=master)](https://travis-ci.org/obgm/libcoap)
+[![Static Analysis](https://scan.coverity.com/projects/10970/badge.svg?flat=1)](https://scan.coverity.com/projects/obgm-libcoap)
+
+Copyright (C) 2010--2017 by Olaf Bergmann <bergmann@tzi.org> and others
 
 ABOUT LIBCOAP
 =============
diff -Nru libcoap-4.1.2~rc+git20161120/src/address.c libcoap-4.1.2/src/address.c
--- libcoap-4.1.2~rc+git20161120/src/address.c	2016-01-15 23:00:15.000000000 +0100
+++ libcoap-4.1.2/src/address.c	2017-02-04 10:23:54.000000000 +0100
@@ -1,6 +1,6 @@
 /* address.c -- representation of network addresses
  *
- * Copyright (C) 2015 Olaf Bergmann <bergmann@tzi.org>
+ * Copyright (C) 2015-2016 Olaf Bergmann <bergmann@tzi.org>
  *
  * This file is part of the CoAP library libcoap. Please see
  * README for terms of use.
@@ -8,6 +8,7 @@
 
 #ifdef WITH_POSIX
 #include <assert.h>
+#include <arpa/inet.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
 
@@ -37,6 +38,20 @@
  return 0;
 }
 
+int coap_is_mcast(const coap_address_t *a) {
+  if (!a)
+    return 0;
+
+ switch (a->addr.sa.sa_family) {
+ case AF_INET:
+   return IN_MULTICAST(ntohl(a->addr.sin.sin_addr.s_addr));
+ case  AF_INET6:
+   return IN6_IS_ADDR_MULTICAST(&a->addr.sin6.sin6_addr);
+ default:  /* fall through and signal error */
+   ;
+  }
+ return 0;
+}
 #else /* WITH_POSIX */
 
 /* make compilers happy that do not like empty modules */
diff -Nru libcoap-4.1.2~rc+git20161120/src/coap_io.c libcoap-4.1.2/src/coap_io.c
--- libcoap-4.1.2~rc+git20161120/src/coap_io.c	2016-11-20 10:58:59.000000000 +0100
+++ libcoap-4.1.2/src/coap_io.c	2017-02-04 10:23:54.000000000 +0100
@@ -495,8 +495,11 @@
 	memcpy(&(*packet)->dst.addr.sin6.sin6_addr, 
 	       &u.p->ipi6_addr, sizeof(struct in6_addr));
 
-	(*packet)->src.size = mhdr.msg_namelen;
-	assert((*packet)->src.size == sizeof(struct sockaddr_in6));
+	(*packet)->src.size = sizeof(struct sockaddr_in6);
+        if ((*packet)->src.size != mhdr.msg_namelen) {
+          coap_log(LOG_DEBUG, "wrong IPv6 address length detected, dropped packet\n");
+          goto error;
+        }
 
 	(*packet)->src.addr.sin6.sin6_family = SIN6(mhdr.msg_name)->sin6_family;
 	(*packet)->src.addr.sin6.sin6_addr = SIN6(mhdr.msg_name)->sin6_addr;
@@ -519,7 +522,12 @@
 	memcpy(&(*packet)->dst.addr.sin.sin_addr, 
 	       &u.p->ipi_addr, sizeof(struct in_addr));
 
-	(*packet)->src.size = mhdr.msg_namelen;
+	(*packet)->src.size = sizeof(struct sockaddr_in);
+        if ((*packet)->src.size != mhdr.msg_namelen) {
+          coap_log(LOG_DEBUG, "wrong IPv4 address length detected, dropped packet\n");
+          goto error;
+        }
+
 	assert(memcmp(&(*packet)->src.addr.st, mhdr.msg_name, (*packet)->src.size) == 0);
 
 	break;
@@ -531,7 +539,12 @@
 	memcpy(&(*packet)->dst.addr.sin.sin_addr,
 	       CMSG_DATA(cmsg), sizeof(struct in_addr));
 
-	(*packet)->src.size = mhdr.msg_namelen;
+	(*packet)->src.size = sizeof(struct sockaddr_in);
+        if ((*packet)->src.size != mhdr.msg_namelen) {
+          coap_log(LOG_DEBUG, "wrong IPv4 address length detected, dropped packet\n");
+          goto error;
+        }
+
 	assert(memcmp(&(*packet)->src.addr.st, mhdr.msg_name, (*packet)->src.size) == 0);
 
 	break;
diff -Nru libcoap-4.1.2~rc+git20161120/src/debug.c libcoap-4.1.2/src/debug.c
--- libcoap-4.1.2~rc+git20161120/src/debug.c	2016-11-13 19:15:38.000000000 +0100
+++ libcoap-4.1.2/src/debug.c	2017-02-04 10:23:54.000000000 +0100
@@ -417,7 +417,7 @@
       buf_len = snprintf((char *)buf, sizeof(buf), "%u/%c/%u",
 			 coap_opt_block_num(option), /* block number */
 			 COAP_OPT_BLOCK_MORE(option) ? 'M' : '_', /* M bit */
-			 (2 << (COAP_OPT_BLOCK_SZX(option) + 4))); /* block size */
+			 (1 << (COAP_OPT_BLOCK_SZX(option) + 4))); /* block size */
 
       break;
 
diff -Nru libcoap-4.1.2~rc+git20161120/src/net.c libcoap-4.1.2/src/net.c
--- libcoap-4.1.2~rc+git20161120/src/net.c	2016-11-20 10:58:59.000000000 +0100
+++ libcoap-4.1.2/src/net.c	2017-02-04 10:23:54.000000000 +0100
@@ -332,20 +332,19 @@
 coap_context_t *
 coap_new_context(
   const coap_address_t *listen_addr) {
-#ifndef WITH_CONTIKI
-  coap_context_t *c = coap_malloc_type(COAP_CONTEXT, sizeof( coap_context_t ) );
-#endif /* not WITH_CONTIKI */
-#ifdef WITH_CONTIKI
   coap_context_t *c;
 
-  if (initialized)
-    return NULL;
-#endif /* WITH_CONTIKI */
-
   if (!listen_addr) {
     coap_log(LOG_EMERG, "no listen address specified\n");
     return NULL;
   }
+#ifdef WITH_CONTIKI
+  if (initialized)
+    return NULL;
+#endif /* WITH_CONTIKI */
+#ifndef WITH_CONTIKI
+  c = coap_malloc_type(COAP_CONTEXT, sizeof(coap_context_t));
+#endif /* not WITH_CONTIKI */
 
   coap_clock_init();
 #ifdef WITH_LWIP
@@ -1392,30 +1391,22 @@
      * be the well-known URI. In that case, we generate a default
      * response, otherwise, we return 4.04 */
 
-    switch(node->pdu->hdr->code) {
-
-    case COAP_REQUEST_GET: 
-      if (is_wkc(key)) {	/* GET request for .well-known/core */
+    if (is_wkc(key)) {	/* request for .well-known/core */
+      if (node->pdu->hdr->code == COAP_REQUEST_GET) { /* GET */
 	info("create default response for %s\n", COAP_DEFAULT_URI_WELLKNOWN);
 	response = coap_wellknown_response(context, node->pdu);
-
-      } else { /* GET request for any another resource, return 4.04 */
-
-	debug("GET for unknown resource 0x%02x%02x%02x%02x, return 4.04\n", 
-	      key[0], key[1], key[2], key[3]);
-	response = 
-	  coap_new_error_response(node->pdu, COAP_RESPONSE_CODE(404), 
-				  opt_filter);
-      }
-      break;
-
-    default: 			/* any other request type */
-
-      debug("unhandled request for unknown resource 0x%02x%02x%02x%02x\r\n",
-	    key[0], key[1], key[2], key[3]);
-
+      } else {
+        debug("method not allowed for .well-known/core\n");
 	response = coap_new_error_response(node->pdu, COAP_RESPONSE_CODE(405), 
 					   opt_filter);
+      }
+    } else { /* request for any another resource, return 4.04 */
+
+      debug("request for unknown resource 0x%02x%02x%02x%02x, return 4.04\n",
+            key[0], key[1], key[2], key[3]);
+      response =
+        coap_new_error_response(node->pdu, COAP_RESPONSE_CODE(404),
+                                opt_filter);
     }
       
     if (response
@@ -1425,6 +1416,7 @@
       warn("cannot send response for transaction %u\n", node->id);
     }
     coap_delete_pdu(response);
+    response = NULL;
 
     return;
   }
@@ -1509,6 +1501,7 @@
       }
       }
       coap_delete_pdu(response);
+      response = NULL;
     } else {
       warn("cannot generate response\r\n");
     }
@@ -1528,7 +1521,10 @@
       }
     }
     coap_delete_pdu(response);
-  }  
+    response = NULL;
+  }
+
+  assert(response == NULL);
 }
 
 static inline void
diff -Nru libcoap-4.1.2~rc+git20161120/src/pdu.c libcoap-4.1.2/src/pdu.c
--- libcoap-4.1.2~rc+git20161120/src/pdu.c	2016-11-13 19:15:38.000000000 +0100
+++ libcoap-4.1.2/src/pdu.c	2017-02-04 10:23:54.000000000 +0100
@@ -1,6 +1,6 @@
 /* pdu.c -- CoAP message structure
  *
- * Copyright (C) 2010--2014 Olaf Bergmann <bergmann@tzi.org>
+ * Copyright (C) 2010--2016 Olaf Bergmann <bergmann@tzi.org>
  *
  * This file is part of the CoAP library libcoap. Please see
  * README for terms of use. 
@@ -279,20 +279,23 @@
 /* if you change anything here, make sure, that the longest string does not 
  * exceed COAP_ERROR_PHRASE_LENGTH. */
 error_desc_t coap_error[] = {
-  { COAP_RESPONSE_CODE(65),  "2.01 Created" },
-  { COAP_RESPONSE_CODE(66),  "2.02 Deleted" },
-  { COAP_RESPONSE_CODE(67),  "2.03 Valid" },
-  { COAP_RESPONSE_CODE(68),  "2.04 Changed" },
-  { COAP_RESPONSE_CODE(69),  "2.05 Content" },
+  { COAP_RESPONSE_CODE(201), "Created" },
+  { COAP_RESPONSE_CODE(202), "Deleted" },
+  { COAP_RESPONSE_CODE(203), "Valid" },
+  { COAP_RESPONSE_CODE(204), "Changed" },
+  { COAP_RESPONSE_CODE(205), "Content" },
+  { COAP_RESPONSE_CODE(231), "Continue" },
   { COAP_RESPONSE_CODE(400), "Bad Request" },
   { COAP_RESPONSE_CODE(401), "Unauthorized" },
   { COAP_RESPONSE_CODE(402), "Bad Option" },
   { COAP_RESPONSE_CODE(403), "Forbidden" },
   { COAP_RESPONSE_CODE(404), "Not Found" },
   { COAP_RESPONSE_CODE(405), "Method Not Allowed" },
+  { COAP_RESPONSE_CODE(406), "Not Acceptable" },
   { COAP_RESPONSE_CODE(408), "Request Entity Incomplete" },
+  { COAP_RESPONSE_CODE(412), "Precondition Failed" },
   { COAP_RESPONSE_CODE(413), "Request Entity Too Large" },
-  { COAP_RESPONSE_CODE(415), "Unsupported Media Type" },
+  { COAP_RESPONSE_CODE(415), "Unsupported Content-Format" },
   { COAP_RESPONSE_CODE(500), "Internal Server Error" },
   { COAP_RESPONSE_CODE(501), "Not Implemented" },
   { COAP_RESPONSE_CODE(502), "Bad Gateway" },
@@ -387,8 +390,10 @@
    * response back to the network. */
   memcpy(&pdu->hdr->id, data + 2, 2);
 
-  /* append data (including the Token) to pdu structure */
-  memcpy(pdu->hdr + 1, data + sizeof(coap_hdr_t), length - sizeof(coap_hdr_t));
+  /* Append data (including the Token) to pdu structure, if any. */
+  if (length > sizeof(coap_hdr_t)) {
+    memcpy(pdu->hdr + 1, data + sizeof(coap_hdr_t), length - sizeof(coap_hdr_t));
+  }
   pdu->length = length;
  
   /* Finally calculate beginning of data block and thereby check integrity
diff -Nru libcoap-4.1.2~rc+git20161120/tests/test_error_response.c libcoap-4.1.2/tests/test_error_response.c
--- libcoap-4.1.2~rc+git20161120/tests/test_error_response.c	2016-11-13 19:15:38.000000000 +0100
+++ libcoap-4.1.2/tests/test_error_response.c	2017-02-04 10:23:54.000000000 +0100
@@ -51,6 +51,7 @@
   CU_ASSERT(pdu->hdr->id == htons(0x1234));
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static void
@@ -80,6 +81,7 @@
   CU_ASSERT(response->hdr->code == 0x84);
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static void
@@ -113,6 +115,7 @@
   CU_ASSERT(response->hdr->code == code);
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static void
@@ -152,6 +155,7 @@
   CU_ASSERT(response->hdr->code == code);
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static void
@@ -193,6 +197,7 @@
   CU_ASSERT(response->hdr->code == code);
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static void
@@ -234,6 +239,7 @@
   CU_ASSERT(response->hdr->code == code);
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static void
@@ -276,6 +282,7 @@
   CU_ASSERT(response->hdr->code == code);
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static void
@@ -317,6 +324,7 @@
   CU_ASSERT(response->hdr->code == code);
 
   CU_ASSERT(memcmp(response->hdr, teststr, sizeof(teststr)) == 0);
+  coap_delete_pdu(response);
 }
 
 static int
diff -Nru libcoap-4.1.2~rc+git20161120/tests/test_pdu.c libcoap-4.1.2/tests/test_pdu.c
--- libcoap-4.1.2~rc+git20161120/tests/test_pdu.c	2016-11-13 19:15:38.000000000 +0100
+++ libcoap-4.1.2/tests/test_pdu.c	2017-02-04 10:23:54.000000000 +0100
@@ -264,7 +264,7 @@
   result = coap_add_token(pdu, 5, (unsigned char *)"token");
 
   CU_ASSERT(result == 1);
-  CU_ASSERT(pdu->length = sizeof(teststr));
+  CU_ASSERT(pdu->length == sizeof(teststr));
   CU_ASSERT_PTR_NULL(pdu->data);
   CU_ASSERT(memcmp(pdu->hdr, teststr, sizeof(teststr)) == 0);
 }


unblock libcoap/4.1.2-1

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

--- End Message ---
--- Begin Message ---
Carsten Schoenert:
> Package: release.debian.org
> Severity: normal
> User: release.debian.org@packages.debian.org
> Usertags: unblock
> 
> Please unblock package libcoap
> 
> Hello release team,
> 
> I wanted to request a unblocking of the libcoap package.
> Upstream got finally released the version 4.1.2 about one month ago with
> some small changes against the actual version 4.1.2~rc+git20161120 in
> testing.
> 
> The libcoap package is as the name is telling providing a C library for
> the implementation of the CoAP protocol, mainly used in devices around
> a IoT environment.
> 
> libcoap has no actual reverse depends and popcon is right now rather
> small which is probably reasoned in the not really existing IoT
> environment in Debian.
> 
> The actual version 4.1.2-1 in unstable is a simple rebuild without
> special fixing anything.
> 
> The srcdiff is massive and maybe not really helpfull to see the
> reflecting changes on the packaging on a first view. The changed
> configure script is the main change between both versions.
> 
> [...]
> 
> unblock libcoap/4.1.2-1
> 
> [...]

Unblocked, thanks.

~Niels

--- End Message ---

Reply to: