xref: /PHP-8.3/ext/pdo_sqlite/config.m4 (revision 3a4d0d36)
1PHP_ARG_WITH([pdo-sqlite],
2  [for sqlite 3 support for PDO],
3  [AS_HELP_STRING([--without-pdo-sqlite],
4    [PDO: sqlite 3 support.])],
5  [$PHP_PDO])
6
7if test "$PHP_PDO_SQLITE" != "no"; then
8
9  if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
10    AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
11  fi
12
13  PHP_CHECK_PDO_INCLUDES
14
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)
19  AC_DEFINE(HAVE_PDO_SQLITELIB, 1, [Define to 1 if you have the pdo_sqlite extension enabled.])
20
21  PHP_CHECK_LIBRARY(sqlite3, sqlite3_close_v2, [
22    AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2])
23  ], [], [$PDO_SQLITE_SHARED_LIBADD])
24
25  PHP_CHECK_LIBRARY(sqlite3, sqlite3_column_table_name, [
26    AC_DEFINE(HAVE_SQLITE3_COLUMN_TABLE_NAME, 1, [have sqlite3_column_table_name])
27  ], [], [$PDO_SQLITE_SHARED_LIBADD])
28
29  PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
30  PHP_NEW_EXTENSION(pdo_sqlite, pdo_sqlite.c sqlite_driver.c sqlite_statement.c,
31    $ext_shared,,-I$pdo_cv_inc_path)
32
33  PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
34fi
35