summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in3
-rw-r--r--ext/dbase/dbase.c2
-rw-r--r--ext/dotnet/php_dotnet.h4
-rw-r--r--ext/ereg/regex/regex_extra.h2
-rw-r--r--ext/fbsql/php_fbsql.c3
-rw-r--r--ext/filepro/filepro.c2
-rw-r--r--ext/gd/gdcache.c2
-rw-r--r--ext/hwapi/hwapi.cpp8
-rw-r--r--ext/hyperwave/hw.c2
-rw-r--r--ext/imap/php_imap.h4
-rw-r--r--ext/informix/ifx.ec8
-rw-r--r--ext/mcal/php_mcal.h4
-rw-r--r--ext/mysql/php_mysql.c1
-rw-r--r--ext/oci8/oci8.c4
-rw-r--r--ext/odbc/php_odbc.c2
-rw-r--r--ext/oracle/oracle.c4
-rw-r--r--ext/rpc/dotnet/php_dotnet.h4
-rw-r--r--ext/standard/dl.c4
-rw-r--r--ext/standard/fsock.c2
-rw-r--r--ext/standard/info.c3
-rw-r--r--ext/standard/mail.c5
-rw-r--r--ext/xml/xml.c3
-rw-r--r--main/main.c2
-rw-r--r--main/php.h14
-rw-r--r--main/php_ini.c3
-rwxr-xr-xmain/streams.c2
-rw-r--r--regex/regex_extra.h2
-rw-r--r--sapi/apache/php_apache.c2
-rw-r--r--sapi/cgi/cgi_main.c2
-rw-r--r--sapi/cli/php_cli.c2
-rw-r--r--sapi/servlet/servlet.c2
31 files changed, 36 insertions, 71 deletions
diff --git a/configure.in b/configure.in
index 343484779c..b701e20800 100644
--- a/configure.in
+++ b/configure.in
@@ -325,6 +325,7 @@ limits.h \
locale.h \
monetary.h \
mach-o/dyld.h \
+netdb.h \
pwd.h \
resolv.h \
signal.h \
@@ -1108,6 +1109,8 @@ PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend)
PHP_GEN_BUILD_DIRS
PHP_GEN_GLOBAL_MAKEFILE
+AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ])
+
$php_shtool mkdir -p pear/scripts
ALL_OUTPUT_FILES="php4.spec main/build-defs.h \
pear/scripts/phpize pear/scripts/php-config \
diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c
index 3e2514a63c..ee48334b89 100644
--- a/ext/dbase/dbase.c
+++ b/ext/dbase/dbase.c
@@ -760,7 +760,7 @@ zend_module_entry dbase_module_entry = {
#ifdef COMPILE_DL_DBASE
ZEND_GET_MODULE(dbase)
-#if (WIN32|WINNT) && defined(THREAD_SAFE)
+#if defined(PHP_WIN32) && defined(THREAD_SAFE)
/*NOTE: You should have an odbc.def file where you
export DllMain*/
diff --git a/ext/dotnet/php_dotnet.h b/ext/dotnet/php_dotnet.h
index b56af145e2..598c0b5579 100644
--- a/ext/dotnet/php_dotnet.h
+++ b/ext/dotnet/php_dotnet.h
@@ -1,7 +1,7 @@
#ifndef PHP_DOTNET_H
#define PHP_DOTNET_H
-#if WIN32|WINNT
+#ifdef PHP_WIN32
PHP_MINIT_FUNCTION(DOTNET);
PHP_MSHUTDOWN_FUNCTION(DOTNET);
@@ -14,7 +14,7 @@ extern zend_module_entry DOTNET_module_entry;
#define DOTNET_module_ptr NULL
-#endif /* Win32|WINNT */
+#endif /* PHP_WIN32 */
#define phpext_DOTNET_ptr DOTNET_module_ptr
diff --git a/ext/ereg/regex/regex_extra.h b/ext/ereg/regex/regex_extra.h
index 3db9e4ad1a..d668f7613f 100644
--- a/ext/ereg/regex/regex_extra.h
+++ b/ext/ereg/regex/regex_extra.h
@@ -7,7 +7,7 @@
#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX))
-#if !(WIN32|WINNT)
+#ifndef PHP_WIN32
#ifndef PHP_NO_ALIASES
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c
index 82dd3965cc..649d01aa2b 100644
--- a/ext/fbsql/php_fbsql.c
+++ b/ext/fbsql/php_fbsql.c
@@ -42,11 +42,10 @@
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
-#if WIN32|WINNT
+#ifdef PHP_WIN32
#include <winsock.h>
#else
#include <php_config.h>
-#include <build-defs.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c
index d3a4f86d1f..cb7ec89986 100644
--- a/ext/filepro/filepro.c
+++ b/ext/filepro/filepro.c
@@ -151,7 +151,7 @@ zend_module_entry filepro_module_entry = {
#ifdef COMPILE_DL_FILEPRO
ZEND_GET_MODULE(filepro)
-#if (WIN32|WINNT) && defined(THREAD_SAFE)
+#if defined(PHP_WIN32) && defined(THREAD_SAFE)
/*NOTE: You should have an odbc.def file where you
export DllMain*/
diff --git a/ext/gd/gdcache.c b/ext/gd/gdcache.c
index b89f5610ac..7791d1bbf5 100644
--- a/ext/gd/gdcache.c
+++ b/ext/gd/gdcache.c
@@ -37,7 +37,7 @@
*/
/* This just seems unessacary */
-#if (WIN32|WINNT)
+#if PHP_WIN32
#define ENABLE_GD_TTF
#else
#include "php_config.h"
diff --git a/ext/hwapi/hwapi.cpp b/ext/hwapi/hwapi.cpp
index c250d575fd..b08f9ae598 100644
--- a/ext/hwapi/hwapi.cpp
+++ b/ext/hwapi/hwapi.cpp
@@ -25,17 +25,17 @@ extern "C"
{
#include "php.h"
#include "php_globals.h"
-//#include "ext/standard/php_standard.h"
#include "ext/standard/head.h"
#include "ext/standard/info.h"
-//#include "fopen-wrappers.h"
+#if 0
+#include "ext/standard/php_standard.h"
+#include "fopen-wrappers.h"
+#endif
#include "SAPI.h"
}
#ifdef PHP_WIN32
#include <winsock.h>
-#else
-#include "build-defs.h"
#endif
#ifdef HAVE_MMAP
#include <sys/mman.h>
diff --git a/ext/hyperwave/hw.c b/ext/hyperwave/hw.c
index 09a889434b..9155649deb 100644
--- a/ext/hyperwave/hw.c
+++ b/ext/hyperwave/hw.c
@@ -35,8 +35,6 @@
#ifdef PHP_WIN32
#include <winsock.h>
-#else
-#include "build-defs.h"
#endif
#if HYPERWAVE
diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h
index 429262fe71..6398895d1d 100644
--- a/ext/imap/php_imap.h
+++ b/ext/imap/php_imap.h
@@ -34,10 +34,6 @@
#if HAVE_IMAP
-#ifndef PHP_WIN32
-#include "build-defs.h"
-#endif
-
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
/* these are used for quota support */
# include "c-client.h" /* includes mail.h and rfc822.h */
diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec
index ce2dc75728..47b2eaab51 100644
--- a/ext/informix/ifx.ec
+++ b/ext/informix/ifx.ec
@@ -47,13 +47,17 @@
#ifdef PHP_WIN32
#include <winsock.h>
-#else
-#include "build-defs.h"
+#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+
+#if HAVE_NETDB_H
#include <netdb.h>
+#endif
+
+#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
diff --git a/ext/mcal/php_mcal.h b/ext/mcal/php_mcal.h
index 07b32a2a7f..1845b4cfd1 100644
--- a/ext/mcal/php_mcal.h
+++ b/ext/mcal/php_mcal.h
@@ -5,10 +5,6 @@
#if HAVE_MCAL
-#ifndef PHP_WIN32
-#include "build-defs.h"
-#endif
-
/* Functions accessable to PHP */
extern zend_module_entry php_mcal_module_entry;
#define php_mcal_module_ptr &php_mcal_module_entry
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 50ba2a2492..e35a404acb 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -43,7 +43,6 @@
# include <sys/socket.h>
# define signal(a, b) NULL
#else
-# include "build-defs.h"
# if HAVE_SIGNAL_H
# include <signal.h>
# endif
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 84e2a89960..1f5ff22e59 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -124,10 +124,6 @@ static zend_class_entry *oci_coll_class_entry_ptr;
} \
}
-#ifndef PHP_WIN32
-#include "build-defs.h"
-#endif
-
#include <fcntl.h>
#ifndef O_BINARY
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 54d0ca03aa..1ef4280aec 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -49,8 +49,6 @@
#define ODBC_TYPE "Win32"
#define PHP_ODBC_TYPE ODBC_TYPE
-#else
-#include "build-defs.h"
#endif
/*
diff --git a/ext/oracle/oracle.c b/ext/oracle/oracle.c
index a49f10d78c..cc907e780b 100644
--- a/ext/oracle/oracle.c
+++ b/ext/oracle/oracle.c
@@ -53,10 +53,6 @@
#define PHP_ORA_API
#endif
-#ifndef PHP_WIN32
-#include "build-defs.h"
-#endif
-
#ifdef ZTS
int ora_globals_id;
#else
diff --git a/ext/rpc/dotnet/php_dotnet.h b/ext/rpc/dotnet/php_dotnet.h
index b56af145e2..598c0b5579 100644
--- a/ext/rpc/dotnet/php_dotnet.h
+++ b/ext/rpc/dotnet/php_dotnet.h
@@ -1,7 +1,7 @@
#ifndef PHP_DOTNET_H
#define PHP_DOTNET_H
-#if WIN32|WINNT
+#ifdef PHP_WIN32
PHP_MINIT_FUNCTION(DOTNET);
PHP_MSHUTDOWN_FUNCTION(DOTNET);
@@ -14,7 +14,7 @@ extern zend_module_entry DOTNET_module_entry;
#define DOTNET_module_ptr NULL
-#endif /* Win32|WINNT */
+#endif /* PHP_WIN32 */
#define phpext_DOTNET_ptr DOTNET_module_ptr
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index cdde02ab6f..90ecf3d4cc 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -26,10 +26,6 @@
#include "ext/standard/info.h"
#include "SAPI.h"
-#if !defined(PHP_WIN32) && !defined(NETWARE)
-#include "build-defs.h"
-#endif
-
#if defined(HAVE_LIBDL) || HAVE_MACH_O_DYLD_H
#include <stdlib.h>
#include <stdio.h>
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 629cb720a5..64281e6c61 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -105,8 +105,6 @@ static int fsock_globals_id;
#ifdef USE_WINSOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
-#else
-#include "build-defs.h"
#endif
/* {{{ php_lookup_hostname */
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 6dfccf4ace..294e48e8cb 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -31,9 +31,6 @@
#include "SAPI.h"
#include <time.h>
#include "php_main.h"
-#if !defined(PHP_WIN32) && !defined(NETWARE)
-#include "build-defs.h"
-#endif
#include "zend_globals.h" /* needs ELS */
#include "zend_extensions.h"
#ifdef HAVE_SYS_UTSNAME_H
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index c81e33a442..e678bcc86e 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -23,15 +23,14 @@
#include <stdio.h>
#include "php.h"
#include "ext/standard/info.h"
-#if !defined(PHP_WIN32) && !defined(NETWARE)
-#include "build-defs.h"
+
#if HAVE_SYSEXITS_H
#include <sysexits.h>
#endif
#if HAVE_SYS_SYSEXITS_H
#include <sys/sysexits.h>
#endif
-#endif
+
#include "php_mail.h"
#include "php_ini.h"
#include "safe_mode.h"
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 6cfb1f07ab..e30898dcdf 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -35,9 +35,6 @@
#if HAVE_LIBEXPAT
-#if !defined(PHP_WIN32) && !defined(NETWARE)
-# include "build-defs.h"
-# endif
# include "ext/standard/head.h"
/* Short-term TODO list:
diff --git a/main/main.c b/main/main.c
index 83eaf25f63..98a392759d 100644
--- a/main/main.c
+++ b/main/main.c
@@ -40,8 +40,6 @@
#ifdef USE_WINSOCK
#include <novsock2.h>
#endif
-#else
-#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>
diff --git a/main/php.h b/main/php.h
index bbaaeaf183..4cf5e8a7ef 100644
--- a/main/php.h
+++ b/main/php.h
@@ -62,9 +62,13 @@
#endif
#ifdef NETWARE
-#define PHP_UNAME "NetWare" /* For php_get_uname() function */
-#define PHP_OS PHP_UNAME /* This is obtained using 'uname' on Unix and assigned in the case of Windows;
- we'll do it this way atleast for now */
+/* For php_get_uname() function */
+#define PHP_UNAME "NetWare"
+/*
+ * This is obtained using uname(2) on Unix and assigned in the case of Windows;
+ * we'll do it this way at least for now.
+ */
+#define PHP_OS PHP_UNAME
#endif
#include "php_regex.h"
@@ -92,6 +96,10 @@
#include <alloca.h>
#endif
+#if HAVE_BUILD_DEFS_H
+#include "build-defs.h"
+#endif
+
/*
* This is a fast version of strlcpy which should be used, if you
* know the size of the destination buffer and if you know
diff --git a/main/php_ini.c b/main/php_ini.c
index f83ceb5c28..e439547809 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -22,9 +22,6 @@
#define INI_CHECK_CWD
#include "php.h"
-#if !defined(PHP_WIN32) && !defined(NETWARE)
-#include "build-defs.h"
-#endif
#include "ext/standard/info.h"
#include "zend_ini.h"
#include "php_ini.h"
diff --git a/main/streams.c b/main/streams.c
index d5e3123052..edeab0488b 100755
--- a/main/streams.c
+++ b/main/streams.c
@@ -45,8 +45,6 @@
#ifdef PHP_WIN32
#define EWOULDBLOCK WSAEWOULDBLOCK
-#else
-#include "build-defs.h"
#endif
#define STREAM_DEBUG 0
diff --git a/regex/regex_extra.h b/regex/regex_extra.h
index 3db9e4ad1a..d668f7613f 100644
--- a/regex/regex_extra.h
+++ b/regex/regex_extra.h
@@ -7,7 +7,7 @@
#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX))
-#if !(WIN32|WINNT)
+#ifndef PHP_WIN32
#ifndef PHP_NO_ALIASES
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 4cde682d82..ba9b0aa94e 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -24,8 +24,6 @@
#if defined(PHP_WIN32) || defined(NETWARE)
#include "zend.h"
#include "ap_compat.h"
-#else
-#include "build-defs.h"
#endif
#ifdef ZTS
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 88305f8613..21b62ae9b2 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -34,8 +34,6 @@
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
-#else
-#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 859e3127d3..2e07439299 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -33,8 +33,6 @@
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
-#else
-#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>
diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c
index 538a603f8c..be2ead9613 100644
--- a/sapi/servlet/servlet.c
+++ b/sapi/servlet/servlet.c
@@ -29,8 +29,6 @@
#include "win32/time.h"
#include "win32/signal.h"
#include <process.h>
-#else
-#include "build-defs.h"
#endif
#if HAVE_SYS_TIME_H
#include <sys/time.h>