/ Check-in [0beb88a9]
Login

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

Overview
Comment:Merge the latest trunk changes into the stat3-trunk branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | stat3-trunk
Files: files | file ages | folders
SHA1: 0beb88a92c8f75231df120bef54616c7e4bb68c8
User & Date: drh 2011-09-23 14:40:31
Context
2011-09-25
17:47
If an open as read/write fails, do not try to reopen as read-only if in exclusive access mode. Closed-Leaf check-in: 4a153f01 user: drh tags: stat3-trunk
2011-09-23
14:40
Merge the latest trunk changes into the stat3-trunk branch. check-in: 0beb88a9 user: drh tags: stat3-trunk
13:59
Testability enhancements. check-in: be44928c user: drh tags: stat3-trunk
2011-09-22
15:31
Remove a redundant (and undefined) "forcedelete" command from corruptE.test. check-in: 6d8d4e16 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

   881    881   
   882    882   soaktest:	testfixture$(TEXE) sqlite3$(TEXE)
   883    883   	./testfixture$(TEXE) $(TOP)/test/all.test -soak=1
   884    884   
   885    885   test:	testfixture$(TEXE) sqlite3$(TEXE)
   886    886   	./testfixture$(TEXE) $(TOP)/test/veryquick.test
   887    887   
   888         -sqlite3_analyzer$(TEXE):	$(TESTFIXTURE_SRC) $(TOP)/tool/spaceanal.tcl
   889         -	sed \
   890         -	  -e '/^#/d' \
   891         -	  -e 's,\\,\\\\,g' \
   892         -	  -e 's,",\\",g' \
   893         -	  -e 's,^,",' \
   894         -	  -e 's,$$,\\n",' \
   895         -	  $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h
   896         -	$(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
   897         -		-DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE \
   898         -		$(TEMP_STORE) -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(TLIBS)
          888  +sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
          889  +	echo "#define TCLSH 2" > $@
          890  +	cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
          891  +	echo "static const char *tclsh_main_loop(void){" >> $@
          892  +	echo "static const char *zMainloop = " >> $@
          893  +	$(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
          894  +	echo "; return zMainloop; }" >> $@
   899    895   
          896  +sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
          897  +	$(LTLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS)
   900    898   
   901    899   # Standard install and cleanup targets
   902    900   #
   903    901   lib_install:	libsqlite3.la
   904    902   	$(INSTALL) -d $(DESTDIR)$(libdir)
   905    903   	$(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
   906    904   	
................................................................................
   926    924   	rm -f sqlite3.h opcodes.*
   927    925   	rm -rf .libs .deps
   928    926   	rm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gz
   929    927   	rm -f mkkeywordhash$(BEXE) keywordhash.h
   930    928   	rm -f $(PUBLISH)
   931    929   	rm -f *.da *.bb *.bbg gmon.out
   932    930   	rm -rf tsrc .target_source
          931  +	rm -f tclsqlite3$(TEXE)
   933    932   	rm -f testfixture$(TEXE) test.db
   934         -	rm -f sqlite3.dll sqlite3.lib sqlite3.def
          933  +	rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
   935    934   	rm -f sqlite3.c
          935  +	rm -f sqlite3_analyzer$(TEXE) sqlite3_analyzer.c
   936    936   
   937    937   distclean:	clean
   938    938   	rm -f config.log config.status libtool Makefile sqlite3.pc
   939    939   
   940    940   #
   941    941   # Windows section
   942    942   #

Changes to Makefile.msc.

   922    922   
   923    923   soaktest:	testfixture.exe sqlite3.exe
   924    924   	.\testfixture.exe $(TOP)\test\all.test -soak=1
   925    925   
   926    926   test:	testfixture.exe sqlite3.exe
   927    927   	.\testfixture.exe $(TOP)\test\veryquick.test
   928    928   
   929         -spaceanal_tcl.h:	$(TOP)\tool\spaceanal.tcl
   930         -	$(NAWK) -f $(TOP)/tool/tostr.awk \
   931         -		$(TOP)\tool\spaceanal.tcl > spaceanal_tcl.h
          929  +sqlite3_analyzer.c: sqlite3.c $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
          930  +	copy sqlite3.c + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
          931  +	echo static const char *tclsh_main_loop(void){ >> $@
          932  +	echo static const char *zMainloop = >> $@
          933  +	$(NAWK) -f $(TOP)\tool\tostr.awk $(TOP)\tool\spaceanal.tcl >> $@
          934  +	echo ; return zMainloop; } >> $@
   932    935   
   933         -sqlite3_analyzer.exe:	$(TESTFIXTURE_SRC) spaceanal_tcl.h
   934         -	$(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \
   935         -		-DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE \
   936         -		-DBUILD_sqlite -I$(TCLINCDIR) \
   937         -		$(TESTFIXTURE_SRC) \
          936  +sqlite3_analyzer.exe:	sqlite3_analyzer.c
          937  +	$(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \
   938    938   		/link $(LTLINKOPTS) /LIBPATH:$(TCLLIBDIR) $(LIBTCL) $(TLIBS)
   939    939   
   940    940   clean:
   941    941   	del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib
   942    942   	del /Q sqlite3.h opcodes.c opcodes.h
   943    943   	del /Q lemon.exe lempar.c parse.*
   944    944   	del /Q mkkeywordhash.exe keywordhash.h
   945    945   	-rmdir /Q/S tsrc
   946    946   	del /Q .target_source
          947  +	del /Q tclsqlite3.exe
   947    948   	del /Q testfixture.exe testfixture.exp test.db
   948    949   	del /Q sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
   949    950   	del /Q sqlite3.c
   950         -	del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp spaceanal_tcl.h
          951  +	del /Q sqlite3_analyzer.exe sqlite3_analyzer.exp sqlite3_analyzer.c
   951    952   
   952    953   #
   953    954   # Windows section
   954    955   #
   955    956   dll: sqlite3.dll
   956    957   
   957    958   sqlite3.def: libsqlite3.lib

Changes to VERSION.

     1         -3.7.8
            1  +3.7.9

Changes to configure.

     1      1   #! /bin/sh
     2      2   # Guess values for system-dependent variables and create Makefiles.
     3         -# Generated by GNU Autoconf 2.65 for sqlite 3.7.8.
            3  +# Generated by GNU Autoconf 2.67 for sqlite 3.7.9.
     4      4   #
     5      5   #
     6      6   # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
     7         -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
     8         -# Inc.
            7  +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
            8  +# Foundation, Inc.
     9      9   #
    10     10   #
    11     11   # This configure script is free software; the Free Software Foundation
    12     12   # gives unlimited permission to copy, distribute and modify it.
    13     13   ## -------------------- ##
    14     14   ## M4sh Initialization. ##
    15     15   ## -------------------- ##
................................................................................
   312    312   	    s//\1/
   313    313   	    q
   314    314   	  }
   315    315   	  s/.*/./; q'`
   316    316         test -d "$as_dir" && break
   317    317       done
   318    318       test -z "$as_dirs" || eval "mkdir $as_dirs"
   319         -  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
          319  +  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
   320    320   
   321    321   
   322    322   } # as_fn_mkdir_p
   323    323   # as_fn_append VAR VALUE
   324    324   # ----------------------
   325    325   # Append the text in VALUE to the end of the definition contained in VAR. Take
   326    326   # advantage of any shell optimizations that allow amortized linear growth over
................................................................................
   352    352     as_fn_arith ()
   353    353     {
   354    354       as_val=`expr "$@" || test $? -eq 1`
   355    355     }
   356    356   fi # as_fn_arith
   357    357   
   358    358   
   359         -# as_fn_error ERROR [LINENO LOG_FD]
   360         -# ---------------------------------
          359  +# as_fn_error STATUS ERROR [LINENO LOG_FD]
          360  +# ----------------------------------------
   361    361   # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
   362    362   # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
   363         -# script with status $?, using 1 if that was 0.
          363  +# script with STATUS, using 1 if that was 0.
   364    364   as_fn_error ()
   365    365   {
   366         -  as_status=$?; test $as_status -eq 0 && as_status=1
   367         -  if test "$3"; then
   368         -    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   369         -    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
          366  +  as_status=$1; test $as_status -eq 0 && as_status=1
          367  +  if test "$4"; then
          368  +    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
          369  +    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   370    370     fi
   371         -  $as_echo "$as_me: error: $1" >&2
          371  +  $as_echo "$as_me: error: $2" >&2
   372    372     as_fn_exit $as_status
   373    373   } # as_fn_error
   374    374   
   375    375   if expr a : '\(a\)' >/dev/null 2>&1 &&
   376    376      test "X`expr 00001 : '.*\(...\)'`" = X001; then
   377    377     as_expr=expr
   378    378   else
................................................................................
   675    675   
   676    676   
   677    677   
   678    678   test -n "$DJDIR" || exec 7<&0 </dev/null
   679    679   exec 6>&1
   680    680   
   681    681   # Name of the host.
   682         -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
          682  +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
   683    683   # so uname gets run too.
   684    684   ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
   685    685   
   686    686   #
   687    687   # Initializations.
   688    688   #
   689    689   ac_default_prefix=/usr/local
................................................................................
   694    694   subdirs=
   695    695   MFLAGS=
   696    696   MAKEFLAGS=
   697    697   
   698    698   # Identity of this package.
   699    699   PACKAGE_NAME='sqlite'
   700    700   PACKAGE_TARNAME='sqlite'
   701         -PACKAGE_VERSION='3.7.8'
   702         -PACKAGE_STRING='sqlite 3.7.8'
          701  +PACKAGE_VERSION='3.7.9'
          702  +PACKAGE_STRING='sqlite 3.7.9'
   703    703   PACKAGE_BUGREPORT=''
   704    704   PACKAGE_URL=''
   705    705   
   706    706   # Factoring default headers for most tests.
   707    707   ac_includes_default="\
   708    708   #include <stdio.h>
   709    709   #ifdef HAVE_SYS_TYPES_H
................................................................................
   948    948     if test -n "$ac_prev"; then
   949    949       eval $ac_prev=\$ac_option
   950    950       ac_prev=
   951    951       continue
   952    952     fi
   953    953   
   954    954     case $ac_option in
   955         -  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
   956         -  *)	ac_optarg=yes ;;
          955  +  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
          956  +  *=)   ac_optarg= ;;
          957  +  *)    ac_optarg=yes ;;
   957    958     esac
   958    959   
   959    960     # Accept the important Cygnus configure options, so we can diagnose typos.
   960    961   
   961    962     case $ac_dashdash$ac_option in
   962    963     --)
   963    964       ac_dashdash=yes ;;
................................................................................
   994    995     | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
   995    996       datarootdir=$ac_optarg ;;
   996    997   
   997    998     -disable-* | --disable-*)
   998    999       ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
   999   1000       # Reject names that are not valid shell variable names.
  1000   1001       expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
  1001         -      as_fn_error "invalid feature name: $ac_useropt"
         1002  +      as_fn_error $? "invalid feature name: $ac_useropt"
  1002   1003       ac_useropt_orig=$ac_useropt
  1003   1004       ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
  1004   1005       case $ac_user_opts in
  1005   1006         *"
  1006   1007   "enable_$ac_useropt"
  1007   1008   "*) ;;
  1008   1009         *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
................................................................................
  1020   1021     -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
  1021   1022       dvidir=$ac_optarg ;;
  1022   1023   
  1023   1024     -enable-* | --enable-*)
  1024   1025       ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
  1025   1026       # Reject names that are not valid shell variable names.
  1026   1027       expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
  1027         -      as_fn_error "invalid feature name: $ac_useropt"
         1028  +      as_fn_error $? "invalid feature name: $ac_useropt"
  1028   1029       ac_useropt_orig=$ac_useropt
  1029   1030       ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
  1030   1031       case $ac_user_opts in
  1031   1032         *"
  1032   1033   "enable_$ac_useropt"
  1033   1034   "*) ;;
  1034   1035         *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
................................................................................
  1224   1225     -version | --version | --versio | --versi | --vers | -V)
  1225   1226       ac_init_version=: ;;
  1226   1227   
  1227   1228     -with-* | --with-*)
  1228   1229       ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
  1229   1230       # Reject names that are not valid shell variable names.
  1230   1231       expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
  1231         -      as_fn_error "invalid package name: $ac_useropt"
         1232  +      as_fn_error $? "invalid package name: $ac_useropt"
  1232   1233       ac_useropt_orig=$ac_useropt
  1233   1234       ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
  1234   1235       case $ac_user_opts in
  1235   1236         *"
  1236   1237   "with_$ac_useropt"
  1237   1238   "*) ;;
  1238   1239         *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
................................................................................
  1240   1241       esac
  1241   1242       eval with_$ac_useropt=\$ac_optarg ;;
  1242   1243   
  1243   1244     -without-* | --without-*)
  1244   1245       ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
  1245   1246       # Reject names that are not valid shell variable names.
  1246   1247       expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
  1247         -      as_fn_error "invalid package name: $ac_useropt"
         1248  +      as_fn_error $? "invalid package name: $ac_useropt"
  1248   1249       ac_useropt_orig=$ac_useropt
  1249   1250       ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
  1250   1251       case $ac_user_opts in
  1251   1252         *"
  1252   1253   "with_$ac_useropt"
  1253   1254   "*) ;;
  1254   1255         *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
................................................................................
  1270   1271     -x-libraries | --x-libraries | --x-librarie | --x-librari \
  1271   1272     | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  1272   1273       ac_prev=x_libraries ;;
  1273   1274     -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  1274   1275     | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  1275   1276       x_libraries=$ac_optarg ;;
  1276   1277   
  1277         -  -*) as_fn_error "unrecognized option: \`$ac_option'
  1278         -Try \`$0 --help' for more information."
         1278  +  -*) as_fn_error $? "unrecognized option: \`$ac_option'
         1279  +Try \`$0 --help' for more information"
  1279   1280       ;;
  1280   1281   
  1281   1282     *=*)
  1282   1283       ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
  1283   1284       # Reject names that are not valid shell variable names.
  1284   1285       case $ac_envvar in #(
  1285   1286         '' | [0-9]* | *[!_$as_cr_alnum]* )
  1286         -      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
         1287  +      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
  1287   1288       esac
  1288   1289       eval $ac_envvar=\$ac_optarg
  1289   1290       export $ac_envvar ;;
  1290   1291   
  1291   1292     *)
  1292   1293       # FIXME: should be removed in autoconf 3.0.
  1293   1294       $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
................................................................................
  1297   1298       ;;
  1298   1299   
  1299   1300     esac
  1300   1301   done
  1301   1302   
  1302   1303   if test -n "$ac_prev"; then
  1303   1304     ac_option=--`echo $ac_prev | sed 's/_/-/g'`
  1304         -  as_fn_error "missing argument to $ac_option"
         1305  +  as_fn_error $? "missing argument to $ac_option"
  1305   1306   fi
  1306   1307   
  1307   1308   if test -n "$ac_unrecognized_opts"; then
  1308   1309     case $enable_option_checking in
  1309   1310       no) ;;
  1310         -    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
         1311  +    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
  1311   1312       *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
  1312   1313     esac
  1313   1314   fi
  1314   1315   
  1315   1316   # Check all directory arguments for consistency.
  1316   1317   for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
  1317   1318   		datadir sysconfdir sharedstatedir localstatedir includedir \
................................................................................
  1326   1327         eval $ac_var=\$ac_val;;
  1327   1328     esac
  1328   1329     # Be sure to have absolute directory names.
  1329   1330     case $ac_val in
  1330   1331       [\\/$]* | ?:[\\/]* )  continue;;
  1331   1332       NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
  1332   1333     esac
  1333         -  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
         1334  +  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
  1334   1335   done
  1335   1336   
  1336   1337   # There might be people who depend on the old broken behavior: `$host'
  1337   1338   # used to hold the argument of --host etc.
  1338   1339   # FIXME: To remove some day.
  1339   1340   build=$build_alias
  1340   1341   host=$host_alias
  1341   1342   target=$target_alias
  1342   1343   
  1343   1344   # FIXME: To remove some day.
  1344   1345   if test "x$host_alias" != x; then
  1345   1346     if test "x$build_alias" = x; then
  1346   1347       cross_compiling=maybe
  1347         -    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
  1348         -    If a cross compiler is detected then cross compile mode will be used." >&2
         1348  +    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
         1349  +    If a cross compiler is detected then cross compile mode will be used" >&2
  1349   1350     elif test "x$build_alias" != "x$host_alias"; then
  1350   1351       cross_compiling=yes
  1351   1352     fi
  1352   1353   fi
  1353   1354   
  1354   1355   ac_tool_prefix=
  1355   1356   test -n "$host_alias" && ac_tool_prefix=$host_alias-
................................................................................
  1356   1357   
  1357   1358   test "$silent" = yes && exec 6>/dev/null
  1358   1359   
  1359   1360   
  1360   1361   ac_pwd=`pwd` && test -n "$ac_pwd" &&
  1361   1362   ac_ls_di=`ls -di .` &&
  1362   1363   ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
  1363         -  as_fn_error "working directory cannot be determined"
         1364  +  as_fn_error $? "working directory cannot be determined"
  1364   1365   test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
  1365         -  as_fn_error "pwd does not report name of working directory"
         1366  +  as_fn_error $? "pwd does not report name of working directory"
  1366   1367   
  1367   1368   
  1368   1369   # Find the source files, if location was not specified.
  1369   1370   if test -z "$srcdir"; then
  1370   1371     ac_srcdir_defaulted=yes
  1371   1372     # Try the directory containing this script, then the parent directory.
  1372   1373     ac_confdir=`$as_dirname -- "$as_myself" ||
................................................................................
  1397   1398       srcdir=..
  1398   1399     fi
  1399   1400   else
  1400   1401     ac_srcdir_defaulted=no
  1401   1402   fi
  1402   1403   if test ! -r "$srcdir/$ac_unique_file"; then
  1403   1404     test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
  1404         -  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
         1405  +  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
  1405   1406   fi
  1406   1407   ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
  1407   1408   ac_abs_confdir=`(
  1408         -	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
         1409  +	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
  1409   1410   	pwd)`
  1410   1411   # When building in place, set srcdir=.
  1411   1412   if test "$ac_abs_confdir" = "$ac_pwd"; then
  1412   1413     srcdir=.
  1413   1414   fi
  1414   1415   # Remove unnecessary trailing slashes from srcdir.
  1415   1416   # Double slashes in file names in object file debugging info
................................................................................
  1427   1428   #
  1428   1429   # Report the --help message.
  1429   1430   #
  1430   1431   if test "$ac_init_help" = "long"; then
  1431   1432     # Omit some internal or obsolete options to make the list less imposing.
  1432   1433     # This message is too long to be a string in the A/UX 3.1 sh.
  1433   1434     cat <<_ACEOF
  1434         -\`configure' configures sqlite 3.7.8 to adapt to many kinds of systems.
         1435  +\`configure' configures sqlite 3.7.9 to adapt to many kinds of systems.
  1435   1436   
  1436   1437   Usage: $0 [OPTION]... [VAR=VALUE]...
  1437   1438   
  1438   1439   To assign environment variables (e.g., CC, CFLAGS...), specify them as
  1439   1440   VAR=VALUE.  See below for descriptions of some of the useful variables.
  1440   1441   
  1441   1442   Defaults for the options are specified in brackets.
  1442   1443   
  1443   1444   Configuration:
  1444   1445     -h, --help              display this help and exit
  1445   1446         --help=short        display options specific to this package
  1446   1447         --help=recursive    display the short help of all the included packages
  1447   1448     -V, --version           display version information and exit
  1448         -  -q, --quiet, --silent   do not print \`checking...' messages
         1449  +  -q, --quiet, --silent   do not print \`checking ...' messages
  1449   1450         --cache-file=FILE   cache test results in FILE [disabled]
  1450   1451     -C, --config-cache      alias for \`--cache-file=config.cache'
  1451   1452     -n, --no-create         do not create output files
  1452   1453         --srcdir=DIR        find the sources in DIR [configure dir or \`..']
  1453   1454   
  1454   1455   Installation directories:
  1455   1456     --prefix=PREFIX         install architecture-independent files in PREFIX
................................................................................
  1492   1493     --build=BUILD     configure for building on BUILD [guessed]
  1493   1494     --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  1494   1495   _ACEOF
  1495   1496   fi
  1496   1497   
  1497   1498   if test -n "$ac_init_help"; then
  1498   1499     case $ac_init_help in
  1499         -     short | recursive ) echo "Configuration of sqlite 3.7.8:";;
         1500  +     short | recursive ) echo "Configuration of sqlite 3.7.9:";;
  1500   1501      esac
  1501   1502     cat <<\_ACEOF
  1502   1503   
  1503   1504   Optional Features:
  1504   1505     --disable-option-checking  ignore unrecognized --enable/--with options
  1505   1506     --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  1506   1507     --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
................................................................................
  1609   1610       cd "$ac_pwd" || { ac_status=$?; break; }
  1610   1611     done
  1611   1612   fi
  1612   1613   
  1613   1614   test -n "$ac_init_help" && exit $ac_status
  1614   1615   if $ac_init_version; then
  1615   1616     cat <<\_ACEOF
  1616         -sqlite configure 3.7.8
  1617         -generated by GNU Autoconf 2.65
         1617  +sqlite configure 3.7.9
         1618  +generated by GNU Autoconf 2.67
  1618   1619   
  1619         -Copyright (C) 2009 Free Software Foundation, Inc.
         1620  +Copyright (C) 2010 Free Software Foundation, Inc.
  1620   1621   This configure script is free software; the Free Software Foundation
  1621   1622   gives unlimited permission to copy, distribute and modify it.
  1622   1623   _ACEOF
  1623   1624     exit
  1624   1625   fi
  1625   1626   
  1626   1627   ## ------------------------ ##
................................................................................
  1716   1717   # Tests whether HEADER exists and can be compiled using the include files in
  1717   1718   # INCLUDES, setting the cache variable VAR accordingly.
  1718   1719   ac_fn_c_check_header_compile ()
  1719   1720   {
  1720   1721     as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  1721   1722     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
  1722   1723   $as_echo_n "checking for $2... " >&6; }
  1723         -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
         1724  +if eval "test \"\${$3+set}\"" = set; then :
  1724   1725     $as_echo_n "(cached) " >&6
  1725   1726   else
  1726   1727     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  1727   1728   /* end confdefs.h.  */
  1728   1729   $4
  1729   1730   #include <$2>
  1730   1731   _ACEOF
................................................................................
  1759   1760     ac_status=$?
  1760   1761     if test -s conftest.err; then
  1761   1762       grep -v '^ *+' conftest.err >conftest.er1
  1762   1763       cat conftest.er1 >&5
  1763   1764       mv -f conftest.er1 conftest.err
  1764   1765     fi
  1765   1766     $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  1766         -  test $ac_status = 0; } >/dev/null && {
         1767  +  test $ac_status = 0; } > conftest.i && {
  1767   1768   	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
  1768   1769   	 test ! -s conftest.err
  1769   1770          }; then :
  1770   1771     ac_retval=0
  1771   1772   else
  1772   1773     $as_echo "$as_me: failed program was:" >&5
  1773   1774   sed 's/^/| /' conftest.$ac_ext >&5
................................................................................
  1825   1826   # ----------------------------------
  1826   1827   # Tests whether FUNC exists, setting the cache variable VAR accordingly
  1827   1828   ac_fn_c_check_func ()
  1828   1829   {
  1829   1830     as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  1830   1831     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
  1831   1832   $as_echo_n "checking for $2... " >&6; }
  1832         -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
         1833  +if eval "test \"\${$3+set}\"" = set; then :
  1833   1834     $as_echo_n "(cached) " >&6
  1834   1835   else
  1835   1836     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  1836   1837   /* end confdefs.h.  */
  1837   1838   /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
  1838   1839      For example, HP-UX 11i <limits.h> declares gettimeofday.  */
  1839   1840   #define $2 innocuous_$2
................................................................................
  1893   1894   # Tests whether TYPE exists after having included INCLUDES, setting cache
  1894   1895   # variable VAR accordingly.
  1895   1896   ac_fn_c_check_type ()
  1896   1897   {
  1897   1898     as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  1898   1899     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
  1899   1900   $as_echo_n "checking for $2... " >&6; }
  1900         -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
         1901  +if eval "test \"\${$3+set}\"" = set; then :
  1901   1902     $as_echo_n "(cached) " >&6
  1902   1903   else
  1903   1904     eval "$3=no"
  1904   1905     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  1905   1906   /* end confdefs.h.  */
  1906   1907   $4
  1907   1908   int
................................................................................
  1946   1947   # -------------------------------------------------------
  1947   1948   # Tests whether HEADER exists, giving a warning if it cannot be compiled using
  1948   1949   # the include files in INCLUDES and setting the cache variable VAR
  1949   1950   # accordingly.
  1950   1951   ac_fn_c_check_header_mongrel ()
  1951   1952   {
  1952   1953     as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
  1953         -  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
         1954  +  if eval "test \"\${$3+set}\"" = set; then :
  1954   1955     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
  1955   1956   $as_echo_n "checking for $2... " >&6; }
  1956         -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
         1957  +if eval "test \"\${$3+set}\"" = set; then :
  1957   1958     $as_echo_n "(cached) " >&6
  1958   1959   fi
  1959   1960   eval ac_res=\$$3
  1960   1961   	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
  1961   1962   $as_echo "$ac_res" >&6; }
  1962   1963   else
  1963   1964     # Is the header compilable?
................................................................................
  1985   1986   #include <$2>
  1986   1987   _ACEOF
  1987   1988   if ac_fn_c_try_cpp "$LINENO"; then :
  1988   1989     ac_header_preproc=yes
  1989   1990   else
  1990   1991     ac_header_preproc=no
  1991   1992   fi
  1992         -rm -f conftest.err conftest.$ac_ext
         1993  +rm -f conftest.err conftest.i conftest.$ac_ext
  1993   1994   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
  1994   1995   $as_echo "$ac_header_preproc" >&6; }
  1995   1996   
  1996   1997   # So?  What about this header?
  1997   1998   case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
  1998   1999     yes:no: )
  1999   2000       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
................................................................................
  2012   2013   $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
  2013   2014       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
  2014   2015   $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
  2015   2016       ;;
  2016   2017   esac
  2017   2018     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
  2018   2019   $as_echo_n "checking for $2... " >&6; }
  2019         -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
         2020  +if eval "test \"\${$3+set}\"" = set; then :
  2020   2021     $as_echo_n "(cached) " >&6
  2021   2022   else
  2022   2023     eval "$3=\$ac_header_compiler"
  2023   2024   fi
  2024   2025   eval ac_res=\$$3
  2025   2026   	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
  2026   2027   $as_echo "$ac_res" >&6; }
................................................................................
  2028   2029     eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
  2029   2030   
  2030   2031   } # ac_fn_c_check_header_mongrel
  2031   2032   cat >config.log <<_ACEOF
  2032   2033   This file contains any messages produced by compilers while
  2033   2034   running configure, to aid debugging if configure makes a mistake.
  2034   2035   
  2035         -It was created by sqlite $as_me 3.7.8, which was
  2036         -generated by GNU Autoconf 2.65.  Invocation command line was
         2036  +It was created by sqlite $as_me 3.7.9, which was
         2037  +generated by GNU Autoconf 2.67.  Invocation command line was
  2037   2038   
  2038   2039     $ $0 $@
  2039   2040   
  2040   2041   _ACEOF
  2041   2042   exec 5>>config.log
  2042   2043   {
  2043   2044   cat <<_ASUNAME
................................................................................
  2139   2140   # WARNING: Use '\'' to represent an apostrophe within the trap.
  2140   2141   # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
  2141   2142   trap 'exit_status=$?
  2142   2143     # Save into config.log some information that might help in debugging.
  2143   2144     {
  2144   2145       echo
  2145   2146   
  2146         -    cat <<\_ASBOX
  2147         -## ---------------- ##
         2147  +    $as_echo "## ---------------- ##
  2148   2148   ## Cache variables. ##
  2149         -## ---------------- ##
  2150         -_ASBOX
         2149  +## ---------------- ##"
  2151   2150       echo
  2152   2151       # The following way of writing the cache mishandles newlines in values,
  2153   2152   (
  2154   2153     for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
  2155   2154       eval ac_val=\$$ac_var
  2156   2155       case $ac_val in #(
  2157   2156       *${as_nl}*)
................................................................................
  2177   2176         sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
  2178   2177         ;;
  2179   2178       esac |
  2180   2179       sort
  2181   2180   )
  2182   2181       echo
  2183   2182   
  2184         -    cat <<\_ASBOX
  2185         -## ----------------- ##
         2183  +    $as_echo "## ----------------- ##
  2186   2184   ## Output variables. ##
  2187         -## ----------------- ##
  2188         -_ASBOX
         2185  +## ----------------- ##"
  2189   2186       echo
  2190   2187       for ac_var in $ac_subst_vars
  2191   2188       do
  2192   2189         eval ac_val=\$$ac_var
  2193   2190         case $ac_val in
  2194   2191         *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
  2195   2192         esac
  2196   2193         $as_echo "$ac_var='\''$ac_val'\''"
  2197   2194       done | sort
  2198   2195       echo
  2199   2196   
  2200   2197       if test -n "$ac_subst_files"; then
  2201         -      cat <<\_ASBOX
  2202         -## ------------------- ##
         2198  +      $as_echo "## ------------------- ##
  2203   2199   ## File substitutions. ##
  2204         -## ------------------- ##
  2205         -_ASBOX
         2200  +## ------------------- ##"
  2206   2201         echo
  2207   2202         for ac_var in $ac_subst_files
  2208   2203         do
  2209   2204   	eval ac_val=\$$ac_var
  2210   2205   	case $ac_val in
  2211   2206   	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
  2212   2207   	esac
  2213   2208   	$as_echo "$ac_var='\''$ac_val'\''"
  2214   2209         done | sort
  2215   2210         echo
  2216   2211       fi
  2217   2212   
  2218   2213       if test -s confdefs.h; then
  2219         -      cat <<\_ASBOX
  2220         -## ----------- ##
         2214  +      $as_echo "## ----------- ##
  2221   2215   ## confdefs.h. ##
  2222         -## ----------- ##
  2223         -_ASBOX
         2216  +## ----------- ##"
  2224   2217         echo
  2225   2218         cat confdefs.h
  2226   2219         echo
  2227   2220       fi
  2228   2221       test "$ac_signal" != 0 &&
  2229   2222         $as_echo "$as_me: caught signal $ac_signal"
  2230   2223       $as_echo "$as_me: exit $exit_status"
................................................................................
  2271   2264   
  2272   2265   
  2273   2266   # Let the site file select an alternate cache file if it wants to.
  2274   2267   # Prefer an explicitly selected file to automatically selected ones.
  2275   2268   ac_site_file1=NONE
  2276   2269   ac_site_file2=NONE
  2277   2270   if test -n "$CONFIG_SITE"; then
  2278         -  ac_site_file1=$CONFIG_SITE
         2271  +  # We do not want a PATH search for config.site.
         2272  +  case $CONFIG_SITE in #((
         2273  +    -*)  ac_site_file1=./$CONFIG_SITE;;
         2274  +    */*) ac_site_file1=$CONFIG_SITE;;
         2275  +    *)   ac_site_file1=./$CONFIG_SITE;;
         2276  +  esac
  2279   2277   elif test "x$prefix" != xNONE; then
  2280   2278     ac_site_file1=$prefix/share/config.site
  2281   2279     ac_site_file2=$prefix/etc/config.site
  2282   2280   else
  2283   2281     ac_site_file1=$ac_default_prefix/share/config.site
  2284   2282     ac_site_file2=$ac_default_prefix/etc/config.site
  2285   2283   fi
................................................................................
  2286   2284   for ac_site_file in "$ac_site_file1" "$ac_site_file2"
  2287   2285   do
  2288   2286     test "x$ac_site_file" = xNONE && continue
  2289   2287     if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
  2290   2288       { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
  2291   2289   $as_echo "$as_me: loading site script $ac_site_file" >&6;}
  2292   2290       sed 's/^/| /' "$ac_site_file" >&5
  2293         -    . "$ac_site_file"
         2291  +    . "$ac_site_file" \
         2292  +      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
         2293  +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
         2294  +as_fn_error $? "failed to load site script $ac_site_file
         2295  +See \`config.log' for more details" "$LINENO" 5 ; }
  2294   2296     fi
  2295   2297   done
  2296   2298   
  2297   2299   if test -r "$cache_file"; then
  2298   2300     # Some versions of bash will fail to source /dev/null (special files
  2299   2301     # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
  2300   2302     if test /dev/null != "$cache_file" && test -f "$cache_file"; then
................................................................................
  2362   2364     fi
  2363   2365   done
  2364   2366   if $ac_cache_corrupted; then
  2365   2367     { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  2366   2368   $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  2367   2369     { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
  2368   2370   $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
  2369         -  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
         2371  +  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
  2370   2372   fi
  2371   2373   ## -------------------- ##
  2372   2374   ## Main body of script. ##
  2373   2375   ## -------------------- ##
  2374   2376   
  2375   2377   ac_ext=c
  2376   2378   ac_cpp='$CPP $CPPFLAGS'
................................................................................
  2378   2380   ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  2379   2381   ac_compiler_gnu=$ac_cv_c_compiler_gnu
  2380   2382   
  2381   2383   
  2382   2384   
  2383   2385   sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'`
  2384   2386   if test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then
  2385         -as_fn_error "configure script is out of date:
         2387  +as_fn_error $? "configure script is out of date:
  2386   2388    configure \$PACKAGE_VERSION = $PACKAGE_VERSION
  2387   2389    top level VERSION file     = $sqlite_version_sanity_check
  2388   2390   please regen with autoconf" "$LINENO" 5
  2389   2391   fi
  2390   2392   
  2391   2393   # The following RCS revision string applies to configure.in
  2392   2394   # $Revision: 1.56 $
................................................................................
  2417   2419   
  2418   2420   
  2419   2421   
  2420   2422   ltmain="$ac_aux_dir/ltmain.sh"
  2421   2423   
  2422   2424   ac_aux_dir=
  2423   2425   for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
  2424         -  for ac_t in install-sh install.sh shtool; do
  2425         -    if test -f "$ac_dir/$ac_t"; then
  2426         -      ac_aux_dir=$ac_dir
  2427         -      ac_install_sh="$ac_aux_dir/$ac_t -c"
  2428         -      break 2
  2429         -    fi
  2430         -  done
         2426  +  if test -f "$ac_dir/install-sh"; then
         2427  +    ac_aux_dir=$ac_dir
         2428  +    ac_install_sh="$ac_aux_dir/install-sh -c"
         2429  +    break
         2430  +  elif test -f "$ac_dir/install.sh"; then
         2431  +    ac_aux_dir=$ac_dir
         2432  +    ac_install_sh="$ac_aux_dir/install.sh -c"
         2433  +    break
         2434  +  elif test -f "$ac_dir/shtool"; then
         2435  +    ac_aux_dir=$ac_dir
         2436  +    ac_install_sh="$ac_aux_dir/shtool install -c"
         2437  +    break
         2438  +  fi
  2431   2439   done
  2432   2440   if test -z "$ac_aux_dir"; then
  2433         -  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
         2441  +  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
  2434   2442   fi
  2435   2443   
  2436   2444   # These three variables are undocumented and unsupported,
  2437   2445   # and are intended to be withdrawn in a future Autoconf release.
  2438   2446   # They can cause serious problems if a builder's source tree is in a directory
  2439   2447   # whose full name contains unusual characters.
  2440   2448   ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
  2441   2449   ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
  2442   2450   ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
  2443   2451   
  2444   2452   
  2445   2453   # Make sure we can run config.sub.
  2446   2454   $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
  2447         -  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
         2455  +  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
  2448   2456   
  2449   2457   { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
  2450   2458   $as_echo_n "checking build system type... " >&6; }
  2451   2459   if test "${ac_cv_build+set}" = set; then :
  2452   2460     $as_echo_n "(cached) " >&6
  2453   2461   else
  2454   2462     ac_build_alias=$build_alias
  2455   2463   test "x$ac_build_alias" = x &&
  2456   2464     ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
  2457   2465   test "x$ac_build_alias" = x &&
  2458         -  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
         2466  +  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
  2459   2467   ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
  2460         -  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
         2468  +  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
  2461   2469   
  2462   2470   fi
  2463   2471   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
  2464   2472   $as_echo "$ac_cv_build" >&6; }
  2465   2473   case $ac_cv_build in
  2466   2474   *-*-*) ;;
  2467         -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
         2475  +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
  2468   2476   esac
  2469   2477   build=$ac_cv_build
  2470   2478   ac_save_IFS=$IFS; IFS='-'
  2471   2479   set x $ac_cv_build
  2472   2480   shift
  2473   2481   build_cpu=$1
  2474   2482   build_vendor=$2
................................................................................
  2485   2493   if test "${ac_cv_host+set}" = set; then :
  2486   2494     $as_echo_n "(cached) " >&6
  2487   2495   else
  2488   2496     if test "x$host_alias" = x; then
  2489   2497     ac_cv_host=$ac_cv_build
  2490   2498   else
  2491   2499     ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
  2492         -    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
         2500  +    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
  2493   2501   fi
  2494   2502   
  2495   2503   fi
  2496   2504   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
  2497   2505   $as_echo "$ac_cv_host" >&6; }
  2498   2506   case $ac_cv_host in
  2499   2507   *-*-*) ;;
  2500         -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
         2508  +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
  2501   2509   esac
  2502   2510   host=$ac_cv_host
  2503   2511   ac_save_IFS=$IFS; IFS='-'
  2504   2512   set x $ac_cv_host
  2505   2513   shift
  2506   2514   host_cpu=$1
  2507   2515   host_vendor=$2
................................................................................
  2809   2817   fi
  2810   2818   
  2811   2819   fi
  2812   2820   
  2813   2821   
  2814   2822   test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  2815   2823   $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  2816         -as_fn_error "no acceptable C compiler found in \$PATH
  2817         -See \`config.log' for more details." "$LINENO" 5; }
         2824  +as_fn_error $? "no acceptable C compiler found in \$PATH
         2825  +See \`config.log' for more details" "$LINENO" 5 ; }
  2818   2826   
  2819   2827   # Provide some information about the compiler.
  2820   2828   $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
  2821   2829   set X $ac_compile
  2822   2830   ac_compiler=$2
  2823   2831   for ac_option in --version -v -V -qversion; do
  2824   2832     { { ac_try="$ac_compiler $ac_option >&5"
................................................................................
  2924   2932     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  2925   2933   $as_echo "no" >&6; }
  2926   2934   $as_echo "$as_me: failed program was:" >&5
  2927   2935   sed 's/^/| /' conftest.$ac_ext >&5
  2928   2936   
  2929   2937   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  2930   2938   $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  2931         -{ as_fn_set_status 77
  2932         -as_fn_error "C compiler cannot create executables
  2933         -See \`config.log' for more details." "$LINENO" 5; }; }
         2939  +as_fn_error 77 "C compiler cannot create executables
         2940  +See \`config.log' for more details" "$LINENO" 5 ; }
  2934   2941   else
  2935   2942     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  2936   2943   $as_echo "yes" >&6; }
  2937   2944   fi
  2938   2945   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
  2939   2946   $as_echo_n "checking for C compiler default output file name... " >&6; }
  2940   2947   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
................................................................................
  2968   2975   	  break;;
  2969   2976       * ) break;;
  2970   2977     esac
  2971   2978   done
  2972   2979   else
  2973   2980     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  2974   2981   $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  2975         -as_fn_error "cannot compute suffix of executables: cannot compile and link
  2976         -See \`config.log' for more details." "$LINENO" 5; }
         2982  +as_fn_error $? "cannot compute suffix of executables: cannot compile and link
         2983  +See \`config.log' for more details" "$LINENO" 5 ; }
  2977   2984   fi
  2978   2985   rm -f conftest conftest$ac_cv_exeext
  2979   2986   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
  2980   2987   $as_echo "$ac_cv_exeext" >&6; }
  2981   2988   
  2982   2989   rm -f conftest.$ac_ext
  2983   2990   EXEEXT=$ac_cv_exeext
................................................................................
  3026   3033       cross_compiling=no
  3027   3034     else
  3028   3035       if test "$cross_compiling" = maybe; then
  3029   3036   	cross_compiling=yes
  3030   3037       else
  3031   3038   	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  3032   3039   $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  3033         -as_fn_error "cannot run C compiled programs.
         3040  +as_fn_error $? "cannot run C compiled programs.
  3034   3041   If you meant to cross compile, use \`--host'.
  3035         -See \`config.log' for more details." "$LINENO" 5; }
         3042  +See \`config.log' for more details" "$LINENO" 5 ; }
  3036   3043       fi
  3037   3044     fi
  3038   3045   fi
  3039   3046   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
  3040   3047   $as_echo "$cross_compiling" >&6; }
  3041   3048   
  3042   3049   rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
................................................................................
  3079   3086   done
  3080   3087   else
  3081   3088     $as_echo "$as_me: failed program was:" >&5
  3082   3089   sed 's/^/| /' conftest.$ac_ext >&5
  3083   3090   
  3084   3091   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  3085   3092   $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  3086         -as_fn_error "cannot compute suffix of object files: cannot compile
  3087         -See \`config.log' for more details." "$LINENO" 5; }
         3093  +as_fn_error $? "cannot compute suffix of object files: cannot compile
         3094  +See \`config.log' for more details" "$LINENO" 5 ; }
  3088   3095   fi
  3089   3096   rm -f conftest.$ac_cv_objext conftest.$ac_ext
  3090   3097   fi
  3091   3098   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
  3092   3099   $as_echo "$ac_cv_objext" >&6; }
  3093   3100   OBJEXT=$ac_cv_objext
  3094   3101   ac_objext=$OBJEXT
................................................................................
  3357   3364   
  3358   3365         $ac_path_SED_found && break 3
  3359   3366       done
  3360   3367     done
  3361   3368     done
  3362   3369   IFS=$as_save_IFS
  3363   3370     if test -z "$ac_cv_path_SED"; then
  3364         -    as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
         3371  +    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
  3365   3372     fi
  3366   3373   else
  3367   3374     ac_cv_path_SED=$SED
  3368   3375   fi
  3369   3376   
  3370   3377   fi
  3371   3378   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
................................................................................
  3433   3440   
  3434   3441         $ac_path_GREP_found && break 3
  3435   3442       done
  3436   3443     done
  3437   3444     done
  3438   3445   IFS=$as_save_IFS
  3439   3446     if test -z "$ac_cv_path_GREP"; then
  3440         -    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
         3447  +    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  3441   3448     fi
  3442   3449   else
  3443   3450     ac_cv_path_GREP=$GREP
  3444   3451   fi
  3445   3452   
  3446   3453   fi
  3447   3454   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
................................................................................
  3499   3506   
  3500   3507         $ac_path_EGREP_found && break 3
  3501   3508       done
  3502   3509     done
  3503   3510     done
  3504   3511   IFS=$as_save_IFS
  3505   3512     if test -z "$ac_cv_path_EGREP"; then
  3506         -    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
         3513  +    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  3507   3514     fi
  3508   3515   else
  3509   3516     ac_cv_path_EGREP=$EGREP
  3510   3517   fi
  3511   3518   
  3512   3519      fi
  3513   3520   fi
................................................................................
  3566   3573   
  3567   3574         $ac_path_FGREP_found && break 3
  3568   3575       done
  3569   3576     done
  3570   3577     done
  3571   3578   IFS=$as_save_IFS
  3572   3579     if test -z "$ac_cv_path_FGREP"; then
  3573         -    as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
         3580  +    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
  3574   3581     fi
  3575   3582   else
  3576   3583     ac_cv_path_FGREP=$FGREP
  3577   3584   fi
  3578   3585   
  3579   3586      fi
  3580   3587   fi
................................................................................
  3682   3689   if test -n "$LD"; then
  3683   3690     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
  3684   3691   $as_echo "$LD" >&6; }
  3685   3692   else
  3686   3693     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  3687   3694   $as_echo "no" >&6; }
  3688   3695   fi
  3689         -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
         3696  +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
  3690   3697   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
  3691   3698   $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
  3692   3699   if test "${lt_cv_prog_gnu_ld+set}" = set; then :
  3693   3700     $as_echo_n "(cached) " >&6
  3694   3701   else
  3695   3702     # I'd rather use --version here, but apparently some GNU lds only accept -v.
  3696   3703   case `$LD -v 2>&1 </dev/null` in
................................................................................
  3884   3891   { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
  3885   3892   $as_echo_n "checking the name lister ($NM) interface... " >&6; }
  3886   3893   if test "${lt_cv_nm_interface+set}" = set; then :
  3887   3894     $as_echo_n "(cached) " >&6
  3888   3895   else
  3889   3896     lt_cv_nm_interface="BSD nm"
  3890   3897     echo "int some_variable = 0;" > conftest.$ac_ext
  3891         -  (eval echo "\"\$as_me:3891: $ac_compile\"" >&5)
         3898  +  (eval echo "\"\$as_me:3898: $ac_compile\"" >&5)
  3892   3899     (eval "$ac_compile" 2>conftest.err)
  3893   3900     cat conftest.err >&5
  3894         -  (eval echo "\"\$as_me:3894: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
         3901  +  (eval echo "\"\$as_me:3901: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
  3895   3902     (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
  3896   3903     cat conftest.err >&5
  3897         -  (eval echo "\"\$as_me:3897: output\"" >&5)
         3904  +  (eval echo "\"\$as_me:3904: output\"" >&5)
  3898   3905     cat conftest.out >&5
  3899   3906     if $GREP 'External.*some_variable' conftest.out > /dev/null; then
  3900   3907       lt_cv_nm_interface="MS dumpbin"
  3901   3908     fi
  3902   3909     rm -f conftest*
  3903   3910   fi
  3904   3911   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
................................................................................
  5096   5103   	;;
  5097   5104       esac
  5098   5105     fi
  5099   5106     rm -rf conftest*
  5100   5107     ;;
  5101   5108   *-*-irix6*)
  5102   5109     # Find out which ABI we are using.
  5103         -  echo '#line 5103 "configure"' > conftest.$ac_ext
         5110  +  echo '#line 5110 "configure"' > conftest.$ac_ext
  5104   5111     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  5105   5112     (eval $ac_compile) 2>&5
  5106   5113     ac_status=$?
  5107   5114     $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  5108   5115     test $ac_status = 0; }; then
  5109   5116       if test "$lt_cv_prog_gnu_ld" = yes; then
  5110   5117         case `/usr/bin/file conftest.$ac_objext` in
................................................................................
  5885   5892   _ACEOF
  5886   5893   if ac_fn_c_try_cpp "$LINENO"; then :
  5887   5894   
  5888   5895   else
  5889   5896     # Broken: fails on valid input.
  5890   5897   continue
  5891   5898   fi
  5892         -rm -f conftest.err conftest.$ac_ext
         5899  +rm -f conftest.err conftest.i conftest.$ac_ext
  5893   5900   
  5894   5901     # OK, works on sane cases.  Now check whether nonexistent headers
  5895   5902     # can be detected and how.
  5896   5903     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  5897   5904   /* end confdefs.h.  */
  5898   5905   #include <ac_nonexistent.h>
  5899   5906   _ACEOF
................................................................................
  5901   5908     # Broken: success on invalid input.
  5902   5909   continue
  5903   5910   else
  5904   5911     # Passes both tests.
  5905   5912   ac_preproc_ok=:
  5906   5913   break
  5907   5914   fi
  5908         -rm -f conftest.err conftest.$ac_ext
         5915  +rm -f conftest.err conftest.i conftest.$ac_ext
  5909   5916   
  5910   5917   done
  5911   5918   # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
  5912         -rm -f conftest.err conftest.$ac_ext
         5919  +rm -f conftest.i conftest.err conftest.$ac_ext
  5913   5920   if $ac_preproc_ok; then :
  5914   5921     break
  5915   5922   fi
  5916   5923   
  5917   5924       done
  5918   5925       ac_cv_prog_CPP=$CPP
  5919   5926   
................................................................................
  5944   5951   _ACEOF
  5945   5952   if ac_fn_c_try_cpp "$LINENO"; then :
  5946   5953   
  5947   5954   else
  5948   5955     # Broken: fails on valid input.
  5949   5956   continue
  5950   5957   fi
  5951         -rm -f conftest.err conftest.$ac_ext
         5958  +rm -f conftest.err conftest.i conftest.$ac_ext
  5952   5959   
  5953   5960     # OK, works on sane cases.  Now check whether nonexistent headers
  5954   5961     # can be detected and how.
  5955   5962     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  5956   5963   /* end confdefs.h.  */
  5957   5964   #include <ac_nonexistent.h>
  5958   5965   _ACEOF
................................................................................
  5960   5967     # Broken: success on invalid input.
  5961   5968   continue
  5962   5969   else
  5963   5970     # Passes both tests.
  5964   5971   ac_preproc_ok=:
  5965   5972   break
  5966   5973   fi
  5967         -rm -f conftest.err conftest.$ac_ext
         5974  +rm -f conftest.err conftest.i conftest.$ac_ext
  5968   5975   
  5969   5976   done
  5970   5977   # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
  5971         -rm -f conftest.err conftest.$ac_ext
         5978  +rm -f conftest.i conftest.err conftest.$ac_ext
  5972   5979   if $ac_preproc_ok; then :
  5973   5980   
  5974   5981   else
  5975   5982     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
  5976   5983   $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
  5977         -as_fn_error "C preprocessor \"$CPP\" fails sanity check
  5978         -See \`config.log' for more details." "$LINENO" 5; }
         5984  +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
         5985  +See \`config.log' for more details" "$LINENO" 5 ; }
  5979   5986   fi
  5980   5987   
  5981   5988   ac_ext=c
  5982   5989   ac_cpp='$CPP $CPPFLAGS'
  5983   5990   ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  5984   5991   ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  5985   5992   ac_compiler_gnu=$ac_cv_c_compiler_gnu
................................................................................
  6100   6107   # On IRIX 5.3, sys/types and inttypes.h are conflicting.
  6101   6108   for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
  6102   6109   		  inttypes.h stdint.h unistd.h
  6103   6110   do :
  6104   6111     as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
  6105   6112   ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
  6106   6113   "
  6107         -eval as_val=\$$as_ac_Header
  6108         -   if test "x$as_val" = x""yes; then :
         6114  +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
  6109   6115     cat >>confdefs.h <<_ACEOF
  6110   6116   #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
  6111   6117   _ACEOF
  6112   6118   
  6113   6119   fi
  6114   6120   
  6115   6121   done
................................................................................
  6622   6628      # Note that $ac_compile itself does not contain backslashes and begins
  6623   6629      # with a dollar sign (not a hyphen), so the echo should work correctly.
  6624   6630      # The option is referenced via a variable to avoid confusing sed.
  6625   6631      lt_compile=`echo "$ac_compile" | $SED \
  6626   6632      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  6627   6633      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  6628   6634      -e 's:$: $lt_compiler_flag:'`
  6629         -   (eval echo "\"\$as_me:6629: $lt_compile\"" >&5)
         6635  +   (eval echo "\"\$as_me:6635: $lt_compile\"" >&5)
  6630   6636      (eval "$lt_compile" 2>conftest.err)
  6631   6637      ac_status=$?
  6632   6638      cat conftest.err >&5
  6633         -   echo "$as_me:6633: \$? = $ac_status" >&5
         6639  +   echo "$as_me:6639: \$? = $ac_status" >&5
  6634   6640      if (exit $ac_status) && test -s "$ac_outfile"; then
  6635   6641        # The compiler can only warn and ignore the option if not recognized
  6636   6642        # So say no if there are warnings other than the usual output.
  6637   6643        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  6638   6644        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  6639   6645        if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  6640   6646          lt_cv_prog_compiler_rtti_exceptions=yes
................................................................................
  6961   6967      # Note that $ac_compile itself does not contain backslashes and begins
  6962   6968      # with a dollar sign (not a hyphen), so the echo should work correctly.
  6963   6969      # The option is referenced via a variable to avoid confusing sed.
  6964   6970      lt_compile=`echo "$ac_compile" | $SED \
  6965   6971      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  6966   6972      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  6967   6973      -e 's:$: $lt_compiler_flag:'`
  6968         -   (eval echo "\"\$as_me:6968: $lt_compile\"" >&5)
         6974  +   (eval echo "\"\$as_me:6974: $lt_compile\"" >&5)
  6969   6975      (eval "$lt_compile" 2>conftest.err)
  6970   6976      ac_status=$?
  6971   6977      cat conftest.err >&5
  6972         -   echo "$as_me:6972: \$? = $ac_status" >&5
         6978  +   echo "$as_me:6978: \$? = $ac_status" >&5
  6973   6979      if (exit $ac_status) && test -s "$ac_outfile"; then
  6974   6980        # The compiler can only warn and ignore the option if not recognized
  6975   6981        # So say no if there are warnings other than the usual output.
  6976   6982        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  6977   6983        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  6978   6984        if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  6979   6985          lt_cv_prog_compiler_pic_works=yes
................................................................................
  7066   7072      # (2) before a word containing "conftest.", or (3) at the end.
  7067   7073      # Note that $ac_compile itself does not contain backslashes and begins
  7068   7074      # with a dollar sign (not a hyphen), so the echo should work correctly.
  7069   7075      lt_compile=`echo "$ac_compile" | $SED \
  7070   7076      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  7071   7077      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  7072   7078      -e 's:$: $lt_compiler_flag:'`
  7073         -   (eval echo "\"\$as_me:7073: $lt_compile\"" >&5)
         7079  +   (eval echo "\"\$as_me:7079: $lt_compile\"" >&5)
  7074   7080      (eval "$lt_compile" 2>out/conftest.err)
  7075   7081      ac_status=$?
  7076   7082      cat out/conftest.err >&5
  7077         -   echo "$as_me:7077: \$? = $ac_status" >&5
         7083  +   echo "$as_me:7083: \$? = $ac_status" >&5
  7078   7084      if (exit $ac_status) && test -s out/conftest2.$ac_objext
  7079   7085      then
  7080   7086        # The compiler can only warn and ignore the option if not recognized
  7081   7087        # So say no if there are warnings
  7082   7088        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  7083   7089        $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  7084   7090        if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
................................................................................
  7121   7127      # (2) before a word containing "conftest.", or (3) at the end.
  7122   7128      # Note that $ac_compile itself does not contain backslashes and begins
  7123   7129      # with a dollar sign (not a hyphen), so the echo should work correctly.
  7124   7130      lt_compile=`echo "$ac_compile" | $SED \
  7125   7131      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  7126   7132      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  7127   7133      -e 's:$: $lt_compiler_flag:'`
  7128         -   (eval echo "\"\$as_me:7128: $lt_compile\"" >&5)
         7134  +   (eval echo "\"\$as_me:7134: $lt_compile\"" >&5)
  7129   7135      (eval "$lt_compile" 2>out/conftest.err)
  7130   7136      ac_status=$?
  7131   7137      cat out/conftest.err >&5
  7132         -   echo "$as_me:7132: \$? = $ac_status" >&5
         7138  +   echo "$as_me:7138: \$? = $ac_status" >&5
  7133   7139      if (exit $ac_status) && test -s out/conftest2.$ac_objext
  7134   7140      then
  7135   7141        # The compiler can only warn and ignore the option if not recognized
  7136   7142        # So say no if there are warnings
  7137   7143        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  7138   7144        $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  7139   7145        if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
................................................................................
  9501   9507   else
  9502   9508     	  if test "$cross_compiling" = yes; then :
  9503   9509     lt_cv_dlopen_self=cross
  9504   9510   else
  9505   9511     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  9506   9512     lt_status=$lt_dlunknown
  9507   9513     cat > conftest.$ac_ext <<_LT_EOF
  9508         -#line 9508 "configure"
         9514  +#line 9514 "configure"
  9509   9515   #include "confdefs.h"
  9510   9516   
  9511   9517   #if HAVE_DLFCN_H
  9512   9518   #include <dlfcn.h>
  9513   9519   #endif
  9514   9520   
  9515   9521   #include <stdio.h>
................................................................................
  9597   9603   else
  9598   9604     	  if test "$cross_compiling" = yes; then :
  9599   9605     lt_cv_dlopen_self_static=cross
  9600   9606   else
  9601   9607     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  9602   9608     lt_status=$lt_dlunknown
  9603   9609     cat > conftest.$ac_ext <<_LT_EOF
  9604         -#line 9604 "configure"
         9610  +#line 9610 "configure"
  9605   9611   #include "confdefs.h"
  9606   9612   
  9607   9613   #if HAVE_DLFCN_H
  9608   9614   #include <dlfcn.h>
  9609   9615   #endif
  9610   9616   
  9611   9617   #include <stdio.h>
................................................................................
 10262  10268   
 10263  10269   #########
 10264  10270   # Check for needed/wanted headers
 10265  10271   for ac_header in sys/types.h stdlib.h stdint.h inttypes.h
 10266  10272   do :
 10267  10273     as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 10268  10274   ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
 10269         -eval as_val=\$$as_ac_Header
 10270         -   if test "x$as_val" = x""yes; then :
        10275  +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
 10271  10276     cat >>confdefs.h <<_ACEOF
 10272  10277   #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 10273  10278   _ACEOF
 10274  10279   
 10275  10280   fi
 10276  10281   
 10277  10282   done
................................................................................
 10280  10285   #########
 10281  10286   # Figure out whether or not we have these functions
 10282  10287   #
 10283  10288   for ac_func in usleep fdatasync localtime_r gmtime_r localtime_s utime
 10284  10289   do :
 10285  10290     as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 10286  10291   ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
 10287         -eval as_val=\$$as_ac_var
 10288         -   if test "x$as_val" = x""yes; then :
        10292  +if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
 10289  10293     cat >>confdefs.h <<_ACEOF
 10290  10294   #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 10291  10295   _ACEOF
 10292  10296   
 10293  10297   fi
 10294  10298   done
 10295  10299   
................................................................................
 10746  10750   else
 10747  10751   
 10748  10752       # First check to see if --with-tcl was specified.
 10749  10753       if test x"${with_tclconfig}" != x ; then
 10750  10754         if test -f "${with_tclconfig}/tclConfig.sh" ; then
 10751  10755           ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
 10752  10756         else
 10753         -        as_fn_error "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
        10757  +        as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
 10754  10758         fi
 10755  10759       fi
 10756  10760   
 10757  10761       # Start autosearch by asking tclsh
 10758  10762       if test x"$cross_compiling" = xno; then
 10759  10763         for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}`
 10760  10764         do
................................................................................
 11046  11050   			found="no"
 11047  11051   			if test "$cross_compiling" != yes; then
 11048  11052   				for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do
 11049  11053   					for subdir in include include/readline; do
 11050  11054   						as_ac_File=`$as_echo "ac_cv_file_$dir/$subdir/readline.h" | $as_tr_sh`
 11051  11055   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $dir/$subdir/readline.h" >&5
 11052  11056   $as_echo_n "checking for $dir/$subdir/readline.h... " >&6; }
 11053         -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then :
        11057  +if eval "test \"\${$as_ac_File+set}\"" = set; then :
 11054  11058     $as_echo_n "(cached) " >&6
 11055  11059   else
 11056  11060     test "$cross_compiling" = yes &&
 11057         -  as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5
        11061  +  as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
 11058  11062   if test -r "$dir/$subdir/readline.h"; then
 11059  11063     eval "$as_ac_File=yes"
 11060  11064   else
 11061  11065     eval "$as_ac_File=no"
 11062  11066   fi
 11063  11067   fi
 11064  11068   eval ac_res=\$$as_ac_File
 11065  11069   	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 11066  11070   $as_echo "$ac_res" >&6; }
 11067         -eval as_val=\$$as_ac_File
 11068         -   if test "x$as_val" = x""yes; then :
        11071  +if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
 11069  11072     found=yes
 11070  11073   fi
 11071  11074   
 11072  11075   						if test "$found" = "yes"; then
 11073  11076   							TARGET_READLINE_INC="-I$dir/$subdir"
 11074  11077   							break
 11075  11078   						fi
................................................................................
 11418  11421   # Let make expand exec_prefix.
 11419  11422   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 11420  11423   
 11421  11424   DEFS=-DHAVE_CONFIG_H
 11422  11425   
 11423  11426   ac_libobjs=
 11424  11427   ac_ltlibobjs=
        11428  +U=
 11425  11429   for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
 11426  11430     # 1. Remove the extension, and $U if already installed.
 11427  11431     ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
 11428  11432     ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
 11429  11433     # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
 11430  11434     #    will be set to the directory where LIBOBJS objects are built.
 11431  11435     as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
................................................................................
 11579  11583   LANGUAGE=C
 11580  11584   export LANGUAGE
 11581  11585   
 11582  11586   # CDPATH.
 11583  11587   (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 11584  11588   
 11585  11589   
 11586         -# as_fn_error ERROR [LINENO LOG_FD]
 11587         -# ---------------------------------
        11590  +# as_fn_error STATUS ERROR [LINENO LOG_FD]
        11591  +# ----------------------------------------
 11588  11592   # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 11589  11593   # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
 11590         -# script with status $?, using 1 if that was 0.
        11594  +# script with STATUS, using 1 if that was 0.
 11591  11595   as_fn_error ()
 11592  11596   {
 11593         -  as_status=$?; test $as_status -eq 0 && as_status=1
 11594         -  if test "$3"; then
 11595         -    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
 11596         -    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
        11597  +  as_status=$1; test $as_status -eq 0 && as_status=1
        11598  +  if test "$4"; then
        11599  +    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
        11600  +    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
 11597  11601     fi
 11598         -  $as_echo "$as_me: error: $1" >&2
        11602  +  $as_echo "$as_me: error: $2" >&2
 11599  11603     as_fn_exit $as_status
 11600  11604   } # as_fn_error
 11601  11605   
 11602  11606   
 11603  11607   # as_fn_set_status STATUS
 11604  11608   # -----------------------
 11605  11609   # Set $? to STATUS, without forking.
................................................................................
 11787  11791   	    s//\1/
 11788  11792   	    q
 11789  11793   	  }
 11790  11794   	  s/.*/./; q'`
 11791  11795         test -d "$as_dir" && break
 11792  11796       done
 11793  11797       test -z "$as_dirs" || eval "mkdir $as_dirs"
 11794         -  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
        11798  +  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 11795  11799   
 11796  11800   
 11797  11801   } # as_fn_mkdir_p
 11798  11802   if mkdir -p . 2>/dev/null; then
 11799  11803     as_mkdir_p='mkdir -p "$as_dir"'
 11800  11804   else
 11801  11805     test -d ./-p && rmdir ./-p
................................................................................
 11840  11844   test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 11841  11845   
 11842  11846   cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 11843  11847   # Save the log message, to keep $0 and so on meaningful, and to
 11844  11848   # report actual input values of CONFIG_FILES etc. instead of their
 11845  11849   # values after options handling.
 11846  11850   ac_log="
 11847         -This file was extended by sqlite $as_me 3.7.8, which was
 11848         -generated by GNU Autoconf 2.65.  Invocation command line was
        11851  +This file was extended by sqlite $as_me 3.7.9, which was
        11852  +generated by GNU Autoconf 2.67.  Invocation command line was
 11849  11853   
 11850  11854     CONFIG_FILES    = $CONFIG_FILES
 11851  11855     CONFIG_HEADERS  = $CONFIG_HEADERS
 11852  11856     CONFIG_LINKS    = $CONFIG_LINKS
 11853  11857     CONFIG_COMMANDS = $CONFIG_COMMANDS
 11854  11858     $ $0 $@
 11855  11859   
................................................................................
 11906  11910   
 11907  11911   Report bugs to the package provider."
 11908  11912   
 11909  11913   _ACEOF
 11910  11914   cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 11911  11915   ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 11912  11916   ac_cs_version="\\
 11913         -sqlite config.status 3.7.8
 11914         -configured by $0, generated by GNU Autoconf 2.65,
        11917  +sqlite config.status 3.7.9
        11918  +configured by $0, generated by GNU Autoconf 2.67,
 11915  11919     with options \\"\$ac_cs_config\\"
 11916  11920   
 11917         -Copyright (C) 2009 Free Software Foundation, Inc.
        11921  +Copyright (C) 2010 Free Software Foundation, Inc.
 11918  11922   This config.status script is free software; the Free Software Foundation
 11919  11923   gives unlimited permission to copy, distribute and modify it."
 11920  11924   
 11921  11925   ac_pwd='$ac_pwd'
 11922  11926   srcdir='$srcdir'
 11923  11927   INSTALL='$INSTALL'
 11924  11928   AWK='$AWK'
................................................................................
 11927  11931   
 11928  11932   cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 11929  11933   # The default lists apply if the user does not specify any file.
 11930  11934   ac_need_defaults=:
 11931  11935   while test $# != 0
 11932  11936   do
 11933  11937     case $1 in
 11934         -  --*=*)
        11938  +  --*=?*)
 11935  11939       ac_option=`expr "X$1" : 'X\([^=]*\)='`
 11936  11940       ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
 11937  11941       ac_shift=:
 11938  11942       ;;
        11943  +  --*=)
        11944  +    ac_option=`expr "X$1" : 'X\([^=]*\)='`
        11945  +    ac_optarg=
        11946  +    ac_shift=:
        11947  +    ;;
 11939  11948     *)
 11940  11949       ac_option=$1
 11941  11950       ac_optarg=$2
 11942  11951       ac_shift=shift
 11943  11952       ;;
 11944  11953     esac
 11945  11954   
................................................................................
 11953  11962       $as_echo "$ac_cs_config"; exit ;;
 11954  11963     --debug | --debu | --deb | --de | --d | -d )
 11955  11964       debug=: ;;
 11956  11965     --file | --fil | --fi | --f )
 11957  11966       $ac_shift
 11958  11967       case $ac_optarg in
 11959  11968       *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
        11969  +    '') as_fn_error $? "missing file argument" ;;
 11960  11970       esac
 11961  11971       as_fn_append CONFIG_FILES " '$ac_optarg'"
 11962  11972       ac_need_defaults=false;;
 11963  11973     --header | --heade | --head | --hea )
 11964  11974       $ac_shift
 11965  11975       case $ac_optarg in
 11966  11976       *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
 11967  11977       esac
 11968  11978       as_fn_append CONFIG_HEADERS " '$ac_optarg'"
 11969  11979       ac_need_defaults=false;;
 11970  11980     --he | --h)
 11971  11981       # Conflict between --help and --header
 11972         -    as_fn_error "ambiguous option: \`$1'
        11982  +    as_fn_error $? "ambiguous option: \`$1'
 11973  11983   Try \`$0 --help' for more information.";;
 11974  11984     --help | --hel | -h )
 11975  11985       $as_echo "$ac_cs_usage"; exit ;;
 11976  11986     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
 11977  11987     | -silent | --silent | --silen | --sile | --sil | --si | --s)
 11978  11988       ac_cs_silent=: ;;
 11979  11989   
 11980  11990     # This is an error.
 11981         -  -*) as_fn_error "unrecognized option: \`$1'
        11991  +  -*) as_fn_error $? "unrecognized option: \`$1'
 11982  11992   Try \`$0 --help' for more information." ;;
 11983  11993   
 11984  11994     *) as_fn_append ac_config_targets " $1"
 11985  11995        ac_need_defaults=false ;;
 11986  11996   
 11987  11997     esac
 11988  11998     shift
................................................................................
 12287  12297   do
 12288  12298     case $ac_config_target in
 12289  12299       "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
 12290  12300       "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 12291  12301       "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
 12292  12302       "sqlite3.pc") CONFIG_FILES="$CONFIG_FILES sqlite3.pc" ;;
 12293  12303   
 12294         -  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
        12304  +  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
 12295  12305     esac
 12296  12306   done
 12297  12307   
 12298  12308   
 12299  12309   # If the user did not use the arguments to specify the items to instantiate,
 12300  12310   # then the envvar interface is used.  Set only those that are not.
 12301  12311   # We use the long form for the default assignment because of an extremely
................................................................................
 12325  12335   {
 12326  12336     tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
 12327  12337     test -n "$tmp" && test -d "$tmp"
 12328  12338   }  ||
 12329  12339   {
 12330  12340     tmp=./conf$$-$RANDOM
 12331  12341     (umask 077 && mkdir "$tmp")
 12332         -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
        12342  +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
 12333  12343   
 12334  12344   # Set up the scripts for CONFIG_FILES section.
 12335  12345   # No need to generate them if there are no CONFIG_FILES.
 12336  12346   # This happens for instance with `./config.status config.h'.
 12337  12347   if test -n "$CONFIG_FILES"; then
 12338  12348   
 12339  12349   
................................................................................
 12342  12352   # But we know of no other shell where ac_cr would be empty at this
 12343  12353   # point, so we can use a bashism as a fallback.
 12344  12354   if test "x$ac_cr" = x; then
 12345  12355     eval ac_cr=\$\'\\r\'
 12346  12356   fi
 12347  12357   ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 12348  12358   if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
 12349         -  ac_cs_awk_cr='\r'
        12359  +  ac_cs_awk_cr='\\r'
 12350  12360   else
 12351  12361     ac_cs_awk_cr=$ac_cr
 12352  12362   fi
 12353  12363   
 12354  12364   echo 'BEGIN {' >"$tmp/subs1.awk" &&
 12355  12365   _ACEOF
 12356  12366   
 12357  12367   
 12358  12368   {
 12359  12369     echo "cat >conf$$subs.awk <<_ACEOF" &&
 12360  12370     echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
 12361  12371     echo "_ACEOF"
 12362  12372   } >conf$$subs.sh ||
 12363         -  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
 12364         -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
        12373  +  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
        12374  +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 12365  12375   ac_delim='%!_!# '
 12366  12376   for ac_last_try in false false false false false :; do
 12367  12377     . ./conf$$subs.sh ||
 12368         -    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
        12378  +    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 12369  12379   
 12370  12380     ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
 12371  12381     if test $ac_delim_n = $ac_delim_num; then
 12372  12382       break
 12373  12383     elif $ac_last_try; then
 12374         -    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
        12384  +    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 12375  12385     else
 12376  12386       ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
 12377  12387     fi
 12378  12388   done
 12379  12389   rm -f conf$$subs.sh
 12380  12390   
 12381  12391   cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
................................................................................
 12456  12466   _ACEOF
 12457  12467   cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 12458  12468   if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
 12459  12469     sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 12460  12470   else
 12461  12471     cat
 12462  12472   fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
 12463         -  || as_fn_error "could not setup config files machinery" "$LINENO" 5
        12473  +  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 12464  12474   _ACEOF
 12465  12475   
 12466         -# VPATH may cause trouble with some makes, so we remove $(srcdir),
 12467         -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
        12476  +# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
        12477  +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 12468  12478   # trailing colons and then remove the whole line if VPATH becomes empty
 12469  12479   # (actually we leave an empty line to preserve line numbers).
 12470  12480   if test "x$srcdir" = x.; then
 12471         -  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
 12472         -s/:*\$(srcdir):*/:/
 12473         -s/:*\${srcdir}:*/:/
 12474         -s/:*@srcdir@:*/:/
 12475         -s/^\([^=]*=[	 ]*\):*/\1/
        12481  +  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
        12482  +h
        12483  +s///
        12484  +s/^/:/
        12485  +s/[	 ]*$/:/
        12486  +s/:\$(srcdir):/:/g
        12487  +s/:\${srcdir}:/:/g
        12488  +s/:@srcdir@:/:/g
        12489  +s/^:*//
 12476  12490   s/:*$//
        12491  +x
        12492  +s/\(=[	 ]*\).*/\1/
        12493  +G
        12494  +s/\n//
 12477  12495   s/^[^=]*=[	 ]*$//
 12478  12496   }'
 12479  12497   fi
 12480  12498   
 12481  12499   cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 12482  12500   fi # test -n "$CONFIG_FILES"
 12483  12501   
................................................................................
 12497  12515   # handling of long lines.
 12498  12516   ac_delim='%!_!# '
 12499  12517   for ac_last_try in false false :; do
 12500  12518     ac_t=`sed -n "/$ac_delim/p" confdefs.h`
 12501  12519     if test -z "$ac_t"; then
 12502  12520       break
 12503  12521     elif $ac_last_try; then
 12504         -    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
        12522  +    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
 12505  12523     else
 12506  12524       ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
 12507  12525     fi
 12508  12526   done
 12509  12527   
 12510  12528   # For the awk script, D is an array of macro values keyed by name,
 12511  12529   # likewise P contains macro parameters if any.  Preserve backslash
................................................................................
 12582  12600       }
 12583  12601     }
 12584  12602   }
 12585  12603   { print }
 12586  12604   _ACAWK
 12587  12605   _ACEOF
 12588  12606   cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 12589         -  as_fn_error "could not setup config headers machinery" "$LINENO" 5
        12607  +  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 12590  12608   fi # test -n "$CONFIG_HEADERS"
 12591  12609   
 12592  12610   
 12593  12611   eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
 12594  12612   shift
 12595  12613   for ac_tag
 12596  12614   do
 12597  12615     case $ac_tag in
 12598  12616     :[FHLC]) ac_mode=$ac_tag; continue;;
 12599  12617     esac
 12600  12618     case $ac_mode$ac_tag in
 12601  12619     :[FHL]*:*);;
 12602         -  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
        12620  +  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
 12603  12621     :[FH]-) ac_tag=-:-;;
 12604  12622     :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
 12605  12623     esac
 12606  12624     ac_save_IFS=$IFS
 12607  12625     IFS=:
 12608  12626     set x $ac_tag
 12609  12627     IFS=$ac_save_IFS
................................................................................
 12623  12641   	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 12624  12642   	 # because $ac_f cannot contain `:'.
 12625  12643   	 test -f "$ac_f" ||
 12626  12644   	   case $ac_f in
 12627  12645   	   [\\/$]*) false;;
 12628  12646   	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 12629  12647   	   esac ||
 12630         -	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
        12648  +	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
 12631  12649         esac
 12632  12650         case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
 12633  12651         as_fn_append ac_file_inputs " '$ac_f'"
 12634  12652       done
 12635  12653   
 12636  12654       # Let's still pretend it is `configure' which instantiates (i.e., don't
 12637  12655       # use $as_me), people would be surprised to read:
................................................................................
 12650  12668          ac_sed_conf_input=`$as_echo "$configure_input" |
 12651  12669          sed 's/[\\\\&|]/\\\\&/g'`;; #(
 12652  12670       *) ac_sed_conf_input=$configure_input;;
 12653  12671       esac
 12654  12672   
 12655  12673       case $ac_tag in
 12656  12674       *:-:* | *:-) cat >"$tmp/stdin" \
 12657         -      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
        12675  +      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
 12658  12676       esac
 12659  12677       ;;
 12660  12678     esac
 12661  12679   
 12662  12680     ac_dir=`$as_dirname -- "$ac_file" ||
 12663  12681   $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 12664  12682   	 X"$ac_file" : 'X\(//\)[^/]' \| \
................................................................................
 12781  12799   s&@builddir@&$ac_builddir&;t t
 12782  12800   s&@abs_builddir@&$ac_abs_builddir&;t t
 12783  12801   s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 12784  12802   s&@INSTALL@&$ac_INSTALL&;t t
 12785  12803   $ac_datarootdir_hack
 12786  12804   "
 12787  12805   eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
 12788         -  || as_fn_error "could not create $ac_file" "$LINENO" 5
        12806  +  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 12789  12807   
 12790  12808   test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
 12791  12809     { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
 12792  12810     { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
 12793  12811     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 12794         -which seems to be undefined.  Please make sure it is defined." >&5
        12812  +which seems to be undefined.  Please make sure it is defined" >&5
 12795  12813   $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 12796         -which seems to be undefined.  Please make sure it is defined." >&2;}
        12814  +which seems to be undefined.  Please make sure it is defined" >&2;}
 12797  12815   
 12798  12816     rm -f "$tmp/stdin"
 12799  12817     case $ac_file in
 12800  12818     -) cat "$tmp/out" && rm -f "$tmp/out";;
 12801  12819     *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
 12802  12820     esac \
 12803         -  || as_fn_error "could not create $ac_file" "$LINENO" 5
        12821  +  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 12804  12822    ;;
 12805  12823     :H)
 12806  12824     #
 12807  12825     # CONFIG_HEADER
 12808  12826     #
 12809  12827     if test x"$ac_file" != x-; then
 12810  12828       {
 12811  12829         $as_echo "/* $configure_input  */" \
 12812  12830         && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
 12813  12831       } >"$tmp/config.h" \
 12814         -      || as_fn_error "could not create $ac_file" "$LINENO" 5
        12832  +      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 12815  12833       if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
 12816  12834         { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 12817  12835   $as_echo "$as_me: $ac_file is unchanged" >&6;}
 12818  12836       else
 12819  12837         rm -f "$ac_file"
 12820  12838         mv "$tmp/config.h" "$ac_file" \
 12821         -	|| as_fn_error "could not create $ac_file" "$LINENO" 5
        12839  +	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
 12822  12840       fi
 12823  12841     else
 12824  12842       $as_echo "/* $configure_input  */" \
 12825  12843         && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
 12826         -      || as_fn_error "could not create -" "$LINENO" 5
        12844  +      || as_fn_error $? "could not create -" "$LINENO" 5
 12827  12845     fi
 12828  12846    ;;
 12829  12847   
 12830  12848     :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
 12831  12849   $as_echo "$as_me: executing $ac_file commands" >&6;}
 12832  12850    ;;
 12833  12851     esac
................................................................................
 13475  13493   
 13476  13494   
 13477  13495   as_fn_exit 0
 13478  13496   _ACEOF
 13479  13497   ac_clean_files=$ac_clean_files_save
 13480  13498   
 13481  13499   test $ac_write_fail = 0 ||
 13482         -  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
        13500  +  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 13483  13501   
 13484  13502   
 13485  13503   # configure is writing to config.log, and then calls config.status.
 13486  13504   # config.status does its own redirection, appending to config.log.
 13487  13505   # Unfortunately, on DOS this fails, as config.log is still kept open
 13488  13506   # by configure, so config.status won't be able to write to it; its
 13489  13507   # output is simply discarded.  So we exec the FD to /dev/null,
................................................................................
 13496  13514     test "$silent" = yes &&
 13497  13515       ac_config_status_args="$ac_config_status_args --quiet"
 13498  13516     exec 5>/dev/null
 13499  13517     $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
 13500  13518     exec 5>>config.log
 13501  13519     # Use ||, not &&, to avoid exiting from the if with $? = 1, which
 13502  13520     # would make configure fail if this is the last instruction.
 13503         -  $ac_cs_success || as_fn_exit $?
        13521  +  $ac_cs_success || as_fn_exit 1
 13504  13522   fi
 13505  13523   if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 13506  13524     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 13507  13525   $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 13508  13526   fi
 13509  13527   

Changes to main.mk.

   514    514   
   515    515   # Rules for building test programs and for running tests
   516    516   #
   517    517   tclsqlite3:	$(TOP)/src/tclsqlite.c libsqlite3.a
   518    518   	$(TCCX) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \
   519    519   		$(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB)
   520    520   
          521  +sqlite3_analyzer.c: sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
          522  +	echo "#define TCLSH 2" > $@
          523  +	cat sqlite3.c $(TOP)/src/test_stat.c $(TOP)/src/tclsqlite.c >> $@
          524  +	echo "static const char *tclsh_main_loop(void){" >> $@
          525  +	echo "static const char *zMainloop = " >> $@
          526  +	$(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl >> $@
          527  +	echo "; return zMainloop; }" >> $@
          528  +
          529  +sqlite3_analyzer$(EXE): sqlite3_analyzer.c
          530  +	$(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB) 
   521    531   
   522    532   # Rules to build the 'testfixture' application.
   523    533   #
   524    534   TESTFIXTURE_FLAGS  = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
   525    535   TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE 
   526    536   
   527    537   testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c
................................................................................
   556    566   threadtest3$(EXE): sqlite3.o $(TOP)/test/threadtest3.c $(TOP)/test/tt3_checkpoint.c
   557    567   	$(TCCX) -O2 sqlite3.o $(TOP)/test/threadtest3.c \
   558    568   		-o threadtest3$(EXE) $(THREADLIB)
   559    569   
   560    570   threadtest: threadtest3$(EXE)
   561    571   	./threadtest3$(EXE)
   562    572   
   563         -sqlite3_analyzer$(EXE):	$(TOP)/src/tclsqlite.c sqlite3.c $(TESTSRC) \
   564         -			$(TOP)/tool/spaceanal.tcl
   565         -	$(NAWK) -f $(TOP)/tool/tostr.awk $(TOP)/tool/spaceanal.tcl \
   566         -		 >spaceanal_tcl.h
   567         -	$(TCCX) $(TCL_FLAGS) -DTCLSH=2 $(TESTFIXTURE_FLAGS)                    \
   568         -		-DSQLITE_TEST=1 -DSQLITE_PRIVATE=""                            \
   569         -		$(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c                    \
   570         -		-o sqlite3_analyzer$(EXE)                                      \
   571         -		$(LIBTCL) $(THREADLIB)
   572         -
   573    573   TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO)
   574    574   $(TEST_EXTENSION): $(TOP)/src/test_loadext.c
   575    575   	$(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION)
   576    576   
   577    577   extensiontest: testfixture$(EXE) $(TEST_EXTENSION)
   578    578   	./testfixture$(EXE) $(TOP)/test/loadext.test
   579    579   
................................................................................
   589    589   #
   590    590   install:	sqlite3 libsqlite3.a sqlite3.h
   591    591   	mv sqlite3 /usr/bin
   592    592   	mv libsqlite3.a /usr/lib
   593    593   	mv sqlite3.h /usr/include
   594    594   
   595    595   clean:	
   596         -	rm -f *.o sqlite3 libsqlite3.a sqlite3.h opcodes.*
          596  +	rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.*
   597    597   	rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h
   598    598   	rm -f $(PUBLISH)
   599    599   	rm -f *.da *.bb *.bbg gmon.out
   600    600   	rm -rf tsrc target_source
   601    601   	rm -f testloadext.dll libtestloadext.so
          602  +	rm -f amalgamation-testfixture amalgamation-testfixture.exe
          603  +	rm -f fts3-testfixture fts3-testfixture.exe
          604  +	rm -f testfixture testfixture.exe
          605  +	rm -f threadtest3 threadtest3.exe
   602    606   	rm -f sqlite3.c fts?amal.c tclsqlite3.c
          607  +	rm -f sqlite3_analyzer sqlite3_analyzer.exe sqlite3_analyzer.c

Changes to src/ctime.c.

   328    328   #endif
   329    329   #ifdef SQLITE_OMIT_WSD
   330    330     "OMIT_WSD",
   331    331   #endif
   332    332   #ifdef SQLITE_OMIT_XFER_OPT
   333    333     "OMIT_XFER_OPT",
   334    334   #endif
   335         -#ifdef SQLITE_PAGECACHE_BLOCKALLOC
   336         -  "PAGECACHE_BLOCKALLOC",
   337         -#endif
   338    335   #ifdef SQLITE_PERFORMANCE_TRACE
   339    336     "PERFORMANCE_TRACE",
   340    337   #endif
   341    338   #ifdef SQLITE_PROXY_DEBUG
   342    339     "PROXY_DEBUG",
   343    340   #endif
   344    341   #ifdef SQLITE_SECURE_DELETE

Changes to src/pager.c.

   666    666     int pageSize;               /* Number of bytes in a page */
   667    667     Pgno mxPgno;                /* Maximum allowed size of the database */
   668    668     i64 journalSizeLimit;       /* Size limit for persistent journal files */
   669    669     char *zFilename;            /* Name of the database file */
   670    670     char *zJournal;             /* Name of the journal file */
   671    671     int (*xBusyHandler)(void*); /* Function to call when busy */
   672    672     void *pBusyHandlerArg;      /* Context argument for xBusyHandler */
          673  +  int nHit, nMiss;            /* Total cache hits and misses */
   673    674   #ifdef SQLITE_TEST
   674         -  int nHit, nMiss;            /* Cache hits and missing */
   675    675     int nRead, nWrite;          /* Database pages read/written */
   676    676   #endif
   677    677     void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */
   678    678   #ifdef SQLITE_HAS_CODEC
   679    679     void *(*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */
   680    680     void (*xCodecSizeChng)(void*,int,int); /* Notify of page size changes */
   681    681     void (*xCodecFree)(void*);             /* Destructor for the codec */
................................................................................
  4165   4165     ** pages belonging to the same sector.
  4166   4166     **
  4167   4167     ** The doNotSpill flag inhibits all cache spilling regardless of whether
  4168   4168     ** or not a sync is required.  This is set during a rollback.
  4169   4169     **
  4170   4170     ** Spilling is also prohibited when in an error state since that could
  4171   4171     ** lead to database corruption.   In the current implementaton it 
  4172         -  ** is impossible for sqlite3PCacheFetch() to be called with createFlag==1
         4172  +  ** is impossible for sqlite3PcacheFetch() to be called with createFlag==1
  4173   4173     ** while in the error state, hence it is impossible for this routine to
  4174   4174     ** be called in the error state.  Nevertheless, we include a NEVER()
  4175   4175     ** test for the error state as a safeguard against future changes.
  4176   4176     */
  4177   4177     if( NEVER(pPager->errCode) ) return SQLITE_OK;
  4178   4178     if( pPager->doNotSpill ) return SQLITE_OK;
  4179   4179     if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){
................................................................................
  5001   5001     assert( (*ppPage)->pgno==pgno );
  5002   5002     assert( (*ppPage)->pPager==pPager || (*ppPage)->pPager==0 );
  5003   5003   
  5004   5004     if( (*ppPage)->pPager && !noContent ){
  5005   5005       /* In this case the pcache already contains an initialized copy of
  5006   5006       ** the page. Return without further ado.  */
  5007   5007       assert( pgno<=PAGER_MAX_PGNO && pgno!=PAGER_MJ_PGNO(pPager) );
  5008         -    PAGER_INCR(pPager->nHit);
         5008  +    pPager->nHit++;
  5009   5009       return SQLITE_OK;
  5010   5010   
  5011   5011     }else{
  5012   5012       /* The pager cache has created a new page. Its content needs to 
  5013   5013       ** be initialized.  */
  5014   5014   
  5015         -    PAGER_INCR(pPager->nMiss);
  5016   5015       pPg = *ppPage;
  5017   5016       pPg->pPager = pPager;
  5018   5017   
  5019   5018       /* The maximum page number is 2^31. Return SQLITE_CORRUPT if a page
  5020   5019       ** number greater than this, or the unused locking-page, is requested. */
  5021   5020       if( pgno>PAGER_MAX_PGNO || pgno==PAGER_MJ_PGNO(pPager) ){
  5022   5021         rc = SQLITE_CORRUPT_BKPT;
................................................................................
  5044   5043           testcase( rc==SQLITE_NOMEM );
  5045   5044           sqlite3EndBenignMalloc();
  5046   5045         }
  5047   5046         memset(pPg->pData, 0, pPager->pageSize);
  5048   5047         IOTRACE(("ZERO %p %d\n", pPager, pgno));
  5049   5048       }else{
  5050   5049         assert( pPg->pPager==pPager );
         5050  +      pPager->nMiss++;
  5051   5051         rc = readDbPage(pPg);
  5052   5052         if( rc!=SQLITE_OK ){
  5053   5053           goto pager_acquire_err;
  5054   5054         }
  5055   5055       }
  5056   5056       pager_set_pagehash(pPg);
  5057   5057     }
................................................................................
  6077   6077     a[7] = pPager->nMiss;
  6078   6078     a[8] = 0;  /* Used to be pPager->nOvfl */
  6079   6079     a[9] = pPager->nRead;
  6080   6080     a[10] = pPager->nWrite;
  6081   6081     return a;
  6082   6082   }
  6083   6083   #endif
         6084  +
         6085  +/*
         6086  +** Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or
         6087  +** SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the
         6088  +** current cache hit or miss count, according to the value of eStat. If the 
         6089  +** reset parameter is non-zero, the cache hit or miss count is zeroed before 
         6090  +** returning.
         6091  +*/
         6092  +void sqlite3PagerCacheStat(Pager *pPager, int eStat, int reset, int *pnVal){
         6093  +  int *piStat;
         6094  +
         6095  +  assert( eStat==SQLITE_DBSTATUS_CACHE_HIT
         6096  +       || eStat==SQLITE_DBSTATUS_CACHE_MISS
         6097  +  );
         6098  +  if( eStat==SQLITE_DBSTATUS_CACHE_HIT ){
         6099  +    piStat = &pPager->nHit;
         6100  +  }else{
         6101  +    piStat = &pPager->nMiss;
         6102  +  }
         6103  +
         6104  +  *pnVal += *piStat;
         6105  +  if( reset ){
         6106  +    *piStat = 0;
         6107  +  }
         6108  +}
  6084   6109   
  6085   6110   /*
  6086   6111   ** Return true if this is an in-memory pager.
  6087   6112   */
  6088   6113   int sqlite3PagerIsMemdb(Pager *pPager){
  6089   6114     return MEMDB;
  6090   6115   }

Changes to src/pager.h.

   151    151   const char *sqlite3PagerFilename(Pager*);
   152    152   const sqlite3_vfs *sqlite3PagerVfs(Pager*);
   153    153   sqlite3_file *sqlite3PagerFile(Pager*);
   154    154   const char *sqlite3PagerJournalname(Pager*);
   155    155   int sqlite3PagerNosync(Pager*);
   156    156   void *sqlite3PagerTempSpace(Pager*);
   157    157   int sqlite3PagerIsMemdb(Pager*);
          158  +void sqlite3PagerCacheStat(Pager *, int, int, int *);
   158    159   
   159    160   /* Functions used to truncate the database file. */
   160    161   void sqlite3PagerTruncateImage(Pager*,Pgno);
   161    162   
   162    163   #if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL)
   163    164   void *sqlite3PagerCodec(DbPage *);
   164    165   #endif

Changes to src/pcache1.c.

    20     20   #include "sqliteInt.h"
    21     21   
    22     22   typedef struct PCache1 PCache1;
    23     23   typedef struct PgHdr1 PgHdr1;
    24     24   typedef struct PgFreeslot PgFreeslot;
    25     25   typedef struct PGroup PGroup;
    26     26   
    27         -typedef struct PGroupBlock PGroupBlock;
    28         -typedef struct PGroupBlockList PGroupBlockList;
    29     27   
    30     28   /* Each page cache (or PCache) belongs to a PGroup.  A PGroup is a set 
    31     29   ** of one or more PCaches that are able to recycle each others unpinned
    32     30   ** pages when they are under memory pressure.  A PGroup is an instance of
    33     31   ** the following object.
    34     32   **
    35     33   ** This page cache implementation works in one of two modes:
................................................................................
    52     50   struct PGroup {
    53     51     sqlite3_mutex *mutex;          /* MUTEX_STATIC_LRU or NULL */
    54     52     int nMaxPage;                  /* Sum of nMax for purgeable caches */
    55     53     int nMinPage;                  /* Sum of nMin for purgeable caches */
    56     54     int mxPinned;                  /* nMaxpage + 10 - nMinPage */
    57     55     int nCurrentPage;              /* Number of purgeable pages allocated */
    58     56     PgHdr1 *pLruHead, *pLruTail;   /* LRU list of unpinned pages */
    59         -#ifdef SQLITE_PAGECACHE_BLOCKALLOC
    60         -  int isBusy;                    /* Do not run ReleaseMemory() if true */
    61         -  PGroupBlockList *pBlockList;   /* List of block-lists for this group */
    62         -#endif
    63     57   };
    64     58   
    65         -/*
    66         -** If SQLITE_PAGECACHE_BLOCKALLOC is defined when the library is built,
    67         -** each PGroup structure has a linked list of the the following starting
    68         -** at PGroup.pBlockList. There is one entry for each distinct page-size 
    69         -** currently used by members of the PGroup (i.e. 1024 bytes, 4096 bytes
    70         -** etc.). Variable PGroupBlockList.nByte is set to the actual allocation
    71         -** size requested by each pcache, which is the database page-size plus
    72         -** the various header structures used by the pcache, pager and btree layers.
    73         -** Usually around (pgsz+200) bytes.
    74         -**
    75         -** This size (pgsz+200) bytes is not allocated efficiently by some
    76         -** implementations of malloc. In particular, some implementations are only
    77         -** able to allocate blocks of memory chunks of 2^N bytes, where N is some
    78         -** integer value. Since the page-size is a power of 2, this means we
    79         -** end up wasting (pgsz-200) bytes in each allocation.
    80         -**
    81         -** If SQLITE_PAGECACHE_BLOCKALLOC is defined, the (pgsz+200) byte blocks
    82         -** are not allocated directly. Instead, blocks of roughly M*(pgsz+200) bytes 
    83         -** are requested from malloc allocator. After a block is returned,
    84         -** sqlite3MallocSize() is used to determine how many (pgsz+200) byte
    85         -** allocations can fit in the space returned by malloc(). This value may
    86         -** be more than M.
    87         -**
    88         -** The blocks are stored in a doubly-linked list. Variable PGroupBlock.nEntry
    89         -** contains the number of allocations that will fit in the aData[] space.
    90         -** nEntry is limited to the number of bits in bitmask mUsed. If a slot
    91         -** within aData is in use, the corresponding bit in mUsed is set. Thus
    92         -** when (mUsed+1==(1 << nEntry)) the block is completely full.
    93         -**
    94         -** Each time a slot within a block is freed, the block is moved to the start
    95         -** of the linked-list. And if a block becomes completely full, then it is
    96         -** moved to the end of the list. As a result, when searching for a free
    97         -** slot, only the first block in the list need be examined. If it is full,
    98         -** then it is guaranteed that all blocks are full.
    99         -*/
   100         -struct PGroupBlockList {
   101         -  int nByte;                     /* Size of each allocation in bytes */
   102         -  PGroupBlock *pFirst;           /* First PGroupBlock in list */
   103         -  PGroupBlock *pLast;            /* Last PGroupBlock in list */
   104         -  PGroupBlockList *pNext;        /* Next block-list attached to group */
   105         -};
   106         -
   107         -struct PGroupBlock {
   108         -  Bitmask mUsed;                 /* Mask of used slots */
   109         -  int nEntry;                    /* Maximum number of allocations in aData[] */
   110         -  u8 *aData;                     /* Pointer to data block */
   111         -  PGroupBlock *pNext;            /* Next PGroupBlock in list */
   112         -  PGroupBlock *pPrev;            /* Previous PGroupBlock in list */
   113         -  PGroupBlockList *pList;        /* Owner list */
   114         -};
   115         -
   116         -/* Minimum value for PGroupBlock.nEntry */
   117         -#define PAGECACHE_BLOCKALLOC_MINENTRY 15
   118         -
   119     59   /* Each page cache is an instance of the following object.  Every
   120     60   ** open database file (including each in-memory database and each
   121     61   ** temporary or transient database) has a single page cache which
   122     62   ** is an instance of this object.
   123     63   **
   124     64   ** Pointers to structures of this type are cast and returned as 
   125     65   ** opaque sqlite3_pcache* handles.
................................................................................
   214    154   ** a pointer to a block of szPage bytes of data and the return value is
   215    155   ** a pointer to the associated PgHdr1 structure.
   216    156   **
   217    157   **   assert( PGHDR1_TO_PAGE(PAGE_TO_PGHDR1(pCache, X))==X );
   218    158   */
   219    159   #define PGHDR1_TO_PAGE(p)    (void*)(((char*)p) - p->pCache->szPage)
   220    160   #define PAGE_TO_PGHDR1(c, p) (PgHdr1*)(((char*)p) + c->szPage)
   221         -
   222         -/*
   223         -** Blocks used by the SQLITE_PAGECACHE_BLOCKALLOC blocks to store/retrieve 
   224         -** a PGroupBlock pointer based on a pointer to a page buffer. 
   225         -*/
   226         -#define PAGE_SET_BLOCKPTR(pCache, pPg, pBlock) \
   227         -  ( *(PGroupBlock **)&(((u8*)pPg)[sizeof(PgHdr1) + pCache->szPage]) = pBlock )
   228         -
   229         -#define PAGE_GET_BLOCKPTR(pCache, pPg) \
   230         -  ( *(PGroupBlock **)&(((u8*)pPg)[sizeof(PgHdr1) + pCache->szPage]) )
   231         -
   232    161   
   233    162   /*
   234    163   ** Macros to enter and leave the PCache LRU mutex.
   235    164   */
   236    165   #define pcache1EnterMutex(X) sqlite3_mutex_enter((X)->mutex)
   237    166   #define pcache1LeaveMutex(X) sqlite3_mutex_leave((X)->mutex)
   238    167   
................................................................................
   351    280       iSize = sqlite3MallocSize(p);
   352    281       sqlite3MemdebugSetType(p, MEMTYPE_PCACHE);
   353    282       return iSize;
   354    283     }
   355    284   }
   356    285   #endif /* SQLITE_ENABLE_MEMORY_MANAGEMENT */
   357    286   
   358         -#ifdef SQLITE_PAGECACHE_BLOCKALLOC
   359         -/*
   360         -** The block pBlock belongs to list pList but is not currently linked in.
   361         -** Insert it into the start of the list.
   362         -*/
   363         -static void addBlockToList(PGroupBlockList *pList, PGroupBlock *pBlock){
   364         -  pBlock->pPrev = 0;
   365         -  pBlock->pNext = pList->pFirst;
   366         -  pList->pFirst = pBlock;
   367         -  if( pBlock->pNext ){
   368         -    pBlock->pNext->pPrev = pBlock;
   369         -  }else{
   370         -    assert( pList->pLast==0 );
   371         -    pList->pLast = pBlock;
   372         -  }
   373         -}
   374         -
   375         -/*
   376         -** If there are no blocks in the list headed by pList, remove pList
   377         -** from the pGroup->pBlockList list and free it with sqlite3_free().
   378         -*/
   379         -static void freeListIfEmpty(PGroup *pGroup, PGroupBlockList *pList){
   380         -  assert( sqlite3_mutex_held(pGroup->mutex) );
   381         -  if( pList->pFirst==0 ){
   382         -    PGroupBlockList **pp;
   383         -    for(pp=&pGroup->pBlockList; *pp!=pList; pp=&(*pp)->pNext);
   384         -    *pp = (*pp)->pNext;
   385         -    sqlite3_free(pList);
   386         -  }
   387         -}
   388         -#endif /* SQLITE_PAGECACHE_BLOCKALLOC */
   389         -
   390    287   /*
   391    288   ** Allocate a new page object initially associated with cache pCache.
   392    289   */
   393    290   static PgHdr1 *pcache1AllocPage(PCache1 *pCache){
   394    291     int nByte = sizeof(PgHdr1) + pCache->szPage;
   395         -  void *pPg = 0;
   396         -  PgHdr1 *p;
          292  +  PgHdr1 *p = 0;
          293  +  void *pPg;
   397    294   
   398         -#ifdef SQLITE_PAGECACHE_BLOCKALLOC
   399         -  PGroup *pGroup = pCache->pGroup;
   400         -  PGroupBlockList *pList;
   401         -  PGroupBlock *pBlock;
   402         -  int i;
   403         -
   404         -  nByte += sizeof(PGroupBlockList *);
   405         -  nByte = ROUND8(nByte);
   406         -
   407         -  for(pList=pGroup->pBlockList; pList; pList=pList->pNext){
   408         -    if( pList->nByte==nByte ) break;
   409         -  }
   410         -  if( pList==0 ){
   411         -    PGroupBlockList *pNew;
   412         -    assert( pGroup->isBusy==0 );
   413         -    assert( sqlite3_mutex_held(pGroup->mutex) );
   414         -    pGroup->isBusy = 1;  /* Disable sqlite3PcacheReleaseMemory() */
   415         -    pNew = (PGroupBlockList *)sqlite3MallocZero(sizeof(PGroupBlockList));
   416         -    pGroup->isBusy = 0;  /* Reenable sqlite3PcacheReleaseMemory() */
   417         -    if( pNew==0 ){
   418         -      /* malloc() failure. Return early. */
   419         -      return 0;
   420         -    }
   421         -#ifdef SQLITE_DEBUG
   422         -    for(pList=pGroup->pBlockList; pList; pList=pList->pNext){
   423         -      assert( pList->nByte!=nByte );
   424         -    }
   425         -#endif
   426         -    pNew->nByte = nByte;
   427         -    pNew->pNext = pGroup->pBlockList;
   428         -    pGroup->pBlockList = pNew;
   429         -    pList = pNew;
   430         -  }
   431         -
   432         -  pBlock = pList->pFirst;
   433         -  if( pBlock==0 || pBlock->mUsed==(((Bitmask)1<<pBlock->nEntry)-1) ){
   434         -    int sz;
   435         -
   436         -    /* Allocate a new block. Try to allocate enough space for the PGroupBlock
   437         -    ** structure and MINENTRY allocations of nByte bytes each. If the 
   438         -    ** allocator returns more memory than requested, then more than MINENTRY 
   439         -    ** allocations may fit in it. */
   440         -    assert( sqlite3_mutex_held(pGroup->mutex) );
   441         -    pcache1LeaveMutex(pCache->pGroup);
   442         -    sz = sizeof(PGroupBlock) + PAGECACHE_BLOCKALLOC_MINENTRY * nByte;
   443         -    pBlock = (PGroupBlock *)sqlite3Malloc(sz);
   444         -    pcache1EnterMutex(pCache->pGroup);
   445         -
   446         -    if( !pBlock ){
   447         -      freeListIfEmpty(pGroup, pList);
   448         -      return 0;
   449         -    }
   450         -    pBlock->nEntry = (sqlite3MallocSize(pBlock) - sizeof(PGroupBlock)) / nByte;
   451         -    if( pBlock->nEntry>=BMS ){
   452         -      pBlock->nEntry = BMS-1;
   453         -    }
   454         -    pBlock->pList = pList;
   455         -    pBlock->mUsed = 0;
   456         -    pBlock->aData = (u8 *)&pBlock[1];
   457         -    addBlockToList(pList, pBlock);
   458         -
   459         -    sz = sqlite3MallocSize(pBlock);
   460         -    sqlite3_mutex_enter(pcache1.mutex);
   461         -    sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz);
   462         -    sqlite3_mutex_leave(pcache1.mutex);
   463         -  }
   464         -
   465         -  for(i=0; pPg==0 && ALWAYS(i<pBlock->nEntry); i++){
   466         -    if( 0==(pBlock->mUsed & ((Bitmask)1<<i)) ){
   467         -      pBlock->mUsed |= ((Bitmask)1<<i);
   468         -      pPg = (void *)&pBlock->aData[pList->nByte * i];
   469         -    }
   470         -  }
   471         -  assert( pPg );
   472         -  PAGE_SET_BLOCKPTR(pCache, pPg, pBlock);
   473         -
   474         -  /* If the block is now full, shift it to the end of the list */
   475         -  if( pBlock->mUsed==(((Bitmask)1<<pBlock->nEntry)-1) && pList->pLast!=pBlock ){
   476         -    assert( pList->pFirst==pBlock );
   477         -    assert( pBlock->pPrev==0 );
   478         -    assert( pList->pLast->pNext==0 );
   479         -    pList->pFirst = pBlock->pNext;
   480         -    pList->pFirst->pPrev = 0;
   481         -    pBlock->pPrev = pList->pLast;
   482         -    pBlock->pNext = 0;
   483         -    pList->pLast->pNext = pBlock;
   484         -    pList->pLast = pBlock;
   485         -  }
   486         -  p = PAGE_TO_PGHDR1(pCache, pPg);
   487         -  if( pCache->bPurgeable ){
   488         -    pCache->pGroup->nCurrentPage++;
   489         -  }
   490         -#else
   491    295     /* The group mutex must be released before pcache1Alloc() is called. This
   492    296     ** is because it may call sqlite3_release_memory(), which assumes that 
   493    297     ** this mutex is not held. */
   494    298     assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
   495    299     pcache1LeaveMutex(pCache->pGroup);
   496    300     pPg = pcache1Alloc(nByte);
   497    301     pcache1EnterMutex(pCache->pGroup);
          302  +
   498    303     if( pPg ){
   499    304       p = PAGE_TO_PGHDR1(pCache, pPg);
   500    305       if( pCache->bPurgeable ){
   501    306         pCache->pGroup->nCurrentPage++;
   502    307       }
   503         -  }else{
   504         -    p = 0;
   505    308     }
   506         -#endif
   507    309     return p;
   508    310   }
   509    311   
   510    312   /*
   511    313   ** Free a page object allocated by pcache1AllocPage().
   512    314   **
   513    315   ** The pointer is allowed to be NULL, which is prudent.  But it turns out
   514    316   ** that the current implementation happens to never call this routine
   515    317   ** with a NULL pointer, so we mark the NULL test with ALWAYS().
   516    318   */
   517    319   static void pcache1FreePage(PgHdr1 *p){
   518    320     if( ALWAYS(p) ){
   519    321       PCache1 *pCache = p->pCache;
   520         -    void *pPg = PGHDR1_TO_PAGE(p);
   521         -
   522         -#ifdef SQLITE_PAGECACHE_BLOCKALLOC
   523         -    PGroupBlock *pBlock = PAGE_GET_BLOCKPTR(pCache, pPg);
   524         -    PGroupBlockList *pList = pBlock->pList;
   525         -    int i = ((u8 *)pPg - pBlock->aData) / pList->nByte;
   526         -
   527         -    assert( pPg==(void *)&pBlock->aData[i*pList->nByte] );
   528         -    assert( pBlock->mUsed & ((Bitmask)1<<i) );
   529         -    pBlock->mUsed &= ~((Bitmask)1<<i);
   530         -
   531         -    /* Remove the block from the list. If it is completely empty, free it.
   532         -    ** Or if it is not completely empty, re-insert it at the start of the
   533         -    ** list. */
   534         -    if( pList->pFirst==pBlock ){
   535         -      pList->pFirst = pBlock->pNext;
   536         -      if( pList->pFirst ) pList->pFirst->pPrev = 0;
   537         -    }else{
   538         -      pBlock->pPrev->pNext = pBlock->pNext;
   539         -    }
   540         -    if( pList->pLast==pBlock ){
   541         -      pList->pLast = pBlock->pPrev;
   542         -      if( pList->pLast ) pList->pLast->pNext = 0;
   543         -    }else{
   544         -      pBlock->pNext->pPrev = pBlock->pPrev;
   545         -    }
   546         -
   547         -    if( pBlock->mUsed==0 ){
   548         -      PGroup *pGroup = p->pCache->pGroup;
   549         -
   550         -      int sz = sqlite3MallocSize(pBlock);
   551         -      sqlite3_mutex_enter(pcache1.mutex);
   552         -      sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -sz);
   553         -      sqlite3_mutex_leave(pcache1.mutex);
   554         -      freeListIfEmpty(pGroup, pList);
   555         -      sqlite3_free(pBlock);
   556         -    }else{
   557         -      addBlockToList(pList, pBlock);
   558         -    }
   559         -#else
   560    322       assert( sqlite3_mutex_held(p->pCache->pGroup->mutex) );
   561         -    pcache1Free(pPg);
   562         -#endif
          323  +    pcache1Free(PGHDR1_TO_PAGE(p));
   563    324       if( pCache->bPurgeable ){
   564    325         pCache->pGroup->nCurrentPage--;
   565    326       }
   566    327     }
   567    328   }
   568    329   
   569    330   /*
................................................................................
  1166    927   **
  1167    928   ** nReq is the number of bytes of memory required. Once this much has
  1168    929   ** been released, the function returns. The return value is the total number 
  1169    930   ** of bytes of memory released.
  1170    931   */
  1171    932   int sqlite3PcacheReleaseMemory(int nReq){
  1172    933     int nFree = 0;
  1173         -#ifdef SQLITE_PAGECACHE_BLOCKALLOC
  1174         -  if( pcache1.grp.isBusy ) return 0;
  1175         -#endif
  1176    934     assert( sqlite3_mutex_notheld(pcache1.grp.mutex) );
  1177    935     assert( sqlite3_mutex_notheld(pcache1.mutex) );
  1178    936     if( pcache1.pStart==0 ){
  1179    937       PgHdr1 *p;
  1180    938       pcache1EnterMutex(&pcache1.grp);
  1181    939       while( (nReq<0 || nFree<nReq) && ((p=pcache1.grp.pLruTail)!=0) ){
  1182    940         nFree += pcache1MemSize(PGHDR1_TO_PAGE(p));

Changes to src/sqlite.h.in.

  5806   5806   **
  5807   5807   ** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt>
  5808   5808   ** <dd>This parameter returns the approximate number of of bytes of heap
  5809   5809   ** and lookaside memory used by all prepared statements associated with
  5810   5810   ** the database connection.)^
  5811   5811   ** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
  5812   5812   ** </dd>
         5813  +**
         5814  +** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
         5815  +** <dd>This parameter returns the number of pager cache hits that have
         5816  +** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT 
         5817  +** is always 0.
         5818  +** </dd>
         5819  +**
         5820  +** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
         5821  +** <dd>This parameter returns the number of pager cache misses that have
         5822  +** occurred. ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS 
         5823  +** is always 0.
         5824  +** </dd>
  5813   5825   ** </dl>
  5814   5826   */
  5815   5827   #define SQLITE_DBSTATUS_LOOKASIDE_USED       0
  5816   5828   #define SQLITE_DBSTATUS_CACHE_USED           1
  5817   5829   #define SQLITE_DBSTATUS_SCHEMA_USED          2
  5818   5830   #define SQLITE_DBSTATUS_STMT_USED            3
  5819   5831   #define SQLITE_DBSTATUS_LOOKASIDE_HIT        4
  5820   5832   #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE  5
  5821   5833   #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL  6
  5822         -#define SQLITE_DBSTATUS_MAX                  6   /* Largest defined DBSTATUS */
         5834  +#define SQLITE_DBSTATUS_CACHE_HIT            7
         5835  +#define SQLITE_DBSTATUS_CACHE_MISS           8
         5836  +#define SQLITE_DBSTATUS_MAX                  8   /* Largest defined DBSTATUS */
  5823   5837   
  5824   5838   
  5825   5839   /*
  5826   5840   ** CAPI3REF: Prepared Statement Status
  5827   5841   **
  5828   5842   ** ^(Each prepared statement maintains various
  5829   5843   ** [SQLITE_STMTSTATUS counters] that measure the number
................................................................................
  5869   5883   **
  5870   5884   ** [[SQLITE_STMTSTATUS_AUTOINDEX]] <dt>SQLITE_STMTSTATUS_AUTOINDEX</dt>
  5871   5885   ** <dd>^This is the number of rows inserted into transient indices that
  5872   5886   ** were created automatically in order to help joins run faster.
  5873   5887   ** A non-zero value in this counter may indicate an opportunity to
  5874   5888   ** improvement performance by adding permanent indices that do not
  5875   5889   ** need to be reinitialized each time the statement is run.</dd>
  5876         -**
  5877   5890   ** </dl>
  5878   5891   */
  5879   5892   #define SQLITE_STMTSTATUS_FULLSCAN_STEP     1
  5880   5893   #define SQLITE_STMTSTATUS_SORT              2
  5881   5894   #define SQLITE_STMTSTATUS_AUTOINDEX         3
  5882   5895   
  5883   5896   /*

Changes to src/status.c.

   213    213         db->pnBytesFreed = 0;
   214    214   
   215    215         *pHighwater = 0;
   216    216         *pCurrent = nByte;
   217    217   
   218    218         break;
   219    219       }
          220  +
          221  +    /*
          222  +    ** Set *pCurrent to the total cache hits or misses encountered by all
          223  +    ** pagers the database handle is connected to. *pHighwater is always set 
          224  +    ** to zero.
          225  +    */
          226  +    case SQLITE_DBSTATUS_CACHE_HIT:
          227  +    case SQLITE_DBSTATUS_CACHE_MISS: {
          228  +      int i;
          229  +      int nRet = 0;
          230  +      assert( SQLITE_DBSTATUS_CACHE_MISS==SQLITE_DBSTATUS_CACHE_HIT+1 );
          231  +
          232  +      for(i=0; i<db->nDb; i++){
          233  +        if( db->aDb[i].pBt ){
          234  +          Pager *pPager = sqlite3BtreePager(db->aDb[i].pBt);
          235  +          sqlite3PagerCacheStat(pPager, op, resetFlag, &nRet);
          236  +        }
          237  +      }
          238  +      *pHighwater = 0;
          239  +      *pCurrent = nRet;
          240  +      break;
          241  +    }
   220    242   
   221    243       default: {
   222    244         rc = SQLITE_ERROR;
   223    245       }
   224    246     }
   225    247     sqlite3_mutex_leave(db->mutex);
   226    248     return rc;
   227    249   }

Changes to src/tclsqlite.c.

  3535   3535   /*
  3536   3536   ** If the macro TCLSH is one, then put in code this for the
  3537   3537   ** "main" routine that will initialize Tcl and take input from
  3538   3538   ** standard input, or if a file is named on the command line
  3539   3539   ** the TCL interpreter reads and evaluates that file.
  3540   3540   */
  3541   3541   #if TCLSH==1
  3542         -static char zMainloop[] =
  3543         -  "set line {}\n"
  3544         -  "while {![eof stdin]} {\n"
  3545         -    "if {$line!=\"\"} {\n"
  3546         -      "puts -nonewline \"> \"\n"
  3547         -    "} else {\n"
  3548         -      "puts -nonewline \"% \"\n"
  3549         -    "}\n"
  3550         -    "flush stdout\n"
  3551         -    "append line [gets stdin]\n"
  3552         -    "if {[info complete $line]} {\n"
  3553         -      "if {[catch {uplevel #0 $line} result]} {\n"
  3554         -        "puts stderr \"Error: $result\"\n"
  3555         -      "} elseif {$result!=\"\"} {\n"
  3556         -        "puts $result\n"
         3542  +static const char *tclsh_main_loop(void){
         3543  +  static const char zMainloop[] =
         3544  +    "set line {}\n"
         3545  +    "while {![eof stdin]} {\n"
         3546  +      "if {$line!=\"\"} {\n"
         3547  +        "puts -nonewline \"> \"\n"
         3548  +      "} else {\n"
         3549  +        "puts -nonewline \"% \"\n"
         3550  +      "}\n"
         3551  +      "flush stdout\n"
         3552  +      "append line [gets stdin]\n"
         3553  +      "if {[info complete $line]} {\n"
         3554  +        "if {[catch {uplevel #0 $line} result]} {\n"
         3555  +          "puts stderr \"Error: $result\"\n"
         3556  +        "} elseif {$result!=\"\"} {\n"
         3557  +          "puts $result\n"
         3558  +        "}\n"
         3559  +        "set line {}\n"
         3560  +      "} else {\n"
         3561  +        "append line \\n\n"
  3557   3562         "}\n"
  3558         -      "set line {}\n"
  3559         -    "} else {\n"
  3560         -      "append line \\n\n"
  3561   3563       "}\n"
  3562         -  "}\n"
  3563         -;
         3564  +  ;
         3565  +  return zMainloop;
         3566  +}
  3564   3567   #endif
  3565   3568   #if TCLSH==2
  3566         -static char zMainloop[] = 
  3567         -#include "spaceanal_tcl.h"
  3568         -;
         3569  +static const char *tclsh_main_loop(void);
  3569   3570   #endif
  3570   3571   
  3571   3572   #ifdef SQLITE_TEST
  3572   3573   static void init_all(Tcl_Interp *);
  3573   3574   static int init_all_cmd(
  3574   3575     ClientData cd,
  3575   3576     Tcl_Interp *interp,
................................................................................
  3644   3645   */
  3645   3646   static void init_all(Tcl_Interp *interp){
  3646   3647     Sqlite3_Init(interp);
  3647   3648   
  3648   3649   #if defined(SQLITE_TEST) || defined(SQLITE_TCLMD5)
  3649   3650     Md5_Init(interp);
  3650   3651   #endif
         3652  +
         3653  +  /* Install the [register_dbstat_vtab] command to access the implementation
         3654  +  ** of virtual table dbstat (source file test_stat.c). This command is
         3655  +  ** required for testfixture and sqlite3_analyzer, but not by the production
         3656  +  ** Tcl extension.  */
         3657  +#if defined(SQLITE_TEST) || TCLSH==2
         3658  +  {
         3659  +    extern int SqlitetestStat_Init(Tcl_Interp*);
         3660  +    SqlitetestStat_Init(interp);
         3661  +  }
         3662  +#endif
  3651   3663   
  3652   3664   #ifdef SQLITE_TEST
  3653   3665     {
  3654   3666       extern int Sqliteconfig_Init(Tcl_Interp*);
  3655   3667       extern int Sqlitetest1_Init(Tcl_Interp*);
  3656   3668       extern int Sqlitetest2_Init(Tcl_Interp*);
  3657   3669       extern int Sqlitetest3_Init(Tcl_Interp*);
................................................................................
  3674   3686       extern int Sqlitetesttclvar_Init(Tcl_Interp*);
  3675   3687       extern int SqlitetestThread_Init(Tcl_Interp*);
  3676   3688       extern int SqlitetestOnefile_Init();
  3677   3689       extern int SqlitetestOsinst_Init(Tcl_Interp*);
  3678   3690       extern int Sqlitetestbackup_Init(Tcl_Interp*);
  3679   3691       extern int Sqlitetestintarray_Init(Tcl_Interp*);
  3680   3692       extern int Sqlitetestvfs_Init(Tcl_Interp *);
  3681         -    extern int SqlitetestStat_Init(Tcl_Interp*);
  3682   3693       extern int Sqlitetestrtree_Init(Tcl_Interp*);
  3683   3694       extern int Sqlitequota_Init(Tcl_Interp*);
  3684   3695       extern int Sqlitemultiplex_Init(Tcl_Interp*);
  3685   3696       extern int SqliteSuperlock_Init(Tcl_Interp*);
  3686   3697       extern int SqlitetestSyscall_Init(Tcl_Interp*);
  3687   3698       extern int Sqlitetestfuzzer_Init(Tcl_Interp*);
  3688   3699       extern int Sqlitetestwholenumber_Init(Tcl_Interp*);
................................................................................
  3718   3729       Sqlitetesttclvar_Init(interp);
  3719   3730       SqlitetestThread_Init(interp);
  3720   3731       SqlitetestOnefile_Init(interp);
  3721   3732       SqlitetestOsinst_Init(interp);
  3722   3733       Sqlitetestbackup_Init(interp);
  3723   3734       Sqlitetestintarray_Init(interp);
  3724   3735       Sqlitetestvfs_Init(interp);
  3725         -    SqlitetestStat_Init(interp);
  3726   3736       Sqlitetestrtree_Init(interp);
  3727   3737       Sqlitequota_Init(interp);
  3728   3738       Sqlitemultiplex_Init(interp);
  3729   3739       SqliteSuperlock_Init(interp);
  3730   3740       SqlitetestSyscall_Init(interp);
  3731   3741       Sqlitetestfuzzer_Init(interp);
  3732   3742       Sqlitetestwholenumber_Init(interp);
................................................................................
  3754   3764     Tcl_Interp *interp;
  3755   3765     
  3756   3766     /* Call sqlite3_shutdown() once before doing anything else. This is to
  3757   3767     ** test that sqlite3_shutdown() can be safely called by a process before
  3758   3768     ** sqlite3_initialize() is. */
  3759   3769     sqlite3_shutdown();
  3760   3770   
         3771  +  Tcl_FindExecutable(argv[0]);
         3772  +  interp = Tcl_CreateInterp();
         3773  +
  3761   3774   #if TCLSH==2
  3762   3775     sqlite3_config(SQLITE_CONFIG_SINGLETHREAD);
  3763   3776   #endif
  3764         -  Tcl_FindExecutable(argv[0]);
  3765   3777   
  3766         -  interp = Tcl_CreateInterp();
  3767   3778     init_all(interp);
  3768   3779     if( argc>=2 ){
  3769   3780       int i;
  3770   3781       char zArgc[32];
  3771   3782       sqlite3_snprintf(sizeof(zArgc), zArgc, "%d", argc-(3-TCLSH));
  3772   3783       Tcl_SetVar(interp,"argc", zArgc, TCL_GLOBAL_ONLY);
  3773   3784       Tcl_SetVar(interp,"argv0",argv[1],TCL_GLOBAL_ONLY);
................................................................................
  3780   3791         const char *zInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
  3781   3792         if( zInfo==0 ) zInfo = Tcl_GetStringResult(interp);
  3782   3793         fprintf(stderr,"%s: %s\n", *argv, zInfo);
  3783   3794         return 1;
  3784   3795       }
  3785   3796     }
  3786   3797     if( TCLSH==2 || argc<=1 ){
  3787         -    Tcl_GlobalEval(interp, zMainloop);
         3798  +    Tcl_GlobalEval(interp, tclsh_main_loop());
  3788   3799     }
  3789   3800     return 0;
  3790   3801   }
  3791   3802   #endif /* TCLSH */

Changes to src/test_config.c.

   557    557   
   558    558   #ifdef YYTRACKMAXSTACKDEPTH
   559    559     Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "1", TCL_GLOBAL_ONLY);
   560    560   #else
   561    561     Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "0", TCL_GLOBAL_ONLY);
   562    562   #endif
   563    563   
   564         -#ifdef SQLITE_PAGECACHE_BLOCKALLOC
   565         -  Tcl_SetVar2(interp, "sqlite_options", "blockalloc", "1", TCL_GLOBAL_ONLY);
   566         -#else
   567         -  Tcl_SetVar2(interp, "sqlite_options", "blockalloc", "0", TCL_GLOBAL_ONLY);
   568         -#endif
   569         -
   570    564   #define LINKVAR(x) { \
   571    565       static const int cv_ ## x = SQLITE_ ## x; \
   572    566       Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \
   573    567                   TCL_LINK_INT | TCL_LINK_READ_ONLY); }
   574    568   
   575    569     LINKVAR( MAX_LENGTH );
   576    570     LINKVAR( MAX_COLUMN );

Changes to src/test_malloc.c.

  1321   1321     } aOp[] = {
  1322   1322       { "LOOKASIDE_USED",      SQLITE_DBSTATUS_LOOKASIDE_USED      },
  1323   1323       { "CACHE_USED",          SQLITE_DBSTATUS_CACHE_USED          },
  1324   1324       { "SCHEMA_USED",         SQLITE_DBSTATUS_SCHEMA_USED         },
  1325   1325       { "STMT_USED",           SQLITE_DBSTATUS_STMT_USED           },
  1326   1326       { "LOOKASIDE_HIT",       SQLITE_DBSTATUS_LOOKASIDE_HIT       },
  1327   1327       { "LOOKASIDE_MISS_SIZE", SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE },
  1328         -    { "LOOKASIDE_MISS_FULL", SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL }
         1328  +    { "LOOKASIDE_MISS_FULL", SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL },
         1329  +    { "CACHE_HIT",           SQLITE_DBSTATUS_CACHE_HIT           },
         1330  +    { "CACHE_MISS",          SQLITE_DBSTATUS_CACHE_MISS          }
  1329   1331     };
  1330   1332     Tcl_Obj *pResult;
  1331   1333     if( objc!=4 ){
  1332         -    Tcl_WrongNumArgs(interp, 1, objv, "PARAMETER RESETFLAG");
         1334  +    Tcl_WrongNumArgs(interp, 1, objv, "DB PARAMETER RESETFLAG");
  1333   1335       return TCL_ERROR;
  1334   1336     }
  1335   1337     if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
  1336   1338     zOpName = Tcl_GetString(objv[2]);
  1337   1339     if( memcmp(zOpName, "SQLITE_", 7)==0 ) zOpName += 7;
  1338   1340     if( memcmp(zOpName, "DBSTATUS_", 9)==0 ) zOpName += 9;
  1339   1341     for(i=0; i<ArraySize(aOp); i++){

Changes to src/test_stat.c.

    14     14   **
    15     15   ** The dbstat virtual table is used to extract low-level formatting
    16     16   ** information from an SQLite database in order to implement the
    17     17   ** "sqlite3_analyzer" utility.  See the ../tool/spaceanal.tcl script
    18     18   ** for an example implementation.
    19     19   */
    20     20   
    21         -#include "sqliteInt.h"
           21  +#ifndef SQLITE_AMALGAMATION
           22  +# include "sqliteInt.h"
           23  +#endif
    22     24   
    23     25   #ifndef SQLITE_OMIT_VIRTUALTABLE
    24     26   
    25     27   /*
    26     28   ** Page paths:
    27     29   ** 
    28     30   **   The value of the 'path' column describes the path taken from the 
................................................................................
   564    566     };
   565    567     sqlite3_create_module(db, "dbstat", &dbstat_module, 0);
   566    568     return SQLITE_OK;
   567    569   }
   568    570   
   569    571   #endif
   570    572   
   571         -#ifdef SQLITE_TEST
          573  +#if defined(SQLITE_TEST) || TCLSH==2
   572    574   #include <tcl.h>
   573    575   
   574    576   static int test_dbstat(
   575    577     void *clientData,
   576    578     Tcl_Interp *interp,
   577    579     int objc,
   578    580     Tcl_Obj *CONST objv[]
................................................................................
   600    602   #endif
   601    603   }
   602    604   
   603    605   int SqlitetestStat_Init(Tcl_Interp *interp){
   604    606     Tcl_CreateObjCommand(interp, "register_dbstat_vtab", test_dbstat, 0, 0);
   605    607     return TCL_OK;
   606    608   }
   607         -#endif
          609  +#endif /* if defined(SQLITE_TEST) || TCLSH==2 */
          610  +

Changes to test/corruptE.test.

    12     12   #
    13     13   # This file implements tests to make sure SQLite does not crash or
    14     14   # segfault if it sees a corrupt database file.  It specifcally
    15     15   # focuses on rowid order corruption.
    16     16   #
    17     17   # $Id: corruptE.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $
    18     18   
    19         -catch {forcedelete test.db test.db-journal test.bu}
    20         -
    21     19   set testdir [file dirname $argv0]
    22     20   source $testdir/tester.tcl
    23     21   
    24     22   # Do not use a codec for tests in this file, as the database file is
    25     23   # manipulated directly using tcl scripts (using the [hexio_write] command).
    26     24   #
    27     25   do_not_use_codec

Changes to test/ctime.test.

   218    218   # test 1 before array bounds (N=-1)
   219    219   do_test ctime-2.5.$tc {
   220    220     set N -1
   221    221     set ans [ catchsql {
   222    222       SELECT sqlite_compileoption_get($N);
   223    223     } ]
   224    224   } {0 {{}}}
   225         -
   226         -ifcapable blockalloc {
   227         -  do_test ctime-3.1a {
   228         -    db eval {SELECT sqlite_compileoption_used('PAGECACHE_BLOCKALLOC')}
   229         -  } {1}
   230         -} else {
   231         -  do_test ctime-3.1b {
   232         -    db eval {SELECT sqlite_compileoption_used('PAGECACHE_BLOCKALLOC')}
   233         -  } {0}
   234         -}
   235         -
   236    225   
   237    226   
   238    227   finish_test

Added test/dbstatus2.test.

            1  +# 2011 September 20
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +#
           12  +# Tests for the sqlite3_stmt_status() function
           13  +#
           14  +
           15  +set testdir [file dirname $argv0]
           16  +source $testdir/tester.tcl
           17  +
           18  +set ::testprefix dbstatus2
           19  +
           20  +do_execsql_test 1.0 {
           21  +  PRAGMA page_size = 1024;
           22  +  PRAGMA auto_vacuum = 0;
           23  +
           24  +  CREATE TABLE t1(a PRIMARY KEY, b);
           25  +  INSERT INTO t1 VALUES(1, randomblob(600));
           26  +  INSERT INTO t1 VALUES(2, randomblob(600));
           27  +  INSERT INTO t1 VALUES(3, randomblob(600));
           28  +}
           29  +
           30  +proc db_hit_miss {db {reset 0}} {
           31  +  set nHit  [sqlite3_db_status $db CACHE_HIT $reset]
           32  +  set nMiss [sqlite3_db_status $db CACHE_MISS $reset]
           33  +  list $nHit $nMiss
           34  +}
           35  +
           36  +do_test 1.1 {
           37  +  db close
           38  +  sqlite3 db test.db
           39  +  expr {[file size test.db] / 1024}
           40  +} 6
           41  +
           42  +do_test 1.2 {
           43  +  execsql { SELECT b FROM t1 WHERE a=2 }
           44  +  db_hit_miss db
           45  +} {{0 2 0} {0 4 0}}
           46  +
           47  +do_test 1.3 { 
           48  +  execsql { SELECT b FROM t1 WHERE a=2 }
           49  +  db_hit_miss db
           50  +} {{0 6 0} {0 4 0}}
           51  +
           52  +do_test 1.4 { 
           53  +  execsql { SELECT b FROM t1 WHERE a=2 }
           54  +  db_hit_miss db
           55  +} {{0 10 0} {0 4 0}}
           56  +
           57  +do_test 1.5 { 
           58  +  db_hit_miss db 1
           59  +} {{0 10 0} {0 4 0}}
           60  +
           61  +do_test 1.6 { 
           62  +  db_hit_miss db 0
           63  +} {{0 0 0} {0 0 0}}
           64  +
           65  +do_test 1.7 {
           66  +  set fd [db incrblob main t1 b 1]
           67  +  fconfigure $fd -translation binary
           68  +  set len [string length [read $fd]]
           69  +  close $fd
           70  +  set len
           71  +} 600
           72  +do_test 1.8 { sqlite3_db_status db CACHE_HIT  0 } {0 2 0}
           73  +do_test 1.9 { sqlite3_db_status db CACHE_MISS 0 } {0 1 0}
           74  +
           75  + 
           76  +finish_test

Changes to test/memdb.test.

   403    403       DELETE FROM t1;
   404    404       SELECT count(*) FROM t1;
   405    405     }
   406    406   } 0
   407    407   
   408    408   # Test that auto-vacuum works with in-memory databases.
   409    409   # 
   410         -ifcapable autovacuum&&!blockalloc {
          410  +ifcapable autovacuum {
   411    411     do_test memdb-9.1 {
   412    412       db close
   413    413       sqlite3 db test.db
   414    414       db cache size 0
   415    415       execsql {
   416    416         PRAGMA auto_vacuum = full;
   417    417         CREATE TABLE t1(a);

Changes to test/memsubsys1.test.

    21     21   # will not work with the "memsubsys1" permutation.
    22     22   #
    23     23   if {[permutation] == "memsubsys1"} {
    24     24     finish_test
    25     25     return
    26     26   }
    27     27   
    28         -# Nor will it work if the pager is allocating memory in blocks.
    29         -#
    30         -ifcapable blockalloc {
    31         -  finish_test
    32         -  return
    33         -}
    34         -
    35     28   # This procedure constructs a new database in test.db.  It fills
    36     29   # this database with many small records (enough to force multiple
    37     30   # rebalance operations in the btree-layer and to require a large
    38     31   # page cache), verifies correct results, then returns.
    39     32   #
    40     33   proc build_test_db {testname pragmas} {
    41     34     catch {db close}

Changes to test/pcache2.test.

    12     12   # This file is focused on testing the pcache module.
    13     13   #
    14     14   # $Id: pcache2.test,v 1.5 2009/07/18 14:36:24 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19         -# If compiled with blockalloc, pagecache memory is not used. Which
    20         -# causes these tests to fail.
    21         -#
    22         -ifcapable blockalloc {
    23         -  finish_test
    24         -  return
    25         -}
    26         -
    27     19   # Set up a pcache memory pool so that we can easily track how many
    28     20   # pages are being used for cache.
    29     21   #
    30     22   do_test pcache2-1.1 {
    31     23     db close
    32     24     sqlite3_reset_auto_extension
    33     25     sqlite3_shutdown

Changes to tool/spaceanal.tcl.

    31     31   
    32     32   # Open the database
    33     33   #
    34     34   sqlite3 db $file_to_analyze
    35     35   register_dbstat_vtab db
    36     36   
    37     37   set pageSize [db one {PRAGMA page_size}]
    38         -
    39         -#set DB [btree_open $file_to_analyze 1000 0]
           38  +db eval {SELECT count(*) FROM sqlite_master}
    40     39   
    41     40   # In-memory database for collecting statistics. This script loops through
    42     41   # the tables and indices in the database being analyzed, adding a row for each
    43     42   # to an in-memory database (for which the schema is shown below). It then
    44     43   # queries the in-memory db to produce the space-analysis report.
    45     44   #
    46     45   sqlite3 mem :memory:
................................................................................
    62     61      ovfl_unused int,  -- Number of unused bytes on overflow pages
    63     62      gap_cnt int       -- Number of gaps in the page layout
    64     63   );}
    65     64   mem eval $tabledef
    66     65   
    67     66   # Create a temporary "dbstat" virtual table.
    68     67   #
    69         -db eval { 
    70         -  CREATE VIRTUAL TABLE temp.stat USING dbstat;
    71         -  CREATE TEMP TABLE dbstat AS SELECT * FROM temp.stat ORDER BY name, path;
    72         -  DROP TABLE temp.stat;
    73         -}
           68  +db eval {CREATE VIRTUAL TABLE temp.stat USING dbstat}
           69  +db eval {CREATE TEMP TABLE dbstat AS SELECT * FROM temp.stat
           70  +         ORDER BY name, path}
           71  +db eval {DROP TABLE temp.stat}
    74     72   
    75     73   proc isleaf {pagetype is_index} {
    76     74     return [expr {$pagetype == "leaf" || ($pagetype == "internal" && $is_index)}]
    77     75   }
    78     76   proc isoverflow {pagetype is_index} {
    79     77     return [expr {$pagetype == "overflow"}]
    80     78   }