Skip to content

Commit 99e0cea

Browse files
committed
Move templates cleanup to phpize and buildconf parts
1 parent 579be0d commit 99e0cea

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

build/build2.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@ targets = configure $(config_h_in)
2222

2323
PHP_AUTOCONF ?= 'autoconf'
2424
PHP_AUTOHEADER ?= 'autoheader'
25+
SED ?= 'sed'
2526

2627
SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used)'||true)
2728

2829
all: $(targets)
2930

3031
$(config_h_in): configure
31-
# explicitly remove target since autoheader does not seem to work
32-
# correctly otherwise (timestamps are not updated)
32+
# Explicitly remove target since autoheader does not seem to work correctly
33+
# otherwise (timestamps are not updated).
34+
# Also disable PACKAGE_* symbols in php_config.h.in
3335
@echo rebuilding $@
3436
@rm -f $@
3537
$(PHP_AUTOHEADER) $(SUPPRESS_WARNINGS)
38+
$(SED) -e 's/^#undef PACKAGE_[^ ]*/\/\* && \*\//g' < $@ > $@.tmp && mv $@.tmp $@
3639

3740
aclocal.m4: configure.ac acinclude.m4
3841
@echo rebuilding $@

buildconf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# A wrapper around Autoconf that generates files to build PHP on *nix systems.
44

55
MAKE=${MAKE:-make}
6+
SED=${SED:-sed}
67
force=0
78
debug=0
89

configure.ac

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,11 +1727,4 @@ Check '[$]0 --help' for available options
17271727
fi
17281728
])
17291729

1730-
AC_CONFIG_COMMANDS_POST([
1731-
# Disable PACKAGE_* symbols in main/php_config.h.in
1732-
$SED -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < $srcdir/main/php_config.h.in \
1733-
> $srcdir/main/php_config.h.in.tmp && \
1734-
mv $srcdir/main/php_config.h.in.tmp $srcdir/main/php_config.h.in
1735-
])
1736-
17371730
AC_OUTPUT

scripts/phpize.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ phpize_autotools()
160160
{
161161
$PHP_AUTOCONF || exit 1
162162
$PHP_AUTOHEADER || exit 1
163+
164+
# Disable PACKAGE_* symbols in config.h.in
165+
$SED -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < config.h.in > config.h.in.tmp
166+
mv config.h.in.tmp config.h.in
163167
}
164168

165169
# Main script

scripts/phpize.m4

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,4 @@ test -d modules || $php_shtool mkdir modules
205205

206206
AC_CONFIG_HEADERS([config.h])
207207

208-
AC_CONFIG_COMMANDS_POST([
209-
# Disable PACKAGE_* symbols in config.h.in
210-
$SED -e 's/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < $srcdir/config.h.in \
211-
> $srcdir/config.h.in.tmp && \
212-
mv $srcdir/config.h.in.tmp $srcdir/config.h.in
213-
])
214-
215208
AC_OUTPUT

0 commit comments

Comments
 (0)