How can I compile sqlite3 from source on macOS?
3
votes
2
answers
2129
views
I'm trying to build a copy of
sqlite3
from source on my M1 Mac Mini running macOS Monterey 12.4 (21F79). The reason I want to do this (instead of using a [precompiled build](https://www.sqlite.org/download.html) or installing via Homebrew or MacPorts) is that I need to enable the SQLITE_ENABLE_UPDATE_DELETE_LIMIT
flag (see [here](https://www.sqlite.org/compile.html#enable_update_delete_limit)) . It's my understanding that in order to enable that flag, one needs to compile from the [canonical source](https://www.sqlite.org/getthecode.html) , rather than the [amalgamation](https://www.sqlite.org/amalgamation.html) .
I have read the project's page entitled [*"How To Compile SQLite"*](https://www.sqlite.org/howtocompile.html) but I failed to wrap my head around the process. I vaguely understand that I will need some combination of gcc, Tcl, the Lemon parser, a bit of luck, and the right incantations to feed them all.
With regard to that flag, the page specifically states:
> _If this option is defined, then it must also be defined when using the Lemon parser generator tool to generate a parse.c file. Because of this, this option may only be used when the library is built from source, **not from the amalgamation** or from the collection of pre-packaged C files provided for non-Unix like platforms on the website._
I understand this may be an XY problem! Still, I would like to know how to do this—if only to satisfy my curiosity. Does anyone know the steps?
Asked by luckman212
(3945 rep)
May 18, 2022, 09:31 PM
Last activity: Sep 29, 2023, 12:57 PM
Last activity: Sep 29, 2023, 12:57 PM