# Copyright: 2016-2023 Paul Obermeier (obermeier@tcl3d.org) # Distributed under BSD license. # # BuildType Windows: Batch / vs # Batch / gcc # BuildType Linux : Batch / gcc # BuildType Darwin : Batch / gcc # # How to update the sqlite3 package: # 1. Download the C source code amalgation distribution and extract files sqlite3.c and sqlite3.h. # 2. Download the precompiled Windows distribution and extract file sqlite3.def. # 3. Copy the compile* scripts into the new folder. proc Init_sqlite3 { libName libVersion } { SetScriptAuthor $libName "Paul Obermeier" "obermeier@tcl3d.org" SetLibHomepage $libName "https://www.sqlite.org/" SetLibDependencies $libName "None" SetPlatforms $libName "All" SetWinCompilers $libName "gcc" "vs" } proc Build_sqlite3 { libName libVersion buildDir instDir devDir distDir } { if { [UseStage "Extract" $libName] } { ExtractLibrary $libName $buildDir } if { [UseStage "Configure" $libName] } { } if { [UseStage "Compile" $libName] } { if { [IsWindows] } { if { [UseWinCompiler $libName "gcc"] } { set cmd "" append cmd "bash compileMingw.sh" MSysRun $libName "${libName}_Compile" $buildDir "$cmd" if { [NeedDll2Lib $libName] } { Dll2Lib $libName "$buildDir" "sqlite3.dll" "sqlite3.def" "$buildDir/sqlite3.lib" } } else { set cmd "" append cmd "CALL .\\compile.bat" DosRun $libName "${libName}_Compile" $buildDir "$cmd" set cmd "" append cmd "CALL lib.exe " append cmd "/def:$libName.def " append cmd "/out:$libName.lib " append cmd "/machine:[GetArchitecture] " DosRun $libName "${libName}_Def2Lib" $buildDir "$cmd" } } else { set cmd "" append cmd "bash compile[GetPlatformName].sh" MSysRun $libName "${libName}_Compile" $buildDir "$cmd" } } if { [UseStage "Distribute" $libName] } { SingleFileCopy "$buildDir/$libName.h" "$devDir/include" StripLibraries "$buildDir" if { [IsWindows] } { SingleFileCopy "$buildDir/$libName.dll" "$devDir/lib" if { [UseWinCompiler $libName "vs"] || [NeedDll2Lib $libName] } { SingleFileCopy "$buildDir/$libName.lib" "$devDir/lib" } } elseif { [IsLinux] } { SingleFileCopy "$buildDir/$libName.so" "$devDir/lib" } else { SingleFileCopy "$buildDir/$libName.dylib" "$devDir/lib" } } return true }