summaryrefslogtreecommitdiff
path: root/ext/dbm/extconf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-21 21:13:52 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-21 21:13:52 +0000
commit8963f50f269f93d2ca7034cf3c6508e9df1686f6 (patch)
tree127b6202d4b90dfc3b69ce7254e64dd26be9da4c /ext/dbm/extconf.rb
parent80a6b1474d2238bde20fc770bc51792ebef0e892 (diff)
* ext/dbm/extconf.rb: check DBM_SUFFIX for Mac OS X.
Its ndbm.h doesn't include db.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm/extconf.rb')
-rw-r--r--ext/dbm/extconf.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index f2bf148..e821690 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -152,6 +152,9 @@ def headers.db_check2(db, hdr)
# it defines _DB_H_.
have_db_header = have_macro('_DB_H_', hdr, hsearch)
+ # Mac OS X uses Berkeley DB 1 but ndbm.h doesn't include db.h.
+ have_db_header |= have_macro('DBM_SUFFIX', hdr, hsearch)
+
# Old GDBM's ndbm.h, until 1.8.3, defines dbm_clearerr as a macro which
# expands to no tokens.
have_gdbm_header1 = have_empty_macro_dbm_clearerr(hdr, hsearch)
@@ -172,6 +175,10 @@ def headers.db_check2(db, hdr)
return false
end
+ if have_db_header
+ $defs.push('-DRUBYDBM_DB_HEADER')
+ end
+
have_gdbm_header = have_gdbm_header1 | have_gdbm_header2
if have_gdbm_header
$defs.push('-DRUBYDBM_GDBM_HEADER')