xref: /PHP-8.4/ext/dba/config.w32 (revision 77ad57c6)
1// vim:ft=javascript
2
3ARG_WITH("dba", "DBA support", "no");
4ARG_WITH("qdbm", "DBA: QDBM support", "no");
5ARG_WITH("db", "DBA: Berkeley DB support", "no");
6ARG_WITH("lmdb", "DBA: Lightning memory-mapped database support", "no");
7
8if (PHP_DBA != "no") {
9	EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
10	ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba");
11	ADD_SOURCES("ext/dba/libflatfile", "flatfile.c", "dba");
12	ADD_SOURCES("ext/dba/libinifile", "inifile.c", "dba");
13	AC_DEFINE('HAVE_DBA', 1, "Define to 1 if the PHP extension 'dba' is available.");
14	ADD_FLAG("CFLAGS_DBA", "/D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1");
15
16	if (PHP_DB != "no") {
17		if (CHECK_LIB("libdb31s.lib;libdb61.lib", "dba", PHP_DBA) &&
18			CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) {
19			ADD_FLAG("CFLAGS_DBA", "/D DB1_VERSION=\"\\\"Berkeley DB 1.85 emulation in DB3\\\"\" /D DB1_INCLUDE_FILE=\"\\\"db_185.h\\\"\" /D DBA_DB3=1 /D DB3_INCLUDE_FILE=\"\\\"db.h\\\"\"");
20		} else {
21			WARNING("dba: db handlers not enabled; libraries and headers not found");
22		}
23	}
24
25	if (PHP_QDBM != "no") {
26		if (CHECK_LIB("qdbm_a.lib;qdbm.lib", "dba", PHP_DBA) &&
27			CHECK_HEADER_ADD_INCLUDE("depot.h", "CFLAGS_DBA", PHP_DBA + ";" + PHP_PHP_BUILD + "\\include\\qdbm")) {
28			ADD_SOURCES("ext/dba", "dba_qdbm.c", "dba");
29			AC_DEFINE("QDBM_INCLUDE_FILE", "<depot.h>", "The QDBM handler header file.", false);
30			AC_DEFINE("DBA_QDBM", 1, "Define to 1 if the dba extension uses the QDBM handler.");
31		} else {
32			WARNING("dba: qdbm handlers not enabled; libraries and headers not found");
33		}
34	}
35
36	if (PHP_LMDB != "no") {
37		if (CHECK_LIB("liblmdb_a.lib", "dba", PHP_DBA) &&
38			CHECK_HEADER_ADD_INCLUDE("lmdb.h", "CFLAGS_DBA") &&
39			CHECK_LIB("ntdll.lib", "dba", PHP_DBA)) {
40			ADD_SOURCES("ext/dba", "dba_lmdb.c", "dba");
41			AC_DEFINE("LMDB_INCLUDE_FILE", "<lmdb.h>", "The LMDB handler header file.", false);
42			AC_DEFINE("DBA_LMDB", 1, "Define to 1 if the dba extension uses the LMDB handler.");
43		} else {
44			WARNING("dba: lmdb handlers not enabled; libraries and headers not found");
45		}
46	}
47}
48