Skip to content

Commit 08eff25

Browse files
committed
[WIP] build sqlite3
- [x] Linux/macOS - [ ] Windows
1 parent 3289c1f commit 08eff25

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

library_builders.bat

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,47 @@ exit /b 0
144144
if errorlevel 1 exit 1
145145
exit /b 0
146146

147+
:build_sqlite
148+
if exist sqlite-stamp exit /b 0
149+
150+
set SQLITE_VERSION="3510200"
151+
152+
curl -sLo sqlite-amalgamation-%SQLITE_VERSION%.zip ^
153+
https://www.sqlite.org/2026/sqlite-amalgamation-%SQLITE_VERSION%.zip
154+
if errorlevel 1 exit 1
155+
156+
powershell Expand-Archive sqlite-amalgamation-%SQLITE_VERSION%.zip -DestinationPath '.'
157+
if errorlevel 1 exit 1
158+
159+
:: build
160+
cd sqlite-amalgamation-%SQLITE_VERSION%
161+
cl /c /O2 /MT /DSQLITE_ENABLE_FTS5 /DSQLITE_ENABLE_JSON1 /DSQLITE_ENABLE_RTREE sqlite3.c
162+
if errorlevel 1 exit 1
163+
lib /OUT:sqlite3.lib sqlite3.obj
164+
if errorlevel 1 exit 1
165+
166+
:: install
167+
mkdir %BUILD_PREFIX%\SQLite3
168+
if errorlevel 1 exit 1
169+
mkdir %BUILD_PREFIX%\SQLite3\include
170+
if errorlevel 1 exit 1
171+
mkdir %BUILD_PREFIX%\SQLite3\lib
172+
if errorlevel 1 exit 1
173+
174+
copy /Y sqlite3.h "%BUILD_PREFIX%\SQLite3\include\"
175+
if errorlevel 1 exit 1
176+
copy /Y sqlite3.lib "%BUILD_PREFIX%\SQLite3\lib\"
177+
if errorlevel 1 exit 1
178+
179+
:: cleanup
180+
cd ..
181+
rmdir /s /q sqlite-amalgamation-%SQLITE_VERSION%
182+
if errorlevel 1 exit 1
183+
184+
break > sqlite-stamp
185+
if errorlevel 1 exit 1
186+
exit /b 0
187+
147188
:build_zfp
148189
if exist zfp-stamp exit /b 0
149190

@@ -209,6 +250,7 @@ exit /b 0
209250
:main
210251
call :install_buildessentials
211252
call :build_zlib
253+
call :build_sqlite
212254
:: build_bzip2
213255
:: build_szip
214256
call :build_zfp

library_builders.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,32 @@ function build_blosc2 {
173173
touch blosc-stamp2
174174
}
175175

176+
function build_sqlite {
177+
if [ -e sqlite-stamp ]; then return; fi
178+
179+
SQLITE_VERSION="3510200" # "3.51.2"
180+
181+
curl -sLO https://www.sqlite.org/2026/sqlite-autoconf-${SQLITE_VERSION}.tar.gz
182+
file sqlite-autoconf*.tar.gz
183+
tar xzf sqlite-autoconf-${SQLITE_VERSION}.tar.gz
184+
rm sqlite-autoconf*.tar.gz
185+
186+
cd sqlite-autoconf-${SQLITE_VERSION}
187+
188+
./configure \
189+
--disable-shared \
190+
--prefix=${BUILD_PREFIX} \
191+
--all \
192+
--disable-readline
193+
make
194+
${SUDO} make install
195+
196+
cd -
197+
rm -rf sqlite-autoconf*
198+
199+
touch sqlite-stamp
200+
}
201+
176202
function build_zfp {
177203
if [ -e zfp-stamp ]; then return; fi
178204

@@ -316,6 +342,7 @@ fi
316342

317343
install_buildessentials
318344
build_zlib
345+
build_sqlite
319346
build_zfp
320347
build_blosc2
321348
build_hdf5

0 commit comments

Comments
 (0)