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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  15. [aduskett@gmail.com: Update for 7.3.0]
  16. ---
  17. acinclude.m4 | 2 +-
  18. ext/iconv/config.m4 | 22 ----------------------
  19. 2 files changed, 1 insertion(+), 23 deletions(-)
  20. diff --git a/acinclude.m4 b/acinclude.m4
  21. index af4aa06..1bd2652 100644
  22. --- a/acinclude.m4
  23. +++ b/acinclude.m4
  24. @@ -2444,7 +2444,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
  25. dnl
  26. if test "$found_iconv" = "no"; then
  27. - for i in $PHP_ICONV /usr/local /usr; do
  28. + for i in $PHP_ICONV; do
  29. if test -r $i/include/giconv.h; then
  30. AC_DEFINE(HAVE_GICONV_H, 1, [ ])
  31. ICONV_DIR=$i
  32. diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
  33. index 72334f79..29c358ad 100644
  34. --- a/ext/iconv/config.m4
  35. +++ b/ext/iconv/config.m4
  36. @@ -12,28 +12,6 @@ if test "$PHP_ICONV" != "no"; then
  37. ])
  38. if test "$iconv_avail" != "no"; then
  39. - if test -z "$ICONV_DIR"; then
  40. - for i in /usr/local /usr; do
  41. - if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
  42. - PHP_ICONV_PREFIX="$i"
  43. - break
  44. - fi
  45. - done
  46. - if test -z "$PHP_ICONV_PREFIX"; then
  47. - PHP_ICONV_PREFIX="/usr"
  48. - fi
  49. - else
  50. - PHP_ICONV_PREFIX="$ICONV_DIR"
  51. - fi
  52. -
  53. - CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
  54. - LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
  55. -
  56. - if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
  57. - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
  58. - else
  59. - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
  60. - fi
  61. AC_MSG_CHECKING([if iconv is glibc's])
  62. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnu/libc-version.h>]], [[gnu_get_libc_version();]])],[
  63. --
  64. 2.7.4