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 # AEGISUB FEATURE SUPPORT
######################### #########################
HAVE_ALSA = @with_alsa@ HAVE_ALSA = @with_alsa@
HAVE_AUTO4_LUA = @with_auto4_lua@
HAVE_HUNSPELL = @with_hunspell@ HAVE_HUNSPELL = @with_hunspell@
HAVE_OPENAL = @with_openal@ HAVE_OPENAL = @with_openal@
HAVE_OSS = @with_oss@ HAVE_OSS = @with_oss@

View File

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

View File

@ -399,24 +399,19 @@ AGI_OPT_PKG(hunspell, [build without hunspell spell-checking [auto]], [Enable Hu
############ ############
# Automation # Automation
############ ############
AC_ARG_WITH(lua, # First try pkg-config with several names
AS_HELP_STRING([--without-lua], PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1 lua5.1 < 5.2, [], [
[build without lua 5.1 (auto4)])) 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)"], [ AS_IF([test -z "$LUA_LIBS"],
# First try pkg-config with several names [AGI_FIND_LIB([LUA], [lua51 lua-5.1 lua5.1 lua], [])])
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"], AC_AGI_COMPILE([Lua 5.1 (auto4)], [lua], [$LUA_CFLAGS], [$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],[
#include <lua.hpp> #include <lua.hpp>
int main () { int main () {
@ -426,15 +421,10 @@ int main () {
lua_close(L); lua_close(L);
return !res; return !res;
}]) }])
AS_IF([test x$agi_cv_with_lua = xno && test x$with_lua = xyes], AS_IF([test x$agi_cv_with_lua = xno],
[AC_MSG_FAILURE([--with-lua was specified, but lua 5.1 could not be found. Try setting LUA_CLFAGS and LUA_LIBS manually])]) [AC_MSG_FAILURE([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$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_CFLAGS)
AC_SUBST(LUA_LIBS) AC_SUBST(LUA_LIBS)
@ -719,9 +709,6 @@ Configure settings
Default Settings Default Settings
Audio Player: $DEFAULT_PLAYER_AUDIO Audio Player: $DEFAULT_PLAYER_AUDIO
Scripting Engines
auto4 Lua: $with_auto4_lua $lua51_disabled
Audio Players Audio Players
ALSA: $with_alsa $alsa_disabled ALSA: $with_alsa $alsa_disabled
OpenAL: $with_openal $openal_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) CFLAGS += $(AEGISUB_CFLAGS)
CXXFLAGS += $(AEGISUB_CFLAGS) -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX) CXXFLAGS += $(AEGISUB_CFLAGS) -D__STDC_FORMAT_MACROS $(CXXFLAGS_WX)
LIBS := -L../libaegisub -laegisub $(LIBS) LIBS := -L../libaegisub -laegisub $(LIBS) $(LIBS_CCMALLOC) $(LIBS_EFENCE)
LIBS += $(LIBS_CCMALLOC) $(LIBS_EFENCE) $(LIBS_GL) LIBS += $(LIBS_GL) $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE)
LIBS += $(LIBS_PTHREAD) $(LIBS_WX) $(LIBS_FREETYPE) LIBS += $(LIBS_FONTCONFIG) $(LIBS_FFTW3) $(LIBS_UCHARDET) $(LIBS_BOOST)
LIBS += $(LIBS_FONTCONFIG) $(LIBS_FFTW3) LIBS += $(LIBS_ICU) $(LIBS_LUA)
LIBS += $(LIBS_UCHARDET) $(LIBS_BOOST) $(LIBS_ICU)
LDFLAGS += $(LDFLAGS_CCMALLOC) LDFLAGS += $(LDFLAGS_CCMALLOC)
@ -88,17 +87,6 @@ else
EXTRA_DIST += subtitles_provider_libass.cpp EXTRA_DIST += subtitles_provider_libass.cpp
endif 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 # MISCELLANOUS
############## ##############
@ -120,6 +108,7 @@ charset_detect.o: CXXFLAGS += -D_X86_
font_file_lister_fontconfig.o: CXXFLAGS += $(CFLAGS_FONTCONFIG) font_file_lister_fontconfig.o: CXXFLAGS += $(CFLAGS_FONTCONFIG)
text_file_reader.o: CXXFLAGS += -D_X86_ text_file_reader.o: CXXFLAGS += -D_X86_
video_provider_manager.o: CXXFLAGS += $(CFLAGS_FFMS2) 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 += \ SRC += \
MatroskaParser.c \ MatroskaParser.c \
@ -137,14 +126,15 @@ SRC += \
ass_style_storage.cpp \ ass_style_storage.cpp \
ass_time.cpp \ ass_time.cpp \
audio_box.cpp \ audio_box.cpp \
audio_controller.cpp \
audio_colorscheme.cpp \ audio_colorscheme.cpp \
audio_controller.cpp \
audio_display.cpp \ audio_display.cpp \
audio_karaoke.cpp \ audio_karaoke.cpp \
audio_marker.cpp \ audio_marker.cpp \
audio_player.cpp \ audio_player.cpp \
audio_provider.cpp \ audio_provider.cpp \
audio_provider_convert.cpp \ audio_provider_convert.cpp \
audio_provider_dummy.cpp \
audio_provider_hd.cpp \ audio_provider_hd.cpp \
audio_provider_lock.cpp \ audio_provider_lock.cpp \
audio_provider_pcm.cpp \ audio_provider_pcm.cpp \
@ -155,6 +145,12 @@ SRC += \
audio_timing_dialogue.cpp \ audio_timing_dialogue.cpp \
audio_timing_karaoke.cpp \ audio_timing_karaoke.cpp \
auto4_base.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 \ avisynth_wrap.cpp \
base_grid.cpp \ base_grid.cpp \
charset_detect.cpp \ charset_detect.cpp \
@ -191,7 +187,6 @@ SRC += \
dialog_translation.cpp \ dialog_translation.cpp \
dialog_version_check.cpp \ dialog_version_check.cpp \
dialog_video_details.cpp \ dialog_video_details.cpp \
audio_provider_dummy.cpp \
export_fixstyle.cpp \ export_fixstyle.cpp \
export_framerate.cpp \ export_framerate.cpp \
fft.cpp \ fft.cpp \
@ -213,9 +208,9 @@ SRC += \
plugin_manager.cpp \ plugin_manager.cpp \
preferences.cpp \ preferences.cpp \
preferences_base.cpp \ preferences_base.cpp \
search_replace_engine.cpp \
scintilla_text_ctrl.cpp \ scintilla_text_ctrl.cpp \
scintilla_text_selection_controller.cpp \ scintilla_text_selection_controller.cpp \
search_replace_engine.cpp \
spellchecker.cpp \ spellchecker.cpp \
spline.cpp \ spline.cpp \
spline_curve.cpp \ spline_curve.cpp \
@ -239,8 +234,8 @@ SRC += \
text_file_reader.cpp \ text_file_reader.cpp \
text_file_writer.cpp \ text_file_writer.cpp \
thesaurus.cpp \ thesaurus.cpp \
timeedit_ctrl.cpp \
threaded_frame_source.cpp \ threaded_frame_source.cpp \
timeedit_ctrl.cpp \
toggle_bitmap.cpp \ toggle_bitmap.cpp \
toolbar.cpp \ toolbar.cpp \
tooltip_manager.cpp \ tooltip_manager.cpp \

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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