[前][次][番号順一覧][スレッド一覧]

ruby-changes:53683

From: nobu <ko1@a...>
Date: Wed, 21 Nov 2018 12:27:06 +0900 (JST)
Subject: [ruby-changes:53683] nobu:r65899 (trunk): configure.ac: add --disable-fiber-coroutine option

nobu	2018-11-21 12:26:59 +0900 (Wed, 21 Nov 2018)

  New Revision: 65899

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65899

  Log:
    configure.ac: add --disable-fiber-coroutine option
    
    * configure.ac: add --disable-fiber-coroutine option, and disable
      it on x86-mingw32 for now.

  Modified files:
    trunk/Makefile.in
    trunk/common.mk
    trunk/configure.ac
    trunk/win32/Makefile.sub
Index: common.mk
===================================================================
--- common.mk	(revision 65898)
+++ common.mk	(revision 65899)
@@ -138,6 +138,7 @@ COMMONOBJS    = array.$(OBJEXT) \ https://github.com/ruby/ruby/blob/trunk/common.mk#L138
 		vm_backtrace.$(OBJEXT) \
 		vm_dump.$(OBJEXT) \
 		vm_trace.$(OBJEXT) \
+		$(COROUTINE_OBJ) \
 		$(DTRACE_OBJ) \
 		$(BUILTIN_ENCOBJS) \
 		$(BUILTIN_TRANSOBJS) \
@@ -895,8 +896,9 @@ strstr.$(OBJEXT): {$(VPATH)}strstr.c https://github.com/ruby/ruby/blob/trunk/common.mk#L896
 nt.$(OBJEXT): {$(VPATH)}nt.c
 ia64.$(OBJEXT): {$(VPATH)}ia64.s
 	$(CC) $(CFLAGS) -c $<
-$(COROUTINE_H:.h=).$(OBJEXT): {$(VPATH)}$(COROUTINE_H:.h=).$(ASMEXT)
-$(COROUTINE_H:.h=).$(OBJEXT): $(COROUTINE_H:Context.h=.time)
+.coroutine_obj $(COROUTINE_OBJ): \
+	{$(VPATH)}$(COROUTINE_H:.h=).$(ASMEXT) \
+	$(COROUTINE_H:Context.h=.time)
 $(COROUTINE_H:Context.h=.time):
 	$(Q) $(MAKEDIRS) $(@D)
 	@exit > $@
Index: win32/Makefile.sub
===================================================================
--- win32/Makefile.sub	(revision 65898)
+++ win32/Makefile.sub	(revision 65899)
@@ -293,10 +293,10 @@ DLNOBJ = dln.obj https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L293
 COROUTINE_H = coroutine/Win64/Context.h
 !elseif "$(ARCH)" == "i386"
 COROUTINE_H = coroutine/Win32/Context.h
+!else
+COROUTINE_H =
 !endif
-!if defined(COROUTINE_H)
-MISSING = $(MISSING) $(COROUTINE_H:.h=.obj)
-!endif
+COROUTINE_OBJ = $(COROUTINE_H:.h=.obj)
 
 ARFLAGS = -machine:$(MACHINE) -out:
 LD = $(CC)
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 65898)
+++ Makefile.in	(revision 65899)
@@ -144,6 +144,7 @@ XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L144
 BOOTSTRAPRUBY = @BOOTSTRAPRUBY@
 
 COROUTINE_H = @X_FIBER_COROUTINE_H@
+COROUTINE_OBJ = $(COROUTINE_H:.h=.@OBJEXT@)
 
 #### End of system configuration section. ####
 
Index: configure.ac
===================================================================
--- configure.ac	(revision 65898)
+++ configure.ac	(revision 65899)
@@ -963,6 +963,7 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.ac#L963
 		AS_IF([test "$target_cpu" = x64], [
 		    ac_cv_func___builtin_setjmp=no
 		    ac_cv_func_round=no
+		    rb_cv_fiber_coroutine=no # TODO: Enable this after AppVeyor msys2 build succeeds
 		])
 		ac_cv_func_tgamma=no
 		rb_cv_negative_time_t=yes
@@ -2326,38 +2327,35 @@ AS_IF([test "${universal_binary-no}" = y https://github.com/ruby/ruby/blob/trunk/configure.ac#L2327
     AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
 ])
 
-AC_MSG_CHECKING(native coroutine implementation for ${target_cpu}-${target_os})
-AS_CASE(["$target_cpu-$target_os"],
-  [x*64-darwin*], [
-    AC_MSG_RESULT(amd64)
-    COROUTINE_H=coroutine/amd64/Context.h
-    AC_DEFINE_UNQUOTED(FIBER_USE_COROUTINE, ["$COROUTINE_H"])
-    AC_LIBOBJ([coroutine/amd64/Context])
-  ],
-  [x*64-linux], [
-    AC_MSG_RESULT(amd64)
-    COROUTINE_H=coroutine/amd64/Context.h
-    AC_DEFINE_UNQUOTED(FIBER_USE_COROUTINE, ["$COROUTINE_H"])
-    AC_LIBOBJ([coroutine/amd64/Context])
-  ],
-  [*86-linux], [
-    AC_MSG_RESULT(x86)
-    COROUTINE_H=coroutine/x86/Context.h
+AC_ARG_ENABLE(fiber-coroutine,
+    AS_HELP_STRING([--disable-fiber-coroutine], [disable native coroutine implementation for fiber]),
+    [rb_cv_fiber_coroutine=$enableval])
+AS_CASE(["$rb_cv_fiber_coroutine"], [yes|''], [
+    AC_MSG_CHECKING(native coroutine implementation for ${target_cpu}-${target_os})
+    AS_CASE(["$target_cpu-$target_os"],
+	[x*64-darwin*], [
+	    rb_cv_fiber_coroutine=amd64
+	],
+	[x*64-linux], [
+	    rb_cv_fiber_coroutine=amd64
+	],
+	[*86-linux], [
+	    rb_cv_fiber_coroutine=x86
+	],
+	[x64-mingw32], [
+	    rb_cv_fiber_coroutine=win64
+	],
+	[*], [
+	    rb_cv_fiber_coroutine=
+	]
+    )
+    AC_MSG_RESULT(${rb_cv_fiber_coroutine:-no})
+])
+AS_IF([test "${rb_cv_fiber_coroutine:-no}" != no], [
+    COROUTINE_H=coroutine/$rb_cv_fiber_coroutine/Context.h
     AC_DEFINE_UNQUOTED(FIBER_USE_COROUTINE, ["$COROUTINE_H"])
-    AC_LIBOBJ([coroutine/x86/Context])
-  ],
-  # TODO: Enable this after AppVeyor msys2 build succeeds
-  # [x64-mingw32], [
-  #   AC_MSG_RESULT(win64)
-  #   COROUTINE_H=coroutine/win64/Context.h
-  #   AC_DEFINE_UNQUOTED(FIBER_USE_COROUTINE, ["$COROUTINE_H"])
-  #   AC_LIBOBJ([coroutine/win64/Context])
-  # ],
-  [*], [
-    AC_MSG_RESULT(no)
-  ]
-)
-AC_SUBST(X_FIBER_COROUTINE_H, [$COROUTINE_H])
+    AC_SUBST(X_FIBER_COROUTINE_H, [$COROUTINE_H])
+])
 
 AS_IF([test x"$enable_pthread" = xyes], [
     for pthread_lib in thr pthread pthreads c c_r root; do

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]