cvs: php4 / Makefile.global acinclude.m4 /ext/iconv iconv.c php_iconv.h
| From: | Sascha Schumann | Date: | Wed, 20 Mar 2002 13:24:59 +0000 |
| Subject: | cvs: php4 / Makefile.global acinclude.m4 /ext/iconv iconv.c php_iconv.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10481@lists.php.net to get a copy of this message | ||
sas Wed Mar 20 08:24:59 2002 EDT
Modified files:
/php4 Makefile.global acinclude.m4
/php4/ext/iconv iconv.c php_iconv.h
Log:
Expand the variables in PHP_EXPAND_BUILD_VARS.
Make HAVE_ICONV/HAVE_LIBICONV available through the more
fine-grained approach using a single include file per
directive. This will significantly reduce the price of
full dependencies for developers, because basically each
file today includes php.h which includes php_config.h.
If PHP_ATOM_INC is defined, these include files can be used.
For all PHP_DEFINEs, empty files are created upon configure start.
Index: php4/Makefile.global
diff -u php4/Makefile.global:1.7 php4/Makefile.global:1.8
--- php4/Makefile.global:1.7 Tue Mar 19 06:48:40 2002
+++ php4/Makefile.global Wed Mar 20 08:24:59 2002
@@ -3,7 +3,7 @@
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
-DEFS = -I$(top_builddir)/main -I$(top_srcdir)
+DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.171 php4/acinclude.m4:1.172
--- php4/acinclude.m4:1.171 Wed Mar 20 07:08:30 2002
+++ php4/acinclude.m4 Wed Mar 20 08:24:59 2002
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.171 2002/03/20 12:08:30 sas Exp $
+dnl $Id: acinclude.m4,v 1.172 2002/03/20 13:24:59 sas Exp $
dnl
dnl This file contains local autoconf functions.
@@ -17,12 +17,12 @@
])
-dnl PHP_DEFINE(what[, value])
+dnl PHP_DEFINE(WHAT[, value])
dnl
-dnl Creates builddir/include/what.h and in there #define what value
+dnl Creates builddir/include/what.h and in there #define WHAT value
dnl
AC_DEFUN(PHP_DEFINE,[
- echo "#define $1 $2" > include/$1.h
+ [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" >
include/php_]translit($1,A-Z,a-z)[.h]
])
dnl PHP_INIT_BUILD_SYSTEM
@@ -31,6 +31,9 @@
mkdir include >/dev/null 2>&1
> Makefile.objects
> Makefile.fragments
+dnl We need to play tricks here to avoid matching the egrep line itself
+pattern=define
+egrep $pattern'.*include/php' $srcdir/configure|sed 's/.*>//'|xargs touch
])
dnl PHP_GEN_GLOBAL_MAKEFILE
@@ -68,9 +71,23 @@
])
dnl PHP_ASSIGN_BUILD_VARS(type)
-dnl Internal macro, should/can be exploded manually
+dnl Internal macro
AC_DEFUN(PHP_ASSIGN_BUILD_VARS,[
- for acx in pre meta post; do for acy in c cxx; do eval b_${acy}_$acx=[\$]$1_${acy}_$acx; done;
done
+ifelse($1,shared,[
+ b_c_pre=$shared_c_pre
+ b_cxx_pre=$shared_cxx_pre
+ b_c_meta=$shared_c_meta
+ b_cxx_meta=$shared_cxx_meta
+ b_c_post=$shared_c_post
+ b_cxx_post=$shared_cxx_post
+],[
+ b_c_pre=$php_c_pre
+ b_cxx_pre=$php_cxx_pre
+ b_c_meta=$php_c_meta
+ b_cxx_meta=$php_cxx_meta
+ b_c_post=$php_c_post
+ b_cxx_post=$php_cxx_post
+])dnl
b_lo=[$]$1_lo
])
@@ -1357,10 +1374,14 @@
found_iconv=no
unset ICONV_DIR
- AC_CHECK_FUNCS(iconv libiconv, [
- AC_DEFINE(HAVE_ICONV, 1, [ ])
+ AC_CHECK_FUNC(iconv, [
+ PHP_DEFINE(HAVE_ICONV)
found_iconv=yes
- ], [
+ ],[
+ AC_CHECK_FUNC(libiconv,[
+ PHP_DEFINE(HAVE_LIBICONV)
+ found_iconv=yes
+ ],[
for i in $PHP_ICONV /usr/local /usr; do
if test -r $i/include/giconv.h; then
@@ -1383,16 +1404,17 @@
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
- AC_DEFINE(HAVE_LIBICONV, 1, [ ])
+ PHP_DEFINE(HAVE_LIBICONV)
], [
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
found_iconv=yes
- AC_DEFINE(HAVE_ICONV, 1, [ ])
+ PHP_DEFINE(HAVE_ICONV)
])
], [
-L$ICONV_DIR/lib
])
fi
+ ])
])
if test "$found_iconv" = "yes"; then
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.33 php4/ext/iconv/iconv.c:1.34
--- php4/ext/iconv/iconv.c:1.33 Mon Mar 11 17:23:05 2002
+++ php4/ext/iconv/iconv.c Wed Mar 20 08:24:59 2002
@@ -17,13 +17,18 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iconv.c,v 1.33 2002/03/11 22:23:05 mfischer Exp $ */
+/* $Id: iconv.c,v 1.34 2002/03/20 13:24:59 sas Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
+
+#ifdef PHP_ATOM_INC
+#include "php_have_iconv.h"
+#include "php_have_libiconv.h"
+#endif
#if HAVE_ICONV
Index: php4/ext/iconv/php_iconv.h
diff -u php4/ext/iconv/php_iconv.h:1.10 php4/ext/iconv/php_iconv.h:1.11
--- php4/ext/iconv/php_iconv.h:1.10 Mon Mar 4 18:28:17 2002
+++ php4/ext/iconv/php_iconv.h Wed Mar 20 08:24:59 2002
@@ -26,6 +26,11 @@
#define PHP_ICONV_API
#endif
+#ifdef PHP_ATOM_INC
+#include "php_have_iconv.h"
+#endif
+
+
#if HAVE_ICONV
extern zend_module_entry iconv_module_entry;
#define iconv_module_ptr &iconv_module_entry