cvs commit

From: Date: Sat, 03 Jul 1999 01:40:21 +0000
Subject: cvs commit
Groups: php.dev 
Request: Send a blank email to php-dev+get-8036@lists.php.net to get a copy of this message
From: bjh Date: Sat Jul 3 01:40:21 1999 Modified files: php3/ChangeLog php3/Makefile.in php3/apMakefile.tmpl php3/config.h.in php3/configure.in php3/main.c php3/php.h php3/functions/basic_functions.c php3/functions/dns.c php3/functions/filestat.c php3/functions/syslog.c Log message: OS/2 port. Issues addressed to make PHP3 work on OS/2: - Tell makefile to run programs via sh instead of OS/2's normal CLI 'cmd.exe' which doesn't support some of the sh features used. - Add build rule for OS/2 dll apache loadable module to apMakefile.tmpl. - define ushort type (used in mysql.c) via configure. - look for crypt() in ufc library if not found in libc or libcrypt. - Don't do AC_STRUCT_ST_BLOCKS, we have no fileblocks.o. - Only include syslog.h if HAVE_SYSLOG_H defined (which it's not on OS/2). - Disable some unsupported functions that are also unsupported on Win32 - Add an OS/2 disk free space function. - Make use of S_IFBLK conditional on S_IFBLK being defined (which it's not on OS/2). - Disable syslog.c if not defined HAVE_SYSLOG_H or MSVC5 I've tested building on Linux too so hopefully I haven't broken anything for the rest of you. Index: php3/ChangeLog diff -u php3/ChangeLog:1.716 php3/ChangeLog:1.717 --- php3/ChangeLog:1.716 Fri Jul 2 19:40:57 1999 +++ php3/ChangeLog Sat Jul 3 01:40:20 1999 @@ -2,6 +2,7 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ??, Version 3.0.12 +- make buildable on OS/2 (Brian Havard <brianh@kheldar.apana.org.au>) - added Chad Cunningham's patches for Mac OS X compatibility (markonen) - added ldap_error(), ldap_errno() and ldap_err2str() functions (kk) - fix --with-shared-apache (Sascha) Index: php3/Makefile.in diff -u php3/Makefile.in:1.336 php3/Makefile.in:1.337 --- php3/Makefile.in:1.336 Thu Jul 1 08:04:05 1999 +++ php3/Makefile.in Sat Jul 3 01:40:20 1999 @@ -24,7 +24,7 @@ # +----------------------------------------------------------------------+ # -# $Id: Makefile.in,v 1.336 1999/07/01 12:04:05 sas Exp $ +# $Id: Makefile.in,v 1.337 1999/07/03 05:40:20 bjh Exp $ # prefix = @prefix@ @@ -33,6 +33,7 @@ VPATH = @srcdir@ bindir = @bindir@ +SHELL = @SH@ CC = @CC@ LN_S = @LN_S@ AR = ar rc Index: php3/apMakefile.tmpl diff -u php3/apMakefile.tmpl:1.6 php3/apMakefile.tmpl:1.7 --- php3/apMakefile.tmpl:1.6 Mon May 25 08:08:33 1998 +++ php3/apMakefile.tmpl Sat Jul 3 01:40:20 1999 @@ -36,6 +36,12 @@ rm -f $@ $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) +# Build OS/2 dll +libphp3.dll: $(OBJS) mod_php3.def + $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $* $(OBJS) libmodphp3.a $(LIBS_SHLIB) $(EXTRA_LIBS) $(LIBS1) + emxbind -b -q -s -h0 -dmod_php3.def $* && \ + rm $* + # 1. extension .o for shared objects cannot be used here because # first these files aren't still shared objects and second we # have to use a different name to trigger the different @@ -43,7 +49,7 @@ # 2. extension -so.o (as used elsewhere) cannot be used because # the suffix feature of Make really wants just .x, so we use # extension .so-o -.SUFFIXES: .o .so-o +.SUFFIXES: .o .so-o .dll .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $< .c.so-o: Index: php3/config.h.in diff -u php3/config.h.in:1.178 php3/config.h.in:1.179 --- php3/config.h.in:1.178 Fri Jul 2 09:18:50 1999 +++ php3/config.h.in Sat Jul 3 01:40:20 1999 @@ -113,6 +113,9 @@ /* define uint by configure if it is missed (QNX and BSD derived) */ #undef uint +/* define ushort by configure if it is missed (OS/2) */ +#undef ushort + /* define ulong by configure if it is missed (most probably is) */ #undef ulong Index: php3/configure.in diff -u php3/configure.in:1.427 php3/configure.in:1.428 --- php3/configure.in:1.427 Fri Jul 2 16:34:42 1999 +++ php3/configure.in Sat Jul 3 01:40:20 1999 @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.427 1999/07/02 20:34:42 markonen Exp $ +dnl $Id: configure.in,v 1.428 1999/07/03 05:40:20 bjh Exp $ dnl Process this file with autoconf to produce a configure script. AC_INIT(main.c) @@ -30,6 +30,7 @@ AC_PROG_CC_C_O AC_PROG_LN_S AC_PATH_PROG(PERL_PATH, perl) +AC_PATH_PROG(SH, sh, /bin/sh) dnl Make flex scanners use const if they can, even if __STDC__ is not dnl true, for compilers like Sun's that only set __STDC__ true in @@ -124,7 +125,14 @@ AC_CHECK_LIB(c, crypt, [:], [ AC_CHECK_LIB(crypt, crypt, [ LIBS="-lcrypt $LIBS" - AC_DEFINE(HAVE_LIBCRYPT) ], []) ]) + AC_DEFINE(HAVE_LIBCRYPT) + ],[ + AC_CHECK_LIB(ufc, crypt, [ + LIBS="-lufc $LIBS" + AC_DEFINE(HAVE_LIBCRYPT) + ]) + ]) +]) AC_CHECK_LIB(c, dlopen, [ # fake it @@ -216,7 +224,9 @@ dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argument if test "uname -s 2>/dev/null" != "QNX"; then - AC_STRUCT_ST_BLOCKS + if test "uname -s 2>/dev/null" != "OS/2"; then + AC_STRUCT_ST_BLOCKS + fi else AC_MSG_WARN(warnings level for cc set to 0) WARNING_LEVEL=0 @@ -229,6 +239,7 @@ AC_TYPE_UID_T dnl This is required for QNX and may be some BSD derived systems AC_CHECK_TYPE( uint, unsigned int ) +AC_CHECK_TYPE( ushort, unsigned short ) AC_CHECK_TYPE( ulong, unsigned long ) AC_CHECK_TYPE(ptrdiff_t, unsigned long) Index: php3/main.c diff -u php3/main.c:1.502 php3/main.c:1.503 --- php3/main.c:1.502 Fri Jul 2 12:41:50 1999 +++ php3/main.c Sat Jul 3 01:40:20 1999 @@ -29,7 +29,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.502 1999/07/02 16:41:50 markonen Exp $ */ +/* $Id: main.c,v 1.503 1999/07/03 05:40:20 bjh Exp $ */ /* #define CRASH_DETECTION */ @@ -80,7 +80,7 @@ #include <io.h> #include <fcntl.h> #include "win32/syslog.h" -#else +#elif HAVE_SYSLOG_H #include <syslog.h> #endif Index: php3/php.h diff -u php3/php.h:1.58 php3/php.h:1.59 --- php3/php.h:1.58 Fri Jul 2 12:41:51 1999 +++ php3/php.h Sat Jul 3 01:40:20 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.58 1999/07/02 16:41:51 markonen Exp $ */ +/* $Id: php.h,v 1.59 1999/07/03 05:40:20 bjh Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -69,6 +69,16 @@ # define PHPAPI # define PHPAPI_EXPORT # define THREAD_LS +#endif + +#ifdef __EMX__ +#define OS2 1 +#define TCPIPV4 +#define MAXSOCKETS 2048 +#if !APACHE +#define strcasecmp(s1, s2) stricmp(s1, s2) +#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n) +#endif #endif #if HAVE_UNIX_H Index: php3/functions/basic_functions.c diff -u php3/functions/basic_functions.c:1.270 php3/functions/basic_functions.c:1.271 --- php3/functions/basic_functions.c:1.270 Mon Jun 28 15:47:32 1999 +++ php3/functions/basic_functions.c Sat Jul 3 01:40:20 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.270 1999/06/28 19:47:32 jim Exp $ */ +/* $Id: basic_functions.c,v 1.271 1999/07/03 05:40:20 bjh Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif @@ -229,7 +229,7 @@ {"gethostbyaddr", php3_gethostbyaddr, NULL}, {"gethostbyname", php3_gethostbyname, NULL}, {"gethostbynamel", php3_gethostbynamel, NULL}, -#if !(WIN32|WINNT)||HAVE_BINDLIB +#if !(WIN32|WINNT|OS2)||HAVE_BINDLIB {"checkdnsrr", php3_checkdnsrr, NULL}, {"getmxrr", php3_getmxrr, second_and_third_args_force_ref}, #endif Index: php3/functions/dns.c diff -u php3/functions/dns.c:1.55 php3/functions/dns.c:1.56 --- php3/functions/dns.c:1.55 Thu Jun 24 08:27:59 1999 +++ php3/functions/dns.c Sat Jul 3 01:40:20 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.55 1999/06/24 12:27:59 sas Exp $ */ +/* $Id: dns.c,v 1.56 1999/07/03 05:40:20 bjh Exp $ */ #ifdef THREAD_SAFE #include "tls.h" @@ -181,7 +181,7 @@ return estrdup(inet_ntoa(in)); } -#if !(WIN32|WINNT)||HAVE_BINDLIB +#if !(WIN32|WINNT|OS2)||HAVE_BINDLIB /* {{{ proto int checkdnsrr(string host [, string type]) Check DNS records corresponding to a given Internet host name or IP address */ Index: php3/functions/filestat.c diff -u php3/functions/filestat.c:1.90 php3/functions/filestat.c:1.91 --- php3/functions/filestat.c:1.90 Mon Jun 28 15:03:54 1999 +++ php3/functions/filestat.c Sat Jul 3 01:40:20 1999 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.90 1999/06/28 19:03:54 jim Exp $ */ +/* $Id: filestat.c,v 1.91 1999/07/03 05:40:20 bjh Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif @@ -43,6 +43,11 @@ #include <ctype.h> #include <time.h> +#ifdef OS2 +# define INCL_DOS +# include <os2.h> +#endif + #ifdef HAVE_UNISTD_H # include <unistd.h> #endif @@ -197,8 +202,15 @@ RETURN_FALSE; } - -#else /* WINDOWS */ +#elif defined(OS2) + { + FSALLOCATE fsinfo; + char drive = path->value.str.val[0] & 95; + + if (DosQueryFSInfo( drive ? drive - 64 : 0, FSIL_ALLOC, &fsinfo, sizeof( fsinfo ) ) == 0) + bytesfree = (double)fsinfo.cbSector * fsinfo.cSectorUnit * fsinfo.cUnitAvail; + } +#else /* WINDOWS, OS/2 */ #if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS) if (statvfs(path->value.str.val,&buf)) RETURN_FALSE; bytesfree = (((double)buf.f_bavail) * ((double)buf.f_frsize)); @@ -224,7 +236,7 @@ int ret; TLS_VARS; ret = 0; -#ifndef WINDOWS +#if !defined(WINDOWS) && !defined(OS2) if (ARG_COUNT(ht)!=2 || getParameters(ht,2,&filename,&group)==FAILURE) { WRONG_PARAM_COUNT; @@ -266,7 +278,7 @@ Change file owner */ void php3_chown(INTERNAL_FUNCTION_PARAMETERS) { -#ifndef WINDOWS +#if !defined(WINDOWS) && !defined(OS2) pval *filename, *user; int ret; uid_t uid; @@ -488,7 +500,9 @@ case S_IFIFO: RETURN_STRING("fifo",1); case S_IFCHR: RETURN_STRING("char",1); case S_IFDIR: RETURN_STRING("dir",1); +#ifdef S_IFBLK case S_IFBLK: RETURN_STRING("block",1); +#endif case S_IFREG: RETURN_STRING("file",1); } php3_error(E_WARNING,"Unknown file type (%d)",GLOBAL(sb).st_mode&S_IFMT); Index: php3/functions/syslog.c diff -u php3/functions/syslog.c:1.45 php3/functions/syslog.c:1.46 --- php3/functions/syslog.c:1.45 Wed Jun 16 07:34:22 1999 +++ php3/functions/syslog.c Sat Jul 3 01:40:21 1999 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: syslog.c,v 1.45 1999/06/16 11:34:22 ssb Exp $ */ +/* $Id: syslog.c,v 1.46 1999/07/03 05:40:21 bjh Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif @@ -40,7 +40,7 @@ #endif #if MSVC5 #include "win32/syslog.h" -#else +#elif HAVE_SYSLOG_H #include <syslog.h> #endif @@ -50,6 +50,8 @@ #include <stdio.h> #include "functions/php3_syslog.h" +#if HAVE_SYSLOG_H || MSVC5 + static int syslog_started; static char *syslog_device; static void start_syslog(void); @@ -286,6 +288,7 @@ DLEXPORT php3_module_entry *get_module(void) { return &syslog_module_entry; } #endif +#endif /* HAVE_SYSLOG_H */ /* * Local variables:

« previous php.dev (#8036) next »