forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aegisub-3.2.2_p20160518-fix-system-luajit-build.patch
121 lines (106 loc) · 3.93 KB
/
aegisub-3.2.2_p20160518-fix-system-luajit-build.patch
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
See http://devel.aegisub.org/ticket/1904
and http://devel.aegisub.org/ticket/1913
and http://devel.aegisub.org/ticket/1922
diff --git a/Makefile.inc.in b/Makefile.inc.in
index d8b3f4a..52e4cf6 100644
--- a/Makefile.inc.in
+++ b/Makefile.inc.in
@@ -9,6 +9,7 @@ HAVE_OPENAL = @with_openal@
HAVE_OSS = @with_oss@
HAVE_PORTAUDIO = @with_portaudio@
HAVE_UCHARDET = @with_uchardet@
+SYSTEM_LUAJIT = @with_system_luajit@
##############
# BUILD OUTPUT
diff --git a/automation/Makefile b/automation/Makefile
index 5483dbd..1231aab 100644
--- a/automation/Makefile
+++ b/automation/Makefile
@@ -12,10 +12,16 @@ 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) $(LIBS_PTHREAD)
+ifeq (no, $(SYSTEM_LUAJIT))
+aegisub-lua_OBJ += $(LIBS_LUA)
+else
+aegisub-lua_LIBS += $(LIBS_LUA)
+endif
+
PROGRAM += $(d)aegisub-lua
test-automation: $(PROGRAM)
diff --git a/configure.ac b/configure.ac
index 1649efc..81b1413 100644
--- a/configure.ac
+++ b/configure.ac
@@ -429,13 +429,15 @@ AS_IF([test $with_system_luajit = no],
[AC_SUBST([LUAJIT_CFLAGS], ['-I$(TOP)vendor/luajit/include'])
AC_SUBST([LUAJIT_LIBS], ['$(TOP)vendor/luajit/src/libluajit.a'])])
+AC_SUBST(with_system_luajit)
+
# We also need a Lua binary to run part of the build system
# Which version doesn't matter as the scripts are portable between them
-AC_CHECK_PROGS([LUA], [lua luajit lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1])
+AC_PATH_PROGS([LUA], [luajit lua lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1])
# If the user doesn't have an installed copy of Lua, just use the one built
# as part of building LuaJIT
-AS_IF([test -z $LUA], [LUA="$srcdir/vendor/luajit/src/host/minilua"])
+AS_IF([test -z $LUA], [LUA='$(TOP)vendor/luajit/src/host/minilua'])
######################################################
# Debugging support
diff --git a/header.mk b/header.mk
index 613b38f..a9ce1d7 100644
--- a/header.mk
+++ b/header.mk
@@ -13,7 +13,10 @@ subdirs := \
tests \
tools \
vendor/luabins \
- vendor/luajit
+
+ifeq (no, $(SYSTEM_LUAJIT))
+subdirs += vendor/luajit
+endif
subdirs := $(addprefix $(TOP),$(addsuffix /Makefile,$(subdirs)))
diff --git a/src/Makefile b/src/Makefile
index 0ee6c84..1a6f015 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,7 +6,7 @@ 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)
src_PCH := $(d)agi_pre.h
src_INSTALLNAME := $(AEGISUB_COMMAND)
@@ -111,11 +111,16 @@ 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 \
+ifeq (no, $(SYSTEM_LUAJIT))
+src_OBJ += $(LIBS_LUA)
+else
+src_LIBS += $(LIBS_LUA)
+endif
+
ifeq (yes, $(BUILD_DARWIN))
src_OBJ += $(d)font_file_lister_coretext.o
src_OBJ += $(subst .mm,.o,$(wildcard $(d)osx/*.mm))
diff --git a/tools/Makefile b/tools/Makefile
index de6166a..e3d108a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -12,6 +12,8 @@ repack-thes-dict_CPPFLAGS := -I$(TOP) -I$(TOP)libaegisub/include $(CFLAGS_ICU)
PROGRAM += $(d)repack-thes-dict
-$(TOP)tools/respack.lua: $(shell command -v "$(BIN_LUA)")
+ifeq (no, $(SYSTEM_LUAJIT))
+$(TOP)tools/respack.lua: $(BIN_LUA)
+endif
include $(TOP)Makefile.target