Author: yamakenz
Date: Wed Sep 19 09:27:35 2007
New Revision: 4980
Modified:
trunk/configure.ac
trunk/uim/Makefile.am
trunk/uim/scim.cpp
Log:
* This commit fix compilation error on uim-scim. But it indicates
"create_config failed" on runtime. I don't know how to fix it
* uim/scim.cpp
- Exclude uim-compat-scm.h and context.h
- Include uim-internal.h
- (init_scim): Follow the API change of
ConfigModule::create_config() in SCIM 1.3. But SCIM 1.4.4 returns
null config
- (get_input_method_lang, get_input_method_name): Fix signed and
unsigned comparison
* uim/Makefile.am
- (CXXFLAGS): Add warning suppression workaround for uim-scim
* configure.ac
- Require SCIM version 1.3.0 or later
- Relax warning flags for uim-scim
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Wed Sep 19 09:27:35 2007
@@ -83,7 +83,7 @@
use_scim="no"
;;
yes|*)
- PKG_CHECK_MODULES(SCIM, scim >= 1.2.0, use_scim="yes",use_scim="no")
+ PKG_CHECK_MODULES(SCIM, scim >= 1.3.0, use_scim="yes",use_scim="no")
;;
esac
],
@@ -1295,6 +1295,13 @@
AX_CFLAGS_GCC_OPTION([-Wno-redundant-decls], [UIM_SCM_CFLAGS])
AX_CFLAGS_GCC_OPTION([-Wno-unused-function], [UIM_SCM_CFLAGS])
AX_LANG_WNOERROR # end AC_LANG_WERROR
+
+ # Suppress the warnings of libuim-scim
+ AC_LANG_WERROR # Turn warning-only unknown options into error.
+ AX_CFLAGS_GCC_OPTION([-Wno-unused-function], [SCIM_CFLAGS])
+ AX_CFLAGS_GCC_OPTION([-Wno-unused-parameter], [SCIM_CFLAGS])
+ AX_CFLAGS_GCC_OPTION([-Wno-unused-variable], [SCIM_CFLAGS])
+ AX_LANG_WNOERROR # end AC_LANG_WERROR
fi
AC_ARG_ENABLE(warnings-into-error,
@@ -1317,9 +1324,11 @@
CFLAGS="$CFLAGS -Werror"
CXXFLAGS="$CXXFLAGS -Werror"
AX_CFLAGS_GCC_OPTION([-Wno-error], [UIM_SCM_CFLAGS])
+ AX_CFLAGS_GCC_OPTION([-Wno-error], [SCIM_CFLAGS])
fi
])
AC_SUBST(UIM_SCM_CFLAGS)
+AC_SUBST(SCIM_CFLAGS)
# Checks for system services
Modified: trunk/uim/Makefile.am
==============================================================================
--- trunk/uim/Makefile.am (original)
+++ trunk/uim/Makefile.am Wed Sep 19 09:27:35 2007
@@ -9,6 +9,9 @@
uim_defs = -DSCM_FILES=\"$(datadir)/uim\"
# FIXME: $(UIM_SCM_CFLAGS) should only affect on uim-scm.c
CFLAGS = @CFLAGS@ $(UIM_SCM_CFLAGS)
+# FIXME: $(SCIM_CFLAGS) should only affect on scim.cpp
+# 'if SCIM' makes this workaround broken
+CXXFLAGS = @CXXFLAGS@ $(SCIM_CFLAGS)
lib_LTLIBRARIES = libuim-scm.la libuim.la libuim-custom.la libuim-bsdlook.la
if LIBUIM_X_UTIL
Modified: trunk/uim/scim.cpp
==============================================================================
--- trunk/uim/scim.cpp (original)
+++ trunk/uim/scim.cpp Wed Sep 19 09:27:35 2007
@@ -42,8 +42,7 @@
#include <scim.h>
#include "uim.h"
#include "uim-scm.h"
-#include "uim-compat-scm.h"
-#include "context.h"
+#include "uim-internal.h"
using namespace scim;
@@ -175,7 +174,13 @@
return uim_scm_f();
}
+#if 0
+ /* for old versions (1.2 or older) of SCIM */
config = config_module->create_config("scim");
+#else
+ /* for new versions (1.3, 1.4) of SCIM */
+ config = config_module->create_config();
+#endif
if ( config.null() )
{
fprintf(stderr, "create_config failed\n");
@@ -226,7 +231,7 @@
{
// FIXME
int nth = uim_scm_c_int( nth_ );
- if ( nth < im_list.size() )
+ if ( nth < (int)im_list.size() )
{
return uim_scm_make_str( im_list.at( nth )->lang.c_str() );
}
@@ -251,7 +256,7 @@
get_input_method_name(uim_lisp nth_)
{
int nth = uim_scm_c_int( nth_ );
- if ( nth < im_list.size() )
+ if ( nth < (int)im_list.size() )
{
// remove space
String imname = WideStr_to_String( im_list.at( nth )->imname );