Skip to content

Commit 5a80df2

Browse files
author
Rui Hirokawa
committed
@mbfilter is changed to bundled version of libmbfl to prevent LGPL licence problem. mbregex is changed to oniguruma.
1 parent d696f12 commit 5a80df2

File tree

235 files changed

+45634
-24071
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+45634
-24071
lines changed

ext/mbstring/README.libmbfl

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
libmbfl is a streamable multibyte character code filter and
3+
converter library.
4+
libmbfl is distributed under LGPL 2.1 and bundled with PHP.
5+
6+
The original version of libmbfl is developed and distributed
7+
at http://sourceforge.jp/project/php-i18n/ .
8+
9+
If you need to modify the bundled libmbfl, the change also have to be applied for
10+
the libmbfl on sourceforge.jp.
11+
12+
If you have question about libmbfl, please ask to
13+
14+
15+
See libmbfl/DISCLAIMER for licensing information of libmbfl.
16+

ext/mbstring/config.m4

+183-30
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,194 @@ dnl
22
dnl $Id$
33
dnl
44

5-
PHP_ARG_ENABLE(mbstring, whether to enable multibyte string support,
6-
[ --enable-mbstring Enable multibyte string support])
5+
AC_DEFUN([PHP_MBSTRING_INIT], [
6+
PHP_MBSTRING_SOURCES=""
7+
PHP_MBSTRING_EXTRA_BUILD_DIRS=""
8+
PHP_MBSTRING_EXTRA_CONFIG_HEADERS=""
9+
PHP_MBSTRING=""
10+
PHP_MBREGEX=""
11+
PHP_MBSTRING_CFLAGS=""
12+
])
713

8-
if test "$PHP_MBSTRING" != "no"; then
9-
AC_DEFINE(HAVE_MBSTRING,1,[whether to have multibyte string support])
14+
AC_DEFUN([PHP_MBSTRING_ADD_SOURCES], [
15+
PHP_MBSTRING_SOURCES="$PHP_MBSTRING_SOURCES $1"
16+
])
1017

11-
if test "$PHP_MBSTRING" != "no" -o "$PHP_MBSTRING" = "ja"; then
12-
AC_DEFINE(HAVE_MBSTR_JA,1,[whether to have japanese support])
13-
fi
14-
if test "$PHP_MBSTRING" = "cn"; then
15-
AC_DEFINE(HAVE_MBSTR_CN,1,[whether to have simplified chinese support])
16-
fi
17-
if test "$PHP_MBSTRING" = "tw"; then
18-
AC_DEFINE(HAVE_MBSTR_TW,1,[whether to have traditional chinese support])
19-
fi
20-
if test "$PHP_MBSTRING" = "kr"; then
21-
AC_DEFINE(HAVE_MBSTR_KR,1,[whether to have korean support])
18+
AC_DEFUN([PHP_MBSTRING_ADD_BUILD_DIR], [
19+
PHP_MBSTRING_EXTRA_BUILD_DIRS="$PHP_MBSTRING_EXTRA_BUILD_DIRS $1"
20+
])
21+
22+
AC_DEFUN([PHP_MBSTRING_CONFIG_HEADER], [
23+
PHP_MBSTRING_EXTRA_CONFIG_HEADERS="$PHP_MBSTRING_EXTRA_CONFIG_HEADERS $1"
24+
])
25+
26+
AC_DEFUN([PHP_MBSTRING_EXTENSION], [
27+
PHP_NEW_EXTENSION(mbstring, $PHP_MBSTRING_SOURCES, $ext_shared,, \\$(PHP_MBSTRING_CFLAGS))
28+
for dir in $PHP_MBSTRING_EXTRA_BUILD_DIRS; do
29+
PHP_ADD_BUILD_DIR([$ext_builddir/$dir])
30+
done
31+
for cfg in $PHP_MBSTRING_EXTRA_CONFIG_HEADERS; do
32+
AC_CONFIG_HEADER([$ext_builddir/$cfg])
33+
done
34+
35+
if test "$LIBMBFL_MODULE_TYPE" = "builtin"; then
36+
PHP_MBSTRING_CFLAGS="-I$ext_srcdir/libmbfl/mbfl $PHP_MBSTRING_CFLAGS"
37+
PHP_MBSTRING_CFLAGS="-I$ext_srcdir/libmbfl $PHP_MBSTRING_CFLAGS"
2238
fi
23-
if test "$PHP_MBSTRING" = "ru"; then
24-
AC_DEFINE(HAVE_MBSTR_RU,1,[whether to have russian support])
39+
PHP_SUBST(PHP_MBSTRING_CFLAGS)
40+
])
41+
42+
43+
AC_DEFUN([PHP_MBSTRING_SETUP], [
44+
PHP_ARG_ENABLE(mbstring, whether to enable multibyte string support,
45+
[ --enable-mbstring Enable multibyte string support])
46+
47+
if test "$PHP_MBSTRING" != "no"; then
48+
AC_DEFINE([HAVE_MBSTRING],1,[whether to have multibyte string support])
49+
50+
if test -z "$PHP_MBSTRING" -o "$PHP_MBSTRING" = "all" -o "$PHP_MBSTRING" = "ja"; then
51+
AC_DEFINE([HAVE_MBSTR_JA],1,[whether to have japanese support])
52+
fi
53+
if test "$PHP_MBSTRING" = "all" -o "$PHP_MBSTRING" = "cn"; then
54+
AC_DEFINE([HAVE_MBSTR_CN],1,[whether to have simplified chinese support])
55+
fi
56+
if test "$PHP_MBSTRING" = "all" -o "$PHP_MBSTRING" = "tw"; then
57+
AC_DEFINE([HAVE_MBSTR_TW],1,[whether to have traditional chinese support])
58+
fi
59+
if test "$PHP_MBSTRING" = "all" -o "$PHP_MBSTIRNG" = "kr"; then
60+
AC_DEFINE([HAVE_MBSTR_KR],1,[whether to have korean support])
61+
fi
62+
if test "$PHP_MBSTRING" = "all" -o "$PHP_MBSTRING" = "ru"; then
63+
AC_DEFINE([HAVE_MBSTR_RU],1,[whether to have russian support])
64+
fi
65+
66+
PHP_MBSTRING_ADD_SOURCES([
67+
mbstring.c php_unicode.c mb_gpc.c php_mbfl_allocators.c
68+
])
2569
fi
26-
if test "$PHP_MBSTRING" = "all"; then
27-
AC_DEFINE(HAVE_MBSTR_JA,1,[whether to have japanese support])
28-
AC_DEFINE(HAVE_MBSTR_CN,1,[whether to have simplified chinese support])
29-
AC_DEFINE(HAVE_MBSTR_TW,1,[whether to have traditional chinese support])
30-
AC_DEFINE(HAVE_MBSTR_KR,1,[whether to have korean support])
31-
AC_DEFINE(HAVE_MBSTR_RU,1,[whether to have russian support])
70+
])
71+
72+
AC_DEFUN([PHP_MBSTRING_SETUP_MBREGEX], [
73+
PHP_ARG_ENABLE([mbregex], [whether to enable multibyte regex support],
74+
[ --disable-mbregex Disable multibyte regex support], yes, no)
75+
76+
if test "$PHP_MBREGEX" != "no" -a "$PHP_MBSTRING" != "no"; then
77+
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, cv_php_mbstring_stdarg, [
78+
AC_TRY_COMPILE([#include <stdarg.h>], [
79+
int foo(int x, ...) {
80+
va_list va;
81+
va_start(va, x);
82+
va_arg(va, int);
83+
va_arg(va, char *);
84+
va_arg(va, double);
85+
return 0;
86+
}
87+
int main() { return foo(10, "", 3.14); }
88+
], [cv_php_mbstring_stdarg=yes], [cv_php_mbstring_stdarg=no])
89+
])
90+
if test "$cv_php_mbstring_stdarg" = "yes"; then
91+
AC_DEFINE([HAVE_STDARG_PROTOTYPES], 1, [Define if stdarg.h is available])
92+
fi
93+
AC_DEFINE([HAVE_MBREGEX], 1, [whether to have multibyte regex support])
94+
PHP_MBSTRING_CFLAGS="-DNOT_RUBY $PHP_MBSTRING_CFLAGS"
95+
96+
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma])
97+
PHP_MBSTRING_CONFIG_HEADER([oniguruma/config.h])
98+
PHP_MBSTRING_ADD_SOURCES([
99+
php_mbregex.c
100+
oniguruma/regcomp.c
101+
oniguruma/regerror.c
102+
oniguruma/regexec.c
103+
oniguruma/reggnu.c
104+
oniguruma/regparse.c
105+
oniguruma/regposerr.c
106+
])
32107
fi
108+
])
109+
110+
AC_DEFUN([PHP_MBSTRING_SETUP_LIBMBFL], [
111+
PHP_ARG_WITH(libmbfl, [ include libmbfl support],
112+
[ --with-libmbfl[=DIR] Include libmbfl support where DIR is libmbfl install prefix.
113+
If DIR is not set, the bundled libmbfl will be used.], no, no)
33114
34-
PHP_NEW_EXTENSION(mbstring, mbfilter_ja.c mbfilter_cn.c mbfilter_tw.c mbfilter_kr.c mbfilter_ru.c mbfilter.c mbstring.c mbregex.c php_mbregex.c html_entities.c php_unicode.c mb_gpc.c, $ext_shared)
35-
fi
115+
if test "$PHP_MBSTRING" != "no"; then
116+
LIBMBFL_MODULE_TYPE=builtin
117+
AC_DEFINE([HAVE_LIBMBFL], 1, [whether to have libmbfl support])
118+
PHP_MBSTRING_ADD_BUILD_DIR([libmbfl])
119+
PHP_MBSTRING_CONFIG_HEADER([libmbfl/config.h])
120+
PHP_MBSTRING_ADD_SOURCES([
121+
libmbfl/filters/html_entities.c
122+
libmbfl/filters/mbfilter_7bit.c
123+
libmbfl/filters/mbfilter_ascii.c
124+
libmbfl/filters/mbfilter_base64.c
125+
libmbfl/filters/mbfilter_big5.c
126+
libmbfl/filters/mbfilter_byte2.c
127+
libmbfl/filters/mbfilter_byte4.c
128+
libmbfl/filters/mbfilter_cp1251.c
129+
libmbfl/filters/mbfilter_cp1252.c
130+
libmbfl/filters/mbfilter_cp866.c
131+
libmbfl/filters/mbfilter_cp932.c
132+
libmbfl/filters/mbfilter_cp936.c
133+
libmbfl/filters/mbfilter_euc_cn.c
134+
libmbfl/filters/mbfilter_euc_jp.c
135+
libmbfl/filters/mbfilter_euc_jp_win.c
136+
libmbfl/filters/mbfilter_euc_kr.c
137+
libmbfl/filters/mbfilter_euc_tw.c
138+
libmbfl/filters/mbfilter_htmlent.c
139+
libmbfl/filters/mbfilter_hz.c
140+
libmbfl/filters/mbfilter_iso2022_kr.c
141+
libmbfl/filters/mbfilter_iso8859_1.c
142+
libmbfl/filters/mbfilter_iso8859_10.c
143+
libmbfl/filters/mbfilter_iso8859_13.c
144+
libmbfl/filters/mbfilter_iso8859_14.c
145+
libmbfl/filters/mbfilter_iso8859_15.c
146+
libmbfl/filters/mbfilter_iso8859_2.c
147+
libmbfl/filters/mbfilter_iso8859_3.c
148+
libmbfl/filters/mbfilter_iso8859_4.c
149+
libmbfl/filters/mbfilter_iso8859_5.c
150+
libmbfl/filters/mbfilter_iso8859_6.c
151+
libmbfl/filters/mbfilter_iso8859_7.c
152+
libmbfl/filters/mbfilter_iso8859_8.c
153+
libmbfl/filters/mbfilter_iso8859_9.c
154+
libmbfl/filters/mbfilter_jis.c
155+
libmbfl/filters/mbfilter_koi8r.c
156+
libmbfl/filters/mbfilter_qprint.c
157+
libmbfl/filters/mbfilter_sjis.c
158+
libmbfl/filters/mbfilter_ucs2.c
159+
libmbfl/filters/mbfilter_ucs4.c
160+
libmbfl/filters/mbfilter_uhc.c
161+
libmbfl/filters/mbfilter_utf16.c
162+
libmbfl/filters/mbfilter_utf32.c
163+
libmbfl/filters/mbfilter_utf7.c
164+
libmbfl/filters/mbfilter_utf7imap.c
165+
libmbfl/filters/mbfilter_utf8.c
166+
libmbfl/filters/mbfilter_uuencode.c
167+
libmbfl/mbfl/mbfilter.c
168+
libmbfl/mbfl/mbfilter_8bit.c
169+
libmbfl/mbfl/mbfilter_pass.c
170+
libmbfl/mbfl/mbfilter_wchar.c
171+
libmbfl/mbfl/mbfl_convert.c
172+
libmbfl/mbfl/mbfl_encoding.c
173+
libmbfl/mbfl/mbfl_filter_output.c
174+
libmbfl/mbfl/mbfl_ident.c
175+
libmbfl/mbfl/mbfl_language.c
176+
libmbfl/mbfl/mbfl_memory_device.c
177+
libmbfl/mbfl/mbfl_string.c
178+
libmbfl/nls/nls_de.c
179+
libmbfl/nls/nls_en.c
180+
libmbfl/nls/nls_ja.c
181+
libmbfl/nls/nls_kr.c
182+
libmbfl/nls/nls_neutral.c
183+
libmbfl/nls/nls_ru.c
184+
libmbfl/nls/nls_uni.c
185+
libmbfl/nls/nls_zh.c
186+
])
187+
fi
188+
])
36189

37-
PHP_ARG_ENABLE(mbregex, whether to enable multibyte regex support,
38-
[ --disable-mbregex Disable multibyte regex support], yes, no)
190+
PHP_MBSTRING_INIT
191+
PHP_MBSTRING_SETUP
192+
PHP_MBSTRING_SETUP_MBREGEX
193+
PHP_MBSTRING_SETUP_LIBMBFL
194+
PHP_MBSTRING_EXTENSION
39195

40-
if test "$PHP_MBREGEX" != "no" -a "$PHP_MBSTRING" != "no"; then
41-
AC_DEFINE(HAVE_MBREGEX, 1, [whether to have multibyte regex support])
42-
fi

ext/mbstring/libmbfl/AUTHORS

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Hironori Sato <[email protected]>
2+
Shigeru Kanemoto <[email protected]>
3+
Tsukada Takuya <[email protected]>
4+
U. Kenkichi <[email protected]>
5+
6+
Moriyoshi Koizumi <[email protected]>
7+
Rui Hirokawa <[email protected]>
8+
Other gracious contributors

ext/mbstring/libmbfl/DISCLAIMER

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# charset=UTF-8
2+
3+
"streamable kanji code filter and converter"
4+
5+
Copyright (c) 1998,1999,2000,2001 HappySize, Inc. All rights reserved.
6+
7+
This software is released under the GNU Lesser General Public License.
8+
(Version 2.1, February 1999)
9+
Please read the following detail of the licence (in japanese).
10+
11+
◆使用許諾条件◆
12+
13+
このソフトウェアは株式会社ハッピーサイズによって開発されました。株式会社ハッ
14+
ピーサイズは、著作権法および万国著作権条約の定めにより、このソフトウェアに関
15+
するすべての権利を留保する権利を持ち、ここに行使します。株式会社ハッピーサイ
16+
ズは以下に明記した条件に従って、このソフトウェアを使用する排他的ではない権利
17+
をお客様に許諾します。何人たりとも、以下の条件に反してこのソフトウェアを使用
18+
することはできません。
19+
20+
このソフトウェアを「GNU Lesser General Public License (Version 2.1, February
21+
1999)」に示された条件で使用することを、全ての方に許諾します。「GNU Lesser
22+
General Public License」を満たさない使用には、株式会社ハッピーサイズから書面
23+
による許諾を得る必要があります。
24+
25+
「GNU Lesser General Public License」の全文は以下のウェブページから取得でき
26+
ます。「GNU Lesser General Public License」とは、これまでLibrary General
27+
Public Licenseと呼ばれていたものです。
28+
http://www.gnu.org/ --- GNUウェブサイト
29+
http://www.gnu.org/copyleft/lesser.html --- ライセンス文面
30+
このライセンスの内容がわからない方、守れない方には使用を許諾しません。
31+
32+
しかしながら、当社とGNUプロジェクトとの特定の関係を示唆または主張するもので
33+
はありません。
34+
35+
◆保証内容◆
36+
37+
このソフトウェアは、期待された動作・機能・性能を持つことを目標として設計され
38+
開発されていますが、これを保証するものではありません。このソフトウェアは「こ
39+
のまま」の状態で提供されており、たとえばこのソフトウェアの有用性ないし特定の
40+
目的に合致することといった、何らかの保証内容が、明示されたり暗黙に示されてい
41+
る場合であっても、その保証は無効です。このソフトウェアを使用した結果ないし使
42+
用しなかった結果によって、直接あるいは間接に受けた身体的な傷害、財産上の損害
43+
、データの損失あるいはその他の全ての損害については、その損害の可能性が使用者
44+
、当社あるいは第三者によって警告されていた場合であっても、当社はその損害の賠
45+
償および補填を行いません。この規定は他の全ての、書面上または書面に無い保証・
46+
契約・規定に優先します。
47+
48+
◆著作権者の連絡先および使用条件についての問い合わせ先◆
49+
50+
〒102-0073
51+
東京都千代田区九段北1-13-5日本地所第一ビル4F
52+
株式会社ハッピーサイズ
53+
Phone: 03-3512-3655, Fax: 03-3512-3656
54+
55+
Web: http://happysize.com/
56+
57+
◆著者◆
58+
59+
金本 茂 <[email protected]>
60+
61+
◆履歴◆
62+
63+
1998/11/10 sgk implementation in C++
64+
1999/4/25 sgk Cで書きなおし。
65+
1999/4/26 sgk 入力フィルタを実装。漢字コードを推定しながらフィルタを追加。
66+
1999/6/?? Unicodeサポート。
67+
1999/6/22 sgk ライセンスをLGPLに変更。
68+

ext/mbstring/libmbfl/INSTALL

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
For UNIX compatible system,
3+
4+
./buildconf
5+
./configure
6+
make
7+
make install
8+
9+
For Windows,
10+
11+
Visual C++ 6.0 and Borland C++ 5.0 is suppoted.
12+

ext/mbstring/libmbfl/Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
EXTRA_DIST=AUTHORS DISCLAIMER
2+
SUBDIRS = nls filters mbfl

ext/mbstring/libmbfl/README

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This is Libmbfl, a streamable multibyte character code filter and
2+
converter library.
3+
4+
See DISCLAIMER for licensing information.
5+
6+
See the file INSTALL for instructions on how to build and install
7+
libmbfl.
8+

ext/mbstring/libmbfl/buildconf

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
libtoolize -c -f --automake
3+
aclocal
4+
autoheader
5+
automake -a -c --foreign
6+
autoconf

0 commit comments

Comments
 (0)