Sha256: 6f87699515ceb6a082fb1903fb4d4e9f2c168d2273cfff2f9da605128da6ef6c

Contents?: true

Size: 1.8 KB

Versions: 44

Compression:

Stored size: 1.8 KB

Contents

ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/

# :stopdoc:

require 'mkmf'

ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
specified_curl = ARGV[0] =~ /^--with-curl/ ? ARGV[0].split("=")[1] : nil
LIBDIR = specified_curl ? "#{specified_curl}/lib": Config::CONFIG['libdir']
INCLUDEDIR = specified_curl ? "#{specified_curl}/include" : Config::CONFIG['includedir']

if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby'
  $LIBRUBYARG_STATIC.gsub!(/-static/, '')
end

$CFLAGS << " #{ENV["CFLAGS"]}"
if Config::CONFIG['target_os'] == 'mingw32'
  $CFLAGS << " -DXP_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF"
elsif Config::CONFIG['target_os'] == 'solaris2'
  $CFLAGS << " -DUSE_INCLUDED_VASPRINTF"
else
  $CFLAGS << " -g -DXP_UNIX"
end

use_macports = !(defined?(RUBY_ENGINE) && RUBY_ENGINE != 'ruby')
$LIBPATH << "/opt/local/lib" if use_macports

$CFLAGS << " -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline"

if Config::CONFIG['target_os'] == 'mingw32'
  header = File.join(ROOT, 'cross', 'curl-7.19.4.win32', 'include')
  unless find_header('curl/curl.h', header)
    abort "need libcurl"
  end
else
  HEADER_DIRS = [
    File.join(INCLUDEDIR, "curl"),
    INCLUDEDIR,
    '/usr/include/curl',
    '/usr/local/include/curl'
  ]

  [
    '/opt/local/include/curl',
    '/opt/local/include',
  ].each { |x| HEADER_DIRS.unshift(x) } if use_macports

  unless find_header('curl/curl.h', *HEADER_DIRS)
    abort "need libcurl"
  end
end

if Config::CONFIG['target_os'] == 'mingw32'
  find_library('curl', 'curl_easy_init',
               File.join(ROOT, 'cross', 'curl-7.19.4.win32', 'bin'))
else
  find_library('curl', 'curl_easy_init',
               LIBDIR,
               '/opt/local/lib',
               '/usr/local/lib',
               '/usr/lib'
    )
end

create_makefile("typhoeus/native")

Version data entries

44 entries across 44 versions & 8 rubygems

Version Path
marnen-typhoeus-0.3.7 ext/typhoeus/extconf.rb
marnen-typhoeus-0.3.6 ext/typhoeus/extconf.rb
marnen-typhoeus-0.3.5 ext/typhoeus/extconf.rb
marnen-typhoeus-0.3.4 ext/typhoeus/extconf.rb
typhoeus-0.3.3 ext/typhoeus/extconf.rb
typhoeus-0.3.2 ext/typhoeus/extconf.rb
xenda-typhoeus-0.2.4 ext/typhoeus/extconf.rb
typhoeus-0.2.4 ext/typhoeus/extconf.rb
typhoeus-0.2.3 ext/typhoeus/extconf.rb
arachni-typhoeus-0.2.0.2 ext/typhoeus/extconf.rb
typhoeus-0.2.2 ext/typhoeus/extconf.rb
arachni-typhoeus-0.2.0.1 ext/typhoeus/extconf.rb
arachni-typhoeus-0.2.0 ext/typhoeus/extconf.rb
typhoeus-0.2.1 ext/typhoeus/extconf.rb
typhoeus-0.2.0 ext/typhoeus/extconf.rb
fblee-typhoeus-0.1.31 ext/typhoeus/extconf.rb
tech-angels-typhoeus-0.1.36 ext/typhoeus/extconf.rb
typhoeus-0.1.31 ext/typhoeus/extconf.rb
typhoeus-0.1.30 ext/typhoeus/extconf.rb
typhoeus-0.1.29 ext/typhoeus/extconf.rb