Bug 29518 - [Gtk] Use the SQLite3 headers from WebKitLibraries if sqlite3 is undetected
Summary: [Gtk] Use the SQLite3 headers from WebKitLibraries if sqlite3 is undetected
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2009-09-19 00:38 PDT by Jan Alonzo
Modified: 2009-10-12 04:57 PDT (History)
3 users (show)

See Also:


Attachments
Patch v1 (1.40 KB, patch)
2009-09-19 00:39 PDT, Jan Alonzo
gns: review+
gns: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Alonzo 2009-09-19 00:38:10 PDT
If the system has no pkg-config for SQLite, use the SQLite3 headers from WebKitLibraries as a fallback. Patch forthcoming.
Comment 1 Jan Alonzo 2009-09-19 00:39:46 PDT
Created attachment 39816 [details]
Patch v1
Comment 2 Xan Lopez 2009-09-21 22:32:24 PDT
Comment on attachment 39816 [details]
Patch v1

>+   PKG_CHECK_MODULES([SQLITE3],
>+                     [sqlite3 >= $SQLITE_REQUIRED_VERSION],
>+                     [sqlite3_has_pkg_config=yes],
>+                     [sqlite3_has_pkg_config=no])
>+   if test "$sqlite3_has_pkg_config" = "no"; then
>+      AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
>+                     [SQLITE3_LIBS="$LIBS";SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"],
>+                     [AC_MSG_ERROR([SQLite3 is required to enable Database support])])
>+   fi

Silly question, shouldn't you first try to use the headers that might come with the library you just found with AC_SEARCH_LIBS?
Or are you assuming that if there's no sqlite pkg-config file the only library you'll find is the one in WebKitLibraries?

>    AC_SUBST([SQLITE3_CFLAGS])
>    AC_SUBST([SQLITE3_LIBS])
> fi
Comment 3 Eric Seidel (no email) 2009-09-23 17:28:17 PDT
Looks fine to me, although I'm not sure you really want to be depending on those headers.  Xan seems to have an objection though, so waiting for you to respond to that before marking r+.  Or rather, Xan can mark it r+ if he agrees.
Comment 4 Holger Freyther 2009-10-05 20:50:16 PDT
Did we ever get a report that someone wanted to use sqlite3 but didn't have pkg-config files?
Comment 5 Jan Alonzo 2009-10-06 02:23:45 PDT
(In reply to comment #2)
> (From update of attachment 39816 [details])
> >+   PKG_CHECK_MODULES([SQLITE3],
> >+                     [sqlite3 >= $SQLITE_REQUIRED_VERSION],
> >+                     [sqlite3_has_pkg_config=yes],
> >+                     [sqlite3_has_pkg_config=no])
> >+   if test "$sqlite3_has_pkg_config" = "no"; then
> >+      AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
> >+                     [SQLITE3_LIBS="$LIBS";SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"],
> >+                     [AC_MSG_ERROR([SQLite3 is required to enable Database support])])
> >+   fi
> 
> Silly question, shouldn't you first try to use the headers that might come with
> the library you just found with AC_SEARCH_LIBS?
> Or are you assuming that if there's no sqlite pkg-config file the only library
> you'll find is the one in WebKitLibraries?

Yes. If there's no .pc file or there's no pkg-config binary, I'll just use what's in WebKitLibraries.

(In reply to comment #4)
> Did we ever get a report that someone wanted to use sqlite3 but didn't have
> pkg-config files?

Consider this a report.
Comment 6 Jan Alonzo 2009-10-12 04:57:10 PDT
Landed as http://trac.webkit.org/changeset/49435.