summaryrefslogtreecommitdiff
path: root/ext/digest/sha2/extconf.rb
blob: 412b2d4301788fa8786b445af3b7502281f43bb1 (plain)
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
# $RoughId: extconf.rb,v 1.1 2001/07/13 15:38:27 knu Exp $
# $Id$

require "mkmf"

$CFLAGS << " -DHAVE_CONFIG_H -I$(srcdir)/.."

$objs = [
  "sha2.#{$OBJEXT}",
  "sha2hl.#{$OBJEXT}",
  "sha2init.#{$OBJEXT}",
]

have_header("sys/cdefs.h")

have_header("inttypes.h")

have_header("unistd.h")

if try_run(<<SRC, $defs.join(' '))
#include "../defs.h"
int main(void) {
#ifdef NO_UINT64_T
    return 1;
#else
    return 0;
#endif
}
SRC
then
  create_makefile("digest/sha2")
else
  puts "** Cannot find a 64bit integer type - skipping the SHA2 module."
end