2011-06-03 17:06:50 +04:00
|
|
|
#/bin/sh
|
|
|
|
#
|
|
|
|
# Run this script in a directory with a working makefile to check for
|
|
|
|
# compiler warnings in SQLite.
|
|
|
|
#
|
2016-10-08 12:21:34 +03:00
|
|
|
|
2017-05-16 12:49:42 +03:00
|
|
|
if uname | grep -i openbsd ; then
|
|
|
|
# Use these for testing on OpenBSD:
|
|
|
|
WARNING_OPTS=-Wall
|
|
|
|
WARNING_ANDROID_OPTS=-Wall
|
|
|
|
else
|
|
|
|
# Use these for testing on Linux and Mac OSX:
|
|
|
|
WARNING_OPTS="-Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long"
|
|
|
|
WARNING_ANDROID_OPTS="-Wshadow -Wall -Wextra"
|
|
|
|
fi
|
2016-10-08 12:21:34 +03:00
|
|
|
|
2011-08-24 19:12:08 +04:00
|
|
|
rm -f sqlite3.c
|
2014-05-27 23:18:36 +04:00
|
|
|
make sqlite3.c
|
2016-02-11 18:37:18 +03:00
|
|
|
echo '********** No optimizations. Includes FTS4/5, RTREE, JSON1 ***'
|
2016-10-08 12:21:34 +03:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -c $WARNING_OPTS -std=c89 \
|
2011-06-03 17:06:50 +04:00
|
|
|
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
|
2016-02-11 18:37:18 +03:00
|
|
|
-DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
|
2011-06-03 17:06:50 +04:00
|
|
|
sqlite3.c
|
2016-02-15 21:58:37 +03:00
|
|
|
if test x`uname` = 'xLinux'; then
|
2015-06-15 17:43:25 +03:00
|
|
|
echo '********** Android configuration ******************************'
|
2016-10-08 12:21:34 +03:00
|
|
|
echo '********** ' Options: $WARNING_ANDROID_OPTS
|
2015-06-15 17:43:25 +03:00
|
|
|
gcc -c \
|
|
|
|
-DHAVE_USLEEP=1 \
|
|
|
|
-DSQLITE_HAVE_ISNAN \
|
|
|
|
-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \
|
|
|
|
-DSQLITE_THREADSAFE=2 \
|
|
|
|
-DSQLITE_TEMP_STORE=3 \
|
|
|
|
-DSQLITE_POWERSAFE_OVERWRITE=1 \
|
|
|
|
-DSQLITE_DEFAULT_FILE_FORMAT=4 \
|
|
|
|
-DSQLITE_DEFAULT_AUTOVACUUM=1 \
|
|
|
|
-DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 \
|
|
|
|
-DSQLITE_ENABLE_FTS3 \
|
|
|
|
-DSQLITE_ENABLE_FTS3_BACKWARDS \
|
|
|
|
-DSQLITE_ENABLE_FTS4 \
|
|
|
|
-DSQLITE_OMIT_BUILTIN_TEST \
|
|
|
|
-DSQLITE_OMIT_COMPILEOPTION_DIAGS \
|
|
|
|
-DSQLITE_OMIT_LOAD_EXTENSION \
|
|
|
|
-DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 \
|
|
|
|
-DSQLITE_ENABLE_ICU \
|
|
|
|
-DUSE_PREAD64 \
|
2016-10-08 12:21:34 +03:00
|
|
|
$WARNING_ANDROID_OPTS \
|
2015-06-15 17:43:25 +03:00
|
|
|
-Os sqlite3.c shell.c
|
2016-02-15 21:58:37 +03:00
|
|
|
fi
|
2013-10-11 19:05:05 +04:00
|
|
|
echo '********** No optimizations. ENABLE_STAT4. THREADSAFE=0 *******'
|
2016-10-08 12:21:34 +03:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -c $WARNING_OPTS -std=c89 \
|
2013-10-11 19:05:05 +04:00
|
|
|
-ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
|
2011-06-24 15:29:51 +04:00
|
|
|
sqlite3.c
|
2016-02-11 18:37:18 +03:00
|
|
|
echo '********** Optimized -O3. Includes FTS4/5, RTREE, JSON1 ******'
|
2016-10-08 12:21:34 +03:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -O3 -c $WARNING_OPTS -std=c89 \
|
2011-06-03 17:06:50 +04:00
|
|
|
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
|
2016-02-11 18:37:18 +03:00
|
|
|
-DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
|
2011-06-03 17:06:50 +04:00
|
|
|
sqlite3.c
|