[PHP-users 4641] mbregex cannot compile

TANABE Junnichi php-users@php.gr.jp
Thu, 10 Jan 2002 05:36:46 +0900



もしかしたら Debian 固有の問題かもしれませんので
# 上記は全て deb パッケージで利用しています。

PHP-4.0.6 まで利用していた mbregex モジュールを
PHP-4.1.1 で利用しようと思い、
# 4.0.6 までは deb パッケージにモジュールを
# 追加するだけで利用できていました。

$ tar xvzf php4_mbregex-1.3.1.tar.gz
$ cd mbregex/
$ phpize
$ ./configure --enable-regex
$ make


make[1]: Entering directory `/home/junnichi/work/php/mbregex'
/bin/sh /home/junnichi/work/php/mbregex/libtool --mode=compile gcc -I. -I/home/junnichi/work/php/mbregex/ -I/home/junnichi/work/php/mbregex/main -I/home/junnichi/work/php/mbregex -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -DHAVE_CONFIG_H  -prefer-pic  -c mbregex.c && touch mbregex.slo
gcc -I. -I/home/junnichi/work/php/mbregex/ -I/home/junnichi/work/php/mbregex/main -I/home/junnichi/work/php/mbregex -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -DHAVE_CONFIG_H -c mbregex.c  -fPIC -DPIC -o mbregex.lo
mbregex.c:528: conflicting types for `re_set_syntax'
/usr/include/regex.h:449: previous declaration of `re_set_syntax'
make[1]: *** [mbregex.slo] エラー 1
make[1]: Leaving directory `/home/junnichi/work/php/mbregex'
make: *** [all-recursive] エラー 1

/usr/include/regex.h の該当箇所(449行目)を見ると

/* Sets the current default syntax to SYNTAX, and return the old syntax.
   You can also simply assign to the `re_syntax_options' variable.  */
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));


念のため、./configure --enable-regex の実行結果も載せます。

creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether gcc and cc understand -c and -o together... yes
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM
checking for PHP extension directory... /usr/lib/php4/20010901
checking whether to enable mbregex support... yes, shared
checking for Cygwin environment... no
checking for mingw32 environment... no
checking how to run the C preprocessor... gcc -E
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... pass_all
checking for object suffix... o
checking for executable suffix... no
checking command to parse /usr/bin/nm -B output... ok
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (/usr/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether -lc should be explicitly linked in... no
creating libtool
checking for working mkdir -p... yes
creating config_vars.mk
creating Makefile
updating cache ./config.cache
creating ./config.status
creating config.h


 | 田邉純一 (TANABE Junnichi)          |
 | E-mail : junnichi@luminousjapan.com |