0002-iconv-tweak-iconv-detection.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 1357df0196806d5697b1f84497ef72aab5faa8a3 Mon Sep 17 00:00:00 2001
  2. From: Gustavo Zacarias <gustavo@zacarias.com.ar>
  3. Date: Tue, 9 Aug 2016 11:50:49 +0200
  4. Subject: [PATCH] iconv: tweak iconv detection
  5. Tweak PHP_SETUP_ICONV from aclocal/acinclude.m4 to not
  6. PHP_ADD_INCLUDE $ICONV_DIR/include since the tests use
  7. test instead of AC_TRY_LINK to find headers which is bad,
  8. specially when adding /usr and /usr/local to the mix.
  9. Do basically the same with ext/iconv/config.m4 by tweaking
  10. PHP_ICONV_H_PATH which, again, uses test and absolute paths.
  11. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  12. [Gustavo: convert to nice m4 instead of patching configure]
  13. [Gustavo: update for 5.6.10]
  14. ---
  15. acinclude.m4 | 2 +-
  16. ext/iconv/config.m4 | 22 ----------------------
  17. 2 files changed, 1 insertion(+), 23 deletions(-)
  18. diff --git a/acinclude.m4 b/acinclude.m4
  19. index af4aa06..1bd2652 100644
  20. --- a/acinclude.m4
  21. +++ b/acinclude.m4
  22. @@ -2471,7 +2471,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
  23. dnl
  24. if test "$found_iconv" = "no"; then
  25. - for i in $PHP_ICONV /usr/local /usr; do
  26. + for i in $PHP_ICONV; do
  27. if test -r $i/include/giconv.h; then
  28. AC_DEFINE(HAVE_GICONV_H, 1, [ ])
  29. ICONV_DIR=$i
  30. diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
  31. index 6a05697..694fcb8 100644
  32. --- a/ext/iconv/config.m4
  33. +++ b/ext/iconv/config.m4
  34. @@ -14,28 +14,6 @@ if test "$PHP_ICONV" != "no"; then
  35. ])
  36. if test "$iconv_avail" != "no"; then
  37. - if test -z "$ICONV_DIR"; then
  38. - for i in /usr/local /usr; do
  39. - if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
  40. - PHP_ICONV_PREFIX="$i"
  41. - break
  42. - fi
  43. - done
  44. - if test -z "$PHP_ICONV_PREFIX"; then
  45. - PHP_ICONV_PREFIX="/usr"
  46. - fi
  47. - else
  48. - PHP_ICONV_PREFIX="$ICONV_DIR"
  49. - fi
  50. -
  51. - CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
  52. - LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
  53. -
  54. - if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
  55. - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
  56. - else
  57. - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
  58. - fi
  59. AC_MSG_CHECKING([if iconv is glibc's])
  60. AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();],
  61. --
  62. 2.7.4