summaryrefslogtreecommitdiff
path: root/ext/digest/digest_conf.rb
blob: 1b929d87322577380232529f98a02eb9645c6905 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: false

def digest_conf(name)
  unless with_config("bundled-#{name}")
    cc = with_config("common-digest")
    if cc == true or /\b#{name}\b/ =~ cc
      if File.exist?("#$srcdir/#{name}cc.h") and
        have_header("CommonCrypto/CommonDigest.h")
        $defs << "-D#{name.upcase}_USE_COMMONDIGEST"
        $headers << "#{name}cc.h"
        return :commondigest
      end
    end
  end
  $objs << "#{name}.#{$OBJEXT}"
  return
end