if (PHP_PCRE_REGEX == "yes") {
EXTENSION("pcre", "php_pcre.c", PHP_PCRE_REGEX_SHARED,
- "-DNO_RECURSE -DHAVE_CONFIG_H -Iext/pcre/pcrelib");
+ "-DNO_RECURSE -Iext/pcre/pcrelib");
ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucp_searchfuncs.c pcre_compile.c pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_info.c pcre_maketables.c pcre_newline.c pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_try_flipped.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c", "pcre");
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");
if test "$PHP_PCRE_REGEX" != "no"; then
if test "$PHP_PCRE_REGEX" = "yes"; then
- PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_exec.c pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_newline.c pcrelib/pcre_ord2utf8.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c, $ext_shared,,-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib)
+ PHP_NEW_EXTENSION(pcre, pcrelib/pcre_chartables.c pcrelib/pcre_ucp_searchfuncs.c pcrelib/pcre_compile.c pcrelib/pcre_config.c pcrelib/pcre_exec.c pcrelib/pcre_fullinfo.c pcrelib/pcre_get.c pcrelib/pcre_globals.c pcrelib/pcre_info.c pcrelib/pcre_maketables.c pcrelib/pcre_newline.c pcrelib/pcre_ord2utf8.c pcrelib/pcre_refcount.c pcrelib/pcre_study.c pcrelib/pcre_tables.c pcrelib/pcre_try_flipped.c pcrelib/pcre_valid_utf8.c pcrelib/pcre_version.c pcrelib/pcre_xclass.c php_pcre.c, $ext_shared,,-I@ext_srcdir@/pcrelib)
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
PHP_ADD_INCLUDE(pcrelib)
locale. Now that pcre_maketables is a function visible to the outside world, we
make use of its code from here in order to be consistent. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include <ctype.h>
#include <stdio.h>
header ensures that the array gets flagged as "someone outside this compilation
unit might reference this" and so it will always be supplied to the linker. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
supporting internal functions that are not used by other modules. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#define NLBLOCK cd /* Block containing newline information */
#define PSSTART start_pattern /* Field containing processed string start */
/* This module contains the external function pcre_config(). */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
pattern matching using an NFA algorithm, trying to mimic Perl as closely as
possible. There are also some static supporting functions. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#define NLBLOCK md /* Block containing newline information */
#define PSSTART start_subject /* Field containing processed string start */
information about a compiled pattern. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
for these functions came from Scott Wimer. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
all threads. However, when compiling for Virtual Pascal, things are done
differently, and global variables are not used (see pcre.in). */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
deprecated, as it has been superseded by pcre_fullinfo(). */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
#ifndef DFTABLES
-# ifdef HAVE_CONFIG_H
# include <config.h>
-# endif
# include "pcre_internal.h"
#endif
http://unicode.org/unicode/reports/tr18/. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
/* This file contains a private PCRE function that converts an ordinal
character value into a UTF8 string. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
shared by different users. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
supporting functions. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
clashes with the library. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
auxiliary local function to flip the appropriate bytes. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
/* This module contains code for searching the table of Unicode character
properties. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
strings. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
string that identifies the PCRE version that is in use. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
pcre_exec() and pcre_def_exec(). */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "pcre_internal.h"
-----------------------------------------------------------------------------
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include <ctype.h>
#include <locale.h>
functions. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
/* Ensure that the PCREPOSIX_EXP_xxx macros are set appropriately for
{
global $newpcre, $dirlen;
- foreach(scandir($path) as $file) {
+ foreach (scandir($path) as $file) {
- if ($file[0] === '.' || $file === 'CVS') continue;
- if (substr_compare($file, '.lo', -3, 3) == 0 || substr_compare($file, '.o', -2, 2) == 0) continue;
+ if ($file[0] === '.' ||
+ $file === 'CVS' ||
+ substr_compare($file, '.lo', -3, 3) == 0 ||
+ substr_compare($file, '.loT', -4, 4) == 0 ||
+ substr_compare($file, '.o', -2, 2) == 0) continue;
$file = "$path/$file";
die("$newfile is not available any more\n");
}
- copy($newfile, $file);
+ // maintain file mtimes so that cvs doesnt get crazy
+ if (file_get_contents($newfile) !== file_get_contents($file)) {
+ copy($newfile, $file);
+ }
+
+ // always include the config.h file
+ $content = file_get_contents($newfile);
+ $newcontent = preg_replace('/#\s*ifdef HAVE_CONFIG_H\s*(.+)\s*#\s*endif/', '$1', $content);
+
+ if ($content !== $newcontent) {
+ file_put_contents($file, $newcontent);
+ }
+
echo "OK\n";
}