diff options
author | Peng Wu <alexepico@gmail.com> | 2013-12-12 12:38:21 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2013-12-12 12:38:27 +0800 |
commit | e6ea82938c6f06d03109da94da6f313c399737e6 (patch) | |
tree | 941f0fcfaa4baef41bb1fd7fd061c0c73404eac9 | |
parent | 5e6708be79ff90cf483bfc66e30437d5019404a0 (diff) | |
download | ibus-libpinyin-e6ea82938c6f06d03109da94da6f313c399737e6.tar.gz ibus-libpinyin-e6ea82938c6f06d03109da94da6f313c399737e6.tar.xz ibus-libpinyin-e6ea82938c6f06d03109da94da6f313c399737e6.zip |
drop IBUS_BUILD_LIBPINYIN macro
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/Makefile.am | 9 | ||||
-rw-r--r-- | src/PYEngine.cc | 2 | ||||
-rw-r--r-- | src/PYMain.cc | 18 | ||||
-rw-r--r-- | src/PYPConfig.cc | 2 |
5 files changed, 4 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac index 28dca45..190f1fc 100644 --- a/configure.ac +++ b/configure.ac @@ -67,8 +67,6 @@ PKG_CHECK_MODULES(LIBPINYIN, [ libpinyin >= 0.9.91 ], [enable_libpinyin=yes]) -AM_CONDITIONAL(IBUS_BUILD_LIBPINYIN, [test x"$enable_libpinyin" = x"yes"]) - LIBPINYIN_DATADIR=`$PKG_CONFIG --variable=pkgdatadir libpinyin` AC_SUBST(LIBPINYIN_DATADIR) diff --git a/src/Makefile.am b/src/Makefile.am index bf65ded..7a4bda6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -85,7 +85,6 @@ ibus_engine_libpinyin_h_sources = \ PYPConfig.h \ $(NULL) -if IBUS_BUILD_LIBPINYIN ibus_engine_libpinyin_c_sources += \ PYPConfig.cc \ PYLibPinyin.cc \ @@ -97,7 +96,6 @@ ibus_engine_libpinyin_c_sources += \ PYPPinyinEngine.cc \ PYPBopomofoEngine.cc \ $(NULL) -endif if IBUS_BUILD_LUA_EXTENSION @@ -152,15 +150,12 @@ ibus_engine_libpinyin_CXXFLAGS += $(LIBUUID_CFLAGS) ibus_engine_libpinyin_LDADD += $(LIBUUID_LIBS) endif -if IBUS_BUILD_LIBPINYIN - ibus_engine_libpinyin_CXXFLAGS += \ - -DIBUS_BUILD_LIBPINYIN \ +ibus_engine_libpinyin_CXXFLAGS += \ -DLIBPINYIN_DATADIR=\"@LIBPINYIN_DATADIR@\/data\" \ $(NULL) -endif if IBUS_BUILD_LUA_EXTENSION - ibus_engine_libpinyin_CXXFLAGS += \ +ibus_engine_libpinyin_CXXFLAGS += \ @LUA_CFLAGS@ \ -DIBUS_BUILD_LUA_EXTENSION \ -I$(top_srcdir)/lua/ \ diff --git a/src/PYEngine.cc b/src/PYEngine.cc index 487ad6e..68260dd 100644 --- a/src/PYEngine.cc +++ b/src/PYEngine.cc @@ -166,7 +166,6 @@ ibus_pinyin_engine_constructor (GType type, name = ibus_engine_get_name ((IBusEngine *) engine); if (name) { -#ifdef IBUS_BUILD_LIBPINYIN if (std::strcmp (name, "libpinyin") == 0 || std::strcmp (name, "libpinyin-debug") == 0) { engine->engine = new LibPinyinPinyinEngine (IBUS_ENGINE (engine)); @@ -175,7 +174,6 @@ ibus_pinyin_engine_constructor (GType type, std::strcmp (name, "libbopomofo-debug") == 0 ) { engine->engine = new LibPinyinBopomofoEngine (IBUS_ENGINE (engine)); } -#endif } else { engine->engine = new LibPinyinPinyinEngine (IBUS_ENGINE (engine)); } diff --git a/src/PYMain.cc b/src/PYMain.cc index 0830b2c..b761c65 100644 --- a/src/PYMain.cc +++ b/src/PYMain.cc @@ -30,9 +30,7 @@ #include "PYBus.h" #include "PYConfig.h" #include "PYPConfig.h" -#ifdef IBUS_BUILD_LIBPINYIN #include "PYLibPinyin.h" -#endif using namespace PY; @@ -88,14 +86,10 @@ start_component (void) exit (0); } -#ifdef IBUS_BUILD_LIBPINYIN LibPinyinBackEnd::init (); -#endif -#ifdef IBUS_BUILD_LIBPINYIN LibPinyinPinyinConfig::init (bus); LibPinyinBopomofoConfig::init (bus); -#endif g_signal_connect ((IBusBus *)bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL); @@ -107,7 +101,7 @@ start_component (void) "https://github.com/libpinyin/ibus-libpinyin", "", "ibus-libpinyin"); -#ifdef IBUS_BUILD_LIBPINYIN + ibus_component_add_engine (component, ibus_engine_desc_new ("libpinyin-debug", N_("Intelligent Pinyin (debug)"), @@ -130,22 +124,17 @@ start_component (void) "Peng Huang <shawn.p.huang@gmail.com>", PKGDATADIR "/icons/ibus-bopomofo.svg", "us")); -#endif factory = ibus_factory_new (ibus_bus_get_connection (bus)); if (ibus) { -#ifdef IBUS_BUILD_LIBPINYIN ibus_factory_add_engine (factory, "libpinyin", IBUS_TYPE_PINYIN_ENGINE); ibus_factory_add_engine (factory, "libbopomofo", IBUS_TYPE_PINYIN_ENGINE); -#endif ibus_bus_request_name (bus, "org.freedesktop.IBus.Libpinyin", 0); } else { -#ifdef IBUS_BUILD_LIBPINYIN ibus_factory_add_engine (factory, "libpinyin-debug", IBUS_TYPE_PINYIN_ENGINE); ibus_factory_add_engine (factory, "libbopomofo-debug", IBUS_TYPE_PINYIN_ENGINE); -#endif ibus_bus_register_component (bus, component); } @@ -157,18 +146,15 @@ start_component (void) static void sigterm_cb (int sig) { -#ifdef IBUS_BUILD_LIBPINYIN LibPinyinBackEnd::finalize (); -#endif + ::exit (EXIT_FAILURE); } static void atexit_cb (void) { -#ifdef IBUS_BUILD_LIBPINYIN LibPinyinBackEnd::finalize (); -#endif } int diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc index d53c708..7649f35 100644 --- a/src/PYPConfig.cc +++ b/src/PYPConfig.cc @@ -275,12 +275,10 @@ LibPinyinConfig::valueChangedCallback (IBusConfig *config, self->valueChanged (section, name, value); -#ifdef IBUS_BUILD_LIBPINYIN if (self->m_section == "engine/pinyin") LibPinyinBackEnd::instance ().setPinyinOptions (self); if (self->m_section == "engine/bopomofo") LibPinyinBackEnd::instance ().setChewingOptions (self); -#endif } static const struct { |