diff options
| author | Benjamin Sanders <ben@Benjamins-MacBook-Pro.local> | 2025-10-11 10:34:24 -0400 |
|---|---|---|
| committer | Benjamin Sanders <ben@Benjamins-MacBook-Pro.local> | 2025-10-11 10:34:24 -0400 |
| commit | 5571dc766e2143e39762ff0b47c41d1c2e154f4c (patch) | |
| tree | f4f124d314a7e76c04484515aa0fd1f2e271a601 /vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext/fastfilereader/extconf.rb | |
| parent | 359f3309c97fc894b63e0a295c76ab298504d635 (diff) | |
Vendor bundled gems for deployment
Diffstat (limited to 'vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext/fastfilereader/extconf.rb')
| -rw-r--r-- | vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext/fastfilereader/extconf.rb | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext/fastfilereader/extconf.rb b/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext/fastfilereader/extconf.rb new file mode 100644 index 0000000..e4d64e4 --- /dev/null +++ b/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext/fastfilereader/extconf.rb @@ -0,0 +1,109 @@ +require 'mkmf' + +def check_libs libs = [], fatal = false + libs.all? { |lib| have_library(lib) || (abort("could not find library: #{lib}") if fatal) } +end + +def check_heads heads = [], fatal = false + heads.all? { |head| have_header(head) || (abort("could not find header: #{head}") if fatal)} +end + +def add_define(name) + $defs.push("-D#{name}") +end + +# Eager check devs tools +have_devel? if respond_to?(:have_devel?) + +add_define 'BUILD_FOR_RUBY' + +# Minor platform details between *nix and Windows: + +if RUBY_PLATFORM =~ /(mswin|mingw|bccwin)/ + GNU_CHAIN = ENV['CROSS_COMPILING'] || $1 == 'mingw' + OS_WIN32 = true + add_define "OS_WIN32" +else + GNU_CHAIN = true + OS_UNIX = true + add_define 'OS_UNIX' +end + +# Adjust number of file descriptors (FD) on Windows + +if RbConfig::CONFIG["host_os"] =~ /mingw/ + found = RbConfig::CONFIG.values_at("CFLAGS", "CPPFLAGS"). + any? { |v| v.include?("FD_SETSIZE") } + + add_define "FD_SETSIZE=32767" unless found +end + +# Main platform invariances: + +case RUBY_PLATFORM +when /mswin32/, /mingw32/, /bccwin32/ + check_heads(%w[windows.h winsock.h], true) + check_libs(%w[kernel32 rpcrt4 gdi32], true) + + if GNU_CHAIN + CONFIG['LDSHAREDXX'] = "$(CXX) -shared -static-libgcc -static-libstdc++" + else + $defs.push "-EHs" + $defs.push "-GR" + end + +when /solaris/ + add_define 'OS_SOLARIS8' + check_libs(%w[nsl socket], true) + + if CONFIG['CC'] == 'cc' && ( + `cc -flags 2>&1` =~ /Sun/ || # detect SUNWspro compiler + `cc -V 2>&1` =~ /Sun/ # detect Solaris Studio compiler + ) + # SUN CHAIN + add_define 'CC_SUNWspro' + $preload = ["\nCXX = CC"] # hack a CXX= line into the makefile + $CFLAGS = CONFIG['CFLAGS'] = "-KPIC" + CONFIG['CCDLFLAGS'] = "-KPIC" + CONFIG['LDSHARED'] = "$(CXX) -G -KPIC -lCstd" + CONFIG['LDSHAREDXX'] = "$(CXX) -G -KPIC -lCstd" + else + # GNU CHAIN + # on Unix we need a g++ link, not gcc. + CONFIG['LDSHARED'] = "$(CXX) -shared" + end + +when /openbsd/ + # OpenBSD branch contributed by Guillaume Sellier. + + # on Unix we need a g++ link, not gcc. On OpenBSD, linking against libstdc++ have to be explicitly done for shared libs + CONFIG['LDSHARED'] = "$(CXX) -shared -lstdc++ -fPIC" + CONFIG['LDSHAREDXX'] = "$(CXX) -shared -lstdc++ -fPIC" + +when /darwin/ + # on Unix we need a g++ link, not gcc. + # Ff line contributed by Daniel Harple. + CONFIG['LDSHARED'] = "$(CXX) " + CONFIG['LDSHARED'].split[1..-1].join(' ') + +when /linux/ + # on Unix we need a g++ link, not gcc. + CONFIG['LDSHARED'] = "$(CXX) -shared" + +when /aix/ + CONFIG['LDSHARED'] = "$(CXX) -Wl,-bstatic -Wl,-bdynamic -Wl,-G -Wl,-brtl" + +when /cygwin/ + # For rubies built with Cygwin, CXX may be set to CC, which is just + # a wrapper for gcc. + # This will compile, but it will not link to the C++ std library. + # Explicitly set CXX to use g++. + CONFIG['CXX'] = "g++" + # on Unix we need a g++ link, not gcc. + CONFIG['LDSHARED'] = "$(CXX) -shared" + +else + # on Unix we need a g++ link, not gcc. + CONFIG['LDSHARED'] = "$(CXX) -shared" +end + +create_makefile "fastfilereaderext" |
