On Mon, May 27, 2013 at 11:08:57AM +0800, Woody Wu wrote:
> Hi, List
>
> Probably this is another case of database corrupted. I read the
> documents about this topic and think I did not make same mistakes
> described in that 'how to corrupt ...' documentation.
>
> I have a testing code, attached in this email, if continuously run it for
> 20 - 40 hours, the sqlite database will be corrupted. But the code
> itself is very simple, it just keeping inserting a lot of rows. After
> inserted some long time, it begin to delete some rows and continues to
> insert.
>
> There is no multi-threads, no concurrent database operations. Every
> instance of the application instance owns exclusively its database file.
>
> The application is running on an ARM Linux system with Yaffs2 filesystem
> on NAND flashes.
>
> Below are sample database error:
>
> ------------------------------------------------------
> sqlite> pragma integrity_check;
> *** in database main ***
> Multiple uses for byte 752 of page 20506
> On tree page 21363 cell 27: invalid page number 16843521
> Multiple uses for byte 676 of page 21363
> Fragmentation of 8 bytes reported as 0 on page 21363
> Multiple uses for byte 392 of page 28676
> rowid 518219 missing from index testidx
> Error: database disk image is malformed
> -----------------------------------------------------
>
> Please have a look at my attached code and be kindly give me a clue on
> what are possible causes?
>
> Thanks in advance.
>
> --
> woody
> I can't go back to yesterday - because I was a different person then.
Sorry, I forget to tell you, the sqlite version is 3.7.17 (autoconfig).
I only added one DEFS in the resulted Makefile: -DHAVE_POSIX_FALLOCATE=0
since my cross tool chain doesn't have posix_fallocate()
implementation. Attached also please refer my Makefile.
> #define _GNU_SOURCE
> #include <string.h>
> #include <stdbool.h>
> #include <stddef.h>
> #include <strings.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <time.h>
> #include <limits.h>
> #include <unistd.h>
> #include <syslog.h>
> #include <assert.h>
> #include <ctype.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <sqlite3.h>
>
> #define MAX_SQL_LEN 150
> #define SQL_CREATE_TESTTBL \
> "create table if not exists testtbl(nComID number(2), nMeterID number(2),
> nMPID number(2), nData number, nStatus number, nTimeReq number);"
> #define SQL_CREATE_TESTIDX \
> "create index if not exists testidx on testtbl(nTimeReq asc,nComID
> asc,nMeterID asc,nMPID asc);"
> #define SQL_BEGIN_TRANS "BEGIN;"
> #define SQL_COMMIT_TRANS "COMMIT;"
> #define SQL_ROLLBACK_TRANS "ROLLBACK;"
>
> static char *db_fname = "test.db";
> static sqlite3 *conn;
> static int sql_code;
> static char *sql_msg;
> static int fill_time;
> static int max_rec_age = 2048;
> static bool auto_vacuum;
> static int cache_size = 0;
> static bool use_syslog;
> static bool verbose;
> static unsigned max_fill_count;
>
> static void mlog(int opt, const char *fmt, ...)
> {
> if (! verbose && LOG_PRI(opt) >= LOG_DEBUG)
> return;
>
> char s[256];
> snprintf(s, sizeof(s), "[%s] %s", basename(db_fname), fmt);
> fmt = s;
> va_list args;
> va_start(args, fmt);
> if (use_syslog)
> vsyslog(opt, fmt, args);
> else
> vprintf(fmt, args);
> va_end(args);
> }
>
> static bool sql_exec(const char *sql)
> {
> mlog(LOG_DEBUG, "sql_exec: %s\n", sql);
> while (true) {
> sql_code = sqlite3_exec(conn,
> sql, NULL, NULL, &sql_msg);
> if (sql_code == SQLITE_OK)
> return true;
> else {
> mlog(LOG_NOTICE, "%s: %s\n", sql_msg, sql);
> if (sql_msg)
> sqlite3_free(sql_msg);
> if (sql_code == SQLITE_BUSY || SQLITE_LOCKED)
> sleep(1);
> else
> return false;
> }
> }
> }
>
> static bool sql_select(const char *sql, char ***result)
> {
> mlog(LOG_DEBUG, "sql_select: %s\n", sql);
> while (true) {
> sql_code = sqlite3_get_table(conn, sql,
> result, NULL, NULL, &sql_msg);
> if (sql_code == SQLITE_OK)
> return true;
> else {
> mlog(LOG_NOTICE, "%s: %s\n", sql_msg, sql);
> if (sql_msg)
> sqlite3_free(sql_msg);
> if (*result)
> sqlite3_free_table(*result);
> *result = NULL;
> if (sql_code == SQLITE_BUSY || SQLITE_LOCKED)
> sleep(1);
> else
> return false;
> }
> }
> }
>
> static bool get_min_time(int *time)
> {
> char **result_tbl;
>
> if (! sql_select("SELECT MIN(nTimeReq) FROM testtbl;", &result_tbl))
> return false;
>
> if (! result_tbl[1])
> *time = 0;
> else
> *time = atoi(result_tbl[1]);
>
> sqlite3_free_table(result_tbl);
> return true;
> }
>
> static bool get_max_time(int *time)
> {
> char **result_tbl;
>
> if (! sql_select("SELECT MAX(nTimeReq) FROM testtbl;", &result_tbl))
> return false;
>
> if (! result_tbl[1])
> *time = 0;
> else
> *time = atoi(result_tbl[1]);
>
> sqlite3_free_table(result_tbl);
> return true;
> }
>
> static bool init_fill_time(void)
> {
> return get_max_time(&fill_time);
> }
>
> static bool prepare(void)
> {
> char sql_set_cache[MAX_SQL_LEN];
>
> mlog(LOG_INFO, "prepare database ...\n");
> if (auto_vacuum) {
> mlog(LOG_INFO, "auto_vacuum = 1\n");
> if (! sql_exec("PRAGMA auto_vacuum = 1;"))
> return false;
> }
> if (cache_size > 0) {
> mlog(LOG_INFO, "using cache_size = %d\n", cache_size);
> snprintf(sql_set_cache, sizeof(sql_set_cache), "PRAGMA cache_size =
> %d;", cache_size);
> if (! sql_exec(sql_set_cache))
> return false;
> }
>
> if (! sql_exec(SQL_CREATE_TESTTBL) || ! sql_exec(SQL_CREATE_TESTIDX))
> return false;
>
> return init_fill_time();
> }
>
> static bool rotate(void)
> {
> if (max_rec_age <= 0)
> return true;
>
> int time0, time1, time2;
>
> if (! get_min_time(&time0) || !get_max_time(&time1))
> return false;
>
> if (time1 < time0) {
> mlog(LOG_ERR, "invalide time range [%d, %d]\n", time0, time1);
> return false;
> } else
> mlog(LOG_DEBUG, "current time range [%d, %d]\n", time0, time1);
>
> if (time1 - time0 <= max_rec_age * 60)
> return true;
>
> mlog(LOG_INFO, "delete nTimeReq < %d + 4\n", time0);
>
> char sql_del[MAX_SQL_LEN];
> sprintf(sql_del, "DELETE FROM testtbl WHERE nTimeReq < %d", time0 + 4);
>
> if (! sql_exec(SQL_BEGIN_TRANS))
> return false;
> if (! sql_exec(sql_del)) {
> sql_exec(SQL_ROLLBACK_TRANS);
> return false;
> }
>
> if (! sql_exec(SQL_COMMIT_TRANS))
> return false;
>
> if (! get_min_time(&time2))
> return false;
> if (time2 < time0 + 4) {
> mlog(LOG_ERR, "delete failed! current min: %d\n", time2);
> return false;
> } else
> return true;
> }
>
> static bool check_db(void)
> {
> static time_t last_chk_time = 0;
>
> time_t elapsed = (unsigned) ((signed)time(0) - (signed)last_chk_time);
> if (elapsed < 30 * 60)
> return true;
>
> int nrow, ncol;
> char **result;
> if (sqlite3_get_table(conn, "PRAGMA integrity_check;",
> &result, &nrow, &ncol, &sql_msg) != SQLITE_OK) {
> mlog(LOG_ERR, "integrity check failed\n");
> sqlite3_free_table(result);
> if (sql_msg)
> sqlite3_free(sql_msg);
> return false;
> }
> if (nrow > 0 && strcmp(result[1], "ok") && strcmp(result[1], "OK")
> && strcmp(result[1], "Ok")) {
> sqlite3_free_table(result);
> mlog(LOG_ERR, "database corrupted!\n");
> return false;
> } else
> mlog(LOG_INFO, "database integrity ok\n");
>
> sqlite3_free_table(result);
> last_chk_time = time(0);
> return true;
> }
>
> static bool fill(void)
> {
> char sql[MAX_SQL_LEN];
>
> if (! rotate())
> return false;
>
> mlog(LOG_DEBUG, "insert with fill_time = %d\n", fill_time);
> if (! sql_exec(SQL_BEGIN_TRANS))
> return false;
>
> size_t n;
> for (n = 0; n < 5; ++n) {
> sprintf(sql, "INSERT INTO testtbl VALUES(3,2,%d,596516,0,%d);", n +
> 1, fill_time);
> if (! sql_exec(sql))
> break;
> }
> if (n < 5) {
> mlog(LOG_WARNING, "insert failed\n");
> if (! sql_exec(SQL_ROLLBACK_TRANS))
> return false;
> } else if (! sql_exec(SQL_COMMIT_TRANS))
> return false;
>
> while ((sql_code = sqlite3_close(conn)) != SQLITE_OK) {
> mlog(LOG_WARNING, "sqlite closing (%d)\n", sql_code);
> sleep(1);
> }
> if ((sql_code = sqlite3_open(db_fname, &conn)) != SQLITE_OK) {
> mlog(LOG_ERR, "sqlite open error (%d)\n", sql_code);
> return false;
> }
>
> return check_db();
> }
>
> static bool do_test(void)
> {
> unsigned cnt = 0;
>
> while ((max_fill_count == 0 || cnt++ < max_fill_count)
> && fill_time++ < INT_MAX
> && fill())
> ;
> if ((max_fill_count == 0 || cnt++ < max_fill_count)
> && fill_time < INT_MAX) {
> mlog(LOG_WARNING, "test aborted abnormally\n");
> return false;
> } else
> return true;
> }
>
> static void test(void)
> {
> if (prepare()) {
> mlog(LOG_INFO, "do the test, fill_time=%d\n"
> , fill_time);
> do_test();
> mlog(LOG_INFO, "test end, fill_time=%d ...\n"
> , fill_time);
> }
> }
>
> static bool parse_opt(int argc, char **argv)
> {
> int c;
> opterr = 0;
> while ((c = getopt(argc, argv, "vusc:a:n:")) != -1)
> switch (c) {
> case 'v':
> verbose = true;
> break;
> case 'u':
> auto_vacuum = true;
> break;
> case 's':
> use_syslog = true;
> break;
> case 'n':
> max_fill_count = atoi(optarg);
> break;
> case 'a':
> max_rec_age = atoi(optarg);
> break;
> case 'c':
> cache_size = atoi(optarg);
> break;
> case '?':
> if (optopt == 'a' || optopt == 'c'|| optopt == 'n')
> fprintf(stderr, "option -%c requries an argument.\n",
> optopt);
> else if (isprint(optopt))
> fprintf(stderr, "unknown option -%c.\n", optopt);
> else
> fprintf(stderr, "unknown option character 0x%x", optopt);
> return false;
> default:
> return false;
> }
>
> if (argc - optind > 1) {
> fprintf(stderr, "too many positional arguments\n");
> return false;
> } else if (optind < argc)
> db_fname = argv[optind];
>
> return true;
> }
>
> int main(int argc, char **argv)
> {
>
> if (! parse_opt(argc, argv))
> return -1;
>
> mlog(LOG_INFO, "sqlitetest start. max_rec_age = %d, auto_vacuum=%d\n",
> max_rec_age, auto_vacuum);
> if ((sql_code = sqlite3_open(db_fname, &conn)) == SQLITE_OK) {
> test();
> sqlite3_close(conn);
> } else {
> mlog(LOG_ERR, "sqlite3_open = %d (%s)\n", sql_code, sql_msg);
> if (sql_msg)
> sqlite3_free(sql_msg);
> }
> mlog(LOG_INFO, "sqlitetest end\n");
> return 0;
> }
>
--
woody
I can't go back to yesterday - because I was a different person then.
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
srcdir = .
top_srcdir = .
pkgdatadir = $(datadir)/sqlite
pkglibdir = $(libdir)/sqlite
pkgincludedir = $(includedir)/sqlite
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/ginstall -c
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu
host_triplet = arm-unknown-linux-gnu
bin_PROGRAMS = sqlite3$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/sqlite3.pc.in $(top_srcdir)/configure INSTALL \
config.guess config.sub depcomp install-sh ltmain.sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = sqlite3.pc
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(includedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libsqlite3_la_LIBADD =
am_libsqlite3_la_OBJECTS = sqlite3.lo
libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_sqlite3_OBJECTS = shell.$(OBJEXT)
sqlite3_OBJECTS = $(am_sqlite3_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES)
DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES)
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
pkgconfigDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkgconfig_DATA)
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = ${SHELL}
/home/woody/git/ffc-apps/master/sqlite-autoconf-3071700/missing --run
aclocal-1.9
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL}
/home/woody/git/ffc-apps/master/sqlite-autoconf-3071700/missing --run tar
AR = arm-linux-ar
AUTOCONF = ${SHELL}
/home/woody/git/ffc-apps/master/sqlite-autoconf-3071700/missing --run autoconf
AUTOHEADER = ${SHELL}
/home/woody/git/ffc-apps/master/sqlite-autoconf-3071700/missing --run autoheader
AUTOMAKE = ${SHELL}
/home/woody/git/ffc-apps/master/sqlite-autoconf-3071700/missing --run
automake-1.9
AWK = gawk
BUILD_CFLAGS =
CC = arm-linux-gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = arm-linux-gcc -E
CPPFLAGS =
CXX = arm-linux-g++
CXXCPP = arm-linux-g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\"
-DPACKAGE_VERSION=\"3.7.17\" -DPACKAGE_STRING=\"sqlite\ 3.7.17\"
-DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" -DPACKAGE_URL=\"\"
-DPACKAGE=\"sqlite\" -DVERSION=\"3.7.17\" -D_FILE_OFFSET_BITS=64
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1
-DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DHAVE_DECL_STRERROR_R=1
-DSTRERROR_R_CHAR_P=1 -DHAVE_POSIX_FALLOCATE=0
DEPDIR = .deps
DYNAMIC_EXTENSION_FLAGS =
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /usr/bin/grep -E
EXEEXT =
F77 = g77
FFLAGS = -g -O2
GREP = /usr/bin/grep
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LDFLAGS =
LIBOBJS =
LIBS = -ldl -lpthread
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL}
/home/woody/git/ffc-apps/master/sqlite-autoconf-3071700/missing --run makeinfo
MKDIR_P = /usr/bin/mkdir -p
OBJEXT = o
PACKAGE = sqlite
PACKAGE_BUGREPORT = http://www.sqlite.org
PACKAGE_NAME = sqlite
PACKAGE_STRING = sqlite 3.7.17
PACKAGE_TARNAME = sqlite
PACKAGE_VERSION = 3.7.17
PATH_SEPARATOR = :
RANLIB = arm-linux-ranlib
READLINE_LIBS = -lcurses
SET_MAKE =
SHELL = /bin/sh
STRIP = arm-linux-strip
THREADSAFE_FLAGS = -D_REENTRANT=1 -DSQLITE_THREADSAFE=1
VERSION = 3.7.17
ac_ct_CC =
ac_ct_CXX =
ac_ct_F77 = g77
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = pc
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = arm-unknown-linux-gnu
host_alias = arm-linux
host_cpu = arm
host_os = linux-gnu
host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = /home/woody/git/ffc-apps/master/sqlite-autoconf-3071700/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = mkdir -p --
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target_alias =
AM_CFLAGS = -D_REENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3
-DSQLITE_ENABLE_RTREE
lib_LTLIBRARIES = libsqlite3.la
libsqlite3_la_SOURCES = sqlite3.c
libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8
sqlite3_SOURCES = shell.c sqlite3.h
sqlite3_LDADD = $(top_builddir)/libsqlite3.la -lcurses
sqlite3_DEPENDENCIES = $(top_builddir)/libsqlite3.la
include_HEADERS = sqlite3.h sqlite3ext.h
EXTRA_DIST = sqlite3.1 tea
pkgconfigdir = ${libdir}/pkgconfig
pkgconfig_DATA = sqlite3.pc
man_MANS = sqlite3.1
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@
$(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@
$(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure
$(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL)
$(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL)
$(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libsqlite3_la_LDFLAGS)
$(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install
$(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install
$(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed
's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES)
@rm -f sqlite3$(EXEEXT)
$(LINK) $(sqlite3_LDFLAGS) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/shell.Po
include ./$(DEPDIR)/sqlite3.Plo
.c.o:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f
"$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c $<
.c.obj:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@
`$(CYGPATH_W) '$<'`; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f
"$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f
"$(DEPDIR)/$*.Tpo"; exit 1; fi
# source='$<' object='$@' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)"
@list='$(pkgconfig_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(pkgconfigDATA_INSTALL) '$$d$$p'
'$(DESTDIR)$(pkgconfigdir)/$$f'"; \
$(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
done
uninstall-pkgconfigDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgconfig_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
done
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(includeHEADERS_INSTALL) '$$d$$p'
'$(DESTDIR)$(includedir)/$$f'"; \
$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
rm -f "$(DESTDIR)$(includedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/.
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed
"s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {}
\; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c
>$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c
>$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e
's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base"
\
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS)
install-binPROGRAMS: install-libLTLIBRARIES
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)";
do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-includeHEADERS install-man \
install-pkgconfigDATA
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
install-info: install-info-am
install-man: install-man1
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
uninstall-info-am uninstall-libLTLIBRARIES uninstall-man \
uninstall-pkgconfigDATA
uninstall-man: uninstall-man1
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \
dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man \
install-man1 install-pkgconfigDATA install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-includeHEADERS uninstall-info-am \
uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \
uninstall-pkgconfigDATA
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users