summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2005-11-17 08:37:31 +0000
committerfoobar <sniper@php.net>2005-11-17 08:37:31 +0000
commitc127df868eb5f473d79a25d2370bb0798064dbfc (patch)
tree149a1b9bbd1f1d6c1aff5db8167434a4bdae5973
parentb5c8fcb5fafdec4ac18c8b73b71a17c6d3e0a5a0 (diff)
downloadphp-git-c127df868eb5f473d79a25d2370bb0798064dbfc.tar.gz
MFH: - Fix compile failure when ext/readline is compiled as shared (bug #35249)
-rw-r--r--sapi/cli/php_cli.c13
-rw-r--r--sapi/cli/php_cli_readline.c7
2 files changed, 9 insertions, 11 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index d5cde26c02..763537d983 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -70,11 +70,12 @@
#include <unixlib/local.h>
#endif
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
#include <readline/readline.h>
#if !HAVE_LIBEDIT
#include <readline/history.h>
#endif
+#include "php_cli_readline.h"
#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
#include "zend_compile.h"
@@ -82,9 +83,7 @@
#include "zend_highlight.h"
#include "zend_indent.h"
-
#include "php_getopt.h"
-#include "php_cli_readline.h"
#ifndef O_BINARY
#define O_BINARY 0
@@ -100,7 +99,7 @@
static char *php_optarg = NULL;
static int php_optind = 1;
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
static char php_last_char = '\0';
#endif
@@ -212,7 +211,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC)
uint remaining = str_length;
size_t ret;
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
if (!str_length) {
return 0;
}
@@ -390,7 +389,7 @@ static void php_cli_usage(char *argv0)
" %s [options] -- [args...]\n"
" %s [options] -a\n"
"\n"
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
" -a Run as interactive shell\n"
#else
" -a Run interactively\n"
@@ -977,7 +976,7 @@ int main(int argc, char *argv[])
cli_register_file_handles(TSRMLS_C);
}
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
if (interactive) {
char *line;
size_t size = 4096, pos = 0, len;
diff --git a/sapi/cli/php_cli_readline.c b/sapi/cli/php_cli_readline.c
index ccdf6bd8f8..301a1534a2 100644
--- a/sapi/cli/php_cli_readline.c
+++ b/sapi/cli/php_cli_readline.c
@@ -20,6 +20,9 @@
/* $Id$ */
#include "php.h"
+
+#if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
+
#include "php_globals.h"
#include "php_variables.h"
#include "zend_hash.h"
@@ -42,20 +45,16 @@
#include <unixlib/local.h>
#endif
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
#include <readline/readline.h>
#if !HAVE_LIBEDIT
#include <readline/history.h>
#endif
-#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */
#include "zend_compile.h"
#include "zend_execute.h"
#include "zend_highlight.h"
#include "zend_indent.h"
-#if HAVE_LIBREADLINE || HAVE_LIBEDIT
-
/* {{{ cli_is_valid_code
*/
typedef enum {