Documentation Source Text

Check-in [501ee3f88e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved explanation of how to build the command-line shell on the howtocompile.html page.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 501ee3f88e389b98346e0bed9cf751fc9413b05b
User & Date: drh 2015-08-28 18:13:53
Context
2015-09-02
11:30
Add missing parenthesis to an expression in fts3.html. check-in: d366268bab user: dan tags: trunk
2015-08-28
18:13
Improved explanation of how to build the command-line shell on the howtocompile.html page. check-in: 501ee3f88e user: drh tags: trunk
2015-08-23
20:46
Fix typos on the "opcodes.html" page. check-in: bce35e487e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/howtocompile.in.

105
106
107
108
109
110
111
112

113






114
115
116








117
118
119
120
121
122
123
option:</p>

<blockquote><pre>
gcc -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION shell.c sqlite3.c
</pre></blockquote>

<p>One might want to provide other [compile-time options] such as
[SQLITE_ENABLE_FTS3] for full-text search or [SQLITE_ENABLE_RTREE]

for the R*Tree search engine extension.  And one would normally to






specify some compiler optimization switches too.  (The precompiled
CLI available for download from the SQLite website uses "-Os".)
There are countless possible variations here.</p>









<p>The key point is this:  Building the CLI consists of compiling 
together two C-language files.   The <b>shell.c</b> file contains the
definition of the entry point and the user input loop and the
SQLite amalgamation <b>sqlite3.c</b> contains the complete implementation
of the SQLite library.</p>








|
>
|
>
>
>
>
>
>
|

|
>
>
>
>
>
>
>
>







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
option:</p>

<blockquote><pre>
gcc -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION shell.c sqlite3.c
</pre></blockquote>

<p>One might want to provide other [compile-time options] such as
[SQLITE_ENABLE_FTS3 | -DSQLITE_ENABLE_FTS3] for full-text search or
[SQLITE_ENABLE_RTREE | -DSQLITE_ENABLE_RTREE]
for the R*Tree search engine extension.  In order to see extra commentary
in [EXPLAIN] listings, add the 
[SQLITE_ENABLE_EXPLAIN_COMMENTS | -DSQLITE_ENABLE_EXPLAIN_COMMENTS] option.
On unix systems, add -DHAVE_USLEEP=1 if the host machine supports the
usleep() system call.  Add -DHAVE_READLINE and the -lreadline
and -lncurses libraries to get command-line editing support.
One might also want to
specify some compiler optimization switches.  (The precompiled
CLI available for download from the SQLite website uses "-Os".)
There are countless possible variations here.  A command to
compile a full-featured shell might look something like this:</p>

<blockquote><pre>
gcc -Os -I. -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS4 &#92;
   -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_EXPLAIN_COMMENTS &#92;
   -DHAVE_USLEEP -DHAVE_READLINE &#92;
   shell.c sqlite3.c -ldl -lreadline -lncurses -o sqlite3
</pre></blockquote>

<p>The key point is this:  Building the CLI consists of compiling 
together two C-language files.   The <b>shell.c</b> file contains the
definition of the entry point and the user input loop and the
SQLite amalgamation <b>sqlite3.c</b> contains the complete implementation
of the SQLite library.</p>