[groonga-commit:1430] ranguba/chupatext [master] * binding/ruby/chupa_ruby.c: separated from module.

null+ranguba at clear-code.com null+ranguba at clear-code.com
Thu Oct 7 04:39:06 EDT 2010


Nobuyoshi Nakada	2010-10-07 08:39:06 +0000 (Thu, 07 Oct 2010)

  New Revision: f71828815c100a83d4f4a8bfcf8717cf3321da47

  Log:
    * binding/ruby/chupa_ruby.c: separated from module.

  Added files:
    binding/Makefile.am
    binding/ruby/Makefile.am
  Modified files:
    Makefile.am
    configure.ac
    module/Makefile.am
    module/ruby.c
  Renamed files:
    binding/ruby/chupa_ruby.c
      (from module/chupa_ruby.c)
    binding/ruby/chupa_ruby.h
      (from module/chupa_ruby.h)

  Modified: Makefile.am (+1 -1)
===================================================================
--- Makefile.am    2010-10-07 05:39:14 +0000 (475d489)
+++ Makefile.am    2010-10-07 08:39:06 +0000 (133a15c)
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = build tool data chupatext test module license po apt
+SUBDIRS = build tool data chupatext test binding module license po apt
 
 pkginclude_HEADERS = chupatext.h
 

  Added: binding/Makefile.am (+1 -0) 100644
===================================================================
--- /dev/null
+++ binding/Makefile.am    2010-10-07 08:39:06 +0000 (00ad581)
@@ -0,0 +1 @@
+SUBDIRS = ruby

  Added: binding/ruby/Makefile.am (+21 -0) 100644
===================================================================
--- /dev/null
+++ binding/ruby/Makefile.am    2010-10-07 08:39:06 +0000 (e1c5084)
@@ -0,0 +1,21 @@
+DEFAULT_INCLUDES = -I$(top_includedir) -I$(build_includedir)
+
+LDFLAGS = -L$(top_builddir)/chupatext -lchupatext
+
+lib_LTLIBRARIES = libchuparuby.la
+
+CHUPA_RUBY_CFLAGS = $(RUBY_CFLAGS)
+CHUPA_RUBY_CPPFLAGS =				\
+	$(RUBY_CPPFLAGS)			\
+	$(GLIB_CFLAGS)				\
+	$(GSF_CFLAGS)
+CHUPA_RUBY_LIBADD = $(RUBY_LDFLAGS) $(RUBY_LIBS) $(GSF_LIBS)
+
+libchuparuby_la_SOURCES = chupa_ruby.c
+libchuparuby_la_CFLAGS = $(CHUPA_RUBY_CFLAGS)
+libchuparuby_la_CPPFLAGS =			\
+	$(CHUPA_RUBY_CPPFLAGS)			\
+	-DCHUPA_RUBY_DIR=\"$(rubydir)\"		\
+	-DRUBY_ARCH=\"$(rubyarch)\"		\
+	$(EMPTY)
+libchuparuby_la_LIBADD = $(CHUPA_RUBY_LIBADD)

  Renamed: binding/ruby/chupa_ruby.c (+13 -0) 94%
===================================================================
--- module/chupa_ruby.c    2010-10-07 05:39:14 +0000 (4ff5df3)
+++ binding/ruby/chupa_ruby.c    2010-10-07 08:39:06 +0000 (2cc8680)
@@ -18,12 +18,25 @@
  *  MA  02110-1301  USA
  */
 
+#define CHUPA_TYPE_RUBY_DECOMPOSER <<<error>>>
 #include "chupa_ruby.h"
 
 static VALUE chupa_ruby_gets(VALUE self);
 static VALUE chupa_ruby_read(int argc, VALUE *argv, VALUE self);
 static VALUE chupa_ruby_decompose(VALUE self);
 
+GType
+chupa_ruby_decomposer_get_type(void)
+{
+    static volatile gsize chupa_ruby_decomposer_type_id__volatile = 0;
+    if (g_once_init_enter(&chupa_ruby_decomposer_type_id__volatile)) {
+        GObject *ruby = G_OBJECT(chupa_decomposer_new("ruby", NULL));
+        g_once_init_leave(&chupa_ruby_decomposer_type_id__volatile,
+                          G_TYPE_FROM_INSTANCE(ruby));
+    }
+    return chupa_ruby_decomposer_type_id__volatile;
+}
+
 static void
 chupa_ruby_dispose(void *ptr)
 {

  Renamed: binding/ruby/chupa_ruby.h (+5 -1) 94%
===================================================================
--- module/chupa_ruby.h    2010-10-07 05:39:14 +0000 (ae6721e)
+++ binding/ruby/chupa_ruby.h    2010-10-07 08:39:06 +0000 (a7e8730)
@@ -44,7 +44,7 @@ VALUE chupa_ruby_decomposed(VALUE self, VALUE data);
 VALUE chupa_ruby_init(void);
 
 /* decomposer */
-#define CHUPA_TYPE_RUBY_DECOMPOSER chupa_type_ruby_decomposer
+GType chupa_ruby_decomposer_get_type(void);
 #define CHUPA_RUBY_DECOMPOSER(obj)            \
   G_TYPE_CHECK_INSTANCE_CAST(obj, CHUPA_TYPE_RUBY_DECOMPOSER, ChupaRubyDecomposer)
 #define CHUPA_RUBY_DECOMPOSER_CLASS(klass)    \
@@ -56,6 +56,10 @@ VALUE chupa_ruby_init(void);
 #define CHUPA_RUBY_DECOMPOSER_GET_CLASS(obj)  \
   G_TYPE_INSTANCE_GET_CLASS(obj, CHUPA_TYPE_RUBY_DECOMPOSER, ChupaRubyDecomposerClass)
 
+#ifndef CHUPA_TYPE_RUBY_DECOMPOSER
+#define CHUPA_TYPE_RUBY_DECOMPOSER chupa_ruby_decomposer_get_type()
+#endif
+
 typedef struct _ChupaRubyDecomposer ChupaRubyDecomposer;
 typedef struct _ChupaRubyDecomposerClass ChupaRubyDecomposerClass;
 

  Modified: configure.ac (+2 -0)
===================================================================
--- configure.ac    2010-10-07 05:39:14 +0000 (dc8eb57)
+++ configure.ac    2010-10-07 08:39:06 +0000 (7367d6b)
@@ -204,6 +204,8 @@ AC_CONFIG_FILES([Makefile
 		 test/Makefile
 		 test/fixtures/Makefile
 		 module/Makefile
+		 binding/Makefile
+		 binding/ruby/Makefile
 		 license/Makefile
 		 apt/Makefile])
 AC_OUTPUT

  Modified: module/Makefile.am (+15 -8)
===================================================================
--- module/Makefile.am    2010-10-07 05:39:14 +0000 (6582d91)
+++ module/Makefile.am    2010-10-07 08:39:06 +0000 (6cfe03c)
@@ -2,6 +2,7 @@ EMPTY =
 
 DEFAULT_INCLUDES = -I$(top_includedir) -I$(build_includedir)
 
+binding_dir = $(top_builddir)/binding
 LDFLAGS = -module -L$(top_builddir)/chupatext -lchupatext
 
 decomposer_LTLIBRARIES =
@@ -30,6 +31,8 @@ factory_LTLIBRARIES += powerpoint_factory.la
 if HAVE_RUBY
 decomposer_LTLIBRARIES += ruby.la
 factory_LTLIBRARIES += ruby_factory.la
+decomposer_LTLIBRARIES += html.la
+factory_LTLIBRARIES += html_factory.la
 endif
 
 text_la_SOURCES = text.c
@@ -141,17 +144,21 @@ powerpoint_factory_la_CPPFLAGS =				\
 	-DCHUPA_LOG_DOMAIN=\"ChupaText-PowerPointFactory\"
 powerpoint_factory_la_LIBADD = $(GLIB_LIBS)
 
-ruby_la_SOURCES = ruby.c chupa_ruby.c
-ruby_la_CFLAGS = $(RUBY_CFLAGS)
-ruby_la_CPPFLAGS =				\
+CHUPA_RUBY_CFLAGS = $(RUBY_CFLAGS)
+CHUPA_RUBY_CPPFLAGS =				\
+	-I$(top_srcdir)/binding/ruby		\
 	$(RUBY_CPPFLAGS)			\
 	$(GLIB_CFLAGS)				\
-	$(GSF_CFLAGS)				\
-	-DCHUPA_RUBY_DIR=\"$(rubydir)\"		\
-	-DRUBY_ARCH=\"$(rubyarch)\"		\
+	$(GSF_CFLAGS)
+CHUPA_RUBY_LIBADD = $(RUBY_LDFLAGS) $(RUBY_LIBS) $(GSF_LIBS)
+
+ruby_la_SOURCES = ruby.c
+ruby_la_CFLAGS = $(CHUPA_RUBY_CFLAGS)
+ruby_la_CPPFLAGS =				\
+	$(CHUPA_RUBY_CPPFLAGS)			\
 	-DG_LOG_DOMAIN=\"ChupaText-Ruby\"	\
 	-DCHUPA_LOG_DOMAIN=\"ChupaText-Ruby\"
-ruby_la_LIBADD = $(RUBY_LDFLAGS) $(RUBY_LIBS) $(GSF_LIBS)
+ruby_la_LIBADD = $(binding_dir)/ruby/libchuparuby.la $(CHUPA_RUBY_LIBADD)
 
 ruby_factory_la_SOURCES = ruby_factory.c
 ruby_factory_la_CPPFLAGS =				\
@@ -159,4 +166,4 @@ ruby_factory_la_CPPFLAGS =				\
 	$(GSF_CFLAGS)					\
 	-DG_LOG_DOMAIN=\"ChupaText-RubyFactory\"	\
 	-DCHUPA_LOG_DOMAIN=\"ChupaText-RubyFactory\"
-ruby_factory_la_LIBADD = $(RUBY_LIBS) $(GLIB_LIBS)
+ruby_factory_la_LIBADD = $(GLIB_LIBS)

  Modified: module/ruby.c (+1 -0)
===================================================================
--- module/ruby.c    2010-10-07 05:39:14 +0000 (d340b38)
+++ module/ruby.c    2010-10-07 08:39:06 +0000 (b607b1d)
@@ -18,6 +18,7 @@
  *  MA  02110-1301  USA
  */
 
+#define CHUPA_TYPE_RUBY_DECOMPOSER chupa_type_ruby_decomposer
 #include "chupa_ruby.h"
 
 static GType chupa_type_ruby_decomposer = 0;



More information about the groonga-commit mailing list