1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
diff --git a/Makefile.inc.in b/Makefile.inc.in
index 5a52d25..6cd16f1 100644
--- a/Makefile.inc.in
+++ b/Makefile.inc.in
@@ -79,7 +79,7 @@ CFLAGS_ICONV = @ICONV_CFLAGS@
CFLAGS_ICU = @ICU_I18N_CFLAGS@
CFLAGS_LIBASS = @LIBASS_CFLAGS@
CFLAGS_LIBPULSE = @LIBPULSE_CFLAGS@
-CFLAGS_LUA = -I$(TOP)vendor/luajit/include
+CFLAGS_LUA = @LUAJIT_CFLAGS@
CFLAGS_OPENAL = @OPENAL_CFLAGS@
CFLAGS_OSS = @OSS_CFLAGS@
CFLAGS_PORTAUDIO = @PORTAUDIO_CFLAGS@
@@ -97,16 +97,12 @@ LIBS_ICONV = @ICONV_LIBS@
LIBS_ICU = @ICU_UC_LIBS@ @ICU_I18N_LIBS@
LIBS_LIBASS = @LIBASS_LIBS@
LIBS_LIBPULSE = @LIBPULSE_LIBS@
-LIBS_LUA = $(TOP)vendor/luajit/src/libluajit.a
+LIBS_LUA = @LUAJIT_LIBS@
LIBS_OPENAL = @OPENAL_LIBS@
LIBS_PORTAUDIO = @PORTAUDIO_LIBS@
LIBS_PTHREAD = @PTHREAD_LIBS@
LIBS_UCHARDET = @UCHARDET_LIBS@
-ifeq (yes, $(BUILD_DARWIN))
-LIBS_LUA = $(TOP)vendor/luajit/src/libluajit-aegisub.so
-endif
-
FONTCONFIG_CONF_DIR = @FONTCONFIG_CONF_DIR@
#####################
diff --git a/automation/Makefile b/automation/Makefile
index d5425b7..121aae7 100644
--- a/automation/Makefile
+++ b/automation/Makefile
@@ -12,9 +12,9 @@ DATA_AUTOMATION_INSTALLED = $(addprefix $(DESTDIR)$(P_DATA)/automation/, $(DATA_
$(DESTDIR)$(P_DATA)/automation/%: $(d)%
$(MKDIR_INSTALL)
-aegisub-lua_OBJ := $(d)tests/aegisub.o $(TOP)lib/libaegisub.a $(TOP)lib/libluabins.a $(LIBS_LUA)
+aegisub-lua_OBJ := $(d)tests/aegisub.o $(TOP)lib/libaegisub.a $(TOP)lib/libluabins.a
aegisub-lua_CPPFLAGS := $(CPPFLAGS_BOOST) $(CFLAGS_LUA) -I$(TOP)libaegisub/include -I$(TOP)src $(CXXFLAGS_WX)
-aegisub-lua_LIBS := $(LIBS_WX) $(LIBS_BOOST) $(LIBS_ICU)
+aegisub-lua_LIBS := $(LIBS_WX) $(LIBS_BOOST) $(LIBS_ICU) $(LIBS_LUA)
PROGRAM += $(d)aegisub-lua
diff --git a/configure.ac b/configure.ac
index 7492568..2c77fcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,8 @@ m4_define([libpulse_required_version], [0.5])
m4_define([pkgconfig_required_version], [0.20])
m4_define([portaudio_required_version], [19])
m4_define([wx_required_version], [3.0.0])
+# Same version as the bundled one
+m4_define([luajit_required_version], [2.0.4])
#######
# Setup
@@ -209,6 +211,7 @@ AS_IF([test x$build_darwin != xyes], [
])
PKG_CHECK_MODULES(LIBASS, libass >= libass_required_version)
+PKG_CHECK_MODULES(LUAJIT, luajit >= luajit_required_version)
AX_BOOST_BASE([boost_required_version])
AX_BOOST_LIB(chrono, BOOST_CHRONO_LIB, [chrono.hpp], [boost::chrono::system_clock::time_point time])
diff --git a/header.mk b/header.mk
index 613b38f..873d4ce 100644
--- a/header.mk
+++ b/header.mk
@@ -13,7 +13,6 @@ subdirs := \
tests \
tools \
vendor/luabins \
- vendor/luajit
subdirs := $(addprefix $(TOP),$(addsuffix /Makefile,$(subdirs)))
diff --git a/src/Makefile b/src/Makefile
index 1fb983c..1fb0acb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,7 +6,8 @@ src_CPPFLAGS := -I$(d) -I.. -I$(d)include -I$(TOP)libaegisub/include -I$(TOP)bui
$(CFLAGS_PTHREAD) $(CFLAGS_FFTW3) $(CFLAGS_ICU) $(CPPFLAGS_BOOST)
src_CXXFLAGS := $(CXXFLAGS_WX)
src_LIBS := $(LIBS_GL) $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE) \
- $(LIBS_LIBASS) $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_BOOST) $(LIBS_ICU)
+ $(LIBS_LIBASS) $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_BOOST) \
+ $(LIBS_ICU) $(LIBS_LUA)
src_PCH := $(d)agi_pre.h
src_INSTALLNAME := $(AEGISUB_COMMAND)
@@ -111,7 +112,6 @@ src_OBJ := \
$(d)video_provider_yuv4mpeg.o \
$(d)video_slider.o \
$(d)visual_feature.o \
- $(LIBS_LUA) \
$(TOP)lib/libaegisub.a \
$(TOP)lib/libluabins.a \
$(TOP)lib/libresrc.a \
@@ -198,10 +198,10 @@ $(d)subtitles_provider.o_FLAGS := $(CFLAGS_LIBASS)
$(d)subtitles_provider_libass.o_FLAGS := $(CFLAGS_LIBASS) -Wno-c++11-narrowing
$(d)text_file_reader.o_FLAGS := -D_X86_
$(d)video_provider_manager.o_FLAGS := $(CFLAGS_FFMS2)
-$(d)auto4_lua.o_FLAGS := -I$(TOP)vendor/luajit/include
-$(d)auto4_lua_assfile.o_FLAGS := -I$(TOP)vendor/luajit/include
-$(d)auto4_lua_dialog.o_FLAGS := -I$(TOP)vendor/luajit/include
-$(d)auto4_lua_progresssink.o_FLAGS := -I$(TOP)vendor/luajit/include
+$(d)auto4_lua.o_FLAGS := $(CFLAGS_LUA)
+$(d)auto4_lua_assfile.o_FLAGS := $(CFLAGS_LUA)
+$(d)auto4_lua_dialog.o_FLAGS := $(CFLAGS_LUA)
+$(d)auto4_lua_progresssink.o_FLAGS := $(CFLAGS_LUA)
$(src_OBJ): $(d)libresrc/bitmap.h $(d)libresrc/default_config.h
diff --git a/src/libresrc/Makefile b/src/libresrc/Makefile
index 6441856..0562eb1 100644
--- a/src/libresrc/Makefile
+++ b/src/libresrc/Makefile
@@ -10,7 +10,7 @@ resrc_OBJ := \
$(resrc_OBJ): $(d)default_config.h $(d)bitmap.h $(d)default_config.cpp $(d)bitmap.cpp
-RESPACK := cd $(TOP)src/libresrc; $(TOP)vendor/luajit/src/host/minilua $(TOP)tools/respack.lua
+RESPACK := cd $(TOP)src/libresrc; luajit $(TOP)tools/respack.lua
$(d)bitmap.cpp: $(d)bitmap.h
$(d)default_config.cpp: $(d)default_config.h
diff --git a/tools/Makefile b/tools/Makefile
index cbf985a..da1d3ef 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -12,6 +12,4 @@ repack-thes-dict_CPPFLAGS := -I$(TOP) -I$(TOP)libaegisub/include $(CFLAGS_ICU)
PROGRAM += $(d)repack-thes-dict
-$(TOP)tools/respack.lua: $(TOP)vendor/luajit/src/host/minilua
-
include $(TOP)Makefile.target
diff --git a/tools/respack.lua b/tools/respack.lua
index 1281ac2..35630a2 100755
--- a/tools/respack.lua
+++ b/tools/respack.lua
@@ -1,4 +1,4 @@
-#!../vendor/luajit/src/host/minilua
+#!/usr/bin/env luajit
-- Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org>
--
-- Permission to use, copy, modify, and distribute this software for any
|