Skip to content

Commit c24ba47

Browse files
committed
Remove external zlib dependency from sqlite
1 parent 4900086 commit c24ba47

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
1. Download OpenSSL sources and extract it in the "phpdesktop/php/" directory. See https://github.com/openssl/openssl/releases .
1313
1. Download libiconv sources and extract in php/ directory. See https://www.gnu.org/software/libiconv/ .
1414
1. Download libxml2 official distribution tarball (tar.xz) and extract in php/ directory. See https://gitlab.gnome.org/GNOME/libxml2/-/releases .
15-
1. Download sqlite sources and extract in php/ directory. See https://www.sqlite.org/download.html .
1615
1. Download zlib 1.3.1 sources and extract in php/ directory. See https://github.com/madler/zlib/releases .
16+
1. Download sqlite sources and extract in php/ directory. See https://www.sqlite.org/download.html .
1717
1. Download PHP sources and extract it in the "phpdesktop/php/" directory. See https://www.php.net/downloads.php .
1818
1. RUn `buildopenssl.sh` script.
1919
1. Run `buildiconv.sh` script.
2020
1. Run `buildxml.sh`script.
21-
1. Run `buildsqlite.sh` script.
2221
1. Run `buildzlib.sh` script.
22+
1. Run `buildsqlite.sh` script.
2323
1. Run `buildphp.sh` script, but before running see the script comments to install requirements.
2424
1. Run `cleanbuild.sh` script.

buildsqlite.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@ if ! cd $root_dir/php/ ; then
1818
fi
1919
rm -f libsqlite3.dylib
2020

21+
if ! cd $root_dir/php/zlib-*/ ; then
22+
echo "Can't find zlib directory"
23+
exit 1
24+
fi
25+
zlib_dir=$(realpath $(pwd))
26+
echo "Found zlib: ${zlib_dir}"
27+
2128
if ! cd $root_dir/php/sqlite-*/ ; then
2229
echo "Can't find sqlite directory"
2330
exit 1
2431
fi
2532
sqlite_dir=$(realpath $(pwd))
2633
echo "Found sqlite: ${sqlite_dir}"
2734

35+
export CPPFLAGS="-I${zlib_dir}/dist-install/include"
36+
export LDFLAGS="-L${zlib_dir}/dist-install/lib"
2837
echo "Configure sqlite..."
2938
./configure \
3039
--prefix=${sqlite_dir}/dist-install \
@@ -35,5 +44,6 @@ make install
3544
cp ./dist-install/lib/libsqlite3.dylib.3.* ./../libsqlite3.dylib
3645
install_name_tool -id libsqlite3.dylib ./../libsqlite3.dylib
3746
install_name_tool -delete_rpath $sqlite_dir/dist-install/lib ./../libsqlite3.dylib
47+
install_name_tool -change $zlib_dir/dist-install/lib/libz.1.dylib libz.1.3.1.dylib ./../libsqlite3.dylib
3848

3949
echo "Done."

0 commit comments

Comments
 (0)