summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-08-19 06:37:05 +0000
committerfoobar <sniper@php.net>2001-08-19 06:37:05 +0000
commite5bd800aeb2893ac4b6eb2850a031105e5e78fc3 (patch)
tree44ce9476a49c074e1bcc92c8c1b9f40e7f58c47c
parent7e34d46573ec7b9a70e79d453d8c7f60adc5c3ed (diff)
downloadphp-git-e5bd800aeb2893ac4b6eb2850a031105e5e78fc3.tar.gz
Fixed bug: #11232. Now we require Fribidi 0.9.0.
# Better use the latest version for this one too since # it seems to have stabilized and they made an internal # rewrite for that one.
-rw-r--r--ext/fribidi/config.m428
-rwxr-xr-xext/fribidi/fribidi.c24
2 files changed, 29 insertions, 23 deletions
diff --git a/ext/fribidi/config.m4 b/ext/fribidi/config.m4
index 2a37d75b18..511ecacefa 100644
--- a/ext/fribidi/config.m4
+++ b/ext/fribidi/config.m4
@@ -1,16 +1,11 @@
dnl $Id$
dnl config.m4 for extension fribidi
-dnl don't forget to call PHP_EXTENSION(fribidi)
-
-
PHP_ARG_WITH(fribidi, whether to add fribidi support,
[ --with-fribidi[=DIR] Include fribidi support (requires FriBidi >=0.1.12).
DIR is the fribidi installation directory -
default /usr/local/])
-
-
if test "$PHP_FRIBIDI" != "no"; then
dnl if module was requested with default path of fribidi installation then
@@ -19,8 +14,6 @@ dnl $PHP_FRIBIDI will be "yes"
if test "$PHP_FRIBIDI" = "yes"; then
PHP_FRIBIDI=/usr/local
fi
-
-
dnl check for fribidi header files
@@ -32,8 +25,6 @@ dnl $PHP_FRIBIDI will be "yes"
AC_MSG_RESULT([missing])
fi
-
-
dnl check for fribidi shared library
AC_MSG_CHECKING([for libfribidi.so file in "$PHP_FRIBIDI/lib/"])
@@ -54,20 +45,35 @@ dnl $PHP_FRIBIDI will be "yes"
AC_MSG_RESULT([missing])
fi
+
+ dnl check for fribidi version
+ AC_MSG_CHECKING([for FriBidi version])
+ FRIBIDI_CONFIG=$PHP_FRIBIDI/bin/fribidi-config
+ if test -x $FRIBIDI_CONFIG; then
+ fribidi_version_full=`$FRIBIDI_CONFIG --version`
+ fi
+
+ fribidi_version=`echo ${fribidi_version_full} | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
+
+ if test "$fribidi_version" -ge 9000; then
+ AC_MSG_RESULT([$fribidi_version_full])
+ else
+ AC_MSG_ERROR(FriBidi version 0.9.0 or later is required to compile php with FriBidi support)
+ fi
+
AC_MSG_CHECKING([sanity to build extension])
if test -n "$FRIBIDI_INCDIR" && test -n "$FRIBIDI_LIBDIR" && test -n "$GLIB_INCDIR"; then
AC_MSG_RESULT([yes])
-
PHP_ADD_INCLUDE("$FRIBIDI_INCDIR")
PHP_ADD_INCLUDE("$GLIB_INCDIR")
PHP_ADD_LIBRARY_WITH_PATH(fribidi,"$FRIBIDI_LIBDIR", FRIBIDI_SHARED_LIBADD)
- PHP_SUBST(FRIBIDI_SHARED_LIBADD)
AC_DEFINE(HAVE_FRIBIDI, 1, [ ])
PHP_EXTENSION(fribidi, $ext_shared)
+ PHP_SUBST(FRIBIDI_SHARED_LIBADD)
else
AC_MSG_RESULT([no])
fi
diff --git a/ext/fribidi/fribidi.c b/ext/fribidi/fribidi.c
index f28ba13427..e88e48d6e6 100755
--- a/ext/fribidi/fribidi.c
+++ b/ext/fribidi/fribidi.c
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
- | Authors: |
+ | Authors: Onn Ben-Zvi <onn@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -66,8 +66,8 @@ ZEND_GET_MODULE(fribidi)
PHP_MINIT_FUNCTION(fribidi)
{
REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_UTF8", FRIBIDI_CHARSET_UTF8, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_6", FRIBIDI_CHARSET_8859_6, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_8", FRIBIDI_CHARSET_8859_8, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_6", FRIBIDI_CHARSET_ISO8859_6, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_8859_8", FRIBIDI_CHARSET_ISO8859_8, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1255", FRIBIDI_CHARSET_CP1255, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_CP1256", FRIBIDI_CHARSET_CP1256, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FRIBIDI_CHARSET_ISIRI_3342", FRIBIDI_CHARSET_ISIRI_3342, CONST_CS | CONST_PERSISTENT);
@@ -108,13 +108,13 @@ PHP_MINFO_FUNCTION(fribidi)
/* Possible values (i.e., char sets supported) */
/* FRIBIDI_CHARSET_UTF8 */
/* FRIBIDI_CHARSET_8859_6 */
-/* FRIBIDI_CHARSET_8859_8 */
-/* FRIBIDI_CHARSET_CP1255 */
-/* FRIBIDI_CHARSET_CP1256 */
-/* FRIBIDI_CHARSET_ISIRI_3342 */
+/* FRIBIDI_CHARSET_8859_8 */
+/* FRIBIDI_CHARSET_CP1255 */
+/* FRIBIDI_CHARSET_CP1256 */
+/* FRIBIDI_CHARSET_ISIRI_3342 */
/* */
/* Output: on success: The visual string. */
-/* on failure: */
+/* on failure: */
/*--------------------------------------------------------------*/
/* {{{ proto string fribidi_log2vis(string str, string direction, int charset)
@@ -174,10 +174,10 @@ PHP_FUNCTION(fribidi_log2vis)
case FRIBIDI_CHARSET_UTF8:
utf8_len=fribidi_utf8_to_unicode(inString, u_logical_str);
break;
- case FRIBIDI_CHARSET_8859_6:
+ case FRIBIDI_CHARSET_ISO8859_6:
fribidi_iso8859_6_to_unicode(inString, u_logical_str);
break;
- case FRIBIDI_CHARSET_8859_8:
+ case FRIBIDI_CHARSET_ISO8859_8:
fribidi_iso8859_8_to_unicode(inString, u_logical_str);
break;
case FRIBIDI_CHARSET_CP1255:
@@ -211,10 +211,10 @@ PHP_FUNCTION(fribidi_log2vis)
case FRIBIDI_CHARSET_UTF8:
fribidi_unicode_to_utf8(u_visual_str, utf8_len , outString);
break;
- case FRIBIDI_CHARSET_8859_6:
+ case FRIBIDI_CHARSET_ISO8859_6:
fribidi_unicode_to_iso8859_6(u_visual_str, len , outString);
break;
- case FRIBIDI_CHARSET_8859_8:
+ case FRIBIDI_CHARSET_ISO8859_8:
fribidi_unicode_to_iso8859_8(u_visual_str, len , outString);
break;
case FRIBIDI_CHARSET_CP1255: