[uim-commit] r157 - in trunk: . scm uim

yamaken@freedesktop.org yamaken@freedesktop.org
Fri Jan 7 07:17:49 PST 2005


Author: yamaken
Date: 2005-01-07 07:17:46 -0800 (Fri, 07 Jan 2005)
New Revision: 157

Modified:
   trunk/configure.ac
   trunk/scm/plugin.scm
   trunk/uim/Makefile.am
   trunk/uim/uim-util.c
Log:
* This commit fixes plugin loading. m17nlib and anthy plugins has been
  loadable without special settings. canna is still broken

* configure.ac
  - Add new option --without-anthy
* uim/Makefile.am
  - (uim_plugindir): New definition
  - (lib_LTLIBRARIES): Move libuim-m17nlib.la, libuim-scim.la,
    libuim-canna.la and libuim-anthy.la to uim_plugin_LTLIBRARIES
  - (uim_plugin_LTLIBRARIES):
    * New definition
    * Moved libuim-m17nlib.la, libuim-scim.la, libuim-canna.la and
      libuim-anthy.la from lib_LTLIBRARIES
  - (libuim_la_CPPFLAGS):
    * Remove -DLIBDIR
    * Add -DPKGLIBDIR
    * Add -DPKGDATADIR
  - Enclose libuim_anthy_la_* into 'if ANTHY' block
* uim/uim-util.c
  - (sys_pkglibdir, sys_pkgdatadir): New static function
  - (uim_init_util_subrs): Add Scheme procedure initialization of
    sys-pkglibdir and sys-pkgdatadir
* scm/plugin.scm
  - (uim-plugin-lib-load-path): Fix sys-libdir with sys-pkglibdir
  - (uim-plugin-scm-load-path): Fix <sys-datadir>/uim/plugin with
    sys-pkgdatadir


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-01-07 13:23:13 UTC (rev 156)
+++ trunk/configure.ac	2005-01-07 15:17:46 UTC (rev 157)
@@ -84,9 +84,27 @@
   ],
   [ PKG_CHECK_MODULES(SCIM, scim >= 1.0.0, use_scim="yes",use_scim="no") ])
 
-# *************************
+# ***********************
+# *** Tests for Anthy ***
+# ***********************
+AC_ARG_WITH(anthy,
+  AC_HELP_STRING([--without-anthy], [Don't build with libanthy]),
+  [
+    if test "x$with_anthy" = "xyes"; then
+      AC_CHECK_HEADERS([anthy/anthy.h], [use_anthy="yes"],
+                       [use_anthy="no"])
+    else
+      use_anthy="no"
+    fi
+  ],
+  [
+    AC_CHECK_HEADERS([anthy/anthy.h], [use_anthy="yes"],
+                     [use_anthy="no"])
+  ])
+
+# ***********************
 # *** Tests for Canna ***
-# *************************
+# ***********************
 AC_ARG_WITH(canna,
 	AS_HELP_STRING([--with-canna], [Build with libcanna]),
 	[
@@ -307,6 +325,7 @@
 
 AM_CONDITIONAL(M17NLIB, test x$use_m17nlib = xyes)
 AM_CONDITIONAL(SCIM, test x$use_scim = xyes)
+AM_CONDITIONAL(ANTHY, test x$use_anthy = xyes)
 AM_CONDITIONAL(CANNA, test x$use_canna = xyes)
 AM_CONDITIONAL(GTK2, test x$use_gtk2 = xyes)
 AM_CONDITIONAL(GTK2_4, test x$use_gtk2_4 = xyes)
@@ -418,6 +437,7 @@
 AC_MSG_RESULT([
 Configure Result :
 
+   Anthy        : ${use_anthy}
    Canna        : ${use_canna}
    m17n-lib     : ${use_m17nlib}
    SCIM         : ${use_scim}

Modified: trunk/scm/plugin.scm
===================================================================
--- trunk/scm/plugin.scm	2005-01-07 13:23:13 UTC (rev 156)
+++ trunk/scm/plugin.scm	2005-01-07 15:17:46 UTC (rev 157)
@@ -34,10 +34,10 @@
 
 (define uim-plugin-lib-load-path
   (list (string-append (getenv "HOME") "/.uim.d/plugin")
-	(string-append (sys-libdir) "/uim/plugin")))
+	(string-append (sys-pkglibdir) "/plugin")))
 (define uim-plugin-scm-load-path
   (list (string-append (getenv "HOME") "/.uim.d/plugin")
-	(string-append (sys-datadir) "/uim/plugin")))
+	(sys-pkgdatadir)))
 
 (if (getenv "LIBUIM_PLUGIN_DIR")
     (set! uim-plugin-lib-load-path

Modified: trunk/uim/Makefile.am
===================================================================
--- trunk/uim/Makefile.am	2005-01-07 13:23:13 UTC (rev 156)
+++ trunk/uim/Makefile.am	2005-01-07 15:17:46 UTC (rev 157)
@@ -6,6 +6,9 @@
 
 lib_LTLIBRARIES = libuim.la
 
+uim_plugin_LTLIBRARIES = 
+uim_plugindir = $(pkglibdir)/plugin
+
 pkginclude_HEADERS = uim.h uim-util.h uim-helper.h uim-im-switcher.h uim-scm.h plugin.h
 
 libuim_la_SOURCES = uim.c uim-scm.c uim-func.c uim-key.c uim-util.c \
@@ -33,7 +36,7 @@
 endif
 
 if M17NLIB
-  lib_LTLIBRARIES += libuim-m17nlib.la
+  uim_plugin_LTLIBRARIES += libuim-m17nlib.la
   libuim_m17nlib_la_SOURCES = m17nlib.c
   libuim_m17nlib_la_LIBADD = @LIBINTL@ @LIBICONV@ @M17NLIB_LIBS@ libuim.la
   libuim_m17nlib_la_LDFLAGS = -luim
@@ -41,7 +44,7 @@
 endif
 
 if SCIM
-  lib_LTLIBRARIES += libuim-scim.la
+  uim_plugin_LTLIBRARIES += libuim-scim.la
   libuim_scim_la_SOURCES = scim.cpp
   libuim_scim_la_LIBADD = @LIBINTL@ @LIBICONV@ @SCIM_LIBS@ libuim.la
   libuim_scim_la_LDFLAGS = -luim
@@ -49,25 +52,27 @@
 endif
 
 if CANNA
-  lib_LTLIBRARIES += libuim-canna.la
+  uim_plugin_LTLIBRARIES += libuim-canna.la
   libuim_canna_la_SOURCES = canna.c
   libuim_canna_la_LIBADD = @LIBINTL@ @LIBICONV@ libuim.la
   libuim_canna_la_LDFLAGS = -luim
   libuim_canna_la_CPPFLAGS = -I$(top_srcdir)
 endif
 
-lib_LTLIBRARIES += libuim-anthy.la
-libuim_anthy_la_SOURCES = anthy.c
-libuim_anthy_la_LIBADD = @LIBINTL@ @LIBICONV@ libuim.la
-libuim_anthy_la_LDFLAGS = -luim
-libuim_anthy_la_CPPFLAGS = -I$(top_srcdir)
+if ANTHY
+  uim_plugin_LTLIBRARIES += libuim-anthy.la
+  libuim_anthy_la_SOURCES = anthy.c
+  libuim_anthy_la_LIBADD = @LIBINTL@ @LIBICONV@ libuim.la
+  libuim_anthy_la_LDFLAGS = -luim
+  libuim_anthy_la_CPPFLAGS = -I$(top_srcdir)
+endif
 
-
 libuimincludedir =  $(includedir)/uim
 
 libuim_la_LDFLAGS = -version-info 0:1:0 -export-symbols-regex uim.\*
 libuim_la_LIBADD = @LIBINTL@ @LIBICONV@
-libuim_la_CPPFLAGS = $(uim_defs) -I$(top_srcdir) -DLIBDIR=\"$(pkglibdir)\"
+libuim_la_CPPFLAGS = $(uim_defs) -I$(top_srcdir) -DPKGLIBDIR=\"$(pkglibdir)\" \
+		     -DPKGDATADIR=\"$(pkgdatadir)\"
 
 if DEBUG
 libuim_la_CPPFLAGS += -DDEBUG -DDEBUG_SCM=1

Modified: trunk/uim/uim-util.c
===================================================================
--- trunk/uim/uim-util.c	2005-01-07 13:23:13 UTC (rev 156)
+++ trunk/uim/uim-util.c	2005-01-07 15:17:46 UTC (rev 157)
@@ -61,12 +61,24 @@
 }
 
 static LISP
+sys_pkglibdir()
+{
+  return uim_scm_make_str(PKGLIBDIR);
+}
+
+static LISP
 sys_datadir()
 {
   return uim_scm_make_str(DATADIR);
 }
 
+static LISP
+sys_pkgdatadir()
+{
+  return uim_scm_make_str(PKGDATADIR);
+}
 
+
 static uim_lisp
 string_equal(uim_lisp x, uim_lisp y)
 {
@@ -442,7 +454,9 @@
 uim_init_util_subrs()
 {
   uim_scm_init_subr_0("sys-libdir", sys_libdir);
+  uim_scm_init_subr_0("sys-pkglibdir", sys_pkglibdir);
   uim_scm_init_subr_0("sys-datadir", sys_datadir);
+  uim_scm_init_subr_0("sys-pkgdatadir", sys_pkgdatadir);
   uim_scm_init_subr_2("string=?", string_equal);
   uim_scm_init_subr_2("nthcdr", nthcdr);
   uim_scm_init_subr_1("charcode->string", charcode2string);



More information about the Uim-commit mailing list