add lua extension compile flags.
authorPeng Wu <alexepico@gmail.com>
Thu, 1 Jul 2010 07:32:36 +0000 (15:32 +0800)
committerPeng Wu <alexepico@gmail.com>
Thu, 1 Jul 2010 07:32:36 +0000 (15:32 +0800)
configure.ac
lua/Makefile.am

index eec2c3d..bea3a0f 100644 (file)
@@ -157,6 +157,21 @@ AC_ARG_ENABLE(db-open-phrase,
 )
 AM_CONDITIONAL(IBUS_BUILD_DB_OPEN_PHRASE, [test x"$enable_db_open_phrase" = x"yes" ])
 
+# --disable-lua-extension
+AC_ARG_ENABLE(lua-extension,
+    AS_HELP_STRING([--disable-lua-extension],
+         [build lua extension]),
+    [   if test "$enableval" = yes; then
+            enable_lua_extension = no
+        else
+            enable_lua_extension = yes
+        fi
+    ],
+    [enable_lua_extension=yes]
+)
+
+AM_CONDITIONAL(IBUS_BUILD_LUA_EXTENSION, [test x"$enable_lua_extension" = x"yes"])
+
 # OUTPUT files
 AC_CONFIG_FILES([ po/Makefile.in
 Makefile
@@ -184,5 +199,6 @@ Build options:
     Use opencc                  $enable_opencc
     Build database android      $enable_db_android
     Build database open-phrase  $enable_db_open_phrase
+    Build lua extension         $enable_lua_extension
 ])
 
index 914f4c5..c1ef9c4 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+if IBUS_BUILD_LUA_EXTENSION
 lua_script_DATA = base.lua \
         $(NULL)
+endif
 
 lua_scriptdir = $(pkgdatadir)
 
+if IBUS_BUILD_LUA_EXTENSION
 noinst_LTLIBRARIES = \
        libpylua.la \
        $(NULL)
+endif
 
 libpylua_la_SOURCES = \
        lua-plugin.h \
@@ -44,12 +48,14 @@ libpylua_la_LIBADD = \
        @LUA_LIBS@ \
        $(NULL)
 
+if IBUS_BUILD_LUA_EXTENSION
 TESTS = \
+    lua-ext-console \
        test-lua-plugin \
        $(NULL)
+endif
 
 noinst_PROGRAMS = \
-       lua-ext-console \
        $(TESTS) \
        $(NULL)