cvs: pear /PECL/session_pgsql config.m4 session_pgsql.c session_pgsql.h
| From: | Yasuo Ohgaki | Date: | Thu, 14 Feb 2002 20:01:17 +0000 |
| Subject: | cvs: pear /PECL/session_pgsql config.m4 session_pgsql.c session_pgsql.h | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2438@lists.php.net to get a copy of this message | ||
yohgaki Thu Feb 14 15:01:17 2002 EDT
Modified files:
/pear/PECL/session_pgsql config.m4 session_pgsql.c session_pgsql.h
Log:
Added libmm check.
Code clean up.
Index: pear/PECL/session_pgsql/config.m4
diff -u pear/PECL/session_pgsql/config.m4:1.3 pear/PECL/session_pgsql/config.m4:1.4
--- pear/PECL/session_pgsql/config.m4:1.3 Wed Jan 23 04:26:45 2002
+++ pear/PECL/session_pgsql/config.m4 Thu Feb 14 15:01:17 2002
@@ -1,11 +1,52 @@
dnl
-dnl $Id: config.m4,v 1.3 2002/01/23 09:26:45 yohgaki Exp $
+dnl $Id: config.m4,v 1.4 2002/02/14 20:01:17 yohgaki Exp $
dnl
-dnl FIXME: mm check
+
PHP_ARG_WITH(session-pgsql,for pgsql sesssion support,
[ --with-session-pgsql[=DIR] Include pgsql(PostgreSQL) support for session storage])
if test "$PHP_SESSION_PGSQL" != "no"; then
+
+ dnl
+ dnl check libmm
+ dnl
+ LIBNAME=mm
+ LIBSYMBOL=mm_create
+
+ for i in /usr/local /usr ; do
+ if test -f "$i/include/mm.h"; then
+ MM_DIR=$i
+ fi
+ done
+
+ if test -z "$MM_DIR" ; then
+ AC_MSG_ERROR(cannot find mm.h under /usr/local /usr)
+ fi
+
+ if test -z "MM_DIR/lib/libmm.so"; then
+ AC_MSG_ERROR([libjpeg.so not found.])
+ fi
+
+
+ PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL,
+ [
+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $MM_DIR/lib, MM_SHARED_LIBADD)
+ AC_DEFINE(HAVE_MMLIB,1,[Whether you have libmm or not])
+ ],[
+ AC_MSG_ERROR([wrong libmm version or libmm not found])
+ ],[
+ -L$MM_DIR/lib -lm -ldl
+ ])
+
+ PHP_SUBST(MM_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($MM_DIR/include)
+
+ dnl
+ dnl check libpq
+ dnl
+ LIBNAME=pq
+ LIBSYMBOL=PQexec
+
if test "$PHP_SESSION_PGSQL" = "yes"; then
PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql"
else
@@ -39,10 +80,19 @@
AC_MSG_ERROR([Unable to find libpq anywhere under $withval])
fi
- PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, SESSION_SHARED_LIBADD)
- PHP_ADD_LIBRARY_WITH_PATH(mm, "/usr/lib", SESSION_SHARED_LIBADD)
+ PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL,
+ [
+ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)
+ AC_DEFINE(HAVE_LIBPQ,1,[Whether you have libpq or not ])
+ ],[
+ AC_MSG_ERROR([wrong libpq version or libpq not found])
+ ],[
+ -L$PGSQL_LIBDIR -lm -ldl
+ ])
+
+ PHP_SUBST(PGSQL_SHARED_LIBADD)
PHP_ADD_INCLUDE($PGSQL_INCLUDE)
- AC_DEFINE(HAVE_SESSION_PGSQL, 1, [Whether you have pgsql session save handler])
- PHP_MODULE_PTR(phpext_ps_pgsql_ptr)
- PHP_EXTENSION(session_pgsql,$ext_shared)
+
+ AC_DEFINE(HAVE_SESSION_PGSQL, 1, [Whether you have pgsql session save handler])
+ PHP_EXTENSION(session_pgsql, $ext_shared)
fi
Index: pear/PECL/session_pgsql/session_pgsql.c
diff -u pear/PECL/session_pgsql/session_pgsql.c:1.14 pear/PECL/session_pgsql/session_pgsql.c:1.15
--- pear/PECL/session_pgsql/session_pgsql.c:1.14 Wed Jan 23 04:26:45 2002
+++ pear/PECL/session_pgsql/session_pgsql.c Thu Feb 14 15:01:17 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session_pgsql.c,v 1.14 2002/01/23 09:26:45 yohgaki Exp $ */
+/* $Id: session_pgsql.c,v 1.15 2002/02/14 20:01:17 yohgaki Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -62,7 +62,7 @@
#define ELOG( x )
#endif
-function_entry ps_pgsql_functions[] = {
+function_entry session_pgsql_functions[] = {
PHP_FE(session_pgsql_status, NULL)
PHP_FE(session_pgsql_info, NULL)
PHP_FE(session_pgsql_add_error, NULL)
@@ -105,27 +105,27 @@
PHP_INI_END()
/* }}} */
-PHP_MINIT_FUNCTION(ps_pgsql);
-PHP_MSHUTDOWN_FUNCTION(ps_pgsql);
-PHP_RSHUTDOWN_FUNCTION(ps_pgsql);
-PHP_MINFO_FUNCTION(ps_pgsql);
+PHP_MINIT_FUNCTION(session_pgsql);
+PHP_MSHUTDOWN_FUNCTION(session_pgsql);
+PHP_RSHUTDOWN_FUNCTION(session_pgsql);
+PHP_MINFO_FUNCTION(session_pgsql);
-/* {{{ ps_pgsql_module_entry
+/* {{{ session_pgsql_module_entry
*/
-zend_module_entry ps_pgsql_module_entry = {
+zend_module_entry session_pgsql_module_entry = {
STANDARD_MODULE_HEADER,
"session pgsql",
- ps_pgsql_functions,
- PHP_MINIT(ps_pgsql), PHP_MSHUTDOWN(ps_pgsql),
- NULL, PHP_RSHUTDOWN(ps_pgsql),
- PHP_MINFO(ps_pgsql),
+ session_pgsql_functions,
+ PHP_MINIT(session_pgsql), PHP_MSHUTDOWN(session_pgsql),
+ NULL, PHP_RSHUTDOWN(session_pgsql),
+ PHP_MINFO(session_pgsql),
"0.1",
STANDARD_MODULE_PROPERTIES
};
/* }}} */
#ifdef COMPILE_DL_SESSION_PGSQL
-ZEND_GET_MODULE(ps_pgsql)
+ZEND_GET_MODULE(session_pgsql)
#endif
/* {{{ php_pg_pgsql_create_table
@@ -249,7 +249,7 @@
/* {{{ PHP_MINIT_FUNCTION
*/
-PHP_MINIT_FUNCTION(ps_pgsql)
+PHP_MINIT_FUNCTION(session_pgsql)
{
REGISTER_INI_ENTRIES();
#ifdef ZTS
@@ -282,7 +282,7 @@
/* {{{ PHP_MSHUTDOEN_FUNCTION
*/
-PHP_MSHUTDOWN_FUNCTION(ps_pgsql)
+PHP_MSHUTDOWN_FUNCTION(session_pgsql)
{
int i;
@@ -305,7 +305,7 @@
/* {{{ PHP_RSHUTDOEN_FUNCTION
*/
-PHP_RSHUTDOWN_FUNCTION(ps_pgsql)
+PHP_RSHUTDOWN_FUNCTION(session_pgsql)
{
int ret;
@@ -321,7 +321,7 @@
/* {{{ PHP_MINFO_FUNCTION
*/
-PHP_MINFO_FUNCTION(ps_pgsql)
+PHP_MINFO_FUNCTION(session_pgsql)
{
php_info_print_table_start();
php_info_print_table_header(2, "pgsql session support", "enabled");
Index: pear/PECL/session_pgsql/session_pgsql.h
diff -u pear/PECL/session_pgsql/session_pgsql.h:1.8 pear/PECL/session_pgsql/session_pgsql.h:1.9
--- pear/PECL/session_pgsql/session_pgsql.h:1.8 Wed Jan 23 04:26:45 2002
+++ pear/PECL/session_pgsql/session_pgsql.h Thu Feb 14 15:01:17 2002
@@ -31,8 +31,8 @@
extern ps_module ps_mod_pgsql;
#define ps_pgsql_ptr &ps_mod_pgsql
-extern zend_module_entry php_session_pgsql_module;
-#define phpext_ps_pgsql_ptr &php_session_pgsql_module
+extern zend_module_entry session_pgsql_module_entry;
+#define phpext_session_pgsql_ptr &session_pgsql_module_entry
PS_FUNCS(pgsql);
@@ -66,20 +66,16 @@
#ifdef ZTS
extern int ps_pgsql_globals_id;
-#else
-extern php_ps_pgsql_globals ps_pgsql_globals;
-#endif
-
-#ifdef ZTS
#define PS_PGSQL(v) TSRMG(ps_pgsql_globals_id, php_ps_pgsql_globals *, v)
#else
+extern php_ps_pgsql_globals ps_pgsql_globals;
#define PS_PGSQL(v) (ps_pgsql_globals.v)
#endif
#else
#define ps_pgsql_ptr NULL
-#define phpext_ps_pgsql_ptr NULL
+#define phpext_session_pgsql_ptr NULL
#endif