Attached is the diffs to current CVS to enable PHP4 to build under the
BeOS. Tested with BeOS r5.0.3 under Intel architecture.

The BeOS release currently requires "--without-mysql" due to
differences in the networking stack which are currently being addressed
by Be.

Index: configure.in
===================================================================
RCS file: /repository/php4/configure.in,v
retrieving revision 1.211
diff -u -u -r1.211 configure.in
--- configure.in        2001/01/14 16:36:29     1.211
+++ configure.in        2001/01/14 22:44:54
@@ -106,6 +106,8 @@
     CPPFLAGS="$CPPFLAGS -traditional-cpp";;
 *bsdi*)
     BSD_MAKEFILE=yes;;
+*beos*)
+       LIBS="$LIBS -lbe -lroot"
 esac
 
 AM_PROG_CC_STDC
@@ -294,6 +296,7 @@
 stdlib.h \
 string.h \
 syslog.h \
+sysexits.h \
 sys/file.h \
 sys/mman.h \
 sys/resource.h \
@@ -301,6 +304,7 @@
 sys/socket.h \
 sys/statfs.h \
 sys/statvfs.h \
+sys/sysexits.h \
 sys/time.h \
 sys/types.h \
 sys/varargs.h \
@@ -360,6 +364,8 @@
 gcvt \
 getlogin \
 gethostbyaddr \
+getprotobyname \
+getprotobynumber \
 getrusage \
 gettimeofday \
 gmtime_r \
Index: ext/mysql/libmysql/libmysql.c
===================================================================
RCS file: /repository/php4/ext/mysql/libmysql/libmysql.c,v
retrieving revision 1.5
diff -u -u -r1.5 libmysql.c
--- ext/mysql/libmysql/libmysql.c       2000/10/20 22:26:48     1.5
+++ ext/mysql/libmysql/libmysql.c       2001/01/14 22:44:54
@@ -25,7 +25,9 @@
 #if !defined(MSDOS) && !defined(__WIN__)
 #include <sys/socket.h>
 #include <netinet/in.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #include <netdb.h>
 #ifdef HAVE_SELECT_H
 #  include <select.h>
Index: ext/standard/basic_functions.c
===================================================================
RCS file: /repository/php4/ext/standard/basic_functions.c,v
retrieving revision 1.297
diff -u -u -r1.297 basic_functions.c
--- ext/standard/basic_functions.c      2001/01/14 16:36:30     1.297
+++ ext/standard/basic_functions.c      2001/01/14 22:44:59
@@ -34,7 +34,9 @@
 #include <time.h>
 #include <stdio.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -228,13 +230,19 @@
        PHP_FE(mt_srand,                                                               
 NULL)
        PHP_FE(mt_getrandmax,                                                   NULL)
        PHP_FE(getservbyname, NULL)
+#ifdef HAVE_GETSERVBYPORT
        PHP_FE(getservbyport, NULL)
+#endif
+#ifdef HAVE_GETPROTOBYNAME
        PHP_FE(getprotobyname, NULL)
+#endif
+#ifdef HAVE_GETPROTOBYNUMBER
        PHP_FE(getprotobynumber, NULL)
+#endif
        PHP_FE(gethostbyaddr,                                                   NULL)
        PHP_FE(gethostbyname,                                                   NULL)
        PHP_FE(gethostbynamel,                                                  NULL)
-#if !defined(PHP_WIN32)||HAVE_BINDLIB
+#if HAVE_BINDLIB && !(defined(__BEOS__)||defined(PHP_WIN32))
        PHP_FE(checkdnsrr,                                                             
 NULL)
        PHP_FE(getmxrr,                                                                
 second_and_third_args_force_ref)
 #else
@@ -424,7 +432,7 @@
        PHP_FALIAS(socket_set_timeout, warn_not_available,      NULL)
 #endif
        PHP_FE(socket_get_status,       NULL)
-#if !defined(PHP_WIN32) || defined(ZTS)
+#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS)
        PHP_FE(realpath,                        NULL)
 #else
        PHP_FALIAS(realpath,            warn_not_available,             NULL)
@@ -2187,8 +2195,8 @@
        RETURN_LONG(ntohs(serv->s_port));
 }
 /* }}} */
-
 
+#ifdef HAVE_GETSERVBYPORT
 /* {{{ proto string getservbyport(int port, string protocol)
    Returns service name associated with port. Protocol must be "tcp" or "udp". */
 PHP_FUNCTION(getservbyport)
@@ -2210,8 +2218,9 @@
        RETURN_STRING(serv->s_name,1);
 }
 /* }}} */
-
+#endif
 
+#ifdef HAVE_GETPROTOBYNAME
 /* {{{ proto int getprotobyname(string name)
    Returns protocol number associated with name as per /etc/protocols */
 PHP_FUNCTION(getprotobyname)
@@ -2236,8 +2245,9 @@
        RETURN_LONG(ent->p_proto);
 }
 /* }}} */
-
+#endif
 
+#ifdef HAVE_GETPROTOBYNUMBER
 /* {{{ proto string getprotobynumber(int proto)
    Returns protocol name associated with protocol number proto */
 PHP_FUNCTION(getprotobynumber)
@@ -2259,7 +2269,7 @@
        RETURN_STRING(ent->p_name,1);
 }
 /* }}} */
-
+#endif
 
 static int php_add_extension_info(zend_module_entry *module, void *arg)
 {
Index: ext/standard/dns.c
===================================================================
RCS file: /repository/php4/ext/standard/dns.c,v
retrieving revision 1.23
diff -u -u -r1.23 dns.c
--- ext/standard/dns.c  2000/11/27 13:31:21     1.23
+++ ext/standard/dns.c  2001/01/14 22:44:59
@@ -36,15 +36,21 @@
 #include <winsock.h>
 #else
 #include <netinet/in.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #include <netdb.h>
 #ifdef _OSD_POSIX
 #undef STATUS
 #undef T_UNSPEC
 #endif
+#ifdef HAVE_ARPA_NAMESERV_H
 #include <arpa/nameser.h>
+#endif
+#ifdef HAVE_RESOLV_H
 #include <resolv.h>
 #endif
+#endif
 
 #include "dns.h"
 
@@ -155,7 +161,7 @@
        return estrdup(inet_ntoa(in));
 }
 
-#if !defined(PHP_WIN32)||HAVE_BINDLIB
+#if HAVE_BINDLIB && !(defined(__BEOS__)||defined(PHP_WIN32))
 
 /* {{{ proto int checkdnsrr(string host [, string type])
    Check DNS records corresponding to a given Internet host name or IP address */
Index: ext/standard/file.c
===================================================================
RCS file: /repository/php4/ext/standard/file.c,v
retrieving revision 1.135
diff -u -u -r1.135 file.c
--- ext/standard/file.c 2001/01/14 14:11:38     1.135
+++ ext/standard/file.c 2001/01/14 22:45:26
@@ -50,8 +50,10 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 #include "ext/standard/head.h"
 #include "safe_mode.h"
 #include "php_string.h"
@@ -1947,7 +1949,7 @@
 /* }}} */
 
 
-#if !defined(PHP_WIN32) || defined(ZTS)
+#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS)
 /* {{{ proto string realpath(string path)
    Return the resolved path */
 PHP_FUNCTION(realpath)
Index: ext/standard/filestat.c
===================================================================
RCS file: /repository/php4/ext/standard/filestat.c,v
retrieving revision 1.51
diff -u -u -r1.51 filestat.c
--- ext/standard/filestat.c     2000/12/07 12:09:38     1.51
+++ ext/standard/filestat.c     2001/01/14 22:45:26
@@ -551,7 +551,7 @@
                case S_IFDIR: RETURN_STRING("dir",1);
                case S_IFBLK: RETURN_STRING("block",1);
                case S_IFREG: RETURN_STRING("file",1);
-#ifndef ZEND_WIN32
+#if !defined(ZEND_WIN32)&&!defined(__BEOS__)
                case S_IFSOCK: RETURN_STRING("socket",1);
 #endif
                }
Index: ext/standard/fsock.c
===================================================================
RCS file: /repository/php4/ext/standard/fsock.c,v
retrieving revision 1.60
diff -u -u -r1.60 fsock.c
--- ext/standard/fsock.c        2001/01/13 23:49:44     1.60
+++ ext/standard/fsock.c        2001/01/14 22:45:26
@@ -48,8 +48,10 @@
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 #ifdef PHP_WIN32
 #undef AF_UNIX
 #endif
@@ -136,7 +138,7 @@
                                                struct timeval *timeout)
 {
 /* probably won't work on Win32, someone else might try it (read: fix it ;) */
-#if !defined(PHP_WIN32) && (defined(O_NONBLOCK) || defined(O_NDELAY))
+#if (!defined(__BEOS__) && !defined(PHP_WIN32)) && (defined(O_NONBLOCK) || 
+defined(O_NDELAY))
 
 #ifndef O_NONBLOCK
 #define O_NONBLOCK O_NDELAY
Index: ext/standard/ftp_fopen_wrapper.c
===================================================================
RCS file: /repository/php4/ext/standard/ftp_fopen_wrapper.c,v
retrieving revision 1.2
diff -u -u -r1.2 ftp_fopen_wrapper.c
--- ext/standard/ftp_fopen_wrapper.c    2000/10/13 09:13:00     1.2
+++ ext/standard/ftp_fopen_wrapper.c    2001/01/14 22:45:26
@@ -51,7 +51,9 @@
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #endif
 
 #ifdef PHP_WIN32
Index: ext/standard/http_fopen_wrapper.c
===================================================================
RCS file: /repository/php4/ext/standard/http_fopen_wrapper.c,v
retrieving revision 1.5
diff -u -u -r1.5 http_fopen_wrapper.c
--- ext/standard/http_fopen_wrapper.c   2001/01/13 13:02:19     1.5
+++ ext/standard/http_fopen_wrapper.c   2001/01/14 22:45:26
@@ -51,7 +51,9 @@
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #endif
 
 #ifdef PHP_WIN32
Index: ext/standard/mail.c
===================================================================
RCS file: /repository/php4/ext/standard/mail.c,v
retrieving revision 1.28
diff -u -u -r1.28 mail.c
--- ext/standard/mail.c 2000/08/03 19:26:19     1.28
+++ ext/standard/mail.c 2001/01/14 22:45:26
@@ -25,7 +25,13 @@
 #include "ext/standard/info.h"
 #if !defined(PHP_WIN32)
 #include "build-defs.h"
+#ifdef HAVE_SYSEXITS_H
 #include <sysexits.h>
+#endif
+#ifdef HAVE_SYS_SYSEXITS_H
+#include <sys/sysexits.h>
+#endif
+
 #endif
 #include "php_mail.h"
 #include "php_ini.h"
Index: ext/standard/syslog.c
===================================================================
RCS file: /repository/php4/ext/standard/syslog.c,v
retrieving revision 1.23
diff -u -u -r1.23 syslog.c
--- ext/standard/syslog.c       2000/09/08 11:24:08     1.23
+++ ext/standard/syslog.c       2001/01/14 22:45:26
@@ -86,7 +86,9 @@
        REGISTER_LONG_CONSTANT("LOG_CONS", LOG_CONS, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_ODELAY", LOG_ODELAY, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_NDELAY", LOG_NDELAY, CONST_CS | CONST_PERSISTENT);
+#ifdef LOG_NOWAIT
        REGISTER_LONG_CONSTANT("LOG_NOWAIT", LOG_NOWAIT, CONST_CS | CONST_PERSISTENT);
+#endif
 #ifdef LOG_PERROR
        /* AIX doesn't have LOG_PERROR */
        REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); 
/*log to stderr*/
@@ -173,7 +175,9 @@
        SET_VAR_LONG("LOG_CONS", LOG_CONS);
        SET_VAR_LONG("LOG_ODELAY", LOG_ODELAY);
        SET_VAR_LONG("LOG_NDELAY", LOG_NDELAY);
+#ifdef LOG_NOWAIT
        SET_VAR_LONG("LOG_NOWAIT", LOG_NOWAIT);
+#endif
 #ifdef LOG_PERROR
        /* AIX doesn't have LOG_PERROR */
        SET_VAR_LONG("LOG_PERROR", LOG_PERROR); /*log to stderr*/
Index: main/fopen-wrappers.c
===================================================================
RCS file: /repository/php4/main/fopen-wrappers.c,v
retrieving revision 1.109
diff -u -u -r1.109 fopen-wrappers.c
--- main/fopen-wrappers.c       2000/12/16 20:52:43     1.109
+++ main/fopen-wrappers.c       2001/01/14 22:45:27
@@ -66,7 +66,9 @@
 #else
 #include <netinet/in.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #endif
 
 #ifdef PHP_WIN32
Index: main/network.c
===================================================================
RCS file: /repository/php4/main/network.c,v
retrieving revision 1.12
diff -u -u -r1.12 network.c
--- main/network.c      2001/01/13 13:02:19     1.12
+++ main/network.c      2001/01/14 22:45:27
@@ -36,7 +36,9 @@
 #ifndef PHP_WIN32
 #include <netinet/in.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #else
 int             inet_aton(const char *, struct in_addr *);
 #endif
Index: main/php_open_temporary_file.c
===================================================================
RCS file: /repository/php4/main/php_open_temporary_file.c,v
retrieving revision 1.4
diff -u -u -r1.4 php_open_temporary_file.c
--- main/php_open_temporary_file.c      2000/11/07 21:13:26     1.4
+++ main/php_open_temporary_file.c      2001/01/14 22:45:27
@@ -34,14 +34,20 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
+#endif
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
+#endif
+
+#if !defined(P_tmpdir)
+#define P_tmpdir ""
 #endif
 
 /* {{{ php_open_temporary_file */
Index: TSRM/tsrm_virtual_cwd.c
===================================================================
RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v
retrieving revision 1.11
diff -u -u -r1.11 tsrm_virtual_cwd.c
--- TSRM/tsrm_virtual_cwd.c     2000/11/22 04:59:32     1.11
+++ TSRM/tsrm_virtual_cwd.c     2001/01/14 22:47:56
@@ -35,6 +35,10 @@
 #include <io.h>
 #endif
 
+#ifdef __BEOS__
+#define realpath(x,y) strcpy(y,x)
+#endif
+
 #define VIRTUAL_CWD_DEBUG 0
 
 #ifdef ZTS

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to