Skip to content

Commit

Permalink
Merge branch 'no-moar-linenoise'
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelzro committed Apr 24, 2015
2 parents cc08ed5 + 0bff027 commit 343ff5b
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 127 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
@@ -1,6 +1,3 @@
[submodule "3rdparty/linenoise"]
path = 3rdparty/linenoise
url = https://github.com/MoarVM/linenoise.git
[submodule "3rdparty/libuv"]
path = 3rdparty/libuv
url = https://github.com/joyent/libuv.git
Expand Down
1 change: 0 additions & 1 deletion 3rdparty/linenoise
Submodule linenoise deleted from 9a580a
39 changes: 3 additions & 36 deletions Configure.pl 100644 → 100755
Expand Up @@ -31,8 +31,8 @@
debug:s optimize:s instrument!
os=s shell=s toolchain=s compiler=s
ar=s cc=s ld=s make=s has-sha has-libuv
static use-readline has-libtommath has-libatomic_ops
has-dyncall has-linenoise
static has-libtommath has-libatomic_ops
has-dyncall
build=s host=s big-endian jit! enable-jit lua=s has-dynasm
prefix=s bindir=s libdir=s mastdir=s make-install asan),
'no-optimize|nooptimize' => sub { $args{optimize} = 0 },
Expand Down Expand Up @@ -73,7 +73,6 @@
$args{instrument} //= 0;
$args{static} //= 0;

$args{'use-readline'} //= 0;
$args{'big-endian'} //= 0;
$args{'has-libtommath'} //= 0;
$args{'has-sha'} //= 0;
Expand Down Expand Up @@ -148,14 +147,6 @@
$config{lddebugflags} //= $config{ccdebugflags};
$config{ldinstflags} //= $config{ccinstflags};

# choose between Linenoise and GNU Readline
if ($args{'use-readline'}) {
$config{hasreadline} = 1;
$defaults{-thirdparty}->{ln} = undef;
unshift @{$config{usrlibs}}, 'readline';
}
else { $config{hasreadline} = 0 }

if ($args{'has-sha'}) {
$config{shaincludedir} = '/usr/include/sha';
$defaults{-thirdparty}->{sha} = undef;
Expand Down Expand Up @@ -253,16 +244,6 @@
. "\t\$(CP) 3rdparty/dyncall/dyncallback/*.h \$(DESTDIR)\$(PREFIX)/include/dyncall\n";
}

if ($args{'has-linenoise'}) {
unshift @{$config{usrlibs}}, 'linenoise';
$defaults{-thirdparty}->{ln} = undef;
}
else {
$config{cincludes} .= ' ' . $defaults{ccinc} . '3rdparty/linenoise';
$config{install} .= "\t\$(MKPATH) \$(DESTDIR)\$(PREFIX)/include/linenoise\n"
. "\t\$(CP) 3rdparty/linenoise/*.h \$(DESTDIR)\$(PREFIX)/include/linenoise\n";
}

if ($args{'jit'}) {
if ($Config{archname} =~ m/^x86_64|^amd64|^darwin(-thread)?(-multi)?-2level/) {
$config{jit} = '$(JIT_POSIX_X64)';
Expand Down Expand Up @@ -723,7 +704,7 @@ =head1 SYNOPSIS
[--toolchain <toolchain>] [--compiler <compiler>]
[--ar <ar>] [--cc <cc>] [--ld <ld>] [--make <make>]
[--debug] [--optimize] [--instrument]
[--static] [--use-readline] [--prefix]
[--static] [--prefix]
[--has-libtommath] [--has-sha] [--has-libuv]
[--has-libatomic_ops] [--has-dynasm]
[--lua <lua>] [--asan] [--no-jit]
Expand Down Expand Up @@ -817,15 +798,6 @@ =head1 OPTIONS
Build MoarVM as a static library instead of a shared one.
=item --use-readline
Disable Linenoise and try to use the system version of GNU Readline
instead.
You must not supply this flag if you create derivative work of
MoarVM - including binary packages of MoarVM itself - that you wish
to distribute under a license other than the GNU GPL.
=item --build <build-triple> --host <host-triple>
Set up cross-compilation.
Expand Down Expand Up @@ -872,11 +844,6 @@ =head1 OPTIONS
=item --has-dyncall
=item --has-linenoise
Link moar executable with libs provided by the system instead of building
and installing an own version from MoarVM's source tree.
=item --no-jit
Disable JIT compiler, which is enabled by default to JIT-compile hot frames.
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Expand Up @@ -26,7 +26,6 @@ Unofficial summary of the intended application of the Artistic License 2.0:
- dyncall MIT
- libtommath Public Domain
- libuv MIT,BSD,ISC
- linenoise BSD
- msinttypes MIT
- sha1 Public Domain
- tinymt MIT
Expand Down
5 changes: 0 additions & 5 deletions build/Makefile.in
Expand Up @@ -542,10 +542,6 @@ dasm_all: src/jit/emit_win32_x64.c src/jit/emit_posix_x64.c
$(MSG) linking $@
$(CMD)@sharule@ $(NOOUT)

@lnlib@: @lnobjects@
$(MSG) linking $@
$(CMD)@lnrule@ $(NOOUT)

@mtlib@: @mtobjects@
$(MSG) linking $@
$(CMD)@mtrule@ $(NOOUT)
Expand All @@ -572,7 +568,6 @@ realclean: clean
-$(CMD)@laoclean@ $(NOOUT) $(NOERR)
-$(CMD)@tomclean@ $(NOOUT) $(NOERR)
-$(CMD)@shaclean@ $(NOOUT) $(NOERR)
-$(CMD)@lnclean@ $(NOOUT) $(NOERR)
-$(CMD)@mtclean@ $(NOOUT) $(NOERR)
-$(CMD)@dcclean@ $(NOOUT) $(NOERR)

Expand Down
1 change: 0 additions & 1 deletion build/check.mk.in
Expand Up @@ -3,7 +3,6 @@ CINCLUDES := -Isrc \
-isystem 3rdparty/libatomic_ops/src \
-isystem 3rdparty/libtommath \
-isystem 3rdparty/sha1 \
-isystem 3rdparty/linenoise \
-isystem 3rdparty/dynasm \
-isystem 3rdparty/dyncall/dynload \
-isystem 3rdparty/dyncall/dyncall \
Expand Down
5 changes: 0 additions & 5 deletions build/config.h.in
Expand Up @@ -28,11 +28,6 @@
#define MVM_BIGENDIAN @be@
#endif

/* Readline detection */
#if @hasreadline@
#define MVM_HAS_READLINE @hasreadline@
#endif

/* pthread_yield() detection */
#if @has_pthread_yield@
#define MVM_HAS_PTHREAD_YIELD @has_pthread_yield@
Expand Down
7 changes: 0 additions & 7 deletions build/setup.pm
Expand Up @@ -23,12 +23,6 @@ our %TP_TOM = (
src => [ '3rdparty/libtommath' ],
);

our %TP_LN = (
name => 'linenoise',
path => '3rdparty/linenoise',
src => [ '3rdparty/linenoise' ],
);

our %TP_MT = (
name => 'tinymt',
path => '3rdparty/tinymt',
Expand Down Expand Up @@ -73,7 +67,6 @@ our %THIRDPARTY = (
lao => { %TP_LAO },
tom => { %TP_TOM },
sha => { %TP_SHA },
ln => { %TP_LN },
mt => { %TP_MT },
dc => { %TP_DC },
dcb => { %TP_DCB },
Expand Down
1 change: 0 additions & 1 deletion src/core/interp.c
Expand Up @@ -3265,7 +3265,6 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
cur_op += 4;
goto NEXT;
OP(readlineint_fh):
GET_REG(cur_op, 0).s = MVM_file_readline_interactive_fh(tc, GET_REG(cur_op, 2).o, GET_REG(cur_op, 4).s);
cur_op += 6;
goto NEXT;
OP(chdir):
Expand Down
59 changes: 0 additions & 59 deletions src/io/fileops.c
Expand Up @@ -15,19 +15,6 @@
#define DEFAULT_MODE _S_IWRITE /* work around sucky libuv defaults */
#endif

#if MVM_HAS_READLINE
#ifdef __cplusplus
extern "C" {
#endif
char *readline(const char *);
void add_history(const char*);
#ifdef __cplusplus
}
#endif
#else
#include <linenoise.h>
#endif

static uv_stat_t file_info(MVMThreadContext *tc, MVMString *filename, MVMint32 use_lstat) {
char * const a = MVM_string_utf8_encode_C_string(tc, filename);
uv_fs_t req;
Expand Down Expand Up @@ -324,52 +311,6 @@ FILE_IS(writable, W)
FILE_IS(executable, X)
#endif

/* Readline interactive; needs a re-visit soon. */
MVMString * MVM_file_readline_interactive_fh(MVMThreadContext *tc, MVMObject *oshandle, MVMString *prompt) {
MVMString *return_str = NULL;
char *line;
char * const prompt_str = MVM_string_utf8_encode_C_string(tc, prompt);
MVMOSHandle *h = (MVMOSHandle *) oshandle;
MVMIOSyncStreamData *data = (MVMIOSyncStreamData *)h->body.data;

#if MVM_HAS_READLINE
line = readline(prompt_str);

MVM_free(prompt_str);

if (line) {
if (*line)
add_history(line);

return_str = MVM_string_decode(tc, tc->instance->VMString, line, strlen(line), MVM_encoding_type_utf8);

MVM_free(line);
} else {
data->eof = 1;
}

#else /* !MVM_HAS_READLINE */
line = linenoise(prompt_str);

MVM_free(prompt_str);

if (line) {
if (*line) {
linenoiseHistoryAdd(line);
}

return_str = MVM_string_decode(tc, tc->instance->VMString, line, strlen(line), MVM_encoding_type_utf8);

MVM_free(line);
} else {
data->eof = 1;
}

#endif /* MVM_HAS_READLINE */

return return_str;
}

/* Read all of a file into a string. */
MVMString * MVM_file_slurp(MVMThreadContext *tc, MVMString *filename, MVMString *encoding) {
MVMString *mode = MVM_string_utf8_decode(tc, tc->instance->VMString, "r", 1);
Expand Down
1 change: 0 additions & 1 deletion src/io/fileops.h
Expand Up @@ -33,7 +33,6 @@ MVMint64 MVM_file_exists(MVMThreadContext *tc, MVMString *f, MVMint32 use_lstat)
MVMint64 MVM_file_isreadable(MVMThreadContext *tc, MVMString *filename, MVMint32 use_lstat);
MVMint64 MVM_file_iswritable(MVMThreadContext *tc, MVMString *filename, MVMint32 use_lstat);
MVMint64 MVM_file_isexecutable(MVMThreadContext *tc, MVMString *filename, MVMint32 use_lstat);
MVMString * MVM_file_readline_interactive_fh(MVMThreadContext *tc, MVMObject *oshandle, MVMString *prompt);
MVMString * MVM_file_slurp(MVMThreadContext *tc, MVMString *filename, MVMString *encoding);
void MVM_file_spew(MVMThreadContext *tc, MVMString *output, MVMString *filename, MVMString *encoding);
MVMObject * MVM_file_get_stdstream(MVMThreadContext *tc, MVMuint8 type, MVMuint8 readable);
Expand Down
7 changes: 1 addition & 6 deletions src/io/io.h
Expand Up @@ -10,7 +10,7 @@ struct MVMIOOps {
const MVMIOAsyncWritable *async_writable;
const MVMIOSeekable *seekable;
const MVMIOSockety *sockety;
const MVMIOInteractive *interactive;
const void *former_interactive;
const MVMIOLockable *lockable;

/* How to mark the handle's data, if needed. */
Expand Down Expand Up @@ -77,11 +77,6 @@ struct MVMIOSockety {
MVMObject * (*accept) (MVMThreadContext *tc, MVMOSHandle *h);
};

/* I/O operations on handles that can do interactive readline. */
struct MVMIOInteractive {
MVMString * (*read_line) (MVMThreadContext *tc, MVMOSHandle *h, MVMString *prompt);
};

/* I/O operations on handles that can lock/unlock. */
struct MVMIOLockable {
MVMint64 (*lock) (MVMThreadContext *tc, MVMOSHandle *h, MVMint64 flag);
Expand Down
2 changes: 1 addition & 1 deletion tools/release.sh
Expand Up @@ -3,7 +3,7 @@ VERSION=$1
exec >MANIFEST
echo MANIFEST
git ls-files | perl -ne "print unless /^3rdparty\/\w+$/"
for submod in 3rdparty/dyncall/ 3rdparty/libuv/ 3rdparty/linenoise/ 3rdparty/dynasm/; do
for submod in 3rdparty/dyncall/ 3rdparty/libuv/ 3rdparty/dynasm/; do
cd $submod
git ls-files | perl -pe "s{^}{$submod}"
cd ../..;
Expand Down

0 comments on commit 343ff5b

Please sign in to comment.