ab Sun Mar 18 23:04:56 2001 EDT Added files: /php4/ext/midgard php_midgard.h.in Modified files: /php4/ext/midgard config.m4 config.m4.session Log: Automatically generate correct #include for cases when module build using phpize or within main PHP4 tree Index: php4/ext/midgard/config.m4 diff -u php4/ext/midgard/config.m4:1.13 php4/ext/midgard/config.m4:1.14 --- php4/ext/midgard/config.m4:1.13 Sun Mar 11 15:45:57 2001 +++ php4/ext/midgard/config.m4 Sun Mar 18 23:04:56 2001 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.13 2001/03/11 23:45:57 davidg Exp $ +dnl $Id: config.m4,v 1.14 2001/03/19 07:04:56 ab Exp $ dnl Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]> dnl Copyright (C) 2000 The Midgard Project ry @@ -66,4 +66,12 @@ if test "$PHP_MIDGARD_EXPERIMENTAL" != "no"; then AC_DEFINE(YOU_WANT_TO_TEST, 1, [ ]) fi + + if test "$php_always_shared" = "yes"; then + MIDCONFIG_FILE="config.h" + else + MIDCONFIG_FILE="php_config.h" + fi + PHP_SUBST(MIDCONFIG_FILE) + PHP_OUTPUT(php_midgard.h) fi Index: php4/ext/midgard/config.m4.session diff -u php4/ext/midgard/config.m4.session:1.3 php4/ext/midgard/config.m4.session:1.4 --- php4/ext/midgard/config.m4.session:1.3 Sun Mar 11 15:45:57 2001 +++ php4/ext/midgard/config.m4.session Sun Mar 18 23:04:56 2001 @@ -1,4 +1,4 @@ -dnl $Id: config.m4.session,v 1.3 2001/03/11 23:45:57 davidg Exp $ +dnl $Id: config.m4.session,v 1.4 2001/03/19 07:04:56 ab Exp $ dnl Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]> dnl Copyright (C) 2000 The Midgard Project ry @@ -74,4 +74,11 @@ if test "$PHP_MIDGARD_SESSION" != "no"; then AC_DEFINE(HAVE_MIDGARD_SESSION, 1, [ ]) fi + if test "$php_always_shared" = "yes"; then + MIDCONFIG_FILE="config.h" + else + MIDCONFIG_FILE="php_config.h" + fi + PHP_SUBST(MIDCONFIG_FILE) + PHP_OUTPUT(php_midgard.h) fi Index: php4/ext/midgard/php_midgard.h.in +++ php4/ext/midgard/php_midgard.h.in /* $Id: php_midgard.h.in,v 1.1 2001/03/19 07:04:56 ab Exp $ Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]> Copyright (C) 2000 The Midgard Project ry Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef PHP_MIDGARD_H #define PHP_MIDGARD_H /* You should tweak config.m4 so this symbol (or some else suitable) gets defined. */ #include "php.h" #include "@MIDCONFIG_FILE@" #if HAVE_MIDGARD #include <midgard/midgard.h> #include <midgard/apache.h> /* #include <Zend/zend_modules.h> */ midgard_request_config *mgd_rcfg(); midgard_directory_config *mgd_dcfg(); midgard *mgd_handle(); zval *mgd_getudf(); int mgd_get_errno(); void mgd_reset_errno(); void mgd_set_errno(int mgd_errno); void mgd_log_debug(int flags, const char *fmt, ...); extern zend_module_entry midgard_module_entry; #define phpext_midgard_ptr &midgard_module_entry #ifdef PHP_WIN32 #define PHP_MIDGARD_API __declspec(dllexport) #else #define PHP_MIDGARD_API #endif PHP_MINIT_FUNCTION(midgard); PHP_MSHUTDOWN_FUNCTION(midgard); PHP_RINIT_FUNCTION(midgard); PHP_RSHUTDOWN_FUNCTION(midgard); PHP_MINFO_FUNCTION(midgard); PHP_FUNCTION(confirm_midgard_compiled); /* For testing, remove later. */ ZEND_BEGIN_MODULE_GLOBALS(midgard) midgard_request_config *rcfg; midgard_directory_config *dcfg; midgard *mgd; int mgd_errno; zval *udf; ZEND_END_MODULE_GLOBALS(midgard) /* In every function that needs to use variables in php_midgard_globals, do call MGDLS_FETCH(); after declaring other variables used by that function, and always refer to them as MGDG(variable). You are encouraged to rename these macros something shorter, see examples in any other php module directory. */ #ifdef ZTS #define MGDG(v) (midgard_globals->v) #define MGDLS_FETCH() php_midgard_globals *midgard_globals = ts_resource(midgard_globals_id) #else #define MGDG(v) (midgard_globals.v) #define MGDLS_FETCH() #endif #else #define phpext_midgard_ptr NULL #endif #endif /* PHP_MIDGARD_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ -- PHP CVS 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]