# sigc++-2.0
# ])
-# check lua
-PKG_CHECK_MODULES(LUA, [
- lua
-])
-
# check env
AC_PATH_PROG(ENV, env)
AC_SUBST(ENV)
[enable_lua_extension=yes]
)
+# check lua
+PKG_CHECK_MODULES(LUA, [
+ lua
+], [],
+[enable_lua_extension=no]
+)
+
AM_CONDITIONAL(IBUS_BUILD_LUA_EXTENSION, [test x"$enable_lua_extension" = x"yes"])
# OUTPUT files
#include <string>
#include "RawEditor.h"
#include "PunctEditor.h"
+#ifdef IBUS_BUILD_LUA_EXTENSION
#include "ExtEditor.h"
+#endif
#include "BopomofoEditor.h"
#include "FallbackEditor.h"
#include "Config.h"
m_editors[MODE_PUNCT].reset (new PunctEditor (m_props, BopomofoConfig::instance ()));
m_editors[MODE_RAW].reset (new RawEditor (m_props, BopomofoConfig::instance ()));
+#ifdef IBUS_BUILD_LUA_EXTENSION
m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props, BopomofoConfig::instance ()));
+#else
+ m_editors[MODE_EXTENSION].reset (new Editor (m_props, BopomofoConfig::instance ()));
+#endif
m_props.signalUpdateProperty ().connect (bind (&BopomofoEngine::updateProperty, this, _1));
DoublePinyinEditor.cc \
Editor.cc \
Engine.cc \
- ExtEditor.cc \
FallbackEditor.cc \
FullPinyinEditor.cc \
HalfFullConverter.cc \
Types.h \
Util.h \
$(NULL)
+
+if IBUS_BUILD_LUA_EXTENSION
+ibus_engine_pinyin_c_sources += ExtEditor.cc
+endif
+
ibus_engine_pinyin_SOURCES = \
$(ibus_engine_pinyin_c_sources) \
$(ibus_engine_pinyin_h_sources) \
-DGETTEXT_PACKAGE=\"@GETTEXT_PACKAGE@\" \
-DPKGDATADIR=\"$(pkgdatadir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
- -I../lua/ \
$(NULL)
ibus_engine_pinyin_LDADD = \
@IBUS_LIBS@ \
@SQLITE_LIBS@ \
@OPENCC_LIBS@ \
- -L../lua/ \
- -lpylua \
$(NULL)
if HAVE_LIBUUID
ibus_engine_pinyin_LDADD += $(LIBUUID_LIBS)
endif
+if IBUS_BUILD_LUA_EXTENSION
+ ibus_engine_pinyin_CXXFLAGS += \
+ -DIBUS_BUILD_LUA_EXTENSION \
+ -I../lua/ \
+ $(NULL)
+endif
+
+if IBUS_BUILD_LUA_EXTENSION
+ ibus_engine_pinyin_LDADD += \
+ -L../lua/ \
+ -lpylua \
+ $(NULL)
+endif
+
+
# if HAVE_BOOST_SIGNALS2
# # do nothing
# else
#include "Config.h"
#include "PunctEditor.h"
#include "RawEditor.h"
+#ifdef IBUS_BUILD_LUA_EXTENSION
#include "ExtEditor.h"
+#endif
#include "FullPinyinEditor.h"
#include "DoublePinyinEditor.h"
#include "FallbackEditor.h"
m_editors[MODE_PUNCT].reset (new PunctEditor (m_props, PinyinConfig::instance ()));
m_editors[MODE_RAW].reset (new RawEditor (m_props, PinyinConfig::instance ()));
+#ifdef IBUS_BUILD_LUA_EXTENSION
m_editors[MODE_EXTENSION].reset (new ExtEditor (m_props, PinyinConfig::instance ()));
+#else
+ m_editors[MODE_EXTENSION].reset (new Editor (m_props, PinyinConfig::instance ()));
+#endif
m_props.signalUpdateProperty ().connect (bind (&PinyinEngine::updateProperty, this, _1));
case IBUS_grave:
m_input_mode = MODE_PUNCT;
break;
+#ifdef IBUS_BUILD_LUA_EXTENSION
case IBUS_i:
m_input_mode = MODE_EXTENSION;
break;
+#endif
}
}
else {