Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Replace LuaJIT with moonjit
Browse files Browse the repository at this point in the history
Make 2.2.0 and later identify itself a bit more distinctly while still
maintaining the same binary and sonames.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
  • Loading branch information
siddhesh committed Jan 14, 2020
1 parent 240ccae commit f409987
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
===============================================================================
Moonjit -- a Just-In-Time Compiler for Lua.

Copyright (C) 2019 moonjit developers.
Copyright (C) 2019-2020 moonjit developers.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ DPREFIX= $(DESTDIR)$(PREFIX)
INSTALL_BIN= $(DPREFIX)/bin
INSTALL_LIB= $(DPREFIX)/$(MULTILIB)
INSTALL_SHARE= $(DPREFIX)/share
INSTALL_INC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)
INSTALL_INC= $(DPREFIX)/include/moonjit-$(MAJVER).$(MINVER)

INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION)
INSTALL_LJLIBD= $(INSTALL_SHARE)/moonjit-$(VERSION)
INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
INSTALL_LMODD= $(INSTALL_SHARE)/lua
INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)
Expand All @@ -44,7 +44,7 @@ INSTALL_CMOD= $(INSTALL_CMODD)/$(ABIVER)
INSTALL_MAN= $(INSTALL_SHARE)/man/man1
INSTALL_PKGCONFIG= $(INSTALL_LIB)/pkgconfig

INSTALL_TNAME= luajit-$(VERSION)
INSTALL_TNAME= moonjit-$(VERSION)
INSTALL_TSYMNAME= luajit
INSTALL_ANAME= libluajit-$(ABIVER).a
INSTALL_SOSHORT1= libluajit-$(ABIVER).so
Expand Down Expand Up @@ -113,12 +113,12 @@ endif
LUAJIT_BIN= src/luajit

default all $(LUAJIT_BIN):
@echo "==== Building LuaJIT $(VERSION) ===="
@echo "==== Building moonjit $(VERSION) ===="
$(MAKE) -C src
@echo "==== Successfully built LuaJIT $(VERSION) ===="
@echo "==== Successfully built moonjit $(VERSION) ===="

install: $(LUAJIT_BIN)
@echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
@echo "==== Installing moonjit $(VERSION) to $(PREFIX) ===="
$(MKDIR) $(INSTALL_DIRS)
cd src && $(INSTALL_X) $(FILE_T) $(INSTALL_T)
cd src && test -f $(FILE_A) && $(INSTALL_F) $(FILE_A) $(INSTALL_STATIC) || :
Expand All @@ -135,11 +135,11 @@ install: $(LUAJIT_BIN)
cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)
@echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
@echo "==== Successfully installed moonjit $(VERSION) to $(PREFIX) ===="


uninstall:
@echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ===="
@echo "==== Uninstalling moonjit $(VERSION) from $(PREFIX) ===="
$(UNINSTALL) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
for file in $(FILES_JITLIB); do \
$(UNINSTALL) $(INSTALL_JITLIB)/$$file; \
Expand All @@ -149,23 +149,23 @@ uninstall:
done
$(LDCONFIG) $(INSTALL_LIB)
$(RMDIR) $(UNINSTALL_DIRS) || :
@echo "==== Successfully uninstalled LuaJIT $(VERSION) from $(PREFIX) ===="
@echo "==== Successfully uninstalled moonjit $(VERSION) from $(PREFIX) ===="

check: $(LUAJIT_BIN)
@echo "==== Running tests for LuaJIT $(VERSION) ===="
@echo "==== Running tests for moonjit $(VERSION) ===="
cd test && ../$^ test.lua
@echo "==== All tests for LuaJIT $(VERSION) succeeded ===="
@echo "==== All tests for moonjit $(VERSION) succeeded ===="

# It is assumed that libluajit.a is built in the process of building LUAJIT_BIN.
bench: $(LUAJIT_BIN)
@echo "==== Running benchmark for LuaJIT $(VERSION) ===="
@echo "==== Running benchmark for moonjit $(VERSION) ===="
make -C bench FILE_A=$(FILE_A)
@echo "==== Successfully finished running benchmark for LuaJIT $(VERSION) ===="
@echo "==== Successfully finished running benchmark for moonjit $(VERSION) ===="

##############################################################################

amalg:
@echo "Building LuaJIT $(VERSION)"
@echo "Building moonjit $(VERSION)"
$(MAKE) -C src amalg

clean:
Expand Down
2 changes: 1 addition & 1 deletion doc/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ prevents implementing features that would otherwise break the Lua/C API and ABI

### Extensions from Lua 5.3

LuaJIT supports some extensions from Lua 5.3:
Moonjit supports some extensions from Lua 5.3:

* Unicode escape `'\u{XX...}'` embeds the UTF-8 encoding in string literals.
* The argument table arg can be read (and modified) by `LUA_INIT` and `-e` chunks.
Expand Down
5 changes: 3 additions & 2 deletions doc/jit.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ strings for CPU-specific features and enabled optimizations.

## jit.version

Contains the moonjit version string. Note that moonjit currently masquerades
as LuaJIT to support existing users of LuaJIT.
Contains the moonjit version string. Note that moonjit 2.1.x releases
masquerade as LuaJIT to support existing users of LuaJIT. moonjit 2.2.0 and
later no longer do this and identify as `moonjit`.

## jit.version\_num

Expand Down
2 changes: 1 addition & 1 deletion doc/moonjit.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Here are the available moonjit control commands:
* `-jdump` — Dumps the code and structures used in various compiler stages.
* `-jp` — Start the integrated profiler.

The `-jv` and `-jdump` commands are extension modules written in Lua. They are mainly used for debugging the JIT compiler itself. For a description of their options and output format, please read the comment block at the start of their source. They can be found in the `lib` directory of the source distribution or installed under the `jit` directory. By default this is `/usr/local/share/luajit-<version>/jit` on POSIX systems.
The `-jv` and `-jdump` commands are extension modules written in Lua. They are mainly used for debugging the JIT compiler itself. For a description of their options and output format, please read the comment block at the start of their source. They can be found in the `lib` directory of the source distribution or installed under the `jit` directory. By default this is `/usr/local/share/moonjit-<version>/jit` on POSIX systems.

### `-O[level]`
### `-O[+]flag -O-flag`
Expand Down
8 changes: 4 additions & 4 deletions etc/luajit.pc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Package information for LuaJIT to be used by pkg-config.
# Package information for moonjit to be used by pkg-config.
majver=2
minver=2
relver=0
Expand All @@ -10,14 +10,14 @@ multilib=lib
exec_prefix=${prefix}
libdir=${exec_prefix}/${multilib}
libname=luajit-${abiver}
includedir=${prefix}/include/luajit-${majver}.${minver}
includedir=${prefix}/include/moonjit-${majver}.${minver}

INSTALL_LMOD=${prefix}/share/lua/${abiver}
INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver}

Name: LuaJIT
Name: moonjit
Description: Just-in-time compiler for Lua
URL: http://luajit.org
URL: https://github.com/moonjit/moonjit
Version: ${version}
Requires:
Libs: -L${libdir} -l${libname}
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,6 @@ $(LUAJIT_T): $(TARGET_O) $(LUAJIT_O) $(TARGET_DEP)
$(E) "LINK $@"
$(Q)$(TARGET_LD) $(TARGET_ALDFLAGS) -o $@ $(LUAJIT_O) $(TARGET_O) $(TARGET_ALIBS)
$(Q)$(TARGET_STRIP) $@
$(E) "OK Successfully built LuaJIT"
$(E) "OK Successfully built moonjit"

##############################################################################
2 changes: 1 addition & 1 deletion src/luaconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#endif
#define LUA_LROOT "/usr/local"
#define LUA_LUADIR "/lua/5.1/"
#define LUA_LJDIR "/luajit-2.2.0/"
#define LUA_LJDIR "/moonjit-2.2.0/"

#ifdef LUA_ROOT
#define LUA_JROOT LUA_ROOT
Expand Down

0 comments on commit f409987

Please sign in to comment.