summaryrefslogtreecommitdiff
path: root/ext/ereg/config0.m4
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/ereg/config0.m4
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/ereg/config0.m4')
-rw-r--r--ext/ereg/config0.m456
1 files changed, 56 insertions, 0 deletions
diff --git a/ext/ereg/config0.m4 b/ext/ereg/config0.m4
new file mode 100644
index 0000000..f4f8190
--- /dev/null
+++ b/ext/ereg/config0.m4
@@ -0,0 +1,56 @@
+dnl $Id$
+dnl config.m4 for extension ereg
+
+dnl
+dnl Check for regex library type
+dnl
+PHP_ARG_WITH(regex,,
+[ --with-regex=TYPE regex library type: system, php. [TYPE=php]
+ WARNING: Do NOT use unless you know what you are doing!], php, no)
+
+case $PHP_REGEX in
+ system)
+ if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter" || test "$PHP_SAPI" = "apache2handler"; then
+ REGEX_TYPE=php
+ else
+ REGEX_TYPE=system
+ fi
+ ;;
+ yes | php)
+ REGEX_TYPE=php
+ ;;
+ *)
+ REGEX_TYPE=php
+ AC_MSG_WARN([Invalid regex library type selected. Using default value: php])
+ ;;
+esac
+
+AC_MSG_CHECKING([which regex library to use])
+AC_MSG_RESULT([$REGEX_TYPE])
+
+if test "$REGEX_TYPE" = "php"; then
+ ereg_regex_sources="regex/regcomp.c regex/regexec.c regex/regerror.c regex/regfree.c"
+ ereg_regex_headers="regex/"
+ PHP_EREG_CFLAGS="-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp"
+fi
+
+PHP_NEW_EXTENSION(ereg, ereg.c $ereg_regex_sources, no,,$PHP_EREG_CFLAGS)
+PHP_INSTALL_HEADERS([ext/ereg], [php_ereg.h php_regex.h $ereg_regex_headers])
+
+if test "$REGEX_TYPE" = "php"; then
+ AC_DEFINE(HAVE_REGEX_T_RE_MAGIC, 1, [ ])
+ AC_DEFINE(HSREGEX,1,[ ])
+ AC_DEFINE(REGEX,1,[ ])
+ PHP_ADD_BUILD_DIR([$ext_builddir/regex], 1)
+ PHP_ADD_INCLUDE([$ext_srcdir/regex])
+elif test "$REGEX_TYPE" = "system"; then
+ AC_DEFINE(REGEX,0,[ ])
+ dnl Check if field re_magic exists in struct regex_t
+ AC_CACHE_CHECK([whether field re_magic exists in struct regex_t], ac_cv_regex_t_re_magic, [
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <regex.h>], [regex_t rt; rt.re_magic;],
+ [ac_cv_regex_t_re_magic=yes], [ac_cv_regex_t_re_magic=no])])
+ if test "$ac_cv_regex_t_re_magic" = "yes"; then
+ AC_DEFINE([HAVE_REGEX_T_RE_MAGIC], [ ], 1)
+ fi
+fi