Skip to content

Commit 7fb3387

Browse files
committed
Remove PHP_DEFINE
PHP_DEFINE was introduced with the PHP 5 build system 9d9d39a and then refactored via 350de12. This simplifies includes. Also changed: - removed PHP_ATOM_INC define via DEFS variable - generated unused include directory removed - Remove include dir from DEFS - Remove also include dir from PDO checks
1 parent 7cf651c commit 7fb3387

File tree

7 files changed

+5
-83
lines changed

7 files changed

+5
-83
lines changed

.gitignore

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ Makefile.fragments
7676
Makefile.objects
7777

7878
# Directories for shared object files and headers generated by `./configure`
79-
include/
8079
libs/
8180
modules/
8281

@@ -86,16 +85,6 @@ modules/
8685
config.h
8786
config.h.in
8887
/ext/date/lib/timelib_config.h
89-
/ext/iconv/php_have_bsd_iconv.h
90-
/ext/iconv/php_have_glibc_iconv.h
91-
/ext/iconv/php_have_ibm_iconv.h
92-
/ext/iconv/php_have_iconv.h
93-
/ext/iconv/php_have_libiconv.h
94-
/ext/iconv/php_iconv_aliased_libiconv.h
95-
/ext/iconv/php_iconv_broken_ignore.h
96-
/ext/iconv/php_iconv_supports_errno.h
97-
/ext/iconv/php_php_iconv_h_path.h
98-
/ext/iconv/php_php_iconv_impl.h
9988
/main/build-defs.h
10089
/main/php_config.h.in
10190
/main/php_config.h

build/Makefile.global

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
22
INSTALL = $(top_srcdir)/build/shtool install -c
33
INSTALL_DATA = $(INSTALL) -m 644
44

5-
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
5+
DEFS = -I$(top_builddir)/main -I$(top_srcdir)
66
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
77

88
all: $(all_targets)
@@ -123,12 +123,10 @@ distclean: clean
123123
rm -f ext/date/lib/timelib_config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
124124
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 sapi/phpdbg/phpdbg.1 ext/phar/phar.1 ext/phar/phar.phar.1
125125
rm -f sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html
126-
rm -f ext/iconv/php_have_bsd_iconv.h ext/iconv/php_have_glibc_iconv.h ext/iconv/php_have_ibm_iconv.h ext/iconv/php_have_iconv.h ext/iconv/php_have_libiconv.h ext/iconv/php_iconv_aliased_libiconv.h ext/iconv/php_iconv_supports_errno.h ext/iconv/php_php_iconv_h_path.h ext/iconv/php_php_iconv_impl.h
127126
rm -f ext/phar/phar.phar ext/phar/phar.php
128127
if test "$(srcdir)" != "$(builddir)"; then \
129128
rm -f ext/phar/phar/phar.inc; \
130129
fi
131-
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
132130

133131
prof-gen:
134132
CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-generate all

build/php.m4

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ AC_DEFUN([PHP_EXPAND_PATH],[
6969
fi
7070
])
7171

72-
dnl
73-
dnl PHP_DEFINE(WHAT [, value[, directory]])
74-
dnl
75-
dnl Creates builddir/include/what.h and in there #define WHAT value.
76-
dnl
77-
AC_DEFUN([PHP_DEFINE],[
78-
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h]
79-
])
80-
8172
dnl
8273
dnl PHP_SUBST(varname)
8374
dnl
@@ -135,12 +126,8 @@ dnl Creates build directories and Makefile placeholders.
135126
dnl
136127
AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[
137128
AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
138-
test -d include || $php_shtool mkdir include
139129
> Makefile.objects
140130
> Makefile.fragments
141-
dnl We need to play tricks here to avoid matching the grep line itself.
142-
pattern=define
143-
$EGREP $pattern'.*include/php' $srcdir/configure|$SED 's/.*>//'|xargs touch 2>/dev/null
144131
])
145132

146133
dnl
@@ -1940,19 +1927,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
19401927
found_iconv=no
19411928
unset ICONV_DIR
19421929
1943-
dnl Create the directories for a VPATH build.
1944-
$php_shtool mkdir -p ext/iconv
1945-
1946-
echo > ext/iconv/php_have_bsd_iconv.h
1947-
echo > ext/iconv/php_have_ibm_iconv.h
1948-
echo > ext/iconv/php_have_glibc_iconv.h
1949-
echo > ext/iconv/php_have_libiconv.h
1950-
echo > ext/iconv/php_have_iconv.h
1951-
echo > ext/iconv/php_php_iconv_impl.h
1952-
echo > ext/iconv/php_iconv_aliased_libiconv.h
1953-
echo > ext/iconv/php_php_iconv_h_path.h
1954-
echo > ext/iconv/php_iconv_supports_errno.h
1955-
19561930
dnl Check libc first if no path is provided in --with-iconv.
19571931
if test "$PHP_ICONV" = "yes"; then
19581932
dnl Reset LIBS temporarily as it may have already been included -liconv in.
@@ -1962,8 +1936,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
19621936
found_iconv=yes
19631937
],[
19641938
AC_CHECK_FUNC(libiconv,[
1965-
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
1966-
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
1939+
AC_DEFINE(HAVE_LIBICONV, 1, [Define to 1 if you have the libiconv])
19671940
found_iconv=yes
19681941
])
19691942
])
@@ -1996,9 +1969,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
19961969
then
19971970
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
19981971
found_iconv=yes
1999-
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
20001972
AC_DEFINE(HAVE_LIBICONV,1,[ ])
2001-
PHP_DEFINE([ICONV_ALIASED_LIBICONV],1,[ext/iconv])
20021973
AC_DEFINE([ICONV_ALIASED_LIBICONV],1,[iconv() is aliased to libiconv() in -liconv])
20031974
], [
20041975
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
@@ -2013,7 +1984,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
20131984
fi
20141985
20151986
if test "$found_iconv" = "yes"; then
2016-
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
20171987
AC_DEFINE(HAVE_ICONV,1,[ ])
20181988
if test -n "$ICONV_DIR"; then
20191989
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/$PHP_LIBDIR, $1)
@@ -2162,9 +2132,7 @@ dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
21622132
dnl
21632133
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
21642134
AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
2165-
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
2166-
pdo_cv_inc_path=$abs_srcdir/ext
2167-
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
2135+
if test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
21682136
pdo_cv_inc_path=$abs_srcdir/ext
21692137
elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
21702138
pdo_cv_inc_path=$phpincludedir/ext

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ PHP_SUBST(all_targets)
15011501
PHP_SUBST(install_targets)
15021502
PHP_SUBST(install_binary_targets)
15031503

1504-
PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/])
1504+
PHP_INSTALL_HEADERS([Zend/ TSRM/ main/ main/streams/])
15051505

15061506
PHP_ADD_SOURCES(TSRM, TSRM.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
15071507

docs/unix-build-system.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
especially noticeable on slower systems
88
* slow recursive make replaced with one global Makefile
99
* eases integration of proper dependencies
10-
* adds PHP_DEFINE(what[, value]) which creates a single include-file per what.
11-
This will allow more fine-grained dependencies.
1210
* abandoning the "one library per directory" concept
1311
* improved integration of the CLI
1412
* several new targets:

ext/iconv/config.m4

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,36 +89,24 @@ int main() {
8989
])
9090
fi
9191

92-
echo > ext/iconv/php_have_bsd_iconv.h
93-
echo > ext/iconv/php_have_glibc_iconv.h
94-
echo > ext/iconv/php_have_libiconv.h
95-
echo > ext/iconv/php_have_ibm_iconv.h
96-
9792
case "$iconv_impl_name" in
9893
gnu_libiconv [)]
99-
PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"],[ext/iconv])
10094
AC_DEFINE([PHP_ICONV_IMPL],["libiconv"],[Which iconv implementation to use])
101-
PHP_DEFINE([HAVE_LIBICONV],1,[ext/iconv])
95+
AC_DEFINE(HAVE_LIBICONV, 1, [Define to 1 if you have the libiconv])
10296
PHP_ADD_LIBRARY_WITH_PATH(iconv, "$PHP_ICONV_PREFIX/$PHP_LIBDIR", ICONV_SHARED_LIBADD)
10397
;;
10498

10599
bsd [)]
106-
PHP_DEFINE([HAVE_BSD_ICONV],1,[ext/iconv])
107100
AC_DEFINE([HAVE_BSD_ICONV],1,[Konstantin Chuguev's iconv implementation])
108-
PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"],[ext/iconv])
109101
AC_DEFINE([PHP_ICONV_IMPL],["BSD iconv"],[Which iconv implementation to use])
110102
;;
111103

112104
glibc [)]
113-
PHP_DEFINE([HAVE_GLIBC_ICONV],1,[ext/iconv])
114105
AC_DEFINE([HAVE_GLIBC_ICONV],1,[glibc's iconv implementation])
115-
PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"],[ext/iconv])
116106
AC_DEFINE([PHP_ICONV_IMPL],["glibc"],[Which iconv implementation to use])
117107
;;
118108
ibm [)]
119-
PHP_DEFINE([HAVE_IBM_ICONV],1,[ext/iconv])
120109
AC_DEFINE([HAVE_IBM_ICONV],1,[IBM iconv implementation])
121-
PHP_DEFINE([PHP_ICONV_IMPL],[\"IBM iconv\"],[ext/iconv])
122110
AC_DEFINE([PHP_ICONV_IMPL],["IBM iconv"],[Which iconv implementation to use])
123111
;;
124112
esac
@@ -143,15 +131,12 @@ int main() {
143131
}
144132
]])],[
145133
AC_MSG_RESULT(yes)
146-
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1,[ext/iconv])
147134
AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not])
148135
],[
149136
AC_MSG_RESULT(no)
150-
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
151137
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
152138
],[
153139
AC_MSG_RESULT(no, cross-compiling)
154-
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
155140
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
156141
])
157142

@@ -174,15 +159,12 @@ int main() {
174159
}
175160
]])],[
176161
AC_MSG_RESULT(yes)
177-
PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv])
178162
AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE])
179163
],[
180164
AC_MSG_RESULT(no)
181-
PHP_DEFINE([ICONV_BROKEN_IGNORE],1,[ext/iconv])
182165
AC_DEFINE([ICONV_BROKEN_IGNORE],1,[Whether iconv supports IGNORE])
183166
],[
184167
AC_MSG_RESULT(no, cross-compiling)
185-
PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv])
186168
AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE])
187169
])
188170

@@ -192,7 +174,6 @@ int main() {
192174
#include FOO
193175
]], [])], [
194176
AC_MSG_RESULT([yes])
195-
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>],[ext/iconv])
196177
AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h])
197178
], [
198179
AC_MSG_RESULT([no])

ext/iconv/php_iconv.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@
3535
#include "php_version.h"
3636
#define PHP_ICONV_VERSION PHP_VERSION
3737

38-
#ifdef PHP_ATOM_INC
39-
#include "ext/iconv/php_have_iconv.h"
40-
#include "ext/iconv/php_have_libiconv.h"
41-
#include "ext/iconv/php_iconv_aliased_libiconv.h"
42-
#include "ext/iconv/php_have_glibc_iconv.h"
43-
#include "ext/iconv/php_have_bsd_iconv.h"
44-
#include "ext/iconv/php_have_ibm_iconv.h"
45-
#include "ext/iconv/php_iconv_supports_errno.h"
46-
#include "ext/iconv/php_php_iconv_impl.h"
47-
#include "ext/iconv/php_php_iconv_h_path.h"
48-
#endif
49-
5038
#ifdef HAVE_ICONV
5139
extern zend_module_entry iconv_module_entry;
5240
#define iconv_module_ptr &iconv_module_entry

0 commit comments

Comments
 (0)