Skip to content

Commit

Permalink
initial - ONn
Browse files Browse the repository at this point in the history
  • Loading branch information
Onn Ben-Zvi committed Nov 13, 2000
1 parent 124569d commit 34b0b1f
Show file tree
Hide file tree
Showing 6 changed files with 503 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/fribidi/Makefile.in
@@ -0,0 +1,9 @@
# $Id$

LTLIBRARY_NAME = libfribidi.la
LTLIBRARY_SOURCES = fribidi.c
LTLIBRARY_SHARED_NAME = fribidi.la
LTLIBRARY_SHARED_LIBADD = $(FRIBIDI_SHARED_LIBADD)

include $(top_srcdir)/build/dynlib.mk
EXTRA_INCLUDES = $(FRIBIDI_INCLUDE)
53 changes: 53 additions & 0 deletions ext/fribidi/README
@@ -0,0 +1,53 @@
Purpose
=======

This extension is basically a wrapper for the FriBidi implementation
of the Unicode Bidi algorithm. The need for such an algorithm rises
from the bidirectional language usage done by applications.
Arabic/Hebrew embedded within English is such a case.

Usage
=====

The only function used is fribidi_log2vis (logical to visual).
Input: 1) The Logical string.
2) Base direction of application - 'L' or 'R'.
3) The char code being used, which can be one of the following
constants:
a) FRIBIDI_CHARSET_UTF8
b) FRIBIDI_CHARSET_8859_6
c) FRIBIDI_CHARSET_8859_8
d) FRIBIDI_CHARSET_CP1255
e) FRIBIDI_CHARSET_CP1256
f) FRIBIDI_CHARSET_ISIRI_3342

Note: Currently, FriBidi supports the above Character Codes alone.

Output: A Visual string.


Compiling
===========
1) Static - ./configure --with-fribidi=base-directory-of-FriBidi-installation-path
(defaults to /usr/local).

2) dl - same, just add static, to get .... --with-fribidi=static,base....

Prerequisites
=============
1) FriBidi must be installed. Latest version can be obtained thru
http://imagic.weizmann.ac.il/~dov/freesw/FriBidi.

2) glib header files: glib.h and glibconfig.h.

Note
=====

The function fribidi_log2vis computes three more arrays which are currently not passed back as output.
These arrays are:
1) mapping from the logical to the visual sting.
2) mapping from the visual to the logical string.
3) embedding level of characters as figured out by the FriBidi algorithm.

The extension needs further implementation to support this.
p.s. - If you don't understand this, you probably don't need it.
74 changes: 74 additions & 0 deletions ext/fribidi/config.m4
@@ -0,0 +1,74 @@
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/],"no")



if test "$PHP_FRIBIDI" != "no"; then

dnl if module was requested with default path of fribidi installation then
dnl $PHP_FRIBIDI will be "yes"

if test "$PHP_FRIBIDI" == "yes"; then
PHP_FRIBIDI="/usr/local"
fi



dnl check for fribidi header files

AC_MSG_CHECKING([for header files in "$PHP_FRIBIDI/include/fribidi"])
if test -f $PHP_FRIBIDI/include/fribidi/fribidi.h && test -f $PHP_FRIBIDI/include/fribidi/fribidi_types.h && test -f $PHP_FRIBIDI/include/fribidi/fribidi_char_sets.h; then
FRIBIDI_INCDIR="$PHP_FRIBIDI/include/fribidi/"
AC_MSG_RESULT([found all])
else
AC_MSG_RESULT([missing])
fi



dnl check for fribidi shared library

AC_MSG_CHECKING([for libfribidi.so file in "$PHP_FRIBIDI/lib/"])
if test -f "$PHP_FRIBIDI/lib/libfribidi.so" ; then
FRIBIDI_LIBDIR="$PHP_FRIBIDI/lib/"
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([missing])
fi

dnl check for glib header files

AC_MSG_CHECKING([for glibconfig.h in "usr/lib/glib/include/"])
if test -f /usr/lib/glib/include/glibconfig.h ; then
AC_MSG_RESULT([found])
GLIB_INCDIR=/usr/lib/glib/include/
else
AC_MSG_RESULT([missing])
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])


AC_ADD_INCLUDE("$FRIBIDI_INCDIR")
AC_ADD_INCLUDE("$GLIB_INCDIR")
AC_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)
else
AC_MSG_RESULT([no])
fi
fi

0 comments on commit 34b0b1f

Please sign in to comment.