Make Lua 5.1 a required dependency

This commit is contained in:
Thomas Goyne 2013-04-10 19:59:02 -07:00
parent c556a47509
commit 68662211a1
12 changed files with 29 additions and 83 deletions

View file

@ -2,7 +2,6 @@
# AEGISUB FEATURE SUPPORT
#########################
HAVE_ALSA = @with_alsa@
HAVE_AUTO4_LUA = @with_auto4_lua@
HAVE_HUNSPELL = @with_hunspell@
HAVE_OPENAL = @with_openal@
HAVE_OSS = @with_oss@

View file

@ -53,7 +53,6 @@
<!-- Automation Lua support -->
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>WITH_AUTO4_LUA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(AegisubContribBase)lua51\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>

View file

@ -399,24 +399,19 @@ AGI_OPT_PKG(hunspell, [build without hunspell spell-checking [auto]], [Enable Hu
############
# Automation
############
AC_ARG_WITH(lua,
AS_HELP_STRING([--without-lua],
[build without lua 5.1 (auto4)]))
# First try pkg-config with several names
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1 lua5.1 < 5.2, [], [
PKG_CHECK_MODULES(LUA, lua-5.1 >= 5.1 lua-5.1 < 5.2, [], [
PKG_CHECK_MODULES(LUA, lua >= 5.1 lua < 5.2, [], [
# Still not found so try to autodetect
AS_IF([test -z "$LUA_CFLAGS"],
[AGI_FIND_HEADER([LUA], [lua.hpp],
[/usr/include/lua5.1 /usr/include/lua51 /usr/local/include/lua51 /usr/local/include/lua5.1 /usr/include /usr/local/include])])
AS_IF([test x$with_lua = xno], [$with_auto4_lua="no"; lua_disabled="(disabled)"], [
# First try pkg-config with several names
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1 lua5.1 < 5.2, [with_auto4_lua="yes"], [
PKG_CHECK_MODULES(LUA, lua-5.1 >= 5.1 lua-5.1 < 5.2, [with_auto4_lua="yes"], [
PKG_CHECK_MODULES(LUA, lua >= 5.1 lua < 5.2, [with_auto4_lua="yes"], [
# Still not found so try to autodetect
AS_IF([test -z "$LUA_CFLAGS"],
[AGI_FIND_HEADER([LUA], [lua.hpp],
[/usr/include/lua5.1 /usr/include/lua51 /usr/local/include/lua51 /usr/local/include/lua5.1 /usr/include /usr/local/include])])
AS_IF([test -z "$LUA_LIBS"],
[AGI_FIND_LIB([LUA], [lua51 lua-5.1 lua5.1 lua], [])])
AS_IF([test -z "$LUA_LIBS"],
[AGI_FIND_LIB([LUA], [lua51 lua-5.1 lua5.1 lua], [])])
AC_AGI_COMPILE([Lua 5.1 (auto4)], [lua], [$LUA_CFLAGS], [$LUA_LIBS],[
AC_AGI_COMPILE([Lua 5.1 (auto4)], [lua], [$LUA_CFLAGS], [$LUA_LIBS],[
#include <lua.hpp>
int main () {
@ -426,15 +421,10 @@ int main () {
lua_close(L);
return !res;
}])
AS_IF([test x$agi_cv_with_lua = xno && test x$with_lua = xyes],
[AC_MSG_FAILURE([--with-lua was specified, but lua 5.1 could not be found. Try setting LUA_CLFAGS and LUA_LIBS manually])])
with_auto4_lua=$agi_cv_with_lua
])])])
])
AS_IF([test x$agi_cv_with_lua = xno],
[AC_MSG_FAILURE([Lua 5.1 could not be found. Try setting LUA_CLFAGS and LUA_LIBS manually])])
])])])
AS_IF([test x$with_auto4_lua = xyes], AC_DEFINE(WITH_AUTO4_LUA, 1, [Enable Automation (auto4), requires lua]))
AC_SUBST(with_auto4_lua)
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS)
@ -719,9 +709,6 @@ Configure settings
Default Settings
Audio Player: $DEFAULT_PLAYER_AUDIO
Scripting Engines
auto4 Lua: $with_auto4_lua $lua51_disabled
Audio Players
ALSA: $with_alsa $alsa_disabled
OpenAL: $with_openal $openal_disabled

View file

@ -10,11 +10,10 @@ AEGISUB_CFLAGS = -I. -I.. -Iinclude -I../libaegisub/include -I../build -DAEGISUB
CFLAGS += $(AEGISUB_CFLAGS)
CXXFLAGS += $(AEGISUB_CFLAGS) -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX)
LIBS := -L../libaegisub -laegisub $(LIBS)
LIBS += $(LIBS_CCMALLOC) $(LIBS_EFENCE) $(LIBS_GL)
LIBS += $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE)
LIBS += $(LIBS_FONTCONFIG) $(LIBS_FFTW3)
LIBS += $(LIBS_UCHARDET) $(LIBS_BOOST) $(LIBS_ICU)
LIBS := -L../libaegisub -laegisub $(LIBS) $(LIBS_CCMALLOC) $(LIBS_EFENCE)
LIBS += $(LIBS_GL) $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE)
LIBS += $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_UCHARDET) $(LIBS_BOOST)
LIBS += $(LIBS_ICU) $(LIBS_LUA)
LDFLAGS += $(LDFLAGS_CCMALLOC)
@ -88,17 +87,6 @@ else
EXTRA_DIST += subtitles_provider_libass.cpp
endif
############
# AUTOMATION
############
ifeq (yes, $(HAVE_AUTO4_LUA))
auto4_lua.o auto4_lua_assfile.o auto4_lua_dialog.o auto4_lua_progresssink.o auto4_lua_regex.o auto4_lua_scriptreader.o: CXXFLAGS += $(CFLAGS_LUA)
LIBS += $(LIBS_LUA)
SRC += auto4_lua.cpp auto4_lua_assfile.cpp auto4_lua_dialog.cpp auto4_lua_progresssink.cpp auto4_regex.cpp auto4_lua_scriptreader.cpp
else
EXTRA_DIST += auto4_lua.cpp auto4_lua_assfile.cpp auto4_lua_dialog.cpp auto4_lua_progresssink.cpp auto4_regex.cpp auto4_lua_scriptreader.cpp
endif
##############
# MISCELLANOUS
##############
@ -120,6 +108,7 @@ charset_detect.o: CXXFLAGS += -D_X86_
font_file_lister_fontconfig.o: CXXFLAGS += $(CFLAGS_FONTCONFIG)
text_file_reader.o: CXXFLAGS += -D_X86_
video_provider_manager.o: CXXFLAGS += $(CFLAGS_FFMS2)
auto4_lua.o auto4_lua_assfile.o auto4_lua_dialog.o auto4_lua_progresssink.o auto4_lua_regex.o auto4_lua_scriptreader.o: CXXFLAGS += $(CFLAGS_LUA)
SRC += \
MatroskaParser.c \
@ -137,14 +126,15 @@ SRC += \
ass_style_storage.cpp \
ass_time.cpp \
audio_box.cpp \
audio_controller.cpp \
audio_colorscheme.cpp \
audio_controller.cpp \
audio_display.cpp \
audio_karaoke.cpp \
audio_marker.cpp \
audio_player.cpp \
audio_provider.cpp \
audio_provider_convert.cpp \
audio_provider_dummy.cpp \
audio_provider_hd.cpp \
audio_provider_lock.cpp \
audio_provider_pcm.cpp \
@ -155,6 +145,12 @@ SRC += \
audio_timing_dialogue.cpp \
audio_timing_karaoke.cpp \
auto4_base.cpp \
auto4_lua.cpp \
auto4_lua_assfile.cpp \
auto4_lua_dialog.cpp \
auto4_lua_progresssink.cpp \
auto4_lua_scriptreader.cpp \
auto4_regex.cpp \
avisynth_wrap.cpp \
base_grid.cpp \
charset_detect.cpp \
@ -191,7 +187,6 @@ SRC += \
dialog_translation.cpp \
dialog_version_check.cpp \
dialog_video_details.cpp \
audio_provider_dummy.cpp \
export_fixstyle.cpp \
export_framerate.cpp \
fft.cpp \
@ -213,9 +208,9 @@ SRC += \
plugin_manager.cpp \
preferences.cpp \
preferences_base.cpp \
search_replace_engine.cpp \
scintilla_text_ctrl.cpp \
scintilla_text_selection_controller.cpp \
search_replace_engine.cpp \
spellchecker.cpp \
spline.cpp \
spline_curve.cpp \
@ -239,8 +234,8 @@ SRC += \
text_file_reader.cpp \
text_file_writer.cpp \
thesaurus.cpp \
timeedit_ctrl.cpp \
threaded_frame_source.cpp \
timeedit_ctrl.cpp \
toggle_bitmap.cpp \
toolbar.cpp \
tooltip_manager.cpp \

View file

@ -34,8 +34,6 @@
#include "config.h"
#ifdef WITH_AUTO4_LUA
#include "auto4_lua.h"
#include "auto4_lua_utils.h"
@ -900,5 +898,3 @@ namespace Automation4 {
return 0;
}
}
#endif // WITH_AUTO4_LUA

View file

@ -34,7 +34,6 @@
#include "config.h"
#ifdef WITH_AUTO4_LUA
#include "auto4_lua.h"
#include "auto4_lua_utils.h"
@ -634,5 +633,3 @@ namespace Automation4 {
// Leaves userdata object on stack
}
}
#endif // WITH_AUTO4_LUA

View file

@ -34,8 +34,6 @@
#include "config.h"
#ifdef WITH_AUTO4_LUA
#include "auto4_lua.h"
#include "ass_style.h"
@ -586,5 +584,3 @@ namespace Automation4 {
evt.Skip();
}
}
#endif // WITH_AUTO4_LUA

View file

@ -34,7 +34,6 @@
#include "config.h"
#ifdef WITH_AUTO4_LUA
#include "auto4_lua.h"
#include "auto4_lua_utils.h"
@ -250,5 +249,3 @@ namespace Automation4 {
return 1;
}
}
#endif

View file

@ -19,8 +19,6 @@
#include "config.h"
#ifdef WITH_AUTO4_LUA
#include "auto4_lua_scriptreader.h"
#include "charset_detect.h"
@ -65,5 +63,3 @@ namespace Automation4 {
return static_cast<LuaScriptReader*>(data)->Read(size);
}
}
#endif // WITH_AUTO4_LUA

View file

@ -16,7 +16,6 @@
#include "config.h"
#ifdef WITH_AUTO4_LUA
#include "auto4_lua_utils.h"
#include <boost/regex/icu.hpp>
@ -205,4 +204,3 @@ int regex_init(lua_State *L) {
return 1;
}
}
#endif

View file

@ -55,9 +55,7 @@ AboutScreen::AboutScreen(wxWindow *parent)
libString += " wxStyledTextCtrl - Copyright (c) Robin Dunn, Neil Hodgson;\n";
libString += " Scintilla - Copyright (c) Neil Hodgson;\n";
libString += " UniversalCharDet - Copyright (c) Netscape Communications Corp.;\n";
#ifdef WITH_AUTO4_LUA
libString += " Lua - Copyright (c) Lua.org, PUC-Rio;\n";
#endif
#ifdef WITH_HUNSPELL
libString += " Hunspell - Copyright (c) Kevin Hendricks;\n";
#endif

View file

@ -40,10 +40,7 @@
#include "include/aegisub/subtitles_provider.h"
#include "plugin_manager.h"
#include "video_provider_manager.h"
#ifdef WITH_AUTO4_LUA
#include "auto4_lua_factory.h"
#endif
PluginManager::PluginManager() {
init = false;
@ -56,28 +53,19 @@ PluginManager::~PluginManager() {
AudioPlayerFactory::Clear();
SubtitlesProviderFactory::Clear();
SpellCheckerFactory::Clear();
#ifdef WITH_AUTO4_LUA
Automation4::ScriptFactory::Unregister(lua);
#endif
}
/// @brief Registers all built-in plugins
void PluginManager::RegisterBuiltInPlugins() {
if (!init) {
// Managers
VideoProviderFactory::RegisterProviders();
AudioProviderFactory::RegisterProviders();
AudioPlayerFactory::RegisterProviders();
SubtitlesProviderFactory::RegisterProviders();
SpellCheckerFactory::RegisterProviders();
// Automation languages
#ifdef WITH_AUTO4_LUA
lua = new Automation4::LuaScriptFactory();
#endif
}
// Done
init = true;
}