sas             Wed Nov 13 20:09:46 2002 EDT

  Added files:                 
    /php4/ext/ircg      ircg_dummy.c ircg_thttpd.c 

  Modified files:              
    /php4       acinclude.m4 configure.in 
    /php4/ext/ircg      config.m4 ircg.c 
    /php4/sapi/cli      config.m4 
  Log:
  - Remove PHP_DISABLE_CLI
  - Streamline ircg build: thttpd-dependent part moved into separate source 
    file, so that it can be added to the SAPI-only object list.
  
  
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.218 php4/acinclude.m4:1.219
--- php4/acinclude.m4:1.218     Tue Oct 29 06:24:26 2002
+++ php4/acinclude.m4   Wed Nov 13 20:09:45 2002
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.218 2002/10/29 11:24:26 sniper Exp $
+dnl $Id: acinclude.m4,v 1.219 2002/11/14 01:09:45 sas Exp $
 dnl
 dnl This file contains local autoconf functions.
 
@@ -137,13 +137,6 @@
   done
 ])
 
-dnl
-dnl Disable building CLI
-dnl
-AC_DEFUN([PHP_DISABLE_CLI],[
-  disable_cli=1
-])
-       
 dnl
 dnl Separator into the configure --help display.
 dnl 
Index: php4/configure.in
diff -u php4/configure.in:1.397 php4/configure.in:1.398
--- php4/configure.in:1.397     Wed Nov 13 14:19:04 2002
+++ php4/configure.in   Wed Nov 13 20:09:45 2002
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.397 2002/11/13 19:19:04 andrei Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.398 2002/11/14 01:09:45 sas Exp $ -*- sh -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -607,7 +607,7 @@
 [  --with-pear=DIR         Install PEAR in DIR (default PREFIX/lib/php)
   --without-pear          Do not install PEAR], DEFAULT, no)
 
-if test "$PHP_PEAR" != "no" && test "$disable_cli" != "1"; then
+if test "$PHP_PEAR" != "no" && test "$PHP_SAPI_CLI" != "no"; then
   install_pear="install-pear install-build install-headers install-programs"
   PEAR_INSTALLDIR=$PHP_PEAR
 fi
@@ -957,7 +957,7 @@
 PHP_OS=`uname | xargs`
 AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
 
-if test "$disable_cli" != "1"; then
+if test "$PHP_SAPI_CLI" != "no"; then
   PHP_CLI_TARGET=sapi/cli/php
   PHP_INSTALL_CLI_TARGET="install-cli"
   PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
Index: php4/ext/ircg/config.m4
diff -u php4/ext/ircg/config.m4:1.14 php4/ext/ircg/config.m4:1.15
--- php4/ext/ircg/config.m4:1.14        Mon Mar 18 10:00:57 2002
+++ php4/ext/ircg/config.m4     Wed Nov 13 20:09:45 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.14 2002/03/18 15:00:57 sas Exp $
+dnl $Id: config.m4,v 1.15 2002/11/14 01:09:45 sas Exp $
 dnl
 
 PHP_ARG_WITH(ircg, for IRCG support,
@@ -26,11 +26,13 @@
   PHP_EVAL_INCLINE(`$IRCG_CONFIG --cppflags`)
   PHP_ADD_LIBRARY_WITH_PATH(ircg, $PHP_IRCG/lib)
   PHP_ADD_INCLUDE($PHP_IRCG/include)
+  PHP_NEW_EXTENSION(ircg, ircg.c ircg_scanner.c, $ext_shared)
   if test "$PHP_SAPI" = "thttpd"; then
-    AC_DEFINE(IRCG_WITH_THTTPD, 1, [Whether thttpd is available])
-    PHP_DISABLE_CLI
+    PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_thttpd.c,[],sapi)
+    PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_dummy.c,[],cli)
+  else
+    PHP_ADD_SOURCES(PHP_EXT_DIR(ircg),ircg_dummy.c)
   fi
   AC_DEFINE(HAVE_IRCG, 1, [Whether you want IRCG support])
-  PHP_NEW_EXTENSION(ircg, ircg.c ircg_scanner.c, $ext_shared)
   PHP_ADD_MAKEFILE_FRAGMENT
 fi
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.139 php4/ext/ircg/ircg.c:1.140
--- php4/ext/ircg/ircg.c:1.139  Wed Nov 13 18:19:12 2002
+++ php4/ext/ircg/ircg.c        Wed Nov 13 20:09:45 2002
@@ -14,9 +14,9 @@
    +----------------------------------------------------------------------+
    | Author: Sascha Schumann <[EMAIL PROTECTED]>                         |
    +----------------------------------------------------------------------+
- */
+*/
 
-/* $Id: ircg.c,v 1.139 2002/11/13 23:19:12 sas Exp $ */
+/* $Id: ircg.c,v 1.140 2002/11/14 01:09:45 sas Exp $ */
 
 /* {{{ includes */
 
@@ -1379,7 +1379,6 @@
    Sets current connection for output */
 PHP_FUNCTION(ircg_set_current)
 {
-#ifdef IRCG_WITH_THTTPD
        zval **p1;
        php_irconn_t *conn;
 #if 0
@@ -1412,10 +1411,9 @@
 #endif
 
        irc_set_currents++;
-       thttpd_register_on_close(http_closed_connection);
-       thttpd_set_dont_close();
-       conn->fd = thttpd_get_fd();
-       if (fcntl(conn->fd, F_GETFL) == -1) {
+
+       if (php_ircg_register_with_sapi(&conn->fd, http_closed_connection) 
+                       || fcntl(conn->fd, F_GETFL) == -1) {
                zend_hash_index_del(&h_irconn, Z_LVAL_PP(p1));
                php_error(E_WARNING, "current fd is not valid");
                RETURN_FALSE;
@@ -1427,7 +1425,6 @@
        }
 
        RETURN_TRUE;
-#endif
 }
 /* }}} */
 
Index: php4/sapi/cli/config.m4
diff -u php4/sapi/cli/config.m4:1.11 php4/sapi/cli/config.m4:1.12
--- php4/sapi/cli/config.m4:1.11        Sun Sep 29 12:22:48 2002
+++ php4/sapi/cli/config.m4     Wed Nov 13 20:09:46 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.11 2002/09/29 16:22:48 sas Exp $
+dnl $Id: config.m4,v 1.12 2002/11/14 01:09:46 sas Exp $
 dnl
 
 AC_MSG_CHECKING(for CLI build)
@@ -29,8 +29,6 @@
   INSTALL_CLI="\$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/php"
   PHP_SUBST(BUILD_CLI)
   PHP_SUBST(INSTALL_CLI)
-else
-  PHP_DISABLE_CLI
 fi
 
 AC_MSG_RESULT($PHP_SAPI_CLI)

Index: php4/ext/ircg/ircg_dummy.c
+++ php4/ext/ircg/ircg_dummy.c
/*
   +----------------------------------------------------------------------+
   | PHP Version 4                                                        |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997-2002 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | http://www.php.net/license/2_02.txt.                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Author: Sascha Schumann <[EMAIL PROTECTED]>                         |
   +----------------------------------------------------------------------+
*/

/* $Id: ircg_dummy.c,v 1.1 2002/11/14 01:09:46 sas Exp $ */


int php_ircg_register_with_sapi(int *fd, void (*arg)(int)) 
{
        return -1;
}

Index: php4/ext/ircg/ircg_thttpd.c
+++ php4/ext/ircg/ircg_thttpd.c
/*
   +----------------------------------------------------------------------+
   | PHP Version 4                                                        |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997-2002 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.02 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available at through the world-wide-web at                           |
   | http://www.php.net/license/2_02.txt.                                 |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | [EMAIL PROTECTED] so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Author: Sascha Schumann <[EMAIL PROTECTED]>                         |
   +----------------------------------------------------------------------+
*/

/* $Id: ircg_thttpd.c,v 1.1 2002/11/14 01:09:46 sas Exp $ */


int php_ircg_register_with_sapi(int *fd, void (*http_closed_connection)(int))
{
        thttpd_register_on_close(http_closed_connection);
        thttpd_set_dont_close();
        *fd = thttpd_get_fd();

        return 0;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to