diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-16 18:49:26 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-30 00:39:06 +0900 |
commit | fcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch) | |
tree | 64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/ext/zlib/extconf.rb |
Fresh start
Diffstat (limited to 'jni/ruby/ext/zlib/extconf.rb')
-rw-r--r-- | jni/ruby/ext/zlib/extconf.rb | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/jni/ruby/ext/zlib/extconf.rb b/jni/ruby/ext/zlib/extconf.rb new file mode 100644 index 0000000..d3a332b --- /dev/null +++ b/jni/ruby/ext/zlib/extconf.rb @@ -0,0 +1,64 @@ +# +# extconf.rb +# +# $Id: extconf.rb 37527 2012-11-06 18:50:53Z luislavena $ +# + +require 'mkmf' +require 'rbconfig' + +dir_config 'zlib' + + +if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and + have_header('zlib.h') then + + defines = [] + + Logging::message 'checking for kind of operating system... ' + os_code = with_config('os-code') || + case RUBY_PLATFORM.split('-',2)[1] + when 'amigaos' then + os_code = 'AMIGA' + when /\Aos2[\-_]emx\z/ then + os_code = 'OS2' + when /mswin|mingw|bccwin/ then + # NOTE: cygwin should be regarded as Unix. + os_code = 'WIN32' + else + os_code = 'UNIX' + end + os_code = 'OS_' + os_code.upcase + + OS_NAMES = { + 'OS_MSDOS' => 'MS-DOS', + 'OS_AMIGA' => 'Amiga', + 'OS_VMS' => 'VMS', + 'OS_UNIX' => 'Unix', + 'OS_ATARI' => 'Atari', + 'OS_OS2' => 'OS/2', + 'OS_MACOS' => 'MacOS', + 'OS_TOPS20' => 'TOPS20', + 'OS_WIN32' => 'Win32', + 'OS_VMCMS' => 'VM/CMS', + 'OS_ZSYSTEM' => 'Z-System', + 'OS_CPM' => 'CP/M', + 'OS_QDOS' => 'QDOS', + 'OS_RISCOS' => 'RISCOS', + 'OS_UNKNOWN' => 'Unknown', + } + unless OS_NAMES.key? os_code then + raise "invalid OS_CODE `#{os_code}'" + end + Logging::message "#{OS_NAMES[os_code]}\n" + defines << "OS_CODE=#{os_code}" + + $defs.concat(defines.collect{|d|' -D'+d}) + + have_func('crc32_combine', 'zlib.h') + have_func('adler32_combine', 'zlib.h') + have_type('z_crc_t', 'zlib.h') + + create_makefile('zlib') + +end |