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"
|
2023-01-04 21:32:14 +03:00
|
|
|
gccvers=`gcc -v 2>&1 | grep '^gcc version'`
|
|
|
|
if test "$gccvers" '<' 'gcc version 6'
|
|
|
|
then
|
|
|
|
WARNING_ANDROID_OPTS="-Wshadow -Wall -Wextra"
|
|
|
|
else
|
|
|
|
WARNING_ANDROID_OPTS="-Wshadow -Wall -Wextra -Wimplicit-fallthrough=0"
|
|
|
|
fi
|
2017-05-16 12:49:42 +03:00
|
|
|
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
|
2018-11-15 22:12:22 +03:00
|
|
|
echo '********** No optimizations. Includes FTS4/5, GEOPOLY, JSON1 ***'
|
2016-10-08 12:21:34 +03:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -c $WARNING_OPTS -std=c89 \
|
2018-11-15 19:56:33 +03:00
|
|
|
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
|
2022-02-17 17:33:13 +03:00
|
|
|
-DSQLITE_ENABLE_FTS5 \
|
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 \
|
|
|
|
-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
|
2018-11-15 22:12:22 +03:00
|
|
|
echo '********** Optimized -O3. Includes FTS4/5, GEOPOLY, JSON1 ******'
|
2016-10-08 12:21:34 +03:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -O3 -c $WARNING_OPTS -std=c89 \
|
2018-11-15 22:12:22 +03:00
|
|
|
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
|
2022-02-17 17:33:13 +03:00
|
|
|
-DSQLITE_ENABLE_FTS5 \
|
2011-06-03 17:06:50 +04:00
|
|
|
sqlite3.c
|