File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed
Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,7 @@ configure: configure.ac $(PHP_M4_FILES)
3434
3535$(config_h_in ) : configure
3636# Explicitly remove target since autoheader does not seem to work correctly
37- # otherwise (timestamps are not updated). Also disable PACKAGE_* symbols in the
38- # generated php_config.h.in template.
37+ # otherwise (timestamps are not updated).
3938 @echo rebuilding $@
4039 @rm -f $@
4140 @$(PHP_AUTOHEADER) $(PHP_AUTOCONF_FLAGS)
42- @sed -e 's/^# undef PACKAGE_[^ ]*/\/\* & \*\//g' < $@ > $@.tmp && mv $@.tmp $@
Original file line number Diff line number Diff line change @@ -2715,3 +2715,19 @@ int main() {
27152715 AC_DEFINE_UNQUOTED ( AS_TR_CPP ( [ PHP_HAVE_$1 _INSTRUCTIONS] ) ,
27162716 [ $have_ext_instructions] , [ Whether the compiler supports $1 instructions] )
27172717] )
2718+
2719+ dnl
2720+ dnl PHP_PATCH_CONFIG_HEADERS([FILE])
2721+ dnl
2722+ dnl PACKAGE_* symbols are automatically defined by Autoconf. When including
2723+ dnl configuration header, warnings about redefined symbols are emitted for such
2724+ dnl symbols if they are defined by multiple libraries. This disables all
2725+ dnl PACKAGE_* symbols in the generated configuration header template FILE. For
2726+ dnl example, main/php_config.h.in for PHP or config.h.in for PHP extensions.
2727+ dnl
2728+ AC_DEFUN ( [ PHP_PATCH_CONFIG_HEADERS] , [
2729+ AC_MSG_NOTICE ( [ patching $1 ] )
2730+
2731+ $SED -e 's/^#undef PACKAGE_[ ^ ] */\/\* & \*\//g' < $srcdir/$1 \
2732+ > $srcdir/$1 .tmp && mv $srcdir/$1 .tmp $srcdir/$1
2733+ ] )
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ PHP_CONFIG_NICE(config.nice)
2727PHP_CANONICAL_HOST_TARGET
2828
2929AC_CONFIG_HEADERS ( [ main/php_config.h] )
30+
3031AH_TOP ( [
3132#ifndef PHP_CONFIG_H
3233#define PHP_CONFIG_H
@@ -1585,6 +1586,9 @@ $PHP_OUTPUT_FILES"
15851586
15861587dnl Generate build files.
15871588AC_CONFIG_FILES ( [ $ALL_OUTPUT_FILES] )
1589+
1590+ AC_CONFIG_COMMANDS_PRE ( [ PHP_PATCH_CONFIG_HEADERS([ main/php_config.h.in] )] )
1591+
15881592AC_CONFIG_COMMANDS ( [ default] ,[
15891593cat <<X
15901594
Original file line number Diff line number Diff line change @@ -163,10 +163,6 @@ phpize_autotools()
163163
164164 $PHP_AUTOCONF || exit 1
165165 $PHP_AUTOHEADER || exit 1
166-
167- # Disable PACKAGE_* symbols in config.h.in
168- $SED -e ' s/^#undef PACKAGE_[^ ]*/\/\* & \*\//g' < config.h.in > config.h.in.tmp
169- mv config.h.in.tmp config.h.in
170166}
171167
172168# Main script
Original file line number Diff line number Diff line change @@ -210,4 +210,6 @@ test -d modules || $php_shtool mkdir modules
210210
211211AC_CONFIG_HEADERS ( [ config.h] )
212212
213+ AC_CONFIG_COMMANDS_PRE ( [ PHP_PATCH_CONFIG_HEADERS([ config.h.in] )] )
214+
213215AC_OUTPUT
You can’t perform that action at this time.
0 commit comments