[SCIM] Patch for Mac OS X

Etsushi Kato ekato at ees.hokudai.ac.jp
Sun Sep 5 07:26:15 PDT 2004


First of all, congratulation on the 1.0.0 release!

Now I managed to make SCIM compile and work fine on Mac OS X 10.3.5.
First, I needed to remove -lstdc++ from src/Makefile.in to make it
compile because of multiple definition of symbols which causes
MacOSX's linker error.  I think -lstdc++ in src/Makefile.in is also
redundant for other platforms since g++ implicitly adding this for
linking.

Second problem is that Mac OS X lacks definition of suseconds_t in
sys/types.h.  I need to add typedef int suseconds_t; for
module/Config/scim_gconf_config.cpp, scim_simple_config.cpp, and
scim_socket_config.cpp.  On Mac OS X, timeval.tv_usec is defined as
int32_t, so it's OK to use int for suseconds_t.  Is it possible to
check the existence of suseconds_t in configure script?

With these changes, SCIM-1.0.0 compiles without problem on Mac OS X,
but loading x11 FrontEnd module fails because x11.so module cannot be
loaded by ltdl.  I'm not sure about the detailed reason, but removing
"-all_load" from whole_archive_flag_spec of configure script enable
ltdl load that module fine.  This may be a libtool problem about
convenience library (static libXimd.a) linking for shared module for
Mac OS X.

Cheers,
-- 
Etsushi Kato
ekato at ees.hokudai.ac.jp

P.S. Please cc me if you reply to this mail.  I'm not subscribed to
this list.
-------------- next part --------------
diff -uNr scim-1.0.0.orig/configure scim-1.0.0/configure
--- scim-1.0.0.orig/configure	Thu Sep  2 16:00:21 2004
+++ scim-1.0.0/configure	Sun Sep  5 23:18:05 2004
@@ -11198,7 +11198,7 @@
       hardcode_direct=no
       hardcode_automatic=yes
       hardcode_shlibpath_var=unsupported
-      whole_archive_flag_spec='-all_load $convenience'
+      whole_archive_flag_spec='$convenience'
       link_all_deplibs=yes
     else
       ld_shlibs=no
@@ -13069,7 +13069,7 @@
     hardcode_direct=no
     hardcode_automatic=yes
     hardcode_shlibpath_var=unsupported
-    whole_archive_flag_spec='-all_load $convenience'
+    whole_archive_flag_spec='$convenience'
     link_all_deplibs=yes
   else
     ld_shlibs=no
@@ -14162,7 +14162,7 @@
     hardcode_direct_CXX=no
     hardcode_automatic_CXX=yes
     hardcode_shlibpath_var_CXX=unsupported
-    whole_archive_flag_spec_CXX='-all_load $convenience'
+    whole_archive_flag_spec_CXX='$convenience'
     link_all_deplibs_CXX=yes
   else
     ld_shlibs_CXX=no
@@ -18045,7 +18045,7 @@
       hardcode_direct_F77=no
       hardcode_automatic_F77=yes
       hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77='-all_load $convenience'
+      whole_archive_flag_spec_F77='$convenience'
       link_all_deplibs_F77=yes
     else
       ld_shlibs_F77=no
@@ -20392,7 +20392,7 @@
       hardcode_direct_GCJ=no
       hardcode_automatic_GCJ=yes
       hardcode_shlibpath_var_GCJ=unsupported
-      whole_archive_flag_spec_GCJ='-all_load $convenience'
+      whole_archive_flag_spec_GCJ='$convenience'
       link_all_deplibs_GCJ=yes
     else
       ld_shlibs_GCJ=no
diff -uNr scim-1.0.0.orig/modules/Config/scim_gconf_config.cpp scim-1.0.0/modules/Config/scim_gconf_config.cpp
--- scim-1.0.0.orig/modules/Config/scim_gconf_config.cpp	Thu May 13 18:03:45 2004
+++ scim-1.0.0/modules/Config/scim_gconf_config.cpp	Sun Sep  5 23:17:21 2004
@@ -40,6 +40,10 @@
 #define scim_config_module_init gconf_LTX_scim_config_module_init
 #define scim_config_module_create_config gconf_LTX_scim_config_module_create_config
 
+#ifdef __APPLE__
+typedef int suseconds_t;
+#endif
+
 using namespace scim;
 
 extern "C" {
diff -uNr scim-1.0.0.orig/modules/Config/scim_simple_config.cpp scim-1.0.0/modules/Config/scim_simple_config.cpp
--- scim-1.0.0.orig/modules/Config/scim_simple_config.cpp	Sun Jun 20 15:29:27 2004
+++ scim-1.0.0/modules/Config/scim_simple_config.cpp	Sun Sep  5 23:17:21 2004
@@ -50,6 +50,10 @@
 #define scim_config_module_init simple_LTX_scim_config_module_init
 #define scim_config_module_create_config simple_LTX_scim_config_module_create_config
 
+#ifdef __APPLE__
+typedef int suseconds_t;
+#endif
+
 extern "C" {
     void scim_module_init (void)
     {
diff -uNr scim-1.0.0.orig/modules/Config/scim_socket_config.cpp scim-1.0.0/modules/Config/scim_socket_config.cpp
--- scim-1.0.0.orig/modules/Config/scim_socket_config.cpp	Sun Jun 20 16:35:51 2004
+++ scim-1.0.0/modules/Config/scim_socket_config.cpp	Sun Sep  5 23:17:21 2004
@@ -42,6 +42,10 @@
 #define scim_config_module_init socket_LTX_scim_config_module_init
 #define scim_config_module_create_config socket_LTX_scim_config_module_create_config
 
+#ifdef __APPLE__
+typedef int suseconds_t;
+#endif
+
 extern "C" {
     void scim_module_init (void)
     {
diff -uNr scim-1.0.0.orig/src/Makefile.in scim-1.0.0/src/Makefile.in
--- scim-1.0.0.orig/src/Makefile.in	Thu Sep  2 16:00:19 2004
+++ scim-1.0.0/src/Makefile.in	Sun Sep  5 23:17:21 2004
@@ -447,8 +447,7 @@
 			  -rpath $(libdir) \
 			  @LIBTOOL_EXPORT_OPTIONS@ \
 			  @LIBICONV@ \
-			  @LTLIBINTL@ \
-			  -lstdc++
+			  @LTLIBINTL@
 
 libscim_1_0_la_LIBADD = libltdlc.la
 scim_SOURCES = scim.cpp 


More information about the scim mailing list