Skip to content

Commit 77ad57c

Browse files
authored
Add and update ext/dba preprocessor macros help texts (#15221)
1 parent 0aec0fa commit 77ad57c

File tree

2 files changed

+57
-30
lines changed

2 files changed

+57
-30
lines changed

ext/dba/config.m4

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ if test "$PHP_QDBM" != "no"; then
151151
if test -n "$THIS_INCLUDE"; then
152152
for LIB in qdbm; do
153153
PHP_CHECK_LIBRARY([$LIB], [dpopen], [
154-
AC_DEFINE_UNQUOTED([QDBM_INCLUDE_FILE], ["$THIS_INCLUDE"], [ ])
155-
AC_DEFINE([DBA_QDBM], [1], [ ])
154+
AC_DEFINE_UNQUOTED([QDBM_INCLUDE_FILE], ["$THIS_INCLUDE"],
155+
[The QDBM handler header file.])
156+
AC_DEFINE([DBA_QDBM], [1],
157+
[Define to 1 if the dba extension uses the QDBM handler.])
156158
THIS_LIBS=$LIB
157159
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
158160
if test -n "$THIS_LIBS"; then
@@ -183,8 +185,10 @@ if test "$PHP_GDBM" != "no"; then
183185

184186
if test -n "$THIS_INCLUDE"; then
185187
PHP_CHECK_LIBRARY([gdbm], [gdbm_open], [
186-
AC_DEFINE_UNQUOTED([GDBM_INCLUDE_FILE], ["$THIS_INCLUDE"], [ ])
187-
AC_DEFINE([DBA_GDBM], [1], [ ])
188+
AC_DEFINE_UNQUOTED([GDBM_INCLUDE_FILE], ["$THIS_INCLUDE"],
189+
[The GDBM handler header file.])
190+
AC_DEFINE([DBA_GDBM], [1],
191+
[Define to 1 if the dba extension uses the GDBM handler.])
188192
THIS_LIBS=gdbm
189193
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
190194
fi
@@ -213,8 +217,10 @@ if test "$PHP_NDBM" != "no"; then
213217
if test -n "$THIS_INCLUDE"; then
214218
for LIB in ndbm db1 c; do
215219
PHP_CHECK_LIBRARY([$LIB], [dbm_open], [
216-
AC_DEFINE_UNQUOTED([NDBM_INCLUDE_FILE], ["$THIS_INCLUDE"], [ ])
217-
AC_DEFINE([DBA_NDBM], [1], [ ])
220+
AC_DEFINE_UNQUOTED([NDBM_INCLUDE_FILE], ["$THIS_INCLUDE"],
221+
[The NDBM handler header file.])
222+
AC_DEFINE([DBA_NDBM], [1],
223+
[Define to 1 if the dba extension uses the NDBM handler.])
218224
THIS_LIBS=$LIB
219225
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
220226
if test -n "$THIS_LIBS"; then
@@ -244,8 +250,10 @@ if test "$PHP_TCADB" != "no"; then
244250
if test -n "$THIS_INCLUDE"; then
245251
for LIB in tokyocabinet; do
246252
PHP_CHECK_LIBRARY([$LIB], [tcadbopen], [
247-
AC_DEFINE_UNQUOTED([TCADB_INCLUDE_FILE], ["$THIS_INCLUDE"], [ ])
248-
AC_DEFINE([DBA_TCADB], [1], [ ])
253+
AC_DEFINE_UNQUOTED([TCADB_INCLUDE_FILE], ["$THIS_INCLUDE"],
254+
[The Tokyo Cabinet handler header file.])
255+
AC_DEFINE([DBA_TCADB], [1],
256+
[Define to 1 if the dba extension uses the Tokyo Cabinet handler.])
249257
THIS_LIBS=$LIB
250258
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
251259
if test -n "$THIS_LIBS"; then
@@ -275,8 +283,10 @@ if test "$PHP_LMDB" != "no"; then
275283
if test -n "$THIS_INCLUDE"; then
276284
for LIB in lmdb; do
277285
PHP_CHECK_LIBRARY([$LIB], [mdb_env_open], [
278-
AC_DEFINE_UNQUOTED([LMDB_INCLUDE_FILE], ["$THIS_INCLUDE"], [ ])
279-
AC_DEFINE([DBA_LMDB], [1], [ ])
286+
AC_DEFINE_UNQUOTED([LMDB_INCLUDE_FILE], ["$THIS_INCLUDE"],
287+
[The LMDB handler header file.])
288+
AC_DEFINE([DBA_LMDB], [1],
289+
[Define to 1 if the dba extension uses the LMDB handler.])
280290
THIS_LIBS=$LIB
281291
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
282292
if test -n "$THIS_LIBS"; then
@@ -355,9 +365,11 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
355365
fi
356366
if test -n "$THIS_LIBS"; then
357367
AC_DEFINE_UNQUOTED([DBA_DB$1], [1],
358-
[Define to 1 if Berkeley DB is compatible with version $1.])
368+
[Define to 1 if the dba extension uses the Berkeley DB version $1 (DB$1)
369+
handler.])
359370
if test -n "$THIS_INCLUDE"; then
360-
AC_DEFINE_UNQUOTED(DB$1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
371+
AC_DEFINE_UNQUOTED([DB$1_INCLUDE_FILE], ["$THIS_INCLUDE"],
372+
[The DB$1 handler header file.])
361373
fi
362374
else
363375
AC_MSG_ERROR([DBA: Could not find necessary library.])
@@ -517,15 +529,18 @@ if test "$PHP_DB1" != "no"; then
517529
THIS_PREFIX=$DB2_PREFIX
518530
fi
519531
if test "$HAVE_DB4" = "1" || test "$HAVE_DB3" = "1" || test "$HAVE_DB2" = "1"; then
520-
AC_DEFINE_UNQUOTED(DB1_VERSION, "Berkeley DB 1.85 emulation in DB$THIS_VERSION", [ ])
532+
AC_DEFINE_UNQUOTED([DB1_VERSION],
533+
["Berkeley DB 1.85 emulation in DB$THIS_VERSION"],
534+
[The DB1 handler version information.])
521535
for i in db$THIS_VERSION/db_185.h include/db$THIS_VERSION/db_185.h include/db/db_185.h; do
522536
if test -f "$THIS_PREFIX/$i"; then
523537
THIS_INCLUDE=$THIS_PREFIX/$i
524538
break
525539
fi
526540
done
527541
else
528-
AC_DEFINE_UNQUOTED(DB1_VERSION, "Unknown DB1", [ ])
542+
AC_DEFINE([DB1_VERSION], ["Unknown DB1"],
543+
[The DB1 handler version information.])
529544
for i in $PHP_DB1 /usr/local /usr; do
530545
if test -f "$i/db1/db.h"; then
531546
THIS_PREFIX=$i
@@ -553,9 +568,11 @@ if test "$PHP_DB1" != "no"; then
553568
]],[[
554569
DB * dbp = dbopen("", 0, 0, DB_HASH, 0);
555570
]])],[
556-
AC_DEFINE_UNQUOTED(DB1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
571+
AC_DEFINE_UNQUOTED([DB1_INCLUDE_FILE], ["$THIS_INCLUDE"],
572+
[The DB1 handler header file.])
557573
AC_DEFINE([DBA_DB1], [1],
558-
[Define to 1 if Berkeley DB is compatible with version 1.])
574+
[Define to 1 the dba extension uses the Berkeley DB version 1 (DB1)
575+
handler.])
559576
THIS_RESULT=yes
560577
],[
561578
THIS_RESULT=no
@@ -590,15 +607,19 @@ if test "$PHP_DBM" != "no"; then
590607
for LIB in dbm c gdbm; do
591608
PHP_CHECK_LIBRARY([$LIB], [dbminit], [
592609
AC_MSG_CHECKING([for DBM using GDBM])
593-
AC_DEFINE_UNQUOTED([DBM_INCLUDE_FILE], ["$THIS_INCLUDE"], [ ])
610+
AC_DEFINE_UNQUOTED([DBM_INCLUDE_FILE], ["$THIS_INCLUDE"],
611+
[The DBM handler include file.])
594612
if test "$LIB" = "gdbm"; then
595-
AC_DEFINE_UNQUOTED([DBM_VERSION], ["GDBM"], [ ])
613+
AC_DEFINE([DBM_VERSION], ["GDBM"],
614+
[The DBM handler version information.])
596615
AC_MSG_RESULT([yes])
597616
else
598-
AC_DEFINE_UNQUOTED([DBM_VERSION], ["DBM"], [ ])
617+
AC_DEFINE([DBM_VERSION], ["DBM"],
618+
[The DBM handler version information.])
599619
AC_MSG_RESULT([no])
600620
fi
601-
AC_DEFINE([DBA_DBM], [1], [ ])
621+
AC_DEFINE([DBA_DBM], [1],
622+
[Define to 1 if the dba extension uses the DBM handler.])
602623
THIS_LIBS=$LIB
603624
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
604625
if test -n "$THIS_LIBS"; then
@@ -641,8 +662,10 @@ PHP_ARG_ENABLE([flatfile],,
641662

642663
dnl CDB
643664
if test "$PHP_CDB" = "yes"; then
644-
AC_DEFINE(DBA_CDB_BUILTIN, 1, [ ])
645-
AC_DEFINE(DBA_CDB, 1, [ ])
665+
AC_DEFINE([DBA_CDB_BUILTIN], [1],
666+
[Define to 1 if the dba extension uses the PHP built-in cdb handler.])
667+
AC_DEFINE([DBA_CDB], [1],
668+
[Define to 1 if the dba extension uses the cdb handler.])
646669
cdb_sources="libcdb/cdb.c libcdb/cdb_make.c libcdb/uint32.c"
647670
THIS_RESULT="builtin"
648671
elif test "$PHP_CDB" != "no"; then
@@ -658,8 +681,10 @@ elif test "$PHP_CDB" != "no"; then
658681
if test -n "$THIS_INCLUDE"; then
659682
for LIB in cdb c; do
660683
PHP_CHECK_LIBRARY([$LIB], [cdb_read], [
661-
AC_DEFINE_UNQUOTED([CDB_INCLUDE_FILE], ["$THIS_INCLUDE"], [ ])
662-
AC_DEFINE([DBA_CDB], [1], [ ])
684+
AC_DEFINE_UNQUOTED([CDB_INCLUDE_FILE], ["$THIS_INCLUDE"],
685+
[The cdb handler header file.])
686+
AC_DEFINE([DBA_CDB], [1],
687+
[Define to 1 if the dba extension uses the cdb handler.])
663688
THIS_LIBS=$LIB
664689
], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
665690
if test -n "$THIS_LIBS"; then
@@ -676,15 +701,17 @@ PHP_DBA_STD_RESULT(cdb)
676701

677702
dnl INIFILE
678703
if test "$PHP_INIFILE" != "no"; then
679-
AC_DEFINE(DBA_INIFILE, 1, [ ])
704+
AC_DEFINE([DBA_INIFILE], [1],
705+
[Define to 1 if the dba extension uses the bundled inifile handler.])
680706
ini_sources="libinifile/inifile.c"
681707
THIS_RESULT="builtin"
682708
fi
683709
PHP_DBA_STD_RESULT(inifile, [INI File])
684710

685711
dnl FLATFILE
686712
if test "$PHP_FLATFILE" != "no"; then
687-
AC_DEFINE(DBA_FLATFILE, 1, [ ])
713+
AC_DEFINE([DBA_FLATFILE], [1],
714+
[Define to 1 if the dba extension uses the bundled flatfile handler.])
688715
flat_sources="libflatfile/flatfile.c"
689716
THIS_RESULT="builtin"
690717
fi

ext/dba/config.w32

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ if (PHP_DBA != "no") {
2626
if (CHECK_LIB("qdbm_a.lib;qdbm.lib", "dba", PHP_DBA) &&
2727
CHECK_HEADER_ADD_INCLUDE("depot.h", "CFLAGS_DBA", PHP_DBA + ";" + PHP_PHP_BUILD + "\\include\\qdbm")) {
2828
ADD_SOURCES("ext/dba", "dba_qdbm.c", "dba");
29-
AC_DEFINE("QDBM_INCLUDE_FILE", "<depot.h>", "", false);
30-
AC_DEFINE("DBA_QDBM", 1, "");
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.");
3131
} else {
3232
WARNING("dba: qdbm handlers not enabled; libraries and headers not found");
3333
}
@@ -38,8 +38,8 @@ if (PHP_DBA != "no") {
3838
CHECK_HEADER_ADD_INCLUDE("lmdb.h", "CFLAGS_DBA") &&
3939
CHECK_LIB("ntdll.lib", "dba", PHP_DBA)) {
4040
ADD_SOURCES("ext/dba", "dba_lmdb.c", "dba");
41-
AC_DEFINE("LMDB_INCLUDE_FILE", "<lmdb.h>", "", false);
42-
AC_DEFINE("DBA_LMDB", 1, "");
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.");
4343
} else {
4444
WARNING("dba: lmdb handlers not enabled; libraries and headers not found");
4545
}

0 commit comments

Comments
 (0)