From d94d4421b2e8265317aa9627c50831d856257bae Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 25 Apr 2013 00:38:35 +0700 Subject: [PATCH] mxe windows builds done --- .gitignore | 5 ++- .npmignore | 110 +++++++++++++++++++++++++++++++++++++++++------- README.md | 1 - tcejdb/Makefile.in | 38 +++++++++-------- tcejdb/README | 58 +++++++++++-------------- tcejdb/configure.ac | 7 ++- tcejdb/mxe/mxe-build.sh | 3 +- tcejdb/tcutil.c | 13 +++--- 8 files changed, 158 insertions(+), 77 deletions(-) diff --git a/.gitignore b/.gitignore index fb70fb6..54757fd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.upload *.rock *.so +*.so.* *.a *.dll *.exe @@ -12,9 +13,9 @@ *.def *.exp *.lib +*.zip .dep.inc - addressbook* autom4te.cache/ config.log @@ -23,6 +24,8 @@ config.status /npm-debug.log /.idea/workspace.xml +/tcejdb/i686-w64* +/tcejdb/x86_64-w64* /tcejdb/tools/win32 /tcejdb/Makefile /tcejdb/libtcejdb.a diff --git a/.npmignore b/.npmignore index c1b22d2..2e8d596 100644 --- a/.npmignore +++ b/.npmignore @@ -1,22 +1,33 @@ *.o *.vlog -*.iml +*.dylib *.upload +*.rock +*.so +*.so.* +*.a +*.dll +*.exe +*.sdf +*.suo +*.def +*.exp +*.lib +*.zip +.dep.inc -nbproject/ +addressbook* +autom4te.cache/ +config.log +config.status -/misc -/node/nodejs -/.idea -/tcejdb/static +/npm-debug.log +/.idea/workspace.xml -/tcejdb/tools -/tcejdb/doc -/tcejdb/deb +/tcejdb/i686-w64* +/tcejdb/x86_64-w64* +/tcejdb/tools/win32 /tcejdb/Makefile -/tcejdb/autom4te.cache -/tcejdb/config.log -/tcejdb/config.status /tcejdb/libtcejdb.a /tcejdb/libtcejdb.so /tcejdb/libtcejdb.so.9 @@ -41,30 +52,97 @@ nbproject/ /tcejdb/tcumttest /tcejdb/tcutest /tcejdb/tcejdb.pc + +/tcejdb/nbproject/private +/tcejdb/static /tcejdb/check.in /tcejdb/check.out /tcejdb/casket* /tcejdb/samples/sample1/sample1 /tcejdb/samples/sample1/addressbook* +/tcejdb/samples/sample1_win32/Debug +/tcejdb/samples/sample1_win32/Release +/tcejdb/samples/sample1_win32/sample1_win32/Debug +/tcejdb/samples/sample1_win32/sample1_win32/Release +/tcejdb/samples/sample1_win32/ipch +/tcejdb/samples/sample1_mingw/nbproject/private +/tcejdb/testejdb/Makefile /tcejdb/testejdb/dbt* /tcejdb/testejdb/t1 /tcejdb/testejdb/t2 /tcejdb/testejdb/t3 +/tcejdb/testejdb/t4 + +*/nbproject/private/* /build /var +/node/samples/sample1/zoo* + + +libtcejdb9*.deb +libtcejdb_*.dsc +libtcejdb_*.tar.gz +libtcejdb_*.build +libtcejdb_*.changes + + +tcejdb/debian/files +tcejdb/debian/*.log +tcejdb/debian/*.substvars +tcejdb/debian/libtcejdb9*/ +tcejdb/debian/tmp/* +tcejdb/debian/*.debhelper + +/pyejdb/build/ +/pyejdb/test/__pycache__ +/pyejdb/testdb* +/pyejdb/dist/ +/pyejdb/pyejdb.egg-info/ + + +/pyejdb/debian/files +/pyejdb/debian/python3-ejdb.debhelper.log +/pyejdb/debian/python3-ejdb.postinst.debhelper +/pyejdb/debian/python3-ejdb.prerm.debhelper +/pyejdb/debian/python3-ejdb.substvars +/pyejdb/debian/python3-ejdb/ +/pyejdb/debian/tmp/ +/python-ejdb_*.build +/python-ejdb_*.dsc +/python-ejdb_*.gz +/python-ejdb_*.build +/python-ejdb_*.changes +/python3-ejdb_*.deb + +/luaejdb/debian/files +/luaejdb/test/testdb* +/luaejdb/debian/lua51-ejdb* +/luaejdb/debian/*.log +/lua-ejdb_*.build +/lua-ejdb_*.dsc +/lua-ejdb_*.gz +/lua-ejdb_*.build +/lua-ejdb_*.changes +/lua51-ejdb_*.deb + + +/jejdb/build +/jejdb/target +/jejdb/*.so +/jejdb/*.so.* +/jejdb/Makefile + +/build +/var /*.deb /*.dsc /*.tar.gz /*.build /*.changes - /tcejdb/debian/ - /pyejdb /luaejdb /jejdb - - diff --git a/README.md b/README.md index e388c65..328fd4a 100644 --- a/README.md +++ b/README.md @@ -944,7 +944,6 @@ Limitations TODO ------------------------------------ * Collect collection index statistic -* Windows port Related software ------------------------------------ diff --git a/tcejdb/Makefile.in b/tcejdb/Makefile.in index 2a98a83..39f7e7a 100644 --- a/tcejdb/Makefile.in +++ b/tcejdb/Makefile.in @@ -9,16 +9,27 @@ # Generic settings SHELL = @SHELL@ +HOST_NAME = @host@ +HOST_CPU = @host_cpu@ +HOST_OS = @host_os@ # Package information PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ PACKAGEDIR = $(PACKAGE)-$(VERSION) -PACKAGETGZ = $(PACKAGE)-$(VERSION).tar.gz +PACKAGEBASE = $(PACKAGE)-$(VERSION)-$(HOST_OS)-$(HOST_CPU) +PACKAGETGZ = $(PACKAGEBASE).tar.gz + LIBVER = @MYLIBVER@ LIBREV = @MYLIBREV@ FORMATVER = @MYFORMATVER@ +ifeq ($(HOST_CPU),x86_64) +MACHINE = X64 +else +MACHINE = X86 +endif + # Targets HEADERFILES = @MYHEADERFILES@ LIBRARYFILES = @MYLIBRARYFILES@ @@ -101,21 +112,16 @@ version : [ -f tcutil.h~ ] && mv -f tcutil.h~ tcutil.h -untabify : - ls *.c *.h *.idl | while read name ; \ - do \ - sed -e 's/\t/ /g' -e 's/ *$$//' $$name > $$name~; \ - [ -f $$name~ ] && mv -f $$name~ $$name ; \ - done - - install : $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE) \ $(DESTDIR)$(LIBDIR) \ $(DESTDIR)$(DATADIR) \ $(DESTDIR)$(PCDIR) \ $(DESTDIR)$(MAN3DIR) - $(INSTALL) -m 644 $(HEADERFILES) $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE) + + $(foreach HF,$(HEADERFILES), \ + $(INSTALL) -m 644 -D $(HF) $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/$(HF); \ + ) $(INSTALL) -m 755 $(LIBRARYFILES) $(DESTDIR)$(LIBDIR) $(INSTALL) -m 644 $(DOCUMENTFILES) $(DESTDIR)$(DATADIR) $(INSTALL) -m 644 $(PCFILES) $(DESTDIR)$(PCDIR) @@ -132,14 +138,11 @@ install : @printf '# Thanks for using Tokyo Cabinet EJDB edition.\n' @printf '#================================================================\n' - -install-strip : - make DESTDIR=$(DESTDIR) install - cd $(DESTDIR)$(BINDIR) && strip $(COMMANDFILES) - +win-archive : install + cd $(HOST_NAME) && zip -r ../$(PACKAGEBASE).zip ./* uninstall : - - cd $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE) && rm -f $(HEADERFILES) + - cd $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE) && rm -rf $(HEADERFILES) - cd $(DESTDIR)$(LIBDIR) && rm -f $(LIBRARYFILES) ## cd $(DESTDIR)$(BINDIR) && rm -f $(COMMANDFILES) ## cd $(DESTDIR)$(LIBEXECDIR) && rm -f $(CGIFILES) @@ -152,7 +155,6 @@ uninstall : dist : make version - make untabify make distclean cd .. && tar cvf - $(PACKAGEDIR) | gzip -c > $(PACKAGETGZ) sync ; sync @@ -733,7 +735,7 @@ tcejdbdll.dll libtcejdbdll.a tcejdbdll.def : $(LIBOBJFILES) $(LIBOBJFILES) $(LDFLAGS) $(LIBS) tcejdbdll.lib tcejdbdll.exp : tcejdbdll.dll libtcejdbdll.a tcejdbdll.def - wine tools/win32/lib.exe /def:tcejdbdll.def + wine tools/win32/lib.exe /def:tcejdbdll.def /machine:$(MACHINE) tcutest : tcutest.o $(LIBRARYFILES) diff --git a/tcejdb/README b/tcejdb/README index dc7a143..91dd812 100644 --- a/tcejdb/README +++ b/tcejdb/README @@ -4,12 +4,20 @@ Embedded JSON Database engine ==================================== -It aims to be a fast [MongoDB](http://mongodb.org)-like library **which can be embedded into C/C++ and [NodeJS](http://nodejs.org/) applications under terms of LGPL license.** +It aims to be a fast [MongoDB](http://mongodb.org)-like library **which can be embedded into C/C++/NodeJS/Python/Lua/Java applications under terms of LGPL license.** EJDB is the C library based on modified version of [Tokyo Cabinet](http://fallabs.com/tokyocabinet/). JSON representation of queries and data implemented with API based on [C BSON](https://github.com/mongodb/mongo-c-driver/tree/master/src/) +News +=============================== +* `2013-04-03` **[Java API binding available](https://github.com/Softmotions/ejdb/blob/master/jejdb/)** +* `2013-03-20` **[Lua binding available](https://github.com/Softmotions/ejdb/blob/master/luaejdb/)** +* `2013-02-15` **[EJDB Python3 binding available](https://github.com/Softmotions/ejdb/blob/master/pyejdb/)** +* `2013-02-07` **[Debian packages provided](https://github.com/Softmotions/ejdb/wiki/Debian-Ubuntu-installation)** +* `2013-01-22` **[Collection joins now supported](https://github.com/Softmotions/ejdb/wiki/Collection-joins)** + Features ================================ * LGPL license allows you to embed this library into proprietary software. @@ -18,24 +26,10 @@ Features * Collection level transactions. * String token matching queries: ```$stror``` ```$strand``` * [Node.js](http://nodejs.org) binding - - -Documentation -================================ - -* **[EJDB Command line interface](https://github.com/Softmotions/ejdb/wiki/EJDB-Command-line-interface)** -* **[NodeJS binding](#nodejs-binding)** - * [Installation](#installation) - * [Samples](#ejdb-nodejs-samples) - * [NodeJS API](#ejdb-nodejs-api) -* **[EJDB C Library](#ejdb-c-library)** - * [Building & Installation](#building--installation) - * [Samples](#ejdb-c-samples) - * [C API](#c-api) - -Community -================================ -We use [EJDB Google group](http://groups.google.com/group/ejdb) as our mailing list. +* [Collection joins](https://github.com/Softmotions/ejdb/wiki/Collection-joins) +* Python binding +* Lua binding +* Java binding EJDB C Library ================================== @@ -83,7 +77,7 @@ int main() { EJQ *q1 = ejdbcreatequery(jb, &bq1, NULL, 0, NULL); uint32_t count; - TCLIST *res = ejdbqrysearch(coll, q1, &count, 0, NULL); + TCLIST *res = ejdbqryexecute(coll, q1, &count, 0, NULL); fprintf(stderr, "\n\nRecords found: %d\n", count); //Now print the result set records @@ -112,27 +106,24 @@ You can save this code in `csnippet.c` And build: ```sh gcc -std=c99 -Wall -pedantic -c -o csnippet.o csnippet.c -gcc -std=c99 -Wall -pedantic -o csnippet csnippet.o -ltcejdb +gcc -o csnippet csnippet.o -ltcejdb ``` Building & Installation -------------------------------- -Prerequisites --------------------------------- -**System libraries:** +[Installing on Debian/Ubuntu](https://github.com/Softmotions/ejdb/wiki/Debian-Ubuntu-installation) -* gcc -* zlib +Manual installation +------------------------------- -On Debian/Ubuntu linux you can install it as follows: +### Prerequisites +**System libraries:** -```sh - sudo apt-get install gcc zlib1g zlib1g-dev -``` +* gcc +* zlib-dev -Building --------------------------------- +### Build and install ~~~~~~ cd ./tcejdb @@ -281,8 +272,9 @@ Limitations TODO ------------------------------------ * Collect collection index statistic -* Windows port Related software ------------------------------------ [Connect session store backed by EJDB database](https://github.com/Softmotions/connect-session-ejdb) + + diff --git a/tcejdb/configure.ac b/tcejdb/configure.ac index 050a051..c958867 100644 --- a/tcejdb/configure.ac +++ b/tcejdb/configure.ac @@ -10,7 +10,7 @@ test -n "$CPPFLAGS" && MYCPPFLAGS="$CPPFLAGS $MYCPPFLAGS" test -n "$LDFLAGS" && MYLDFLAGS="$LDFLAGS $MYLDFLAGS" # Package name -AC_INIT(tcejdb, 1.0.68) +AC_INIT(tcejdb, 1.1.0) AC_CANONICAL_HOST # Package information @@ -83,6 +83,8 @@ then MYCPPFLAGS="$MYCPPFLAGS -D_DEBUG -UNDEBUG -DEJDB_STATIC" MYCMDLDFLAGS="$MYCMDLDFLAGS -static" enables="$enables (debug)" +else + MYLDFLAGS="$MYLDFLAGS -s" fi # Developping mode @@ -382,6 +384,9 @@ esac #================================================================ # Export variables +AC_SUBST(host) +AC_SUBST(host_cpu) +AC_SUBST(host_os) AC_SUBST(MYLIBVER) AC_SUBST(MYLIBREV) AC_SUBST(MYFORMATVER) diff --git a/tcejdb/mxe/mxe-build.sh b/tcejdb/mxe/mxe-build.sh index 4ab26ea..ab71d6a 100755 --- a/tcejdb/mxe/mxe-build.sh +++ b/tcejdb/mxe/mxe-build.sh @@ -42,7 +42,8 @@ export WINEDEBUG=fixme-all set -x autoconf ./configure --host="${HOST}" --prefix=${PREFIX} ${CONFLAGS} -make clean +#make clean make +make win-archive diff --git a/tcejdb/tcutil.c b/tcejdb/tcutil.c index 7fbdcb0..7d6dfe7 100644 --- a/tcejdb/tcutil.c +++ b/tcejdb/tcutil.c @@ -5332,13 +5332,14 @@ void tccalendar(int64_t t, int jl, int *yearp, int *monp, int *dayp, if (hourp) *hourp = 0; if (minp) *minp = 0; if (secp) *secp = 0; + } else { + if (yearp) *yearp = ts.tm_year + 1900; + if (monp) *monp = ts.tm_mon + 1; + if (dayp) *dayp = ts.tm_mday; + if (hourp) *hourp = ts.tm_hour; + if (minp) *minp = ts.tm_min; + if (secp) *secp = ts.tm_sec; } - if (yearp) *yearp = ts.tm_year + 1900; - if (monp) *monp = ts.tm_mon + 1; - if (dayp) *dayp = ts.tm_mday; - if (hourp) *hourp = ts.tm_hour; - if (minp) *minp = ts.tm_min; - if (secp) *secp = ts.tm_sec; } /* Format a date as a string in W3CDTF. */ -- 2.7.4