|
91 | 91 | special_flags += " CFLAGS='#{settings[:cflags]}' LDFLAGS='#{settings[:ldflags]}' CPPFLAGS='#{settings[:cppflags]}' "
|
92 | 92 | end
|
93 | 93 |
|
| 94 | + # Ruby's build process requires a "base" ruby and we need a ruby to install |
| 95 | + # gems into the /opt/puppetlabs/puppet/lib directory. |
| 96 | + # |
| 97 | + # For cross-compiles, the base ruby must be executable on the host we're |
| 98 | + # building on (usually Intel), not the arch we're building for (such as |
| 99 | + # SPARC). This is usually pl-ruby. |
| 100 | + # |
| 101 | + # For native compiles, we don't want ruby's build process to use whatever ruby |
| 102 | + # is in the PATH, as it's probably too old to build ruby 3.2. And we don't |
| 103 | + # want to use/maintain pl-ruby if we don't have to. Instead set baseruby to |
| 104 | + # "no" which will force ruby to build and use miniruby. |
| 105 | + if platform.is_cross_compiled? |
| 106 | + special_flags += " --with-baseruby=#{host_ruby} " |
| 107 | + else |
| 108 | + special_flags += " --with-baseruby=no " |
| 109 | + end |
| 110 | + |
94 | 111 | if platform.is_aix?
|
95 | 112 | # This normalizes the build string to something like AIX 7.1.0.0 rather
|
96 | 113 | # than AIX 7.1.0.2 or something
|
97 | 114 | special_flags += " --build=#{settings[:platform_triple]} "
|
98 |
| - elsif platform.is_cross_compiled? && platform.is_linux? |
99 |
| - special_flags += " --with-baseruby=#{host_ruby} " |
100 | 115 | elsif platform.is_cross_compiled? && platform.is_macos?
|
101 | 116 | # When the target arch is aarch64, ruby incorrectly selects the 'ucontext' coroutine
|
102 | 117 | # implementation instead of 'arm64', so specify 'amd64' explicitly
|
103 | 118 | # https://github.com/ruby/ruby/blob/c9c2245c0a25176072e02db9254f0e0c84c805cd/configure.ac#L2329-L2330
|
104 |
| - special_flags += " --with-baseruby=#{host_ruby} --with-coroutine=arm64 " |
| 119 | + special_flags += " --with-coroutine=arm64 " |
105 | 120 | elsif platform.is_solaris? && platform.architecture == "sparc"
|
106 |
| - if platform.is_cross_compiled? |
107 |
| - special_flags += " --with-baseruby=#{host_ruby} " |
108 |
| - else |
| 121 | + unless platform.is_cross_compiled? |
109 | 122 | # configure seems to enable dtrace because the executable is present,
|
110 | 123 | # explicitly disable it and don't enable it below
|
111 |
| - special_flags += " --with-baseruby=no --enable-dtrace=no " |
| 124 | + special_flags += " --enable-dtrace=no " |
112 | 125 | end
|
113 | 126 | special_flags += "--enable-close-fds-by-recvmsg-with-peek "
|
114 |
| - elsif platform.name =~ /el-6/ || platform.name =~ /sles-11-x86_64/ |
115 |
| - # Since we're not cross compiling, ignore old ruby versions that happen to be in the PATH |
116 |
| - # and force ruby to build miniruby and use that to bootstrap the rest of the build |
117 |
| - special_flags += " --with-baseruby=no " |
| 127 | + |
118 | 128 | elsif platform.is_windows?
|
119 | 129 | # ruby's configure script guesses the build host is `cygwin`, because we're using
|
120 | 130 | # cygwin opensshd & bash. So mkmf will convert compiler paths, e.g. -IC:/... to
|
|
0 commit comments