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
if test "$PHP_FRIBIDI" = "yes"; then
PHP_FRIBIDI=/usr/local
fi
-
-
dnl check for fribidi header files
AC_MSG_RESULT([missing])
fi
-
-
dnl check for fribidi shared library
AC_MSG_CHECKING([for libfribidi.so file in "$PHP_FRIBIDI/lib/"])
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
| 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> |
+----------------------------------------------------------------------+
*/
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);
/* 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)
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:
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: