freeswitch-stable: backport apr fix
authorSebastian Kemper <sebastian_ml@gmx.net>
Sun, 22 Jul 2018 07:29:20 +0000 (09:29 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sun, 22 Jul 2018 07:29:22 +0000 (09:29 +0200)
Backport from master.

The macro APR_TRY_COMPILE_NO_WARNING included in apr/apr-util is
incorrect. It results in extra brackets being put into conftest.c, for
example:

  #include "confdefs.h"

[
  #include <stddef.h>
  #include <iconv.h>
  ]
int main(int argc, const char *const *argv) {
[
  iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0);
  ]
  return 0; }

The test always fails with:

error: expected identifier or '(' before '[' token

The following checks are affected:

- variable length arrays
- type of inbuf parameter to iconv

Fix from upstream (Apache).

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/freeswitch-stable/patches/360-fix-APR_TRY_COMPILE_NO_WARNING.patch [new file with mode: 0644]

diff --git a/net/freeswitch-stable/patches/360-fix-APR_TRY_COMPILE_NO_WARNING.patch b/net/freeswitch-stable/patches/360-fix-APR_TRY_COMPILE_NO_WARNING.patch
new file mode 100644 (file)
index 0000000..245e327
--- /dev/null
@@ -0,0 +1,50 @@
+--- a/libs/apr-util/build/apr_common.m4
++++ b/libs/apr-util/build/apr_common.m4
+@@ -493,13 +493,15 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
+  if test "$ac_cv_prog_gcc" = "yes"; then 
+    CFLAGS="$CFLAGS -Werror"
+  fi
+- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+-  [#include "confdefs.h"
+-  ]
+-  [[$1]]
+-  [int main(int argc, const char *const *argv) {]
+-  [[$2]]
+-  [   return 0; }]])],
++ AC_COMPILE_IFELSE(
++  [AC_LANG_SOURCE(
++   [#include "confdefs.h"
++   ]
++   [[$1]]
++   [int main(int argc, const char *const *argv) {]
++   [[$2]]
++   [   return 0; }]
++  )],
+   [$3], [$4])
+  CFLAGS=$apr_save_CFLAGS
+ ])
+--- a/libs/apr/build/apr_common.m4
++++ b/libs/apr/build/apr_common.m4
+@@ -493,13 +493,15 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
+  if test "$ac_cv_prog_gcc" = "yes"; then 
+    CFLAGS="$CFLAGS -Werror"
+  fi
+- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+-  [#include "confdefs.h"
+-  ]
+-  [[$1]]
+-  [int main(int argc, const char *const *argv) {]
+-  [[$2]]
+-  [   return 0; }]])],
++ AC_COMPILE_IFELSE(
++  [AC_LANG_SOURCE(
++   [#include "confdefs.h"
++   ]
++   [[$1]]
++   [int main(int argc, const char *const *argv) {]
++   [[$2]]
++   [   return 0; }]
++  )],
+   [$3], [$4])
+  CFLAGS=$apr_save_CFLAGS
+ ])