322395379db838147847f59e14d9e72db1a693a2
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / php / 0002-no-iconv-search.patch
1 Tweak PHP_SETUP_ICONV from aclocal/acinclude.m4 to not
2 PHP_ADD_INCLUDE $ICONV_DIR/include since the tests use
3 test instead of AC_TRY_LINK to find headers which is bad,
4 specially when adding /usr and /usr/local to the mix.
5 Do basically the same with ext/iconv/config.m4 by tweaking
6 PHP_ICONV_H_PATH which, again, uses test and absolute paths.
7
8 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
9 [Gustavo: convert to nice m4 instead of patching configure]
10
11 diff -Nura php-5.6.8.orig/acinclude.m4 php-5.6.8/acinclude.m4
12 --- php-5.6.8.orig/acinclude.m4 2015-05-18 20:06:48.557099001 +0200
13 +++ php-5.6.8/acinclude.m4      2015-05-18 20:07:33.177099001 +0200
14 @@ -2470,7 +2470,7 @@
15    dnl
16    if test "$found_iconv" = "no"; then
17  
18 -    for i in $PHP_ICONV /usr/local /usr; do
19 +    for i in $PHP_ICONV; do
20        if test -r $i/include/giconv.h; then
21          AC_DEFINE(HAVE_GICONV_H, 1, [ ])
22          ICONV_DIR=$i
23 diff -Nura php-5.6.7.orig/ext/iconv/config.m4 php-5.6.7/ext/iconv/config.m4
24 --- php-5.6.7.orig/ext/iconv/config.m4  2015-04-08 11:08:11.184847544 -0300
25 +++ php-5.6.7/ext/iconv/config.m4       2015-04-08 11:39:07.823608030 -0300
26 @@ -14,28 +14,8 @@
27    ])
28  
29    if test "$iconv_avail" != "no"; then
30 -    if test -z "$ICONV_DIR"; then
31 -      for i in /usr/local /usr; do
32 -        if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
33 -          PHP_ICONV_PREFIX="$i"
34 -          break
35 -        fi
36 -      done
37 -      if test -z "$PHP_ICONV_PREFIX"; then
38 -        PHP_ICONV_PREFIX="/usr"
39 -      fi
40 -    else
41 -      PHP_ICONV_PREFIX="$ICONV_DIR"
42 -    fi
43  
44 -    CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
45 -    LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
46 -
47 -    if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
48 -      PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
49 -    else
50 -      PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
51 -    fi 
52 +    PHP_ICONV_H_PATH="iconv.h"
53  
54      AC_MSG_CHECKING([if iconv is glibc's])
55      AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();],