2
1

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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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/build/php.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. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  17. [Bernd: rebased for 7.4.10]
  18. ---
  19. build/php.m4 | 2 +-
  20. ext/iconv/config.m4 | 22 ----------------------
  21. 2 files changed, 1 insertion(+), 23 deletions(-)
  22. diff --git a/build/php.m4 b/build/php.m4
  23. index 9586c490..8b3d47ed 100644
  24. --- a/build/php.m4
  25. +++ b/build/php.m4
  26. @@ -1965,7 +1965,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
  27. dnl Check external libs for iconv funcs.
  28. if test "$found_iconv" = "no"; then
  29. - for i in $PHP_ICONV /usr/local /usr; do
  30. + for i in $PHP_ICONV; do
  31. if test -r $i/include/giconv.h; then
  32. AC_DEFINE(HAVE_GICONV_H, 1, [ ])
  33. ICONV_DIR=$i
  34. diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
  35. index fe9b47aa..70599694 100644
  36. --- a/ext/iconv/config.m4
  37. +++ b/ext/iconv/config.m4
  38. @@ -13,28 +13,6 @@ if test "$PHP_ICONV" != "no"; then
  39. ])
  40. if test "$iconv_avail" != "no"; then
  41. - if test -z "$ICONV_DIR"; then
  42. - for i in /usr/local /usr; do
  43. - if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
  44. - PHP_ICONV_PREFIX="$i"
  45. - break
  46. - fi
  47. - done
  48. - if test -z "$PHP_ICONV_PREFIX"; then
  49. - PHP_ICONV_PREFIX="/usr"
  50. - fi
  51. - else
  52. - PHP_ICONV_PREFIX="$ICONV_DIR"
  53. - fi
  54. -
  55. - CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
  56. - LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
  57. -
  58. - if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
  59. - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
  60. - else
  61. - PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
  62. - fi
  63. AC_MSG_CHECKING([if iconv is glibc's])
  64. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnu/libc-version.h>]], [[gnu_get_libc_version();]])],[
  65. --
  66. 2.7.4