diff options
-rw-r--r-- | configure.ac | 19 | ||||
-rw-r--r-- | hangul/hangulkeyboard.c | 6 |
2 files changed, 23 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 19f4999..e527084 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,14 @@ AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([hangul/hangul.h]) AC_CONFIG_HEADER([config.h]) +# Configure options +AC_ARG_ENABLE(external-keyboards, + AS_HELP_STRING([--enable-external-keyboards], + [enable external keyboard xml file loading feature]), + [enable_external_keyboards=$enableval], + [enable_external_keyboards=yes] +) + # library version LIBHANGUL_CURRENT=1 LIBHANGUL_REVISION=0 @@ -52,9 +60,14 @@ AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", gettext package name) AM_ICONV -# Checks for expat +# Checks for pkgconfig PKG_PROG_PKG_CONFIG -PKG_CHECK_MODULES(EXPAT, [expat]) + +# Checks for expat +if test x$enable_external_keyboards = xyes; then + PKG_CHECK_MODULES(EXPAT, [expat]) + AC_DEFINE(ENABLE_EXTERNAL_KEYBOARDS, 1, [Define to 1 if you enabled to load external keyboards]) +fi # Checks for unit test framework if test -n "$PKG_CONFIG"; then @@ -75,3 +88,5 @@ tools/Makefile ]) AC_OUTPUT + +# vim: et diff --git a/hangul/hangulkeyboard.c b/hangul/hangulkeyboard.c index 81e6c07..9ebaca6 100644 --- a/hangul/hangulkeyboard.c +++ b/hangul/hangulkeyboard.c @@ -24,10 +24,12 @@ #include <string.h> #include <limits.h> +#if ENABLE_EXTERNAL_KEYBOARDS #include <locale.h> #include <glob.h> #include <libgen.h> #include <expat.h> +#endif /* ENABLE_EXTERNAL_KEYBOARDS */ #include "hangul-gettext.h" #include "hangul.h" @@ -538,6 +540,7 @@ hangul_keyboard_combine(const HangulKeyboard* keyboard, return res; } +#if ENABLE_EXTERNAL_KEYBOARDS static const char* attr_lookup(const char** attr, const char* name) { @@ -782,6 +785,7 @@ hangul_keyboard_list_load_dir(const char* path) return hangul_keyboards.n; } +#endif /* ENABLE_EXTERNAL_KEYBOARDS */ static void hangul_keyboard_list_clear() @@ -801,6 +805,7 @@ hangul_keyboard_list_clear() int hangul_keyboard_list_init() { +#if ENABLE_EXTERNAL_KEYBOARDS /* 이 함수를 중복 호출할 경우에 대한 처리 * 이미 등록된 자판이 있다면 중복 호출된 것으로 보고 * 함수를 종료한다. */ @@ -832,6 +837,7 @@ hangul_keyboard_list_init() if (n == 0) return 1; +#endif /* ENABLE_EXTERNAL_KEYBOARDS */ return 0; } |