Browse Source

Tidy up package.xml file.

Cleaner approach for setting THREADSAFE and NDEBUG for bundled libsqlite.
Tested with: static, shared and shared with separate build roots under a
non-zts build only.
migration/unlabaled-1.3.2
Wez Furlong 24 years ago
parent
commit
276e721f96
  1. 39
      ext/sqlite/config.m4
  2. 4
      ext/sqlite/package.xml

39
ext/sqlite/config.m4

@ -47,24 +47,7 @@ if test "$PHP_SQLITE" != "no"; then
# use bundled library
PHP_SQLITE_CFLAGS="-I@ext_srcdir@/libsqlite/src"
if test "ek$EXTENSION_DIR" = "ek"; then
if test "$PHP_DEBUG" = "0"; then
PHP_SQLITE_CFLAGS="$PHP_SQLITE_CFLAGS -DNDEBUG"
fi
if test "$enable_experimental_zts" = "yes"; then
PHP_SQLITE_CFLAGS="$PHP_SQLITE_CFLAGS -DTHREADSAFE"
fi
else
php_sqlite_no_debug=`echo $EXTENSION_DIR | grep -c "no-debug"`
php_sqlite_non_zts=`echo $EXTENSION_DIR | grep -c "non-zts"`
if test "$php_sqlite_no_debug" != "0"; then
PHP_SQLITE_CFLAGS="$PHP_SQLITE_CFLAGS -DNDEBUG"
fi
if test "$php_sqlite_non_zts" = "0"; then
PHP_SQLITE_CFLAGS="$PHP_SQLITE_CFLAGS -DTHREADSAFE"
fi
fi
sources="libsqlite/src/opcodes.c
libsqlite/src/parse.c libsqlite/src/encode.c \
@ -97,15 +80,25 @@ if test "$PHP_SQLITE" != "no"; then
SQLITE_VERSION=`cat $ext_srcdir/libsqlite/VERSION`
AC_SUBST(SQLITE_VERSION)
if test "$ext_shared" = "no"; then
echo '#include "php_config.h"' > $ext_srcdir/libsqlite/src/config.h
else
echo "#include \"$abs_builddir/config.h\"" > $ext_srcdir/libsqlite/src/config.h
fi
cat >> $ext_srcdir/libsqlite/src/config.h <<EOF
#if ZTS
# define THREADSAFE 1
#endif
#if !ZEND_DEBUG
# define NDEBUG
#endif
EOF
sed -e s/--VERS--/`cat $ext_srcdir/libsqlite/VERSION`/ -e s/--ENCODING--/$SQLITE_ENCODING/ $ext_srcdir/libsqlite/src/sqlite.h.in >$ext_srcdir/libsqlite/src/sqlite.h
PHP_ADD_MAKEFILE_FRAGMENT
dnl if not building a shared extension, we need to generate a config.h file for
dnl the library
if test "$ext_shared" = "no"; then
echo '#include "php_config.h"' > $ext_srcdir/libsqlite/src/config.h
fi
fi
AC_CHECK_FUNCS(usleep nanosleep)

4
ext/sqlite/package.xml

@ -13,7 +13,7 @@
<maintainer>
<user>tal</user>
<name>Tal Peer</name>
<email>tal@php.net</name>
<email>tal@php.net</email>
<role>developer</role>
</maintainer>
</maintainers>
@ -54,6 +54,8 @@
<file role="test" name="tests/sqlite_002.phpt"/>
<file role="test" name="tests/sqlite_003.phpt"/>
<file role="test" name="tests/sqlite_004.phpt"/>
<file role="test" name="tests/sqlite_005.phpt"/>
<file role="test" name="tests/sqlite_006.phpt"/>
<file role="test" name="tests/blankdb.inc"/>
<dir name="libsqlite">

Loading…
Cancel
Save