Skip to content

Commit 36ae621

Browse files
committed
Fix checks for gdbm/ndbm headers.
1 parent 852b412 commit 36ae621

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Tools/configure/conf_syslibs.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,27 @@ def detect_dbm(v):
7373
else:
7474
v.have_ndbm = False
7575

76-
# Check for gdbm/ndbm.h and gdbm-ndbm.h
76+
# Check for gdbm/ndbm.h and gdbm-ndbm.h (matches configure.ac AC_CACHE_CHECK pattern)
7777
# "gdbm-ndbm.h" and "gdbm/ndbm.h" are both normalized to "gdbm_ndbm_h"
78-
ac_cv_header_gdbm_slash_ndbm_h = pyconf.check_header("gdbm/ndbm.h")
78+
ac_cv_header_gdbm_slash_ndbm_h = pyconf.check_header(
79+
"gdbm/ndbm.h", autodefine=False
80+
)
7981
if ac_cv_header_gdbm_slash_ndbm_h:
8082
pyconf.define(
8183
"HAVE_GDBM_NDBM_H",
8284
1,
8385
"Define to 1 if you have the <gdbm/ndbm.h> header file.",
8486
)
8587

86-
ac_cv_header_gdbm_dash_ndbm_h = pyconf.check_header("gdbm-ndbm.h")
88+
ac_cv_header_gdbm_dash_ndbm_h = pyconf.check_header(
89+
"gdbm-ndbm.h", autodefine=False
90+
)
91+
if ac_cv_header_gdbm_dash_ndbm_h:
92+
pyconf.define(
93+
"HAVE_GDBM_DASH_NDBM_H",
94+
1,
95+
"Define to 1 if you have the <gdbm-ndbm.h> header file.",
96+
)
8797

8898
if ac_cv_header_gdbm_slash_ndbm_h or ac_cv_header_gdbm_dash_ndbm_h:
8999
with pyconf.save_env():

configure-new

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7671,6 +7671,9 @@ function u_detect_dbm( _i_db, _n_db, _tmp_split, ac_cv_have_libdb, ac_cv_head
76717671
pyconf_define("HAVE_GDBM_NDBM_H", 1, 0, "Define to 1 if you have the <gdbm/ndbm.h> header file.")
76727672
}
76737673
ac_cv_header_gdbm_dash_ndbm_h = (pyconf_check_header("gdbm-ndbm.h") ? "yes" : "no")
7674+
if (((ac_cv_header_gdbm_dash_ndbm_h != "") && (ac_cv_header_gdbm_dash_ndbm_h != "no"))) {
7675+
pyconf_define("HAVE_GDBM_DASH_NDBM_H", 1, 0, "Define to 1 if you have the <gdbm-ndbm.h> header file.")
7676+
}
76747677
if ((((ac_cv_header_gdbm_slash_ndbm_h != "") && (ac_cv_header_gdbm_slash_ndbm_h != "no")) || ((ac_cv_header_gdbm_dash_ndbm_h != "") && (ac_cv_header_gdbm_dash_ndbm_h != "no")))) {
76757678
pyconf_save_env()
76767679
r = pyconf_search_libs("dbm_open", "gdbm_compat")

0 commit comments

Comments
 (0)