/ Check-in [3aca9a92]
Login

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

Overview
Comment:Add shell scripts used for testing compiler warnings (tool/warnings.sh), for verifying that the library exports the correct symbols (tool/symbols.sh), and to demonstrate building a full-featured command-line shell (tool/build-shell.sh).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3aca9a92c8b29bb43f65f93593ba4defd65139dc
User & Date: drh 2011-06-03 13:06:50
Context
2011-06-03
13:28
Include more detailed version information in the command-line shell output. check-in: 049c3c42 user: drh tags: trunk
13:06
Add shell scripts used for testing compiler warnings (tool/warnings.sh), for verifying that the library exports the correct symbols (tool/symbols.sh), and to demonstrate building a full-featured command-line shell (tool/build-shell.sh). check-in: 3aca9a92 user: drh tags: trunk
13:02
Fix the build when using SQLITE_OMIT_PRAGMA. check-in: 051f4635 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added tool/build-shell.sh.

            1  +#!/bin/sh
            2  +#
            3  +# This script demonstrates how to do a full-featured build of the sqlite3
            4  +# command-line shell on Linux.
            5  +#
            6  +# SQLite source code should be in a sibling directory named "sqlite".  For
            7  +# example, put SQLite sources in ~/sqlite/sqlite and run this script from
            8  +# ~/sqlite/bld.  There should be an appropriate Makefile in the current
            9  +# directory as well.
           10  +#
           11  +make sqlite3.c
           12  +gcc -o sqlite3 -g -Os -I. \
           13  +   -DSQLITE_THREADSAFE=0 \
           14  +   -DSQLITE_ENABLE_VFSTRACE \
           15  +   -DSQLITE_ENABLE_STAT2 \
           16  +   -DSQLITE_ENABLE_FTS3 \
           17  +   -DSQLITE_ENABLE_RTREE \
           18  +   -DHAVE_READLINE \
           19  +   -DHAVE_USLEEP=1 \
           20  +   ../sqlite/src/shell.c ../sqlite/src/test_vfstrace.c \
           21  +   sqlite3.c -ldl -lreadline -lncurses

Added tool/symbols.sh.

            1  +#!/bin/sh
            2  +#
            3  +# Run this script in a directory that contains a valid SQLite makefile in
            4  +# order to verify that unintentionally exported symbols.
            5  +#
            6  +make sqlite3.c
            7  +
            8  +echo '****** Exported symbols from a build including RTREE, FTS4 & ICU ******'
            9  +gcc -c -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE \
           10  +  -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_STAT2 \
           11  +  -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_UNLOCK_NOTIFY \
           12  +  -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_ATOMIC_WRITE \
           13  +  -DSQLITE_ENABLE_ICU \
           14  +  sqlite3.c
           15  +nm sqlite3.o | grep ' T ' | sort -k 3
           16  +
           17  +echo '****** Surplus symbols from a build including RTREE, FTS4 & ICU ******'
           18  +nm sqlite3.o | grep ' T ' | grep -v ' sqlite3_'
           19  +
           20  +echo '****** Dependencies of the core. No extensions. No OS interface *******'
           21  +gcc -c -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_STAT2 \
           22  +  -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_UNLOCK_NOTIFY \
           23  +  -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_ATOMIC_WRITE \
           24  +  -DSQLITE_OS_OTHER -DSQLITE_THREADSAFE=0 \
           25  +  sqlite3.c
           26  +nm sqlite3.o | grep ' U ' | sort -k 3
           27  +
           28  +echo '****** Dependencies including RTREE & FTS4 *******'
           29  +gcc -c -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE \
           30  +  -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_STAT2 \
           31  +  -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_UNLOCK_NOTIFY \
           32  +  -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_ATOMIC_WRITE \
           33  +  sqlite3.c
           34  +nm sqlite3.o | grep ' U ' | sort -k 3

Added tool/warnings.sh.

            1  +#/bin/sh
            2  +#
            3  +# Run this script in a directory with a working makefile to check for 
            4  +# compiler warnings in SQLite.
            5  +#
            6  +make sqlite3.c
            7  +echo '********** No optimizations.  Includes FTS4 and RTREE *********'
            8  +gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
            9  +      -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
           10  +      sqlite3.c
           11  +echo '********** Optimized -O3.  Includes FTS4 and RTREE *********'
           12  +gcc -O3 -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
           13  +      -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
           14  +      sqlite3.c