[Groonga-commit] groonga/groonga at a61f020 [master] Allow to select Onigmo support

Back to archive index

OBATA Akio null+****@clear*****
Mon Jan 16 17:02:00 JST 2017


OBATA Akio	2017-01-16 17:02:00 +0900 (Mon, 16 Jan 2017)

  New Revision: a61f020cf769bd6f5f7b1a0dc226d991ea293a3f
  https://github.com/groonga/groonga/commit/a61f020cf769bd6f5f7b1a0dc226d991ea293a3f

  Merged 0844dc7: Merge pull request #628 from obache/neatsrc/use-system-onigmo

  Message:
    Allow to select Onigmo support
    
    Introduce --with-onigmo GNU configure option.
    
     "bundled" (default):  use in-tree Onigmo
     "system": try to use system Onigomo or rise error
     "yes": try to use system Onigmo or fallback to in-tree one
     "no" (--without-onigmo): disalbe Onigmo support
    
    Default "bundled" is the same behavior so far.

  Modified files:
    configure.ac
    vendor/onigmo/Makefile.am

  Modified: configure.ac (+31 -7)
===================================================================
--- configure.ac    2017-01-13 12:49:54 +0900 (5be335e)
+++ configure.ac    2017-01-16 17:02:00 +0900 (8f2630a)
@@ -1570,16 +1570,40 @@ AC_ARG_ENABLE(shared-onigmo,
   [enable_shared_onigmo="no"])
 AM_CONDITIONAL(WITH_SHARED_ONIGMO, test "$enable_shared_onigmo" = "yes")
 
-# TODO: Support using system Onigmo instead of bundled Onigmo.
-AC_DEFINE(GRN_WITH_ONIGMO, [1], [Use Onigmo.])
-GRN_WITH_ONIGMO="yes"
+AC_ARG_WITH(onigmo,
+  [AS_HELP_STRING([--without-onigmo],
+    [Don't Use Onigmo. [default=bundled]])],
+  [with_onigmo="$withval"],
+  [with_onigmo="bundled"])
+if test "x$with_onigmo" != "xno"; then
+  GRN_WITH_ONIGMO="yes"
+  if test "x$with_onigmo" != "xbundled"; then
+    m4_ifdef([PKG_CHECK_MODULES], [
+      PKG_CHECK_MODULES([ONIGMO], [onigmo],
+        [_PKG_CONFIG(ONIGMO_LIBS_ONLY_L, [libs-only-L], [onigmo])
+         ONIGMO_LIBS_ONLY_L="$pkg_cv_ONIGMO_LIBS_ONLY_L"
+         have_onigmo=yes],
+        [have_onigmo=no])
+      ],
+      [have_onigmo=no])
+  fi
+  if test "x$with_onigmo" = "xsystem" -a "$have_onigmo" = "no"; then
+    AC_MSG_ERROR("No Onigmo found")
+  fi
+  if test "x$with_onigmo" = "xbundled" -o "$have_onigmo" = "no"; then
+    AC_CONFIG_SUBDIRS([vendor/onigmo])
+    ONIGMO_CFLAGS="-I\$(top_srcdir)/vendor/onigmo-source"
+    ONIGMO_LIBS="\$(top_builddir)/vendor/onigmo-source/libonigmo.la"
+    ONIGMO_LIBS_ONLY_L="-L\$(top_builddir)/vendor/onigmo-source"
+  fi
+  AC_DEFINE(GRN_WITH_ONIGMO, [1], [Use Onigmo.])
+else
+  GRN_WITH_ONIGMO="no"
+fi
 AC_SUBST(GRN_WITH_ONIGMO)
-AC_CONFIG_SUBDIRS([vendor/onigmo])
-
-ONIGMO_CFLAGS="-I\$(top_srcdir)/vendor/onigmo-source"
-ONIGMO_LIBS="\$(top_builddir)/vendor/onigmo-source/libonigmo.la"
 AC_SUBST(ONIGMO_CFLAGS)
 AC_SUBST(ONIGMO_LIBS)
+AM_CONDITIONAL(WITH_BUNDLED_ONIGMO, test "$with_onigmo" != "no" -a "x$have_onigmo" != "xyes")
 
 # PCRE
 GRN_WITH_PCRE=no

  Modified: vendor/onigmo/Makefile.am (+2 -0)
===================================================================
--- vendor/onigmo/Makefile.am    2017-01-13 12:49:54 +0900 (cbd419d)
+++ vendor/onigmo/Makefile.am    2017-01-16 17:02:00 +0900 (2e77323)
@@ -6,6 +6,7 @@ EXTRA_DIST =					\
 CONFIGURE_DEPENDENCIES =			\
 	configure
 
+if WITH_BUNDLED_ONIGMO
 ALL_DEPEND_TARGETS = onigmo-all
 CLEAN_DEPEND_TARGETS = onigmo-clean
 
@@ -28,3 +29,4 @@ onigmo-clean:
 	cd ../onigmo-source && $(MAKE) clean
 
 clean: $(CLEAN_DEPEND_TARGETS)
+endif
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index