1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Don't use PHP_DEFINE in iconv

iconv is the only consumer of this custom define mechanism that
puts every define into a single file. Use the standard mechanism
instead.
This commit is contained in:
Nikita Popov
2020-08-07 12:40:47 +02:00
parent af80d8a14e
commit e6f7784210
4 changed files with 2 additions and 29 deletions

View File

@@ -2,7 +2,7 @@ mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
DEFS = -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
all: $(all_targets)

View File

@@ -1946,7 +1946,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=yes
],[
AC_CHECK_FUNC(libiconv,[
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
found_iconv=yes
])
@@ -1980,9 +1979,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
AC_DEFINE(HAVE_LIBICONV,1,[ ])
PHP_DEFINE([ICONV_ALIASED_LIBICONV],1,[ext/iconv])
AC_DEFINE([ICONV_ALIASED_LIBICONV],1,[iconv() is aliased to libiconv() in -liconv])
], [
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
@@ -1997,7 +1994,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
fi
if test "$found_iconv" = "yes"; then
PHP_DEFINE(HAVE_ICONV,1,[ext/iconv])
AC_DEFINE(HAVE_ICONV,1,[ ])
if test -n "$ICONV_DIR"; then
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/$PHP_LIBDIR, $1)

View File

@@ -96,29 +96,22 @@ int main() {
case "$iconv_impl_name" in
gnu_libiconv [)]
PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["libiconv"],[Which iconv implementation to use])
PHP_DEFINE([HAVE_LIBICONV],1,[ext/iconv])
AC_DEFINE([HAVE_LIBICONV],1,[Whether libiconv is used])
PHP_ADD_LIBRARY_WITH_PATH(iconv, "$PHP_ICONV_PREFIX/$PHP_LIBDIR", ICONV_SHARED_LIBADD)
;;
bsd [)]
PHP_DEFINE([HAVE_BSD_ICONV],1,[ext/iconv])
AC_DEFINE([HAVE_BSD_ICONV],1,[Konstantin Chuguev's iconv implementation])
PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["BSD iconv"],[Which iconv implementation to use])
;;
glibc [)]
PHP_DEFINE([HAVE_GLIBC_ICONV],1,[ext/iconv])
AC_DEFINE([HAVE_GLIBC_ICONV],1,[glibc's iconv implementation])
PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["glibc"],[Which iconv implementation to use])
;;
ibm [)]
PHP_DEFINE([HAVE_IBM_ICONV],1,[ext/iconv])
AC_DEFINE([HAVE_IBM_ICONV],1,[IBM iconv implementation])
PHP_DEFINE([PHP_ICONV_IMPL],[\"IBM iconv\"],[ext/iconv])
AC_DEFINE([PHP_ICONV_IMPL],["IBM iconv"],[Which iconv implementation to use])
;;
esac
@@ -172,15 +165,12 @@ int main() {
}
]])],[
AC_MSG_RESULT(yes)
PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv])
AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE])
],[
AC_MSG_RESULT(no)
PHP_DEFINE([ICONV_BROKEN_IGNORE],1,[ext/iconv])
AC_DEFINE([ICONV_BROKEN_IGNORE],1,[Whether iconv supports IGNORE])
],[
AC_MSG_RESULT(no, cross-compiling)
PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv])
AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE])
])
@@ -190,7 +180,6 @@ int main() {
#include FOO
]], [])], [
AC_MSG_RESULT([yes])
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>],[ext/iconv])
AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h])
], [
AC_MSG_RESULT([no])

View File

@@ -33,18 +33,6 @@
#include "php_version.h"
#define PHP_ICONV_VERSION PHP_VERSION
#ifdef PHP_ATOM_INC
#include "ext/iconv/php_have_iconv.h"
#include "ext/iconv/php_have_libiconv.h"
#include "ext/iconv/php_iconv_aliased_libiconv.h"
#include "ext/iconv/php_have_glibc_iconv.h"
#include "ext/iconv/php_have_bsd_iconv.h"
#include "ext/iconv/php_have_ibm_iconv.h"
#include "ext/iconv/php_iconv_supports_errno.h"
#include "ext/iconv/php_php_iconv_impl.h"
#include "ext/iconv/php_php_iconv_h_path.h"
#endif
#ifdef HAVE_ICONV
extern zend_module_entry iconv_module_entry;
#define iconv_module_ptr &iconv_module_entry