2 # This script is used to build the amalgamation autoconf package.
3 # It assumes the following:
5 # 1. The files "sqlite3.c", "sqlite3.h" and "sqlite3ext.h"
6 # are available in the current directory.
8 # 2. Variable $TOP is set to the full path of the root directory
9 # of the SQLite source tree.
11 # 3. There is nothing of value in the ./mkpkg_tmp_dir directory.
12 # This is important, as the script executes "rm -rf ./mkpkg_tmp_dir".
16 # Bail out of the script if any command returns a non-zero exit
17 # status. Or if the script tries to use an unset variable. These
18 # may fail for old /bin/sh interpreters.
23 TMPSPACE
=.
/mkpkg_tmp_dir
24 VERSION
=`cat $TOP/VERSION`
26 # Set global variable $ARTIFACT to the "3xxyyzz" string incorporated
27 # into artifact filenames. And $VERSION2 to the "3.x.y[.z]" form.
28 xx
=`echo $VERSION|sed 's/3\.\([0-9]*\)\..*/\1/'`
29 yy
=`echo $VERSION|sed 's/3\.[^.]*\.\([0-9]*\).*/\1/'`
32 zz
=`echo $VERSION|sed 's/3\.[^.]*\.[^.]*\.\([0-9]*\).*/\1/'|grep -v '\.'`
34 ARTIFACT
=`printf "3%.2d%.2d%.2d" $xx $yy $zz`
37 cp -R $TOP/autoconf
$TMPSPACE
39 cp sqlite3.c
$TMPSPACE
40 cp sqlite3.h
$TMPSPACE
41 cp sqlite3ext.h
$TMPSPACE
42 cp $TOP/sqlite3.1
$TMPSPACE
43 cp $TOP/sqlite3.pc.
in $TMPSPACE
44 cp $TOP/src
/shell.c
$TMPSPACE
46 chmod 755 $TMPSPACE/install-sh
47 chmod 755 $TMPSPACE/missing
48 chmod 755 $TMPSPACE/depcomp
49 chmod 755 $TMPSPACE/config.sub
50 chmod 755 $TMPSPACE/config.guess
52 cat $TMPSPACE/configure.ac |
53 sed "s/AC_INIT(sqlite, .*, http:\/\/www.sqlite.org)/AC_INIT(sqlite, $VERSION, http:\/\/www.sqlite.org)/" > $TMPSPACE/tmp
54 mv $TMPSPACE/tmp
$TMPSPACE/configure.ac
62 echo "#ifdef USE_SYSTEM_SQLITE" > tea
/generic
/tclsqlite3.c
63 echo "# include <sqlite3.h>" >> tea
/generic
/tclsqlite3.c
64 echo "#else" >> tea
/generic
/tclsqlite3.c
65 echo "#include \"../../sqlite3.c\"" >> tea
/generic
/tclsqlite3.c
66 echo "#endif" >> tea
/generic
/tclsqlite3.c
67 cat $TOP/src
/tclsqlite.c
>> tea
/generic
/tclsqlite3.c
69 cat tea
/configure.
in |
70 sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" > tmp
71 mv tmp tea
/configure.
in
78 .
/configure
&& make dist
79 tar -xzf sqlite-
$VERSION.
tar.gz
80 mv sqlite-
$VERSION sqlite-autoconf-
$ARTIFACT
81 tar -czf sqlite-autoconf-
$ARTIFACT.
tar.gz sqlite-autoconf-
$ARTIFACT
82 mv sqlite-autoconf-
$ARTIFACT.
tar.gz ..