clogger RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
blob 60c46a720678637132523113c0a4f0e7736ba20c 1335 bytes (raw)
name: ext/clogger_ext/extconf.rb 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 
begin
  require 'mkmf'

  # XXX let me know if this works for you...
  if ! defined?(RUBY_VERSION) || RUBY_VERSION !~ /\A1\.[89]\./
    raise "Invalid RUBY_VERSION for C extension"
  end

  have_header('ruby.h') or raise "ruby.h header not found!"

  if have_header('fcntl.h')
    have_macro('F_GETFL', %w(fcntl.h))
    have_macro('O_NONBLOCK', %w(unistd.h fcntl.h))
  end

  unless have_macro('CLOCK_MONOTONIC', 'time.h', '-D_POSIX_C_SOURCE=200112L')
    $CPPFLAGS += '-D_POSIX_SOURCE_200112L'
    have_func('CLOCK_MONOTONIC', 'time.h')
  end
  have_func('localtime_r', 'time.h') or raise "localtime_r needed"
  have_func('gmtime_r', 'time.h') or raise "gmtime_r needed"
  have_func('rb_str_set_len', 'ruby.h')
  dir_config('clogger_ext')
  create_makefile('clogger_ext')
rescue Object => err
  warn "E: #{err.inspect}"
  warn "Skipping C extension, pure Ruby version will be used instead"

  # generate a dummy Makefile to fool rubygems installer
  targets = %w(all static clean distclean realclean
               install install-so install-rb install-rb-default
               pre-install-rb pre-install-rb-default
               site-install site-install-so site-install-rb)
  File.open(File.dirname(__FILE__) << "/Makefile", "wb") do |fp|
    fp.puts targets.join(' ') << ":"
    fp.puts "\techo >&2 extension disabled"
  end
end

debug log:

solving 60c46a7 ...
found 60c46a7 in https://yhbt.net/clogger.git/

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/clogger.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).