3 # Run this script from the top of the source tree in order to confirm that
4 # various aspects of the source tree are up-to-date. Items checked include:
6 # * Makefile.msc and autoconf/Makefile.msc agree
7 # * src/ctime.tcl is consistent with tool/mkctimec.tcl
8 # * VERSION agrees with autoconf/tea/configure.ac
9 # * src/pragma.h agrees with tool/mkpragmatab.tcl
11 # Other tests might be added later.
13 # Error messages are printed and the process exists non-zero if problems
14 # are found. If everything is ok, no output is generated and the process
18 # Read an entire file.
20 proc readfile
{filename} {
21 set fd
[open $filename rb
]
27 # Find the root of the tree.
29 set ROOT
[file dir
[file dir
[file normalize
$argv0]]]
31 # Name of the TCL interpreter
33 set TCLSH
[info nameofexe
]
35 # Number of errors seen.
39 ######################### configure ###########################################
41 set conf
[readfile
$ROOT/configure
]
42 set vers
[readfile
$ROOT/VERSION
]
43 if {[string first
$vers $conf]<=0} {
44 puts "ERROR: ./configure does not agree with ./VERSION"
45 puts "...... Fix: run autoconf"
50 ######################### autoconf/tea/configure.ac ###########################
52 set confac
[readfile
$ROOT/autoconf
/tea
/configure.ac
]
53 set vers
[readfile
$ROOT/VERSION
]
54 set pattern
{AC_INIT
([sqlite
],[}
55 append pattern
[string trim
$vers]
57 if {[string first
$pattern $confac]<=0} {
58 puts "ERROR: ./autoconf/tea/configure.ac does not agree with ./VERSION"
59 puts "...... Fix: manually edit ./autoconf/tea/configure.ac and put the"
60 puts "...... correct version number in AC_INIT()"
65 ######################### autoconf/Makefile.msc ###############################
67 set f1
[readfile
$ROOT/autoconf
/Makefile.msc
]
68 exec $TCLSH $ROOT/tool
/mkmsvcmin.tcl
$ROOT/Makefile.msc tmp1.txt
69 set f2
[readfile tmp1.txt
]
72 puts "ERROR: ./autoconf/Makefile.msc does not agree with ./Makefile.msc"
73 puts "...... Fix: tclsh tool/mkmsvcmin.tcl"
77 ######################### src/pragma.h ########################################
79 set f1
[readfile
$ROOT/src
/pragma.h
]
80 exec $TCLSH $ROOT/tool
/mkpragmatab.tcl tmp2.txt
81 set f2
[readfile tmp2.txt
]
84 puts "ERROR: ./src/pragma.h does not agree with ./tool/mkpragmatab.tcl"
85 puts "...... Fix: tclsh tool/mkpragmatab.tcl"
89 ######################### src/ctime.c ########################################
91 set f1
[readfile
$ROOT/src
/ctime.c
]
92 exec $TCLSH $ROOT/tool
/mkctimec.tcl tmp3.txt
93 set f2
[readfile tmp3.txt
]
96 puts "ERROR: ./src/ctime.c does not agree with ./tool/mkctimec.tcl"
97 puts "..... Fix: tclsh tool/mkctimec.tcl"
101 # If any errors are seen, exit 1 so that the build will fail.
103 if {$NERR>0} {exit 1}