2011-06-03 15:06:50 +02:00
|
|
|
#/bin/sh
|
|
|
|
#
|
|
|
|
# Run this script in a directory with a working makefile to check for
|
|
|
|
# compiler warnings in SQLite.
|
|
|
|
#
|
2016-10-08 11:21:34 +02:00
|
|
|
|
2017-05-16 11:49:42 +02: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 19:32:14 +01: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 11:49:42 +02:00
|
|
|
fi
|
2016-10-08 11:21:34 +02:00
|
|
|
|
2011-08-24 17:12:08 +02:00
|
|
|
rm -f sqlite3.c
|
2014-05-27 21:18:36 +02:00
|
|
|
make sqlite3.c
|
2018-11-15 20:12:22 +01:00
|
|
|
echo '********** No optimizations. Includes FTS4/5, GEOPOLY, JSON1 ***'
|
2016-10-08 11:21:34 +02:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -c $WARNING_OPTS -std=c89 \
|
2018-11-15 17:56:33 +01:00
|
|
|
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
|
2022-02-17 15:33:13 +01:00
|
|
|
-DSQLITE_ENABLE_FTS5 \
|
2011-06-03 15:06:50 +02:00
|
|
|
sqlite3.c
|
2016-02-15 19:58:37 +01:00
|
|
|
if test x`uname` = 'xLinux'; then
|
2015-06-15 16:43:25 +02:00
|
|
|
echo '********** Android configuration ******************************'
|
2016-10-08 11:21:34 +02:00
|
|
|
echo '********** ' Options: $WARNING_ANDROID_OPTS
|
2015-06-15 16:43:25 +02: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 11:21:34 +02:00
|
|
|
$WARNING_ANDROID_OPTS \
|
2015-06-15 16:43:25 +02:00
|
|
|
-Os sqlite3.c shell.c
|
2016-02-15 19:58:37 +01:00
|
|
|
fi
|
2013-10-11 17:05:05 +02:00
|
|
|
echo '********** No optimizations. ENABLE_STAT4. THREADSAFE=0 *******'
|
2016-10-08 11:21:34 +02:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -c $WARNING_OPTS -std=c89 \
|
2013-10-11 17:05:05 +02:00
|
|
|
-ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
|
2011-06-24 13:29:51 +02:00
|
|
|
sqlite3.c
|
2018-11-15 20:12:22 +01:00
|
|
|
echo '********** Optimized -O3. Includes FTS4/5, GEOPOLY, JSON1 ******'
|
2016-10-08 11:21:34 +02:00
|
|
|
echo '********** ' Options: $WARNING_OPTS
|
|
|
|
gcc -O3 -c $WARNING_OPTS -std=c89 \
|
2018-11-15 20:12:22 +01:00
|
|
|
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
|
2022-02-17 15:33:13 +01:00
|
|
|
-DSQLITE_ENABLE_FTS5 \
|
2011-06-03 15:06:50 +02:00
|
|
|
sqlite3.c
|