| OLD | NEW |
| (Empty) |
| 1 #!/bin/sh | |
| 2 # This script is used to build the amalgamation autoconf package. | |
| 3 # It assumes the following: | |
| 4 # | |
| 5 # 1. The files "sqlite3.c", "sqlite3.h" and "sqlite3ext.h" | |
| 6 # are available in the current directory. | |
| 7 # | |
| 8 # 2. Variable $TOP is set to the full path of the root directory | |
| 9 # of the SQLite source tree. | |
| 10 # | |
| 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". | |
| 13 # | |
| 14 | |
| 15 | |
| 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. | |
| 19 # | |
| 20 set -e | |
| 21 set -u | |
| 22 | |
| 23 TMPSPACE=./mkpkg_tmp_dir | |
| 24 VERSION=`cat $TOP/VERSION` | |
| 25 | |
| 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/'` | |
| 30 zz=0 | |
| 31 set +e | |
| 32 zz=`echo $VERSION|sed 's/3\.[^.]*\.[^.]*\.\([0-9]*\).*/\1/'|grep -v '\.'` | |
| 33 set -e | |
| 34 ARTIFACT=`printf "3%.2d%.2d%.2d" $xx $yy $zz` | |
| 35 | |
| 36 rm -rf $TMPSPACE | |
| 37 cp -R $TOP/autoconf $TMPSPACE | |
| 38 | |
| 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 | |
| 45 | |
| 46 cat $TMPSPACE/configure.ac | | |
| 47 sed "s/--SQLITE-VERSION--/$VERSION/" > $TMPSPACE/tmp | |
| 48 mv $TMPSPACE/tmp $TMPSPACE/configure.ac | |
| 49 | |
| 50 cd $TMPSPACE | |
| 51 autoreconf -i | |
| 52 #libtoolize | |
| 53 #aclocal | |
| 54 #autoconf | |
| 55 #automake --add-missing | |
| 56 | |
| 57 mkdir -p tea/generic | |
| 58 echo "#ifdef USE_SYSTEM_SQLITE" > tea/generic/tclsqlite3.c | |
| 59 echo "# include <sqlite3.h>" >> tea/generic/tclsqlite3.c | |
| 60 echo "#else" >> tea/generic/tclsqlite3.c | |
| 61 echo "#include \"sqlite3.c\"" >> tea/generic/tclsqlite3.c | |
| 62 echo "#endif" >> tea/generic/tclsqlite3.c | |
| 63 cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c | |
| 64 | |
| 65 cat tea/configure.ac | | |
| 66 sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" > tmp | |
| 67 mv tmp tea/configure.ac | |
| 68 | |
| 69 cd tea | |
| 70 autoconf | |
| 71 rm -rf autom4te.cache | |
| 72 | |
| 73 cd ../ | |
| 74 ./configure && make dist | |
| 75 tar -xzf sqlite-$VERSION.tar.gz | |
| 76 mv sqlite-$VERSION sqlite-autoconf-$ARTIFACT | |
| 77 tar -czf sqlite-autoconf-$ARTIFACT.tar.gz sqlite-autoconf-$ARTIFACT | |
| 78 mv sqlite-autoconf-$ARTIFACT.tar.gz .. | |
| OLD | NEW |