You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/11/12 08:11:45 UTC

svn commit: r835273 [1/5] - in /commons/sandbox/runtime/trunk/src/main/native: ./ modules/sqlite/ shared/ srclib/sqlite/

Author: mturk
Date: Thu Nov 12 07:11:44 2009
New Revision: 835273

URL: http://svn.apache.org/viewvc?rev=835273&view=rev
Log:
Use sqlite as a module

Added:
    commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/
    commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/config.h   (with props)
    commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/sqlite3.c   (with props)
    commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/sqlite3.h   (with props)
    commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/sqlite3ext.h   (with props)
    commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/sqliteapi.c   (with props)
Removed:
    commons/sandbox/runtime/trunk/src/main/native/srclib/sqlite/
Modified:
    commons/sandbox/runtime/trunk/src/main/native/Makefile.in
    commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
    commons/sandbox/runtime/trunk/src/main/native/configure
    commons/sandbox/runtime/trunk/src/main/native/shared/modules.c

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.in?rev=835273&r1=835272&r2=835273&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.in Thu Nov 12 07:11:44 2009
@@ -51,6 +51,7 @@
 SHFLAGS=@shflags@
 INCLUDES=@includes@
 SSLFLAGS=@sslflags@
+SQLFLAGS=@sqlflags@
 VERSION_MAJOR=@vmajor@
 VERSION_MINOR=@vminor@
 VERSION_PATCH=@vpatch@
@@ -60,6 +61,7 @@
 STATICLIB=lib$(NAME)$(LIB)
 SHAREDLIB=lib$(NAME)$(SO)
 SSLMODLIB=lib$(NAME)ssl$(SO)
+SQLMODLIB=lib$(NAME)sql$(SO)
 TESTSUITE=testsuite$(EXE)
 
 SRCDIR=$(TOPDIR)
@@ -314,8 +316,11 @@
 OPENSSL_OBJS=\
 	$(SRCDIR)/modules/network/ssl/openssl.$(OBJ)
 
+SQLITE_SRCS= \
+	$(SRCDIR)/modules/sqlite/sqlite3.$(OBJ)
+
 SQLITE_OBJS= \
-	$(SRCDIR)/srclib/sqlite/sqlite3.$(OBJ)
+	$(SRCDIR)/modules/sqlite/sqliteapi.$(OBJ)
 
 TEST_OBJS= \
 	$(SRCDIR)/test/testcase.$(OBJ)
@@ -347,7 +352,7 @@
 $(SRCDIR)/srclib/zlib/%.$(OBJ) : $(SRCDIR)/srclib/zlib/%.c
 	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o $@ $<
 
-$(SRCDIR)/srclib/sqlite/%.$(OBJ) : $(SRCDIR)/srclib/sqlite/%.c
+$(SRCDIR)/modules/sqlite/%.$(OBJ) : $(SRCDIR)/modules/sqlite/%.c
 	$(CC) $(CFLAGS) $(CSFLAGS) -D_HAVE_SQLITE_CONFIG_H $(CPPFLAGS) $(INCLUDES) -c -o $@ $<
 
 $(SRCDIR)/modules/network/ssl/%.$(OBJ) : $(SRCDIR)/modules/network/ssl/%.c
@@ -359,16 +364,19 @@
 .cpp.$(OBJ):
 	$(CXX) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
 
-$(STATICLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @sqliteobjs@ @testobjs@
-	$(AR) $(ARFLAGS) $@ $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @sqliteobjs@ @testobjs@
+$(STATICLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @testobjs@
+	$(AR) $(ARFLAGS) $@ $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @testobjs@
 	$(RANLIB) $@
 
-$(SHAREDLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @sqliteobjs@ @testobjs@ $(STATICLIB)
-	$(CC) $(SHFLAGS) $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @sqliteobjs@ @testobjs@ $(LDFLAGS) -o $@
+$(SHAREDLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @testobjs@ $(STATICLIB)
+	$(CC) $(SHFLAGS) $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @testobjs@ $(LDFLAGS) -o $@
 
 $(SSLMODLIB): $(SHAREDLIB) $(OPENSSL_OBJS)
 	$(CC) $(EXLFLAGS) $(SHFLAGS) $(OPENSSL_OBJS) $(LDFLAGS) $(SSLFLAGS) -L. -l$(NAME) -o $@
 
+$(SQLMODLIB): $(SHAREDLIB) $(SQLITE_OBJS) @sqliteobjs@
+	$(CC) $(EXLFLAGS) $(SHFLAGS) $(SQLITE_OBJS) @sqliteobjs@ $(LDFLAGS) $(SQLFLAGS) -L. -l$(NAME) -o $@
+
 $(TESTSUITE): $(STATICLIB) $(SHAREDLIB) @modules@ $(SRCDIR)/test/testsuite.$(OBJ)
 	$(CC) $(EXLFLAGS) $(SRCDIR)/test/testsuite.$(OBJ) $(LDFLAGS) -L. -l$(NAME) -o $@
 

Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=835273&r1=835272&r2=835273&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Thu Nov 12 07:11:44 2009
@@ -47,6 +47,7 @@
 SHFLAGS=@shflags@
 INCLUDES=@includes@
 SSLFLAGS=@sslflags@
+SQLFLAGS=@sqlflags@
 VERSION_MAJOR=@vmajor@
 VERSION_MINOR=@vminor@
 VERSION_PATCH=@vpatch@
@@ -57,6 +58,7 @@
 DESTDIR=$(PREFIX)
 LIBNAME=lib$(NAME)
 SSLNAME=lib$(NAME)ssl
+SQLNAME=lib$(NAME)sql
 
 SRCDIR=$(TOPDIR)
 INCDIR=$(TOPDIR)/include
@@ -64,6 +66,7 @@
 
 SHAREDLIB=$(LIBNAME)$(SO)
 SSLMODLIB=$(SSLNAME)$(SO)
+SQLMODLIB=$(SQLNAME)$(SO)
 EXPORTS=/EXPORT:SubprocMainW
 TESTSUITE=testsuite$(EXE)
 
@@ -201,8 +204,11 @@
 OPENSSL_OBJS=\
 	$(SRCDIR)/modules/network/ssl/openssl.$(OBJ)
 
+SQLITE_SRCS= \
+	$(SRCDIR)/modules/sqlite/sqlite3.$(OBJ)
+
 SQLITE_OBJS= \
-	$(SRCDIR)/srclib/sqlite/sqlite3.$(OBJ)
+	$(SRCDIR)/modules/sqlite/sqliteapi.$(OBJ)
 
 TEST_OBJS= \
 	$(SRCDIR)/test/testcase.$(OBJ)
@@ -224,9 +230,6 @@
 {$(SRCDIR)\srclib\regex}.c{$(SRCDIR)\srclib\regex}.$(OBJ):
 	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
-{$(SRCDIR)\srclib\sqlite}.c{$(SRCDIR)\srclib\sqlite}.$(OBJ):
-	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -D_HAVE_SQLITE_CONFIG_H -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
-
 {$(SRCDIR)\srclib\zlib}.c{$(SRCDIR)\srclib\zlib}.$(OBJ):
 	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
 
@@ -239,10 +242,14 @@
 {$(SRCDIR)\modules\network\ssl}.c{$(SRCDIR)\modules\network\ssl}.$(OBJ):
 	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) $(INCLUDES) -c -Fo$@ -Fd$(SSLNAME)-src $<
 
-$(SHAREDLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @sqliteobjs@ @testobjs@
+{$(SRCDIR)\modules\sqlite}.c{$(SRCDIR)\srclib\modules}.$(OBJ):
+	$(CC) $(CFLAGS) $(CSFLAGS) $(CPPFLAGS) -D_HAVE_SQLITE_CONFIG_H $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $<
+
+
+$(SHAREDLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platform@_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @testobjs@
 	$(RC) /l 0x409 /d "NDEBUG" /i "$(SRCDIR)\include" /fo $@.res $(SRCDIR)/os/win32/main.rc
 	$(LINK) $(SHFLAGS) $(LDFLAGS) /DLL /SUBSYSTEM:WINDOWS $(EXPORTS) /pdb:$(LIBNAME).pdb /out:$@ @<<
-	$(PPORT_OBJS) $(COMMON_OBJS) $(WINDOWS_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @sqliteobjs@ @testobjs@ $@.res
+	$(PPORT_OBJS) $(COMMON_OBJS) $(WINDOWS_OBJS) $(REGEX_OBJS) $(BZIP2_OBJS) $(ZLIB_OBJS) @testobjs@ $@.res
 <<
 	IF EXIST $@.manifest \
 		mt -nologo -manifest $@.manifest -outputresource:$@;2
@@ -255,6 +262,15 @@
 	IF EXIST $(SSLMODLIB).manifest \
 		mt -nologo -manifest $@.manifest -outputresource:$@;2
 
+$(SQLMODLIB): $(SHAREDLIB) $(SQLITE_OBJS) @sqliteobjs@
+	$(RC) /l 0x409 /d "NDEBUG" /d STR_PRODUCT="Apache Commons Runtime SQL Module" /d STR_INTNAME="$(SQLNAME)" /i "$(SRCDIR)\include" /fo $@.res $(SRCDIR)/os/win32/main.rc
+	$(LINK) $(SHFLAGS) /DLL /SUBSYSTEM:WINDOWS $(LDFLAGS) $(SQLFLAGS) /libpath:"." $(LIBNAME).lib /pdb:$(SQLNAME).pdb /out:$@ @<<
+	$(SQLITE_OBJS) @sqliteobjs@ $@.res
+<<
+	IF EXIST $(SQLMODLIB).manifest \
+		mt -nologo -manifest $@.manifest -outputresource:$@;2
+
+
 $(TESTSUITE):  $(SHAREDLIB) @modules@ $(SRCDIR)/test/testsuite.$(OBJ)
 	$(LINK) $(SHFLAGS) /SUBSYSTEM:CONSOLE $(LDFLAGS) /libpath:"." $(LIBNAME).lib /pdb:testsuite.pdb /out:$@ @<<
 	$(SRCDIR)/test/testsuite.$(OBJ)

Modified: commons/sandbox/runtime/trunk/src/main/native/configure
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=835273&r1=835272&r2=835273&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/configure (original)
+++ commons/sandbox/runtime/trunk/src/main/native/configure Thu Nov 12 07:11:44 2009
@@ -1066,20 +1066,21 @@
 
 if [ ".$has_sqlite" = .yes ]; then
     if [ ".$has_embedded_sqlite" = .yes ]; then
-        sqliteobjs='$(SQLITE_OBJS)'
+        sqliteobjs='$(SQLITE_SRCS)'
         varadds includes "-I$topdir/srclib/sqlite"
         have_sqlite3=1
     else
         have_sqlite3=`have_include 0 sqlite3`
         if [ .$have_sqlite3 = .1 ] ; then
             if [ ".$host" = .windows ]; then
-                test ".$sqlite_lib" != . && varadds ldflags "/libpath:\"$sqlite_lib\""
-                varadds ldflags libsqlite3.lib
+                test ".$sqlite_lib" != . && varadds sqlflags "/libpath:\"$sqlite_lib\""
+                varadds sqlflags sqlite3.lib
             else
-                varadds ldflags -lsqlite3
+                varadds sqlflags -lsqlite3
             fi
         fi
     fi
+    varadds modules '??(SQLMODLIB)'
 else
     sqliteobjs=""
 fi
@@ -1129,7 +1130,7 @@
 #define HAVE_OCSP             $have_ocsp
 #define HAVE_SELINUX_H        $have_selinux
 #define HAVE_PORT_H           $have_port
-#define HAVE_SQLITE3_H        $have_sqlite3
+#define HAVE_SQLITE3          $have_sqlite3
 
 #define HAVE_UNISTD_H         `have_include 0 unistd`
 #define HAVE_STRING_H         `have_include 1 string`
@@ -1262,6 +1263,7 @@
     -e 's|@shflags@|'"$shflags"'|g' \
     -e 's|@arflags@|'"$arflags"'|g' \
     -e 's|@sslflags@|'"$sslflags"'|g' \
+    -e 's|@sqlflags@|'"$sqlflags"'|g' \
     -e 's|@rcflags@|'"$rcflags"'|g' \
     -e 's|@includes@|'"$includes"'|g' \
     -e 's|@name@|'"$name"'|g' \

Added: commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/config.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/config.h?rev=835273&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/config.h (added)
+++ commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/config.h Thu Nov 12 07:11:44 2009
@@ -0,0 +1,78 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CONFIG_H
+#define _CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Include our main config file
+ */
+#include "acr_config.h"
+
+/* Sqlite expects undefs
+ */
+#ifndef STDC_HEADERS
+#define STDC_HEADERS 1
+#endif
+#if !HAVE_UNISTD_H
+#undef HAVE_UNISTD_H
+#endif
+#if !HAVE_STRINGS_H
+#undef HAVE_STRINGS_H
+#endif
+#if !HAVE_STRING_H
+#undef HAVE_STRING_H
+#endif
+#if !HAVE_STDINT_H
+#undef HAVE_STDINT_H
+#endif
+#if !HAVE_DLFCN_H
+#undef HAVE_DLFCN_H
+#endif
+#if !HAVE_LOCALTIME_R
+#undef HAVE_LOCALTIME_R
+#endif
+#if !HAVE_GMTIME_R
+#undef HAVE_GMTIME_R
+#endif
+#if !HAVE_FDATASYNC
+#undef HAVE_FDATASYNC
+#endif
+#if !HAVE_USLEEP
+#undef HAVE_USLEEP
+#endif
+#if !HAVE_INTTYPES_H
+#undef HAVE_INTTYPES_H
+#if defined(_WIN32)
+typedef char                int8_t;
+typedef short               int16_t;
+typedef int                 int32_t;
+typedef __int64             int64_t;
+typedef unsigned char       uint8_t;
+typedef unsigned short      uint16_t;
+typedef unsigned int        uint32_t;
+typedef unsigned __int64    uint64_t;
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _CONFIG_H */

Propchange: commons/sandbox/runtime/trunk/src/main/native/modules/sqlite/config.h
------------------------------------------------------------------------------
    svn:eol-style = native