0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-24 16:18:08 +01:00
sqlite/doc/compile-for-unix.md
drh a9e4ebc513 Fix a typo in compile-for-unix.md. Simplify hyperlinks in the compile-for-*
documents.

FossilOrigin-Name: 8cd7d157741f207c3a38744f2d85a5bb808824b5e83b9e033a8ce3954fe38f43
2024-10-17 16:22:47 +00:00

2.3 KiB

Notes On Compiling SQLite On All Kinds Of Unix

Here are step-by-step instructions on how to build SQLite from canonical source on any modern machine that isn't Windows. These notes are tested (on 2024-10-11) on Ubuntu and on MacOS, but they are general and should work on most any modern unix platform.

  1. Install a C-compiler. GCC or Clang both work fine. If you are reading this document, you've probably already done that.

  2. Install TCL9 development libraries. In this note, we'll do a private install in the $HOME/local directory, but you can make adjustments to install TCL9 wherever you like.

    This document assumes you are working with TCL version 9.0.

    1. Get the TCL source archive, perhaps from or .
    2. Untar the source archive. CD into the "unix/" subfolder of the source tree.
    3. Run: `mkdir $HOME/local`
    4. Run: `./configure --prefix=$HOME/local`
    5. Run: `make install`
  3. Download the SQLite source tree and unpack it. CD into the toplevel directory of the source tree.

  4. Run: ./configure --enable-all --with-tclsh=$HOME/local/bin/tclsh9.0

    You do not need to use --with-tclsh if the tclsh you want to use is the first one on your PATH.

  5. Run the "Makefile" makefile with an appropriate target. Examples:

    • `make sqlite3.c`
    • `make sqlite3`
    • `make sqldiff`
    • `make sqlite3_rsync`
    • `make tclextension-install`
    • `make devtest`
    • `make releasetest`
    • `make sqlite3_analyzer`

    It is not required that you run the "tclextension-install" target prior to running tests. However, the tests will run more smoothly if you do. The version of SQLite used for the TCL extension does not need to correspond to the version of SQLite under test. So you can install the SQLite TCL extension once, and then use it to test many different versions of SQLite.

  6. For a debugging build of the CLI, where the ".treetrace" and ".wheretrace" commands work, add the the --enable-debug argument to configure.