diff -Naur Canna37p3.orig/Canna.conf Canna37p3/Canna.conf
--- Canna37p3.orig/Canna.conf	2004-05-19 15:48:47.000000000 +0000
+++ Canna37p3/Canna.conf	2013-08-15 07:49:06.000000000 +0000
@@ -99,7 +99,7 @@
  */
 
 /* root�ˤʤ餺�˥��󥹥ȡ��뤹����Ϥ����������Ʋ����� */
-/* #define InstallAsUser */
+#define InstallAsUser
 /* ����ȸߴ��Υǥ��쥯�ȥ깽¤�ˤ�����Ϥ����������Ƥ������� */
 /* #define ObsoleteInstallDir */
 
@@ -140,25 +140,29 @@
 # define ModernElfLinkAvailable NO
 #endif
 
-cannaPrefix = DefCannaPrefix
+#define MyCCOptions -no-cpp-precomp -Wall -Wpointer-arith -Wno-implicit-int -Wno-return-type
+#undef LibraryCCOptions
+#define LibraryCCOptions MyCCOptions -fno-common
+CCOPTIONS = MyCCOptions
+
+cannaPrefix = @PREFIX@
 cannaExecPrefix = $(cannaPrefix)
 cannaBinDir = $(cannaExecPrefix)/bin
 cannaSrvDir = DefCannaSrvDir
 XCOMM cannaLibDir = /var/lib/canna
 XCOMM cannaLibDir = /var/db/canna
 cannaLibDir = DefCannaLibDir
-XCOMM cannaManDir = $(cannaPrefix)/share/man
-cannaManDir = $(cannaPrefix)/man
+cannaManDir = $(cannaPrefix)/share/man
 cannaIncDir = $(cannaPrefix)/include/canna
 
 libCannaDir = DefLibCannaDir
-ErrDir  = DefErrDir
+ErrDir  = $(cannaPrefix)/var/log/canna
 
 /* ��С������Ȥθߴ�API��̵���ˤ������0��������Ƥ������� */
 #define SupportOldWchar 1
 
 /* IPv6���Ѥ������1��������Ƥ������� */
-#define UseInet6 0 /* requires newer IPv6 implementation */
+#define UseInet6 1 /* requires newer IPv6 implementation */
 
 /* 3.2�Ϥ���3.6�ϤޤǤη����μ��������Ϥ����������Ƥ������� */
 /* #define DIC_3_6_COMPAT */
@@ -169,8 +173,8 @@
 #define ModernElfLink NO /* experimental */
 
 
-cannaOwner = bin
-cannaGroup = bin
+cannaOwner = canna
+cannaGroup = canna
 
 #ifdef InstallAsUser
 cannaOwnerGroup =
@@ -197,15 +201,14 @@
 #ifdef InstallAsUser
 CHOWN = :
 CHGRP = :
-CHMOD = :
 #else
 CHOWN = chown
 CHGRP = chgrp
-CHMOD = chmod
 #endif
+CHMOD = /bin/chmod
 
 /* ���ܸ�ޥ˥奢���Ȥ�ʤ��ΤǤ���Х����ȥ����� */
-#define JAPANESEMAN
+/* #define JAPANESEMAN */
 
 /* #define engineSwitch */
 
@@ -237,7 +240,7 @@
 /* #define UseInstalledLibCanna YES */
 #define UseInstalledLibCanna NO
 
-DicDir   = $(cannaLibDir)/dic
+DicDir   = $(cannaPrefix)/var/lib/canna/dic
 
 /* �������鲼���ѹ����פǤ� */
 
@@ -338,13 +341,8 @@
 useObsoleteFilename = -DUSE_OBSOLETE_STYLE_FILENAME
 #endif
 
-#ifdef InstallAsUser
-UnixSockDir = $(cannaPrefix)/tmp/.iroha_unix
-AccessFile = $(cannaPrefix)/etc/hosts.canna
-#else
 UnixSockDir = /tmp/.iroha_unix
-AccessFile = /etc/hosts.canna
-#endif
+AccessFile = $(cannaPrefix)/etc/canna/hosts.canna
 UnixSockName = IROHA
 
 /*
diff -Naur Canna37p3.orig/Imakefile Canna37p3/Imakefile
--- Canna37p3.orig/Imakefile	2004-05-19 15:39:22.000000000 +0000
+++ Canna37p3/Imakefile	2013-06-27 11:41:05.000000000 +0000
@@ -106,8 +106,10 @@
 	 fi
 
 XCOMM Invoke configure only when accanna.h does not exist for faster build
-accanna.h pubconf.h:
+pubconf.h:
 	$(CONFIGURE_CMD)
+accanna.h: pubconf.h
+	test -r accanna.h || $(CONFIGURE_CMD)
 XCOMM If you want to invoke configure explicitly, do "make config"
 config::
 	$(CONFIGURE_CMD)
diff -Naur Canna37p3.orig/canna/widedef.h Canna37p3/canna/widedef.h
--- Canna37p3.orig/canna/widedef.h	2003-12-27 17:15:20.000000000 +0000
+++ Canna37p3/canna/widedef.h	2005-05-29 15:00:31.000000000 +0000
@@ -32,12 +32,12 @@
 #endif
 
 #if (defined(__FreeBSD__) && __FreeBSD_version < 500000) \
-    || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+    || defined(__NetBSD__) || defined(__OpenBSD__)
 # include <machine/ansi.h>
 #endif
 
 #if (defined(__FreeBSD__) && __FreeBSD_version < 500000) \
-    || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+    || defined(__NetBSD__) || defined(__OpenBSD__)
 # ifdef _BSD_WCHAR_T_
 #  undef _BSD_WCHAR_T_
 #  ifdef WCHAR16
@@ -45,10 +45,6 @@
 #  else
 #   define _BSD_WCHAR_T_ unsigned long
 #  endif
-#  if defined(__APPLE__) && defined(__WCHAR_TYPE__)
-#   undef __WCHAR_TYPE__
-#   define __WCHAR_TYPE__ _BSD_WCHAR_T_
-#  endif
 #  include <stddef.h>
 #  define _WCHAR_T
 # endif
@@ -59,6 +55,14 @@
 # endif
 # include <stddef.h>
 # define _WCHAR_T
+#elif defined(__APPLE__)
+# ifdef WCHAR16
+typedef unsigned short wchar_t;
+# else
+typedef unsigned long wchar_t;
+# endif
+# define _BSD_WCHAR_T_DEFINED_ /* <= 10.3 */
+# define _WCHAR_T /* >= 10.4 */
 #else
 #if !defined(WCHAR_T) && !defined(_WCHAR_T) && !defined(_WCHAR_T_) \
  && !defined(__WCHAR_T) && !defined(_GCC_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
diff -Naur Canna37p3.orig/dic/ideo/words/chimei.t Canna37p3/dic/ideo/words/chimei.t
--- Canna37p3.orig/dic/ideo/words/chimei.t	2003-09-27 06:18:39.000000000 +0000
+++ Canna37p3/dic/ideo/words/chimei.t	2005-05-29 14:59:54.000000000 +0000
@@ -714,7 +714,7 @@
 ���礦���� #CN ����
 ���礦�Ȥ��� #CNS �����
 ���礦�ʤ� #CNS �����
-���礦�Ф󤻤� #CNS ������
+���礦�Ф󤻤� #CNS ������
 ���礦�褦�� #CNS ���ۻ�
 ����ۡ��� #CN ����ۡ���
 ���󤰤��ޤ� #CN ������
diff -Naur Canna37p3.orig/dic/phono/Imakefile Canna37p3/dic/phono/Imakefile
--- Canna37p3.orig/dic/phono/Imakefile	2002-10-19 08:27:40.000000000 +0000
+++ Canna37p3/dic/phono/Imakefile	2005-05-29 14:59:54.000000000 +0000
@@ -25,7 +25,11 @@
                 KPDIC = $(CMDDIR)/kpdic/kpdic
 #endif
 
+#ifdef HasGcc
+       ROMAJI_DIC_DEF = -DSHIFT -traditional
+#else
        ROMAJI_DIC_DEF = -DSHIFT
+#endif
 
                DICDIR = $(cannaLibDir)/dic
             SAMPLEDIR = $(cannaLibDir)/sample
diff -Naur Canna37p3.orig/hosts.canna Canna37p3/hosts.canna
--- Canna37p3.orig/hosts.canna	1970-01-01 00:00:00.000000000 +0000
+++ Canna37p3/hosts.canna	2005-05-29 14:59:54.000000000 +0000
@@ -0,0 +1,2 @@
+unix
+localhost
diff -Naur Canna37p3.orig/lib/canna/lisp.c Canna37p3/lib/canna/lisp.c
--- Canna37p3.orig/lib/canna/lisp.c	2004-04-26 22:49:21.000000000 +0000
+++ Canna37p3/lib/canna/lisp.c	2006-03-23 17:24:20.000000000 +0000
@@ -2643,15 +2643,21 @@
 int n;
 {
   list p, t;
-  FILE *instream, *fopen();
+  list noerror = NIL;
+  FILE *instream;
 
-  argnchk("load",1);
+  if (n != 1 && n != 2)
+    argnerr("load");
+  if (n == 2)
+    noerror = pop1();
   p = pop1();
   if ( !stringp(p) ) {
     error("load: illegal file name  ",p);
     /* NOTREACHED */
   }
   if ((instream = fopen(xstring(p), "r")) == (FILE *)NULL) {
+    if (noerror)
+      return NIL;
     error("load: file not found  ",p);
     /* NOTREACHED */
   }
diff -Naur Canna37p3.orig/server/util.c Canna37p3/server/util.c
--- Canna37p3.orig/server/util.c	2003-09-21 12:56:29.000000000 +0000
+++ Canna37p3/server/util.c	2005-06-04 15:28:41.000000000 +0000
@@ -24,10 +24,10 @@
 static char rcs_id[] = "$Id: util.c,v 1.8 2003/09/21 12:56:29 aida_s Exp $";
 #endif
 
-#include "server.h"
-#if 1 /* unused */
+#if 0 /* unused */
 #include "widedef.h"
 #endif
+#include "server.h"
 
 size_t
 ushort2euc(src, srclen, dest, destlen)
@@ -104,7 +104,7 @@
   return j;
 }
 
-#if 1 /* unused */
+#if 0 /* unused */
 size_t
 wchar2ushort32(src, srclen, dest, destlen)
 register const wchar_t *src;
diff -Naur Canna37p3.orig/update-canna-dics-dir Canna37p3/update-canna-dics-dir
--- Canna37p3.orig/update-canna-dics-dir	1970-01-01 00:00:00.000000000 +0000
+++ Canna37p3/update-canna-dics-dir	2005-05-29 14:59:54.000000000 +0000
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:@PREFIX@/bin:@PREFIX@/sbin
+export PATH
+
+LIST_FILE=@PREFIX@/var/lib/canna/dic/canna/dics.dir
+LIST_DIR=@PREFIX@/var/lib/canna/dics.d
+
+TMPFILE=`tempfile`
+cat ${LIST_DIR}/* >>${TMPFILE}
+mv ${TMPFILE} ${LIST_FILE}
+chmod 0644 ${LIST_FILE}
+chown canna:canna ${LIST_FILE}
+
+exit 0