Skip to content

[ php-wasm ] Add xdebug shared extension to @php-wasm/node JSPI #2248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0136d51
Added -fPIC to libintl
mho22 Jun 5, 2025
f6f6a97
Set php-wasm as a main module and enable dynamic linking
mho22 Jun 5, 2025
990f945
Implement XDebug as zend extension, compile and build
mho22 Jun 9, 2025
aa63703
Remove artifacts
mho22 Jun 9, 2025
8e87691
Correct merge conflicts
mho22 Jun 9, 2025
6f82103
Build xdebug with nx command and PHP_VERSION arg
mho22 Jun 10, 2025
fcfebd3
Add a withXdebug option in loadNodeRuntime
mho22 Jun 10, 2025
6c14976
Create separate file for supported php versions
mho22 Jun 10, 2025
f0e2d7c
Add proper ini entries and mount current working directory in with-xd…
mho22 Jun 11, 2025
77ddbda
Compile all php-wasm and xdebug extensions
mho22 Jun 11, 2025
460c878
Prevent Xdebug to be loaded in Asyncify
mho22 Jun 16, 2025
29520ea
Add tests
mho22 Jun 16, 2025
549f04f
Remove socket connection error and recompile php
mho22 Jun 17, 2025
c6411e4
Correct conflicts
mho22 Jun 17, 2025
491d0bb
Correct lint errors and add tests to CI
mho22 Jun 17, 2025
b3cc02c
Added temporary new job test-unit-jspi
mho22 Jun 17, 2025
fefc94c
Add last test on DBGP communication
mho22 Jun 17, 2025
ffcf2c4
Correct conflicts
mho22 Jun 17, 2025
c382bef
Correct errors and clean unused code
mho22 Jun 17, 2025
e19f292
Correct Errors and make improvements
mho22 Jun 18, 2025
bd0729c
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 Jun 18, 2025
522a7ea
Add previous emscriptenOptions in new ones
mho22 Jun 18, 2025
ffe001f
Correct errors and implement modifications
mho22 Jun 19, 2025
2fe9bbe
Apply new filepath for built and unbuilt version
mho22 Jun 19, 2025
143c23c
Unbundle sqlite3 in PHP 7.3 and 7.2
mho22 Jun 19, 2025
a1eee4f
Document multiple processes like sqlite <7.4 and esbuild path replace…
mho22 Jun 23, 2025
63733cf
Implement an 'import-url' Vite plugin and an ESBuild plugin to handle…
mho22 Jun 24, 2025
f3fb08a
wrap zend_list_free Zend function to avoid function signature mismatc…
mho22 Jun 26, 2025
eccb56f
minor modifications
mho22 Jun 26, 2025
037a25b
Add comment and test for function signature mismatch
mho22 Jun 30, 2025
8e7b5c9
correct merge conflicts from trunk
mho22 Jul 1, 2025
dc7afb4
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 Jul 1, 2025
1e66704
remove only from the unknown function signature mismatch test
mho22 Jul 1, 2025
654df4a
Recompile Asyncify PHP versions with aditional asyncify imports
mho22 Jul 1, 2025
02b80ed
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 Jul 1, 2025
454e740
Try to solve failing checks
mho22 Jul 1, 2025
eec8621
add env variable in ci
mho22 Jul 1, 2025
afcfae0
experiment use of max_old_space_size with runner
mho22 Jul 1, 2025
82b6e58
add aftereach in tests which disposes PHP wasm runtime
mho22 Jul 1, 2025
3ffdd92
improve aftereach which disposes PHP wasm runtime
mho22 Jul 1, 2025
aa53bc3
improve aftereach which disposes PHP wasm runtime
mho22 Jul 1, 2025
e5e453b
add php-networking in ci jobs list
mho22 Jul 1, 2025
f4c2388
Tweak some timeouts to make the checks pass
mho22 Jul 1, 2025
7418095
Tweak some timeouts to make the checks pass
mho22 Jul 1, 2025
3763dbc
Tweak some timeouts to make the checks pass
mho22 Jul 1, 2025
57d15a6
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 Jul 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 35 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,37 @@ jobs:
fail-fast: false
matrix:
include:
- name: test-unit-asyncify (1/15)
- name: test-unit-asyncify (1/16)
target: test
- name: test-unit-asyncify (2/15)
- name: test-unit-asyncify (2/16)
target: test-php
- name: test-unit-asyncify (3/15)
- name: test-unit-asyncify (3/16)
target: test-php-networking
- name: test-unit-asyncify (4/16)
target: test-php-request-handler-files
- name: test-unit-asyncify (4/15)
- name: test-unit-asyncify (5/16)
target: test-php-request-handler-requests
- name: test-unit-asyncify (5/15)
- name: test-unit-asyncify (6/16)
target: test-php-asyncify-file-get-contents-http
- name: test-unit-asyncify (6/15)
- name: test-unit-asyncify (7/16)
target: test-php-asyncify-file-get-contents-https
- name: test-unit-asyncify (7/15)
- name: test-unit-asyncify (8/16)
target: test-php-asyncify-fopen-http
- name: test-unit-asyncify (8/15)
- name: test-unit-asyncify (9/16)
target: test-php-asyncify-fopen-https
- name: test-unit-asyncify (9/15)
- name: test-unit-asyncify (10/16)
target: test-php-asyncify-fsockopen-http
- name: test-unit-asyncify (10/15)
- name: test-unit-asyncify (11/16)
target: test-php-asyncify-fsockopen-https
- name: test-unit-asyncify (11/15)
- name: test-unit-asyncify (12/16)
target: test-php-asyncify-gethostbyname-http
- name: test-unit-asyncify (12/15)
- name: test-unit-asyncify (13/16)
target: test-php-asyncify-gethostbyname-https
- name: test-unit-asyncify (13/15)
- name: test-unit-asyncify (14/16)
target: test-php-asyncify-mysqli-http
- name: test-unit-asyncify (14/15)
- name: test-unit-asyncify (15/16)
target: test-php-asyncify-mysqli-https
- name: test-unit-sqlite3 (15/15)
- name: test-unit-asyncify (16/16)
target: test-php-asyncify-sqlite3
name: ${{ matrix.name }}
services:
Expand Down Expand Up @@ -88,6 +90,24 @@ jobs:
MYSQL_DATABASE: test_db
MYSQL_USER: user
MYSQL_PASSWORD: password
test-unit-jspi:
runs-on: ubuntu-latest
needs: [lint-and-typecheck]
strategy:
fail-fast: false
matrix:
include:
- name: test-unit-jspi (1/1)
target: test-php-dynamic-loading-jspi
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/prepare-playground
with:
node-version: 23
- run: node --expose-gc node_modules/nx/bin/nx affected --target=${{ matrix.target }}
# Most of these tests pass locally but the process is crashing
# on the CI runner.
#
Expand Down
1 change: 0 additions & 1 deletion packages/php-wasm/compile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ libintl/asyncify/dist/root/lib/lib/libintl.a: base-image
docker cp $$(docker create playground-php-wasm:libintl):/root/lib/include ./libintl/asyncify/dist/root/lib
docker cp $$(docker create playground-php-wasm:libintl):/root/lib/data/. ./libintl/


libintl_jspi: libintl/jspi/dist/root/lib/lib/libintl.a
libintl/jspi/dist/root/lib/lib/libintl.a: base-image
mkdir -p ./libintl/jspi/dist/root/lib
Expand Down
21 changes: 8 additions & 13 deletions packages/php-wasm/compile/base-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ RUN chmod a+x /root/replace.sh
COPY ./replace-across-lines.sh /root/replace-across-lines.sh
RUN chmod a+x /root/replace-across-lines.sh

COPY ./emcc-for-php-wasm.sh /root/emcc-for-php-wasm.sh

# Patch emcc to allow skipping flags and passing additional flags using environment variables.
#
# We're compiling libraries statically using emscripten's -sSIDE_MODULE. It differs from the usual unix
Expand All @@ -85,17 +87,10 @@ RUN chmod a+x /root/replace-across-lines.sh
# │ skip those flags when │ │ add these flags when │
# │ calling emcc │ │ calling emcc │
# └────────────────────────┘ └────────────────────────┘
RUN cp /root/emsdk/upstream/emscripten/emcc /root/emsdk/upstream/emscripten/emcc2 && \
cp /root/emsdk/upstream/emscripten/emcc.py /root/emsdk/upstream/emscripten/emcc2.py && \
echo $'#!/bin/bash\n\
for arg do shift\n\
[[ " ${EMCC_SKIP[*]} " =~ " ${arg} " ]] && continue \n\
set -- "$@" "$arg" \n\
done\n\
# Passing extra flags breaks the version check \n\
if [[ "$@" == "-v" ]]; then\n\
export EMCC_FLAGS=""\n\
fi\n\
/root/emsdk/upstream/emscripten/emcc2 "$@" $EMCC_FLAGS \n' > /root/emsdk/upstream/emscripten/emcc && \
RUN <<EOF
set -euo pipefail
cp /root/emsdk/upstream/emscripten/emcc /root/emsdk/upstream/emscripten/emcc2
cp /root/emsdk/upstream/emscripten/emcc.py /root/emsdk/upstream/emscripten/emcc2.py
cp /root/emcc-for-php-wasm.sh /root/emsdk/upstream/emscripten/emcc
chmod a+x /root/emsdk/upstream/emscripten/emcc

EOF
43 changes: 43 additions & 0 deletions packages/php-wasm/compile/base-image/emcc-for-php-wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

set -euo pipefail

# Passing extra flags breaks the version check
if [[ "$@" == "-v" ]]; then
export EMCC_FLAGS=""
fi

# Convert args to an array for filtering
args=("${@}")

# Remove flags that we do not want to pass to emcc
if [[ -n "${EMCC_SKIP:-}" ]]; then
for ((i=0; i < ${#args[@]}; i++)); do
if [[ " ${EMCC_SKIP[*]} " =~ " ${args[$i]} " ]]; then
unset 'args[i]'
fi
done
fi

# Remove duplicate library references to avoid linking errors.
# Begin at end because we generally want dependencies to come last,
# and if two things depend on a lib, we want the lib to come after both.
declare -A seen_libs
for ((i=${#args[@]} - 1; i >= 0; i--)); do
# Skip empty args because array may be sparse
[[ -z "${args[$i]:-}" ]] && continue

arg=${args[i]}
if (
[[ "$arg" =~ ^-l([a-z]|[A-Z]|[0-9]|[\-_])+$ ]] ||
[[ "$arg" =~ (^|/)lib([a-z]|[A-Z]|[0-9]|[\-_])+\.a$ ]]
); then
if [[ -v seen_libs["$arg"] ]]; then
unset 'args[i]'
else
seen_libs["$arg"]=1
fi
fi
done

/root/emsdk/upstream/emscripten/emcc2 "${args[@]}" ${EMCC_FLAGS:-}
6 changes: 4 additions & 2 deletions packages/php-wasm/compile/libintl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ RUN set -euxo pipefail && \
cd /root/icu/source && \
mkdir -p /root/lib && \
source /root/emsdk/emsdk_env.sh && \
export CFLAGS="-fPIC" && \
export CXXFLAGS="-fPIC" && \
emconfigure ./configure \
--build=i386-pc-linux-gnu \
--target=wasm32-unknown-emscripten \
Expand All @@ -41,8 +43,8 @@ RUN set -euxo pipefail && \
--disable-shared \
--enable-static && \
export JSPI_FLAGS=$(if [ "$JSPI" = "1" ]; then echo "-sSUPPORT_LONGJMP=wasm -fwasm-exceptions"; else echo ""; fi) && \
EMCC_FLAGS=" -D__x86_64__ -sSIDE_MODULE $JSPI_FLAGS " emmake make -j"$(nproc)" && \
EMCC_FLAGS=" -D__x86_64__ -sSIDE_MODULE $JSPI_FLAGS " emmake make install -i;
EMCC_FLAGS=" -D__x86_64__ -fPIC -sSIDE_MODULE $JSPI_FLAGS " emmake make -j"$(nproc)" && \
EMCC_FLAGS=" -D__x86_64__ -fPIC -sSIDE_MODULE $JSPI_FLAGS " emmake make install;


RUN set -euxo pipefail && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SOBJ=so
A=a
LIBPREFIX=lib
LIB_EXT_ORDER=.74.2
COMPILE=/root/emsdk/upstream/emscripten/emcc -ffunction-sections -fdata-sections -D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -DU_HAVE_STRING_VIEW=1 -DU_ATTRIBUTE_DEPRECATED= -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c
COMPILE=/root/emsdk/upstream/emscripten/emcc -ffunction-sections -fdata-sections -D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -DU_HAVE_STRING_VIEW=1 -DU_ATTRIBUTE_DEPRECATED= -fPIC -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c
LIBFLAGS=-I/root/lib/include -DPIC -fPIC
GENLIB=/root/emsdk/upstream/emscripten/emcc -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wl,--gc-sections -shared -Wl,-Bsymbolic
GENLIB=/root/emsdk/upstream/emscripten/emcc -fPIC -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wl,--gc-sections -shared -Wl,-Bsymbolic
LDICUDTFLAGS=-nodefaultlibs -nostdlib
LD_SONAME=-Wl,-soname -Wl,
RPATH_FLAGS=
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ SOBJ=so
A=a
LIBPREFIX=lib
LIB_EXT_ORDER=.74.2
COMPILE=/root/emsdk/upstream/emscripten/emcc -ffunction-sections -fdata-sections -D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -DU_HAVE_STRING_VIEW=1 -DU_ATTRIBUTE_DEPRECATED= -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c
COMPILE=/root/emsdk/upstream/emscripten/emcc -ffunction-sections -fdata-sections -D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1 -DU_HAVE_STRING_VIEW=1 -DU_ATTRIBUTE_DEPRECATED= -fPIC -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c
LIBFLAGS=-I/root/lib/include -DPIC -fPIC
GENLIB=/root/emsdk/upstream/emscripten/emcc -O2 -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wl,--gc-sections -shared -Wl,-Bsymbolic
GENLIB=/root/emsdk/upstream/emscripten/emcc -fPIC -std=c11 -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wl,--gc-sections -shared -Wl,-Bsymbolic
LDICUDTFLAGS=-nodefaultlibs -nostdlib
LD_SONAME=-Wl,-soname -Wl,
RPATH_FLAGS=
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
86 changes: 86 additions & 0 deletions packages/php-wasm/compile/libsqlite3/<7.4/pdo_sqlite_config.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
dnl config.m4 for extension pdo_sqlite
dnl vim:et:sw=2:ts=2:

PHP_ARG_WITH(pdo-sqlite, for sqlite 3 support for PDO,
[ --without-pdo-sqlite[=DIR]
PDO: sqlite 3 support. DIR is the sqlite base
install directory [BUNDLED]], $PHP_PDO)

if test "$PHP_PDO_SQLITE" != "no"; then

if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.])
fi

ifdef([PHP_CHECK_PDO_INCLUDES],
[
PHP_CHECK_PDO_INCLUDES
],[
AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then
pdo_cv_inc_path=$phpincludedir/ext
else
AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi
AC_MSG_RESULT($pdo_cv_inc_path)
])

php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c"

SEARCH_PATH="$PHP_PDO_SQLITE /root/lib" # you might want to change this
SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this
if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter
PDO_SQLITE_DIR=$PHP_PDO_SQLITE
else # search default path list
AC_MSG_CHECKING([for sqlite3 files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
PDO_SQLITE_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$PDO_SQLITE_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the sqlite3 distribution])
fi

PHP_ADD_INCLUDE($PDO_SQLITE_DIR/include)

LIBNAME=sqlite3
LIBSYMBOL=sqlite3_open

PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PDO_SQLITE_DIR/$PHP_LIBDIR, PDO_SQLITE_SHARED_LIBADD)
AC_DEFINE(HAVE_PDO_SQLITELIB,1,[ ])
],[
AC_MSG_ERROR([wrong sqlite lib version or lib not found])
],[
-L$PDO_SQLITE_DIR/$PHP_LIBDIR -lm
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
AC_DEFINE(HAVE_SQLITE3_KEY,1, [have commercial sqlite3 with crypto support])
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_close_v2,[
AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2])
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[
AC_DEFINE(HAVE_SQLITE3_COLUMN_TABLE_NAME, 1, [have sqlite3_column_table_name])
])

PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_cv_inc_path)

dnl Solaris fix
PHP_CHECK_LIBRARY(rt, fdatasync, [PHP_ADD_LIBRARY(rt,, PDO_SQLITE_SHARED_LIBADD)])

ifdef([PHP_ADD_EXTENSION_DEP],
[
PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
])
fi
70 changes: 70 additions & 0 deletions packages/php-wasm/compile/libsqlite3/<7.4/sqlite_config0.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
dnl config.m4 for extension sqlite3
dnl vim:et:ts=2:sw=2

PHP_ARG_WITH(sqlite3, whether to enable the SQLite3 extension,
[ --without-sqlite3[=DIR] Do not include SQLite3 support. DIR is the prefix to
SQLite3 installation directory.], yes)

if test $PHP_SQLITE3 != "no"; then
sqlite3_extra_sources=""
PHP_SQLITE3_CFLAGS=" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 "

dnl when running phpize enable_maintainer_zts is not available
if test -z "$enable_maintainer_zts"; then
if test -f "$phpincludedir/main/php_config.h"; then
ZTS=`grep '#define ZTS' $phpincludedir/main/php_config.h|$SED 's/#define ZTS//'`
if test "$ZTS" -eq "1"; then
enable_maintainer_zts="yes"
fi
fi
fi

AC_MSG_CHECKING([for sqlite3 files in default path])
for i in $PHP_SQLITE3 /root/lib; do
if test -r $i/include/sqlite3.h; then
SQLITE3_DIR=$i
AC_MSG_RESULT(found in $i)
break
fi
done

if test -z "$SQLITE3_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the sqlite distribution from http://www.sqlite.org])
fi

AC_MSG_CHECKING([for SQLite 3.3.9+])
PHP_CHECK_LIBRARY(sqlite3, sqlite3_prepare_v2, [
AC_MSG_RESULT(found)
PHP_ADD_LIBRARY_WITH_PATH(sqlite3, $SQLITE3_DIR/$PHP_LIBDIR, SQLITE3_SHARED_LIBADD)
PHP_ADD_INCLUDE($SQLITE3_DIR/include)
],[
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please install SQLite 3.3.9 first or check libsqlite3 is present])
],[
-L$SQLITE3_DIR/$PHP_LIBDIR -lm
])

PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
AC_DEFINE(HAVE_SQLITE3_KEY, 1, [have commercial sqlite3 with crypto support])
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[
AC_DEFINE(SQLITE_ENABLE_COLUMN_METADATA, 1, [have sqlite3 with column metadata enabled])
])
PHP_CHECK_LIBRARY(sqlite3,sqlite3_errstr,[
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function])
])

PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension,
[],
[AC_DEFINE(SQLITE_OMIT_LOAD_EXTENSION, 1, [have sqlite3 with extension support])
])

AC_DEFINE(HAVE_SQLITE3,1,[ ])

sqlite3_sources="sqlite3.c $sqlite3_extra_sources"

PHP_NEW_EXTENSION(sqlite3, $sqlite3_sources, $ext_shared,,$PHP_SQLITE3_CFLAGS)
PHP_ADD_BUILD_DIR([$ext_builddir/libsqlite])
PHP_SUBST(SQLITE3_SHARED_LIBADD)
fi
Loading
Loading