summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Koenig <jck@techsat.com>2017-06-02 12:49:00 (GMT)
committerJoerg Koenig <jck@techsat.com>2017-06-02 12:49:00 (GMT)
commitbb0b11bc7735347741bd179e714bfec33f3f14a9 (patch)
tree7d870bf1e479fe219851652bb9b94dbe17381ebe
parente210c28157220f6f8b01744f757352fb44091694 (diff)
downloadSQLite-bb0b11bc7735347741bd179e714bfec33f3f14a9.zip
SQLite-bb0b11bc7735347741bd179e714bfec33f3f14a9.tar.gz
SQLite-bb0b11bc7735347741bd179e714bfec33f3f14a9.tar.bz2
Initial added SQlite 3.19.2HEADmasterrefs/changes/32/1732/1
Change-Id: I44b5cc9442c9b985669e3b2e66f6d9841ba81b2e
-rwxr-xr-xMakefile120
-rw-r--r--SOURCES/Makefile5
-rw-r--r--SOURCES/sqlite-3.19.2.tar.gzbin0 -> 2542613 bytes
-rw-r--r--SOURCES/test.c19
4 files changed, 144 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..b0eecdf
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,120 @@
+
+TOP = $(shell readlink -f .)
+ARCH = x86-linux64
+
+LOCAL_BUILD_PATH = $(TOP)/build.$(ARCH)
+LOCAL_INST_PATH = $(TOP)/install.$(ARCH)
+
+VERSION=3.19.2
+PACKAGE_NAME = sqlite3-$(VERSION)
+
+CROSS_PATH = /opt/gcc-suite/1.0.0/x86-linux64/mingw64
+CROSS_PREFIX = x86_64-w64-mingw32
+
+CC = "gcc -m64 -static-libgcc"
+CXX = "g++ -m64 -static-libgcc -static-libstdc++"
+
+all: sqlite test pack
+
+ifneq (,$(findstring x86-mingw,$(ARCH)))
+
+sqlite:
+ rm -Rf $(LOCAL_BUILD_PATH)
+ rm -Rf $(LOCAL_INST_PATH)
+ mkdir -p $(LOCAL_BUILD_PATH)
+ mkdir -p $(LOCAL_INST_PATH)
+ cd $(LOCAL_BUILD_PATH) && \
+ tar -zxf $(PWD)/SOURCES/sqlite-$(VERSION).tar.gz
+ cd $(LOCAL_BUILD_PATH)/sqlite-* && \
+ export PATH=$(CROSS_PATH)/bin:$$PATH && \
+ CFLAGS="-m64 -DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_VARIABLE_NUMBER=32768 -fpic" \
+ LDFLAGS="-static-libgcc" \
+ ./configure \
+ --host=$(CROSS_PREFIX) \
+ --target=$(CROSS_PREFIX) \
+ --disable-static \
+ --enable-shared \
+ --disable-readline \
+ --prefix=$(LOCAL_INST_PATH)/sqlite-$(VERSION) && \
+ $(MAKE) && $(MAKE) clean all install && \
+ CFLAGS="-m64 -DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_VARIABLE_NUMBER=32768 -fpic" \
+ LDFLAGS="-static-libgcc" \
+ ./configure \
+ --host=$(CROSS_PREFIX) \
+ --target=$(CROSS_PREFIX) \
+ --enable-static \
+ --disable-shared \
+ --disable-readline \
+ --prefix=$(LOCAL_INST_PATH)/sqlite-$(VERSION) && \
+ $(MAKE) && $(MAKE) clean all install
+ rm -Rf $(LOCAL_INST_PATH)/sqlite-$(VERSION)/lib/pkgconfig
+ cp -f $(LOCAL_INST_PATH)/sqlite-$(VERSION)/bin/*.dll $(LOCAL_INST_PATH)/sqlite-$(VERSION)/lib
+
+pack:
+ cd $(LOCAL_INST_PATH) && \
+ zip -qr $(TOP)/$(PACKAGE_NAME)-$(ARCH).zip .
+
+test:
+ @echo "Nothing to test"
+else
+
+sqlite:
+ rm -Rf $(LOCAL_BUILD_PATH)
+ rm -Rf $(LOCAL_INST_PATH)
+ mkdir -p $(LOCAL_BUILD_PATH)
+ mkdir -p $(LOCAL_INST_PATH)
+ cd $(LOCAL_BUILD_PATH) && \
+ tar -zxf $(PWD)/SOURCES/sqlite-$(VERSION).tar.gz
+ cd $(LOCAL_BUILD_PATH)/sqlite-* && \
+ export PATH=$(GCC_PATH)/bin:$$PATH && \
+ export LD_LIBRARY_PATH=$(GCC_PATH)/lib && \
+ CC=$(CC) CXX=$(CXX) \
+ CFLAGS="-DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_VARIABLE_NUMBER=32768 -fpic" \
+ ./configure \
+ --enable-shared \
+ --disable-static \
+ --disable-readline \
+ --prefix=$(LOCAL_INST_PATH)/sqlite-$(VERSION) && \
+ $(MAKE) && $(MAKE) clean all install
+ cd $(LOCAL_BUILD_PATH)/sqlite-* && \
+ export PATH=$(GCC_PATH)/bin:$$PATH && \
+ export LD_LIBRARY_PATH=$(GCC_PATH)/lib && \
+ CC=$(CC) CXX=$(CXX) \
+ CFLAGS="-DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_VARIABLE_NUMBER=32768 -fpic" \
+ ./configure \
+ --disable-shared \
+ --enable-static \
+ --disable-readline \
+ --prefix=$(LOCAL_INST_PATH)/sqlite-$(VERSION) && \
+ $(MAKE) && $(MAKE) clean all install
+
+$(PWD)/test.$(ARCH).exe:
+ @gcc -I$(PWD)/install.$(ARCH)/sqlite-$(VERSION)/include \
+ -o $(PWD)/test.$(ARCH).exe \
+ $(PWD)/SOURCES/test.c \
+ $(PWD)/install.$(ARCH)/sqlite-$(VERSION)/lib/libsqlite3.a \
+ -lpthread -ldl
+
+test: $(PWD)/test.$(ARCH).exe
+ @echo "TESTING MAX_COLUMN ..."
+ @rm -f $(PWD)/test.$(ARCH).exe
+ @if [ "$(shell $(PWD)/test.$(ARCH).exe)" = "32767" ]; then \
+ echo "SQLITE successfully increased MAX_COLUMN to 32767" ; \
+ else \
+ echo "MAX_COLUMN Patch failed" ; \
+ exit 1; \
+ fi
+ @rm -f $(PWD)/test.$(ARCH).exe
+
+
+pack:
+ cd $(LOCAL_INST_PATH) && \
+ tar -zcf $(TOP)/$(PACKAGE_NAME)-$(ARCH).tgz .
+
+endif
+
+clean:
+ rm -Rf $(LOCAL_BUILD_PATH)
+ rm -Rf $(LOCAL_INST_PATH)
+ rm -f $(TOP)/$(PACKAGE_NAME)*.tgz
+ rm -f $(TOP)/$(PACKAGE_NAME)*.zip
diff --git a/SOURCES/Makefile b/SOURCES/Makefile
new file mode 100644
index 0000000..8cc82c6
--- /dev/null
+++ b/SOURCES/Makefile
@@ -0,0 +1,5 @@
+CWD = $(shell readlink -f .)
+
+$(PWD)/sqlite-3.19.2.tar.gz:
+ wget -c "https://www.sqlite.org/2017/sqlite-autoconf-3190200.tar.gz" -O \
+ $(PWD)/sqlite-3.19.2.tar.gz
diff --git a/SOURCES/sqlite-3.19.2.tar.gz b/SOURCES/sqlite-3.19.2.tar.gz
new file mode 100644
index 0000000..a3ab573
--- /dev/null
+++ b/SOURCES/sqlite-3.19.2.tar.gz
Binary files differ
diff --git a/SOURCES/test.c b/SOURCES/test.c
new file mode 100644
index 0000000..ab7597e
--- /dev/null
+++ b/SOURCES/test.c
@@ -0,0 +1,19 @@
+#include<stdio.h>
+#include<sqlite3.h>
+
+int
+main(int argc, char **argv)
+{
+ int rc;
+ sqlite3 *db;
+
+ rc = sqlite3_open(argv[1], &db);
+ if( rc ){
+ printf("ERROR\n");
+ sqlite3_close(db);
+ return(1);
+ }
+ printf("%d\n", sqlite3_limit(db, SQLITE_LIMIT_COLUMN, -1));
+ sqlite3_close(db);
+ return 0;
+}