Top Level Namespace

Defined Under Namespace

Modules: Packsnap

Instance Method Summary collapse

Instance Method Details

#try_configureObject



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
39
40
41
42
43
44
# File 'ext/packsnap/extconf.rb', line 11

def try_configure
  return if system "./configure --disable-option-checking --disable-dependency-tracking --disable-gtest --without-gflags"

  if try_run 'int main(int argc, char** argv){ return __builtin_expect(1, 1) ? 0 : 1; }'
    $defs << '-DHAVE_BUILTIN_EXPECT'
  end

  if try_run 'int main(int argc, char** argv){ return (__builtin_ctzll(0x100000000LL) == 32) ? 0 : 1; }'
    $defs << '-DHAVE_BUILTIN_CTZ'
  end

  have_header("ruby/st.h")
  have_header("st.h")
  have_header 'dlfcn.h'
  have_header 'inttypes.h'
  have_header 'memory.h'
  have_header 'stddef.h'
  have_header 'stdint.h'
  have_header 'stdlib.h'
  have_header 'strings.h'
  have_header 'string.h'
  have_header 'sys/byteswap.h'
  have_header 'sys/endian.h'
  have_header 'sys/mman.h'
  have_header 'sys/resource.h'
  have_header 'sys/stat.h'
  have_header 'sys/types.h'
  have_header 'unistd.h'
  have_header 'windows.h'

  if try_run 'int main(int argc, char** argv){ int i = 1; return *((char*)&i); }'
    $defs << '-DWORDS_BIGENDIAN'
  end
end