xref: /php-src/ext/pdo_sqlite/config.m4 (revision 693ec809)
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  PHP_CHECK_PDO_INCLUDES
9
10  PHP_SETUP_SQLITE([PDO_SQLITE_SHARED_LIBADD])
11
12  PHP_CHECK_LIBRARY([sqlite3], [sqlite3_close_v2],
13    [AC_DEFINE([HAVE_SQLITE3_CLOSE_V2], [1],
14      [Define to 1 if SQLite library has the 'sqlite3_close_v2' function.])],
15    [],
16    [$PDO_SQLITE_SHARED_LIBADD])
17
18  PHP_CHECK_LIBRARY([sqlite3], [sqlite3_column_table_name],
19    [AC_DEFINE([HAVE_SQLITE3_COLUMN_TABLE_NAME], [1],
20      [Define to 1 if SQLite library was compiled with the
21      SQLITE_ENABLE_COLUMN_METADATA and has the 'sqlite3_column_table_name'
22      function.])],
23    [],
24    [$PDO_SQLITE_SHARED_LIBADD])
25
26  PHP_CHECK_LIBRARY([sqlite3], [sqlite3_load_extension],
27    [],
28    [AC_DEFINE([PDO_SQLITE_OMIT_LOAD_EXTENSION], [1],
29      [Define to 1 if SQLite library was compiled with the
30      SQLITE_OMIT_LOAD_EXTENSION and does not have the extension support with
31      the 'sqlite3_load_extension' function. For usage in the pdo_sqlite. See
32      https://www.sqlite.org/compile.html.])],
33    [$PDO_SQLITE_SHARED_LIBADD])
34
35  PHP_SUBST([PDO_SQLITE_SHARED_LIBADD])
36  PHP_NEW_EXTENSION([pdo_sqlite],
37    [pdo_sqlite.c sqlite_driver.c sqlite_statement.c sqlite_sql_parser.c],
38    [$ext_shared])
39
40  PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
41  PHP_ADD_MAKEFILE_FRAGMENT
42fi
43