Skip to content

Commit 336111e

Browse files
committed
remove the -DHAVE_CONFIG_H switch again to fix things on windows
this means that the upgrade script strips the #ifdef automatically
1 parent 7f7c158 commit 336111e

25 files changed

+21
-50
lines changed

ext/pcre/config.w32

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG_WITH("pcre-regex", "Perl Compatible Regular Expressions", "yes");
55

66
if (PHP_PCRE_REGEX == "yes") {
77
EXTENSION("pcre", "php_pcre.c", PHP_PCRE_REGEX_SHARED,
8-
"-DNO_RECURSE -DHAVE_CONFIG_H -Iext/pcre/pcrelib");
8+
"-DNO_RECURSE -Iext/pcre/pcrelib");
99
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");
1010
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");
1111

ext/pcre/config0.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PHP_ARG_WITH(pcre-regex,for PCRE support,
1111

1212
if test "$PHP_PCRE_REGEX" != "no"; then
1313
if test "$PHP_PCRE_REGEX" = "yes"; then
14-
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)
14+
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)
1515
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
1616
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
1717
AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])

ext/pcre/pcrelib/dftables.c

-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ character tables for PCRE. The tables are built according to the current
4343
locale. Now that pcre_maketables is a function visible to the outside world, we
4444
make use of its code from here in order to be consistent. */
4545

46-
#ifdef HAVE_CONFIG_H
4746
#include <config.h>
48-
#endif
4947

5048
#include <ctype.h>
5149
#include <stdio.h>

ext/pcre/pcrelib/pcre_chartables.c

-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ and dead code stripping is activated. This leads to link errors. Pulling in the
2020
header ensures that the array gets flagged as "someone outside this compilation
2121
unit might reference this" and so it will always be supplied to the linker. */
2222

23-
#ifdef HAVE_CONFIG_H
2423
#include <config.h>
25-
#endif
2624

2725
#include "pcre_internal.h"
2826

ext/pcre/pcrelib/pcre_compile.c

-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
4242
supporting internal functions that are not used by other modules. */
4343

4444

45-
#ifdef HAVE_CONFIG_H
4645
#include <config.h>
47-
#endif
4846

4947
#define NLBLOCK cd /* Block containing newline information */
5048
#define PSSTART start_pattern /* Field containing processed string start */

ext/pcre/pcrelib/pcre_config.c

-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
4141
/* This module contains the external function pcre_config(). */
4242

4343

44-
#ifdef HAVE_CONFIG_H
4544
#include <config.h>
46-
#endif
4745

4846
#include "pcre_internal.h"
4947

ext/pcre/pcrelib/pcre_exec.c

-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
4242
pattern matching using an NFA algorithm, trying to mimic Perl as closely as
4343
possible. There are also some static supporting functions. */
4444

45-
#ifdef HAVE_CONFIG_H
4645
#include <config.h>
47-
#endif
4846

4947
#define NLBLOCK md /* Block containing newline information */
5048
#define PSSTART start_subject /* Field containing processed string start */

ext/pcre/pcrelib/pcre_fullinfo.c

-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
4242
information about a compiled pattern. */
4343

4444

45-
#ifdef HAVE_CONFIG_H
4645
#include <config.h>
47-
#endif
4846

4947
#include "pcre_internal.h"
5048

ext/pcre/pcrelib/pcre_get.c

-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ from the subject string after a regex match has succeeded. The original idea
4343
for these functions came from Scott Wimer. */
4444

4545

46-
#ifdef HAVE_CONFIG_H
4746
#include <config.h>
48-
#endif
4947

5048
#include "pcre_internal.h"
5149

ext/pcre/pcrelib/pcre_globals.c

-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ indirection. These values can be changed by the caller, but are shared between
4646
all threads. However, when compiling for Virtual Pascal, things are done
4747
differently, and global variables are not used (see pcre.in). */
4848

49-
#ifdef HAVE_CONFIG_H
5049
#include <config.h>
51-
#endif
5250

5351
#include "pcre_internal.h"
5452

ext/pcre/pcrelib/pcre_info.c

-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ information about a compiled pattern. However, use of this function is now
4343
deprecated, as it has been superseded by pcre_fullinfo(). */
4444

4545

46-
#ifdef HAVE_CONFIG_H
4746
#include <config.h>
48-
#endif
4947

5048
#include "pcre_internal.h"
5149

ext/pcre/pcrelib/pcre_maketables.c

-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ compilation of dftables.c, in which case the macro DFTABLES is defined. */
4545

4646

4747
#ifndef DFTABLES
48-
# ifdef HAVE_CONFIG_H
4948
# include <config.h>
50-
# endif
5149
# include "pcre_internal.h"
5250
#endif
5351

ext/pcre/pcrelib/pcre_newline.c

-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ and NLTYPE_ANY. The full list of Unicode newline characters is taken from
4747
http://unicode.org/unicode/reports/tr18/. */
4848

4949

50-
#ifdef HAVE_CONFIG_H
5150
#include <config.h>
52-
#endif
5351

5452
#include "pcre_internal.h"
5553

ext/pcre/pcrelib/pcre_ord2utf8.c

-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
4141
/* This file contains a private PCRE function that converts an ordinal
4242
character value into a UTF8 string. */
4343

44-
#ifdef HAVE_CONFIG_H
4544
#include <config.h>
46-
#endif
4745

4846
#include "pcre_internal.h"
4947

ext/pcre/pcrelib/pcre_refcount.c

-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ pattern data block. This might be helpful in applications where the block is
4444
shared by different users. */
4545

4646

47-
#ifdef HAVE_CONFIG_H
4847
#include <config.h>
49-
#endif
5048

5149
#include "pcre_internal.h"
5250

ext/pcre/pcrelib/pcre_study.c

-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
4242
supporting functions. */
4343

4444

45-
#ifdef HAVE_CONFIG_H
4645
#include <config.h>
47-
#endif
4846

4947
#include "pcre_internal.h"
5048

ext/pcre/pcrelib/pcre_tables.c

-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name
4444
clashes with the library. */
4545

4646

47-
#ifdef HAVE_CONFIG_H
4847
#include <config.h>
49-
#endif
5048

5149
#include "pcre_internal.h"
5250

ext/pcre/pcrelib/pcre_try_flipped.c

-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ see if it was compiled with the opposite endianness. If so, it uses an
4343
auxiliary local function to flip the appropriate bytes. */
4444

4545

46-
#ifdef HAVE_CONFIG_H
4746
#include <config.h>
48-
#endif
4947

5048
#include "pcre_internal.h"
5149

ext/pcre/pcrelib/pcre_ucp_searchfuncs.c

-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
4141
/* This module contains code for searching the table of Unicode character
4242
properties. */
4343

44-
#ifdef HAVE_CONFIG_H
4544
#include <config.h>
46-
#endif
4745

4846
#include "pcre_internal.h"
4947

ext/pcre/pcrelib/pcre_valid_utf8.c

-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
4242
strings. */
4343

4444

45-
#ifdef HAVE_CONFIG_H
4645
#include <config.h>
47-
#endif
4846

4947
#include "pcre_internal.h"
5048

ext/pcre/pcrelib/pcre_version.c

-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
4242
string that identifies the PCRE version that is in use. */
4343

4444

45-
#ifdef HAVE_CONFIG_H
4645
#include <config.h>
47-
#endif
4846

4947
#include "pcre_internal.h"
5048

ext/pcre/pcrelib/pcre_xclass.c

-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ class (one that contains characters whose values are > 255). It is used by both
4343
pcre_exec() and pcre_def_exec(). */
4444

4545

46-
#ifdef HAVE_CONFIG_H
4746
#include <config.h>
48-
#endif
4947

5048
#include "pcre_internal.h"
5149

ext/pcre/pcrelib/pcregrep.c

-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
3737
-----------------------------------------------------------------------------
3838
*/
3939

40-
#ifdef HAVE_CONFIG_H
4140
#include <config.h>
42-
#endif
4341

4442
#include <ctype.h>
4543
#include <locale.h>

ext/pcre/pcrelib/pcreposix.c

-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ POSSIBILITY OF SUCH DAMAGE.
4242
functions. */
4343

4444

45-
#ifdef HAVE_CONFIG_H
4645
#include <config.h>
47-
#endif
4846

4947

5048
/* Ensure that the PCREPOSIX_EXP_xxx macros are set appropriately for

ext/pcre/upgrade-pcre.php

+19-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ function recurse($path)
3333
{
3434
global $newpcre, $dirlen;
3535

36-
foreach(scandir($path) as $file) {
36+
foreach (scandir($path) as $file) {
3737

38-
if ($file[0] === '.' || $file === 'CVS') continue;
39-
if (substr_compare($file, '.lo', -3, 3) == 0 || substr_compare($file, '.o', -2, 2) == 0) continue;
38+
if ($file[0] === '.' ||
39+
$file === 'CVS' ||
40+
substr_compare($file, '.lo', -3, 3) == 0 ||
41+
substr_compare($file, '.loT', -4, 4) == 0 ||
42+
substr_compare($file, '.o', -2, 2) == 0) continue;
4043

4144
$file = "$path/$file";
4245

@@ -58,7 +61,19 @@ function recurse($path)
5861
die("$newfile is not available any more\n");
5962
}
6063

61-
copy($newfile, $file);
64+
// maintain file mtimes so that cvs doesnt get crazy
65+
if (file_get_contents($newfile) !== file_get_contents($file)) {
66+
copy($newfile, $file);
67+
}
68+
69+
// always include the config.h file
70+
$content = file_get_contents($newfile);
71+
$newcontent = preg_replace('/#\s*ifdef HAVE_CONFIG_H\s*(.+)\s*#\s*endif/', '$1', $content);
72+
73+
if ($content !== $newcontent) {
74+
file_put_contents($file, $newcontent);
75+
}
76+
6277
echo "OK\n";
6378
}
6479

0 commit comments

Comments
 (0)