From 555c939dc7d12e806a88a00fe22cca52585e7d2f Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 27 May 2013 18:37:33 +0000 Subject: [PATCH] Add the "dist" target to main.mk. For building the amalgamation autoconf package. FossilOrigin-Name: 3fdc8b56493350fc4854fb1eaefe29ac87784f91 --- main.mk | 5 +++ manifest | 16 +++++----- manifest.uuid | 2 +- tool/mkautoconfamal.sh | 70 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 tool/mkautoconfamal.sh diff --git a/main.mk b/main.mk index 912ebb4045..ba73edd711 100644 --- a/main.mk +++ b/main.mk @@ -620,6 +620,11 @@ extensiontest: testfixture$(EXE) $(TEST_EXTENSION) checksymbols: sqlite3.o nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0 +# Build the amalgamation-autoconf package. +# +dist: sqlite3.c + TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh + # Standard install and cleanup targets # diff --git a/manifest b/manifest index 233b7d48c5..1107994056 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sthe\sfiles\sused\sto\sbuild\sthe\samalgamation-autoconf\spackage. -D 2013-05-27T17:19:58.423 +C Add\sthe\s"dist"\starget\sto\smain.mk.\sFor\sbuilding\sthe\samalgamation\sautoconf\spackage. +D 2013-05-27T18:37:33.110 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in f6b58b7bdf6535f0f0620c486dd59aa4662c0b4f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -137,7 +137,7 @@ F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt f2b23a6bde8f1c6e86b957e4d94eab0add520b0d -F main.mk a8ebdf910e2cc10db1f9f54ec316f637458e8001 +F main.mk 2a3cd58acfd1ecc656027afdd60ed1eefb07380f F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac @@ -1056,6 +1056,7 @@ F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/lemon.c 680980c7935bfa1edec20c804c9e5ba4b1dd96f5 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc +F tool/mkautoconfamal.sh 9ef9ad69bc3021a6fd2dac53a2e8cf5b97e0df05 F tool/mkkeywordhash.c bb52064aa614e1426445e4b2b9b00eeecd23cc79 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97 @@ -1089,10 +1090,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 3cd2da42e9403b1e6243ad53f3f2bbf89c0fb9b0 -R 36bfb90ebfbfa2dc4a4f5f2d201ce940 -T *branch * autoconf-package -T *sym-autoconf-package * -T -sym-trunk * +P 048865e8fdd2bef6b43b6cebd45fae94c8a1ab20 +R 5f01d70f556992e077a0b0dc7f686941 U dan -Z b353aa1f8164c124057d033967eb5644 +Z a0aa8f1a377f5d4aff1fe20419c0f786 diff --git a/manifest.uuid b/manifest.uuid index 80a8d1c459..1235935ef2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -048865e8fdd2bef6b43b6cebd45fae94c8a1ab20 \ No newline at end of file +3fdc8b56493350fc4854fb1eaefe29ac87784f91 \ No newline at end of file diff --git a/tool/mkautoconfamal.sh b/tool/mkautoconfamal.sh new file mode 100644 index 0000000000..ddc705848d --- /dev/null +++ b/tool/mkautoconfamal.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# This script is used to build the amalgamation autoconf package. +# It assumes the following: +# +# 1. The files "sqlite3.c", "sqlite3.h" and "sqlite3ext.h" +# are available in the current directory. +# +# 2. Variable $TOP is set to the full path of the root directory +# of the SQLite source tree. +# +# 3. There is nothing of value in the ./mkpkg_tmp_dir directory. +# This is important, as the script executes "rm -rf ./mkpkg_tmp_dir". +# + + +# Bail out of the script if any command returns a non-zero exit +# status. Or if the script tries to use an unset variable. These +# may fail for old /bin/sh interpreters. +# +set -e +set -u + +TMPSPACE=./mkpkg_tmp_dir +VERSION=`cat $TOP/VERSION` + +rm -rf $TMPSPACE +cp -R $TOP/autoconf $TMPSPACE + +cp sqlite3.c $TMPSPACE +cp sqlite3.h $TMPSPACE +cp sqlite3ext.h $TMPSPACE +cp $TOP/sqlite3.1 $TMPSPACE +cp $TOP/sqlite3.pc.in $TMPSPACE +cp $TOP/src/shell.c $TMPSPACE + +chmod 755 $TMPSPACE/install-sh +chmod 755 $TMPSPACE/missing +chmod 755 $TMPSPACE/depcomp +chmod 755 $TMPSPACE/config.sub +chmod 755 $TMPSPACE/config.guess + +cat $TMPSPACE/configure.ac | +sed "s/AC_INIT(sqlite, .*, http:\/\/www.sqlite.org)/AC_INIT(sqlite, $VERSION, http:\/\/www.sqlite.org)/" > $TMPSPACE/tmp +mv $TMPSPACE/tmp $TMPSPACE/configure.ac + +cd $TMPSPACE +aclocal +autoconf +automake + +mkdir -p tea/generic +echo "#ifdef USE_SYSTEM_SQLITE" > tea/generic/tclsqlite3.c +echo "# include " >> tea/generic/tclsqlite3.c +echo "#else" >> tea/generic/tclsqlite3.c +echo "#include \"../../sqlite3.c\"" >> tea/generic/tclsqlite3.c +echo "#endif" >> tea/generic/tclsqlite3.c +cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c + +cat tea/configure.in | + sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" > tmp +mv tmp tea/configure.in + +cd tea +autoconf +rm -rf autom4te.cache + +cd ../ +./configure && make dist +mv sqlite-$VERSION.tar.gz ../sqlite-amalgamation-$VERSION.tar.gz +