mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
configure works for me (RH 6.1)
@- Added readline support. Works *only* in standalone mode! (Thies)
This commit is contained in:
parent
ead9008644
commit
185d90fe22
@ -2,6 +2,33 @@ dnl $Id$
|
|||||||
dnl config.m4 for extension readline
|
dnl config.m4 for extension readline
|
||||||
dnl don't forget to call PHP_EXTENSION(readline)
|
dnl don't forget to call PHP_EXTENSION(readline)
|
||||||
|
|
||||||
dnl AC_DEFINE(HAVE_LIBREADLINE, 1)
|
|
||||||
dnl PHP_EXTENSION(readline)
|
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for readline support)
|
||||||
|
AC_ARG_WITH(readline,
|
||||||
|
[ --with-readline[=DIR] Include readline support. DIR is the readline
|
||||||
|
install directory.],
|
||||||
|
[
|
||||||
|
if test "$withval" != "no"; then
|
||||||
|
for i in $withval /usr/local /usr; do
|
||||||
|
if test -f $i/include/readline/readline.h; then
|
||||||
|
READLINE_DIR=$i
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if test "$READLINE_DIR" = ""; then
|
||||||
|
AC_MSG_ERROR(Please reinstall readline - I cannot find readline.h)
|
||||||
|
fi
|
||||||
|
AC_ADD_INCLUDE($READLINE_DIR/include)
|
||||||
|
AC_ADD_LIBRARY_WITH_PATH(readline, $READLINE_DIR/lib)
|
||||||
|
AC_ADD_LIBRARY_WITH_PATH(history, $READLINE_DIR/lib)
|
||||||
|
AC_ADD_LIBRARY(termcap)
|
||||||
|
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
AC_DEFINE(HAVE_LIBREADLINE, 1)
|
||||||
|
PHP_EXTENSION(readline)
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
@ -22,6 +22,13 @@
|
|||||||
#define _PHP_READLINE_H
|
#define _PHP_READLINE_H
|
||||||
|
|
||||||
#if HAVE_LIBREADLINE
|
#if HAVE_LIBREADLINE
|
||||||
|
#ifdef ZTS
|
||||||
|
#error Readline module will *NEVER* be thread-safe
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CGI_BINARY
|
||||||
|
#error Readline module only useable in standalone-binary
|
||||||
|
#endif
|
||||||
|
|
||||||
extern zend_module_entry readline_module_entry;
|
extern zend_module_entry readline_module_entry;
|
||||||
#define phpext_readline_ptr &readline_module_entry
|
#define phpext_readline_ptr &readline_module_entry
|
||||||
|
@ -18,14 +18,16 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* {{{ includes & prototypes */
|
||||||
|
|
||||||
#include "php.h"
|
#include "php.h"
|
||||||
|
#include "php_readline.h"
|
||||||
|
|
||||||
#if HAVE_LIBREADLINE
|
#if HAVE_LIBREADLINE
|
||||||
|
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
|
|
||||||
|
|
||||||
PHP_FUNCTION(readline);
|
PHP_FUNCTION(readline);
|
||||||
PHP_FUNCTION(readline_version);
|
PHP_FUNCTION(readline_version);
|
||||||
|
|
||||||
@ -36,6 +38,9 @@ PHP_FUNCTION(readline_write_history);
|
|||||||
|
|
||||||
PHP_MINIT_FUNCTION(readline);
|
PHP_MINIT_FUNCTION(readline);
|
||||||
|
|
||||||
|
/* }}} */
|
||||||
|
/* {{{ module stuff */
|
||||||
|
|
||||||
static zend_function_entry php_readline_functions[] = {
|
static zend_function_entry php_readline_functions[] = {
|
||||||
PHP_FE(readline, NULL)
|
PHP_FE(readline, NULL)
|
||||||
PHP_FE(readline_version, NULL)
|
PHP_FE(readline_version, NULL)
|
||||||
@ -46,7 +51,7 @@ static zend_function_entry php_readline_functions[] = {
|
|||||||
{NULL, NULL, NULL}
|
{NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
zend_module_entry readline_module_entry = {
|
zend_module_entry readline_module_entry = {
|
||||||
"PHP-Readline",
|
"PHP-Readline",
|
||||||
php_readline_functions,
|
php_readline_functions,
|
||||||
PHP_MINIT(readline),
|
PHP_MINIT(readline),
|
||||||
@ -62,6 +67,7 @@ PHP_MINIT_FUNCTION(readline)
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* }}} */
|
||||||
/* {{{ proto string readline([string prompt]) */
|
/* {{{ proto string readline([string prompt]) */
|
||||||
|
|
||||||
PHP_FUNCTION(readline)
|
PHP_FUNCTION(readline)
|
||||||
|
Loading…
Reference in New Issue
Block a user