Bug 263381 - "support --with-system-sqlite3 in storage builds" [p=mh+mozilla@glandium.org (Mike Hommey) r=bsmedberg a1.9=beltzner]

This commit is contained in:
reed@reedloden.com 2008-02-22 03:25:59 -08:00
parent ddc1676b1b
commit 13c04d87e7
8 changed files with 48 additions and 11 deletions

View File

@ -427,6 +427,10 @@ else
LCMS_REQUIRES = lcms
endif
MOZ_NATIVE_SQLITE = @MOZ_NATIVE_SQLITE@
SQLITE_CFLAGS = @SQLITE_CFLAGS@
SQLITE_LIBS = @SQLITE_LIBS@
NSPR_CONFIG = @NSPR_CONFIG@
NSPR_CFLAGS = @NSPR_CFLAGS@
NSPR_LIBS = @NSPR_LIBS@

View File

@ -93,7 +93,7 @@ STATIC_EXTRA_LIBS += $(MOZ_PANGO_LIBS)
endif
ifdef MOZ_STORAGE
EXTRA_DSO_LIBS += sqlite3
EXTRA_DSO_LDOPTS += $(SQLITE_LIBS)
endif
ifdef MOZ_ENABLE_STARTUP_NOTIFICATION

View File

@ -128,6 +128,7 @@ LIBGNOME_VERSION=2.0
STARTUP_NOTIFICATION_VERSION=0.8
DBUS_VERSION=0.60
LCMS_VERSION=1.17
SQLITE_VERSION=3.5
MSMANIFEST_TOOL=
@ -5730,7 +5731,6 @@ fi
dnl ========================================================
dnl = Enable mozStorage
dnl = XXX need to implement --with-system-sqlite3 (see bug 263381)
dnl ========================================================
dnl Implicitly enabled by default if building calendar or places
MOZ_ARG_ENABLE_BOOL(storage,
@ -5741,6 +5741,30 @@ if test -n "$MOZ_STORAGE"; then
AC_DEFINE(MOZ_STORAGE)
fi
dnl ========================================================
dnl Check for sqlite
dnl ========================================================
MOZ_NATIVE_SQLITE=
MOZ_ARG_ENABLE_BOOL(system-sqlite,
[ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
MOZ_NATIVE_SQLITE=1,
MOZ_NATIVE_SQLITE= )
if test -z "$MOZ_NATIVE_SQLITE"
then
SQLITE_CFLAGS=
if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
SQLITE_LIBS='$(DIST)/lib/$(LIB_PREFIX)sqlite3.$(LIB_SUFFIX)'
else
SQLITE_LIBS='-lsqlite3'
fi
else
PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
fi
AC_SUBST(MOZ_NATIVE_SQLITE)
dnl ========================================================
dnl = Enable safe browsing (anti-phishing)
dnl ========================================================

View File

@ -12,4 +12,7 @@ To move to a new version:
Simply copy the sqlite3.h and sqlite3.c files from the amalgamation of sqlite.
If mozstorage or nss code need changes due to API changes in sqlite3, be sure
to update SQLITE_VERSION accordingly in $(topsrcdir)/configure.in.
-- Shawn Wilsher <me@shawnwilsher.com> 01/2008

View File

@ -44,11 +44,15 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = storage
DIRS = ../db/sqlite3/src \
public \
src \
build \
$(NULL)
ifndef MOZ_NATIVE_SQLITE
DIRS = ../db/sqlite3/src
endif
DIRS += public \
src \
build \
$(NULL)
ifdef ENABLE_TESTS
TOOL_DIRS += test

View File

@ -65,17 +65,16 @@ EXPORTS = mozStorageCID.h
CPPSRCS = mozStorageModule.cpp
LOCAL_INCLUDES = \
$(SQLITE_CFLAGS) \
-I$(srcdir)/../src
SHARED_LIBRARY_LIBS = \
../src/$(LIB_PREFIX)storage_s.$(LIB_SUFFIX) \
$(NULL)
EXTRA_DSO_LIBS += sqlite3
EXTRA_DSO_LDOPTS += \
$(LIBS_DIR) \
$(EXTRA_DSO_LIBS) \
$(SQLITE_LIBS) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_JS_LIBS) \

View File

@ -66,6 +66,9 @@ CPPSRCS = \
mozStorageUnicodeFunctions.cpp \
$(NULL)
LOCAL_INCLUDES = \
$(SQLITE_CFLAGS)
# This is the default value. If we ever change it when compiling sqlite, we
# will need to change it here as well.
DEFINES += -DSQLITE_MAX_LIKE_PATTERN_LENGTH=50000

View File

@ -231,7 +231,7 @@ endif
ifdef MOZ_STORAGE
COMPONENT_LIBS += storagecomps
EXTRA_DSO_LIBS += sqlite3
EXTRA_DSO_LDOPTS += $(SQLITE_LIBS)
endif
ifdef MOZ_PLACES