Bug 36073

Summary: [Qt] SQLite support no longer optional, required even in minimal Qt build
Product: WebKit Reporter: Robert Hogan <robert>
Component: Tools / TestsAssignee: QtWebKit Unassigned <webkit-qt-unassigned>
Status: RESOLVED FIXED    
Severity: Blocker CC: abecsi, hausmann, ismail, jturcotte, laszlo.gombos, noam, ossy
Priority: P1 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: Other   
OS: All   

Description Robert Hogan 2010-03-12 14:31:46 PST
WebCore.pri only enables SQLite if it is available or none of ENABLE_DATABASE=0 ENABLE_WORKERS=0 ENABLE_SHARED_WORKERS=0 ENABLE_ICONDATABASE=0 is true.

However recent changes to GeoLocationPositionCache.cpp make support mandatory even for minimal builds, so either the build needs to abandon optionalizing it or need to look at omitting WebCore/Geo*.cpp from the build. Currently the build doesn't support the ENABLE_GEOLOCATION option and as far as I can see that flag is kind of moot anyway, it's only used in a couple of places by Mac and Chromium. So geolocation looks hard to drop in a minimal build.

## Define default features macros for optional components
## (look for defs in config.h and included files!)
# Try to locate sqlite3 source
CONFIG(QTDIR_build) {
    SQLITE3SRCDIR = $$QT_SOURCE_TREE/src/3rdparty/sqlite/
} else {
    SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
    isEmpty(SQLITE3SRCDIR) {
        SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
    }
}

# turn off SQLITE support if we do not have sqlite3 available
!CONFIG(QTDIR_build):win32-*:!exists( $${SQLITE3SRCDIR}/sqlite3.c ): DEFINES += ENABLE_SQLITE=0 ENABLE_DATABASE=0 ENABLE_WORKERS=0 ENABLE_SHARED_WORKERS=0 ENABLE_ICONDATABASE=0 ENABLE_OFFLINE_WEB_APPLICATIONS=0 ENABLE_DOM_STORAGE=0

# turn on SQLITE support if any of the dependent features are turned on
!contains(DEFINES, ENABLE_SQLITE=.) {
  contains(DEFINES, ENABLE_DATABASE=1)|contains(DEFINES, ENABLE_ICONDATABASE=1)|contains(DEFINES, ENABLE_DOM_STORAGE=1)|contains(DEFINES, ENABLE_OFFLINE_WEB_APPLICATIONS=1) {
    DEFINES += ENABLE_SQLITE=1
  } else {
    DEFINES += ENABLE_SQLITE=0
  }
}
Comment 1 Jocelyn Turcotte 2010-03-15 03:10:54 PDT
On Windows, to have SQLite supporte enabled in QtWebKit you must either:
- Build QtWebKit within the Qt source tree (i.e. the sources must be in src/3rdparty/webkit and built through configure/make)
- Have the SQLITE3SRCDIR environment variable set to the source directory of sqlite (which can be the one in Qt/src/3rdparty/sqlite)

On most qtwebkit windows trunk dev setup, none of these conditions are met, so requiring SQLite would make the standard build steps a bit more complicated on Windows.
Comment 2 Simon Hausmann 2010-03-15 05:27:35 PDT
(In reply to comment #1)
> On Windows, to have SQLite supporte enabled in QtWebKit you must either:
> - Build QtWebKit within the Qt source tree (i.e. the sources must be in
> src/3rdparty/webkit and built through configure/make)
> - Have the SQLITE3SRCDIR environment variable set to the source directory of
> sqlite (which can be the one in Qt/src/3rdparty/sqlite)
> 
> On most qtwebkit windows trunk dev setup, none of these conditions are met, so
> requiring SQLite would make the standard build steps a bit more complicated on
> Windows.

The third option that currently applies when I build windows package is that QTDIR happens to be set, and so sqlite3.c from QTDIR/src/3rdparty/sqlite gets compiled in.

Perhaps shipping a copy of sqlite3.c is what we have to do with the packages, to fall back to when there is no system library :-(
Comment 3 Csaba Osztrogon√°c 2010-03-24 10:28:30 PDT
I think it should block QtWebKit-2.0 release, because it is a build brake.
Comment 4 Laszlo Gombos 2010-03-26 07:38:57 PDT
I think a better fix is to make the GEOLOCATION guard proper - see https://bugs.webkit.org/show_bug.cgi?id=25756.
Comment 5 Simon Hausmann 2010-03-28 14:02:07 PDT
(In reply to comment #4)
> I think a better fix is to make the GEOLOCATION guard proper - see
> https://bugs.webkit.org/show_bug.cgi?id=25756.

That sounds right. Robert, what do you think?
Comment 6 Robert Hogan 2010-03-29 11:14:04 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > I think a better fix is to make the GEOLOCATION guard proper - see
> > https://bugs.webkit.org/show_bug.cgi?id=25756.
> 
> That sounds right. Robert, what do you think?

Looks like Laszlo has done all the hard work and this bug can be closed once his patch is landed.
Comment 7 Laszlo Gombos 2010-03-30 06:57:15 PDT
56781 builds and run without sqlite, when compiled with the --minimal option - as fix for bug 25756 has been landed. CLOSING this bug, please REOPEN it if you think this needs more work.