diff --git a/configs/components/_base-ruby.rb b/configs/components/_base-ruby.rb index 1f9cd82dd..f302a7d53 100644 --- a/configs/components/_base-ruby.rb +++ b/configs/components/_base-ruby.rb @@ -76,6 +76,9 @@ elsif platform.architecture == 'arm64' && platform.os_version.to_i >= 13 pkg.environment 'CC', 'clang' end +else + pkg.environment 'LDFLAGS', settings[:ldflags] + pkg.environment 'optflags', settings[:cflags] end #################### diff --git a/configs/components/ruby-2.7.8.rb b/configs/components/ruby-2.7.8.rb index 73936bd9b..94b4f7715 100644 --- a/configs/components/ruby-2.7.8.rb +++ b/configs/components/ruby-2.7.8.rb @@ -98,7 +98,15 @@ special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} " - if platform.name =~ /sles-15|el-8|debian-10/ + # TODO: these flags are set in _base-ruby + # but there are conflicts with optflags being rewritten below + if ((platform.is_sles? && platform.os_version.to_i >= 15) || + (platform.is_el? && platform.os_version.to_i >= 8) || + platform.is_debian? || + (platform.is_ubuntu? && platform.os_version.to_i >= 20) || + (platform.is_amazon? && platform.os_version.to_i >= 2023) || + platform.is_fedora? + ) special_flags += " CFLAGS='#{settings[:cflags]}' LDFLAGS='#{settings[:ldflags]}' CPPFLAGS='#{settings[:cppflags]}' " end diff --git a/configs/components/ruby-3.2.3.rb b/configs/components/ruby-3.2.3.rb index b7e4a69df..a657e7a1c 100644 --- a/configs/components/ruby-3.2.3.rb +++ b/configs/components/ruby-3.2.3.rb @@ -93,7 +93,15 @@ special_flags = " --prefix=#{ruby_dir} --with-opt-dir=#{settings[:prefix]} " - if platform.name =~ /sles-15|el-8|debian-10/ + # TODO: these flags are set in _base-ruby + # but there are conflicts with optflags being rewritten below + if ((platform.is_sles? && platform.os_version.to_i >= 15) || + (platform.is_el? && platform.os_version.to_i >= 8) || + platform.is_debian? || + (platform.is_ubuntu? && platform.os_version.to_i >= 20) || + (platform.is_amazon? && platform.os_version.to_i >= 2023) || + platform.is_fedora? + ) special_flags += " CFLAGS='#{settings[:cflags]}' LDFLAGS='#{settings[:ldflags]}' CPPFLAGS='#{settings[:cppflags]}' " end