Skip to content

Commit cba3891

Browse files
authored
Join SQLite library setup M4 macros to PHP_SETUP_SQLITE (#14372)
Macro can simplify managing minimum version of SQLite library on less places.
1 parent 44c199c commit cba3891

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

build/php.m4

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,6 +1918,18 @@ AC_DEFUN([PHP_SETUP_EXPAT], [
19181918
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
19191919
])
19201920

1921+
dnl
1922+
dnl PHP_SETUP_SQLITE([shared-add])
1923+
dnl
1924+
dnl Common setup macro for SQLite library.
1925+
dnl
1926+
AC_DEFUN([PHP_SETUP_SQLITE], [
1927+
PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.7.7], [
1928+
PHP_EVAL_INCLINE([$SQLITE_CFLAGS])
1929+
PHP_EVAL_LIBLINE([$SQLITE_LIBS], [$1])
1930+
])
1931+
])
1932+
19211933
dnl ----------------------------------------------------------------------------
19221934
dnl Misc. macros
19231935
dnl ----------------------------------------------------------------------------

ext/pdo_sqlite/config.m4

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ if test "$PHP_PDO_SQLITE" != "no"; then
1212

1313
PHP_CHECK_PDO_INCLUDES
1414

15-
PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.7.7])
16-
17-
PHP_EVAL_INCLINE($SQLITE_CFLAGS)
18-
PHP_EVAL_LIBLINE($SQLITE_LIBS, PDO_SQLITE_SHARED_LIBADD)
15+
PHP_SETUP_SQLITE([PDO_SQLITE_SHARED_LIBADD])
1916

2017
PHP_CHECK_LIBRARY(sqlite3, sqlite3_close_v2, [
2118
AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2])

ext/sqlite3/config0.m4

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ PHP_ARG_WITH([sqlite3],
55
[yes])
66

77
if test $PHP_SQLITE3 != "no"; then
8-
PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.7.7])
9-
10-
PHP_EVAL_INCLINE($SQLITE_CFLAGS)
11-
PHP_EVAL_LIBLINE($SQLITE_LIBS, SQLITE3_SHARED_LIBADD)
8+
PHP_SETUP_SQLITE([SQLITE3_SHARED_LIBADD])
129
AC_DEFINE(HAVE_SQLITE3, 1, [Define to 1 if you have the sqlite3 extension enabled.])
1310

1411
PHP_CHECK_LIBRARY(sqlite3, sqlite3_errstr, [

0 commit comments

Comments
 (0)