Skip to content

Commit 3e7d50b

Browse files
committed
(PA-4717) Support building ruby 3.2 on 32-bit Windows
1 parent ad6683b commit 3e7d50b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

configs/components/ruby-3.2.0.rb

+12-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@
111111
# cygwin opensshd & bash. So mkmf will convert compiler paths, e.g. -IC:/... to
112112
# cygwin paths, -I/cygdrive/c/..., which confuses mingw-w64. So specify the build
113113
# target explicitly.
114-
special_flags += " CPPFLAGS='-DFD_SETSIZE=2048' debugflags=-g --build x86_64-w64-mingw32 "
114+
special_flags += " CPPFLAGS='-DFD_SETSIZE=2048' debugflags=-g "
115+
116+
if platform.architecture == "x64"
117+
special_flags += " --build x86_64-w64-mingw32 "
118+
else
119+
special_flags += " --build i686-w64-mingw32 "
120+
end
115121
end
116122

117123
without_dtrace = [
@@ -221,7 +227,11 @@
221227
rbconfig_changes["LDFLAGS"] = "-L. -Wl,-rpath=/opt/puppetlabs/puppet/lib -fstack-protector -rdynamic -Wl,-export-dynamic -L/opt/puppetlabs/puppet/lib"
222228
end
223229
elsif platform.is_windows?
224-
rbconfig_changes["CC"] = "x86_64-w64-mingw32-gcc"
230+
if platform.architecture == "x64"
231+
rbconfig_changes["CC"] = "x86_64-w64-mingw32-gcc"
232+
else
233+
rbconfig_changes["CC"] = "i686-w64-mingw32-gcc"
234+
end
225235
end
226236

227237
pkg.add_source("file://resources/files/ruby_vendor_gems/operating_system.rb")

0 commit comments

Comments
 (0)