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

ruby-changes:73540

From: U.Nakamura <ko1@a...>
Date: Tue, 13 Sep 2022 15:45:02 +0900 (JST)
Subject: [ruby-changes:73540] 316b44df09 (master): Add GMP support for mswin

https://git.ruby-lang.org/ruby.git/commit/?id=316b44df09

From 316b44df09d3bf9dcabb8e2ce9528c72304c1bd4 Mon Sep 17 00:00:00 2001
From: "U.Nakamura" <usa@r...>
Date: Tue, 13 Sep 2022 15:43:05 +0900
Subject: Add GMP support for mswin

---
 win32/Makefile.sub  | 6 ++++++
 win32/configure.bat | 7 +++++++
 win32/setup.mak     | 4 ++++
 3 files changed, 17 insertions(+)

diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 9a6bb47e10..361af556cd 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -288,6 +288,9 @@ LIBS = user32.lib advapi32.lib shell32.lib ws2_32.lib https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L288
 !if $(MSC_VER) >= 1400
 LIBS = $(LIBS) iphlpapi.lib
 !endif
+!if defined(USE_GMP)
+LIBS = $(LIBS) gmp.lib
+!endif
 LIBS = $(LIBS) imagehlp.lib shlwapi.lib bcrypt.lib $(EXTLIBS)
 !endif
 !if !defined(MISSING)
@@ -904,6 +907,9 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L907
 !if "$(EXTSTATIC)" == "static"
 #define EXTSTATIC 1
 !endif
+!if "$(USE_GMP)" != ""
+#define USE_GMP 1
+!endif
 #define EXECUTABLE_EXTS $(EXECUTABLE_EXTS)
 #define RUBY_COREDLL "$(RT)"
 #define RUBY_PLATFORM "$(arch)"
diff --git a/win32/configure.bat b/win32/configure.bat
index a3df0bb4eb..7253ade28b 100755
--- a/win32/configure.bat
+++ b/win32/configure.bat
@@ -48,6 +48,7 @@ if "%1" == "--with-git" goto :git https://github.com/ruby/ruby/blob/trunk/win32/configure.bat#L48
 if "%1" == "--without-git" goto :nogit
 if "%1" == "--without-ext" goto :witharg
 if "%1" == "--without-extensions" goto :witharg
+if "%1" == "--with-gmp" goto :gmp
 if "%opt:~0,10%" == "--without-" goto :withoutarg
 if "%opt:~0,7%" == "--with-" goto :witharg
 if "%1" == "-h" goto :help
@@ -210,6 +211,12 @@ goto :loop ; https://github.com/ruby/ruby/blob/trunk/win32/configure.bat#L211
   echo>>confargs.tmp  %1 \
   shift
 goto :loop ;
+:gmp
+  echo>> ~tmp~.mak 	"WITH_GMP=yes" \
+  echo>>confargs.tmp  %1=1 \
+  shift
+  shift
+goto :loop ;
 :witharg
   echo>>confargs.tmp  %1=%2\
   set witharg=1
diff --git a/win32/setup.mak b/win32/setup.mak
index 70565973c0..ddad061442 100644
--- a/win32/setup.mak
+++ b/win32/setup.mak
@@ -90,6 +90,10 @@ $(BANG)endif https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L90
 	@echo HAVE_GIT = $(HAVE_GIT)>> $(MAKEFILE)
 !endif
 
+!if "$(WITH_GMP)" == "yes"
+	@echo>>$(MAKEFILE) USE_GMP = 1
+!endif
+
 -osname-section-:
 	@$(APPEND)
 	@echo # TARGET>>$(MAKEFILE)
-- 
cgit v1.2.1


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

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