[uim-commit] r156 - in trunk: . scm uim
yamaken@freedesktop.org
yamaken@freedesktop.org
Fri Jan 7 05:23:16 PST 2005
Author: yamaken
Date: 2005-01-07 05:23:13 -0800 (Fri, 07 Jan 2005)
New Revision: 156
Modified:
trunk/configure.ac
trunk/scm/plugin.scm
trunk/uim/uim-util.c
Log:
* configure.ac
- Fix LOCALEDIR and GNOMELOCALEDIR definition. This has resolved bug
#1820
- Define LIBDIR and DATADIR
* uim/uim-util.c
- (sys_libdir, sys_datadir): New static function
- (uim_init_util_subrs): Add Scheme procedure initialization of
sys-libdir and sys-datadir
* scm/plugin.scm
- (uim-plugin-lib-load-path): Fix hardcoded system libraries
directory with sys-libdir
- (uim-plugin-lib-load-path): Fix hardcoded system data directory
with sys-datadir
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2005-01-07 11:20:14 UTC (rev 155)
+++ trunk/configure.ac 2005-01-07 13:23:13 UTC (rev 156)
@@ -139,20 +139,22 @@
AM_GNU_GETTEXT_VERSION(0.12)
-# XXX:Ugly localedir definition... need more beautiful way.
+# FIXME: Probably voilent way -- YamaKen 2005-01-07
if test x$prefix = xNONE; then
- # I can't imagine when prefix does not exist -- YamaKen 2004-09-30
- localedir="/usr/local/share/locale"
-else
- #localedir="${prefix}/share/locale"
+ prefix=$ac_default_prefix
+fi
+if test x$exec_prefix = xNONE; then
+ exec_prefix=$prefix
+fi
- # I believe that locale data must be installed into $datadir rather
- # than its default value $prefix/share -- YamaKen 2004-09-30
- localedir="${datadir}/locale"
-fi
+LIBDIR=`eval echo ${libdir}`
+AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [libraries dir])
+DATADIR=`eval echo ${datadir}`
+AC_DEFINE_UNQUOTED(DATADIR, "$DATADIR", [read-only architecture-independent data dir])
# we should use more safe macro such as AC_EXPAND_DIR
LOCALEDIR=`eval echo ${datadir}/locale`
-AC_SUBST(localedir)
+# backward compatibility
+localedir=$LOCALEDIR
AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [locale dir])
AC_DEFINE_UNQUOTED(GNOMELOCALEDIR, "$LOCALEDIR", [locale dir for gnome])
# define XLIB directory
Modified: trunk/scm/plugin.scm
===================================================================
--- trunk/scm/plugin.scm 2005-01-07 11:20:14 UTC (rev 155)
+++ trunk/scm/plugin.scm 2005-01-07 13:23:13 UTC (rev 156)
@@ -34,10 +34,10 @@
(define uim-plugin-lib-load-path
(list (string-append (getenv "HOME") "/.uim.d/plugin")
- "/usr/lib/uim/plugin"))
+ (string-append (sys-libdir) "/uim/plugin")))
(define uim-plugin-scm-load-path
(list (string-append (getenv "HOME") "/.uim.d/plugin")
- "/usr/share/uim/plugin"))
+ (string-append (sys-datadir) "/uim/plugin")))
(if (getenv "LIBUIM_PLUGIN_DIR")
(set! uim-plugin-lib-load-path
Modified: trunk/uim/uim-util.c
===================================================================
--- trunk/uim/uim-util.c 2005-01-07 11:20:14 UTC (rev 155)
+++ trunk/uim/uim-util.c 2005-01-07 13:23:13 UTC (rev 156)
@@ -53,6 +53,20 @@
extern char *uim_return_str;
+/* define constants as procedure to ensure unmodifiable */
+static LISP
+sys_libdir()
+{
+ return uim_scm_make_str(LIBDIR);
+}
+
+static LISP
+sys_datadir()
+{
+ return uim_scm_make_str(DATADIR);
+}
+
+
static uim_lisp
string_equal(uim_lisp x, uim_lisp y)
{
@@ -427,6 +441,8 @@
void
uim_init_util_subrs()
{
+ uim_scm_init_subr_0("sys-libdir", sys_libdir);
+ uim_scm_init_subr_0("sys-datadir", sys_datadir);
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