From 9412daf4f2c0c566116e89adebd9a50a9d0e8224 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Fri, 11 Oct 2013 19:56:16 +0100 Subject: [PATCH] [WINDOWS] Build with SQLite DLL 3.8.0.2 --- win32/installer.bat | 7 +++++++ win32/prepare.bat | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/win32/installer.bat b/win32/installer.bat index 7bf41a80..3f391671 100644 --- a/win32/installer.bat +++ b/win32/installer.bat @@ -82,6 +82,13 @@ if exist "%LIBMAGIC%" ( echo Required %LIBMAGIC% does not exist goto Tidy ) +set LIBSQL3=%MINGW_BIN%\sqlite3.dll +if exist "%LIBSQL3%" ( + %MYCOPY% "%LIBSQL3%" %DESTINATION% +) else ( + echo Required %LIBSQL3% does not exist + goto Tidy +) :: TODO Maybe embed http://gtk-win.sourceforge.net/home/index.php/Main/EmbeddingGTK directly in NSIS? :: Best to use the same GTK version as we built against in prepare.bat!! diff --git a/win32/prepare.bat b/win32/prepare.bat index 06597f74..9ae404fe 100644 --- a/win32/prepare.bat +++ b/win32/prepare.bat @@ -292,6 +292,38 @@ if not exist "%MINGW_BIN%\regex2.dll" ( if ERRORLEVEL 1 goto Error ) +echo =+=+= +echo Checking SQLite dev... +echo =+=+= +set SQL_ZIP=sqlite-amalgamation-3080002.zip +if not exist "%MINGW%\include\sqlite3.h" ( + if not exist %SQL_ZIP% ( + wget http://www.sqlite.org/2013/%SQL_ZIP% + ) + 7z x %SQL_ZIP% + if ERRORLEVEL 1 goto Error + copy /Y sqlite-amalgamation-3080002\s* "%MinGW%\include" + rmdir /S /Q sqlite-amalgamation-3080002 +) + +echo =+=+= +echo Checking SQL DLL... +echo =+=+= +set SQLDLL_ZIP=sqlite-dll-win32-x86-3080002.zip +if not exist "%MINGW_BIN%\sqlite3.dll" ( + if not exist %SQLDLL_ZIP% ( + wget http://www.sqlite.org/2013/%SQLDLL_ZIP% + ) + 7z x %SQLDLL_ZIP% -o"%MinGW_BIN%" + if ERRORLEVEL 1 goto Error + REM Annoyingly SQL doesn't come with a .lib file so have to generate it ourselves: + REM Possibly need to insert the line 'LIBRARY sqlite3.dll' at the beginning of the def file? + REM but this may not be needed as the --dllname option may suffice + popd %MinGW_BIN% + dlltool -d sqlite3.def --dllname sqlite3.dll -l ..\lib\sqlite3.lib + pushd +) + :: :: Ideally building the code on Windows shouldn't need Doc Utils or the Help processor stuff :: But ATM it's too hard to avoid. -- 2.39.5