Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23049 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95585 invoked by uid 1010); 30 Apr 2006 12:05:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95570 invoked from network); 30 Apr 2006 12:05:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2006 12:05:18 -0000 X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:1905] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A6/2A-18514-DF7A4544 for ; Sun, 30 Apr 2006 08:05:17 -0400 Received: from foxbox (unknown [84.228.8.209]) by gw2.emini.dk (Postfix) with ESMTP id 8A42EAF1DF; Sun, 30 Apr 2006 14:05:06 +0200 (CEST) Message-ID: <0ba601c66c4e$1f1b4e90$6602a8c0@foxbox> Reply-To: "Steph Fox" To: "Wez Furlong" Cc: "internals" Date: Sun, 30 Apr 2006 14:03:39 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0BA3_01C66C5E.E17D2AC0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: [PATCH] win32, PDO and the SQLite build From: steph@zend.com ("Steph Fox") ------=_NextPart_000_0BA3_01C66C5E.E17D2AC0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Hi Wez, The attached patch makes it possible to build either php_sqlite.dll without the PDO dependency, or php_pdo_sqlite2.dll with the PDO dependency. If ext/sqlite is built as static it 'just works' (forcing a shared build only if PDO is enabled as shared) but with the same distinctions, i.e. if there's PDO in there it has PDO support, otherwise it doesn't. I'm hoping it'll mean you can consider enabling built-in sqlite by default again, even if PDO isn't quite ready for that yet? I removed the check for php_pdo_driver.h because ext/pdo doesn't check for it itself, making the sqlite check fairly pointless as the whole build breaks further down the line if the configure line contains --enable-pdo when that file's missing. A small note, in case you didn't notice me banging my head against a brick wall on irc earlier - the config.w32 for ext/pdo_sqlite works exclusively with pecl/pdo_sqlite at present, whereas the config.w32 files for ext/pdo and ext/sqlite both use the version in the PHP extensions directory. Probably everyone else in the world is sensible enough to update their PECL sources at the same time as their PHP sources, but I'm not, and there's nothing to tell you during compilation that the PECL version is actually being used. It was only when I finally got it to build (by altering some function signature) and found the module wouldn't load due to a PDO API version mismatch, that I figured out wtf was going down. I'll look into this 'not telling us anything' business when I get some time. I also found - yeah this was a long session - that if the extension you're trying to build doesn't exist in your local copy of the PECL directory the configure line's simply ignored, even if that extension happens to use the sources in the PHP ext dir. This is a separate issue but also needs rectifying, and ditto. The main question I have at present is whether extensions should generally be trying to build from the PECL sources, or from the PHP extension directory? It should really be either one or the other, particularly for PDO and its drivers but also for anything else with a dependency on another extension... - Steph ------=_NextPart_000_0BA3_01C66C5E.E17D2AC0 Content-Type: text/plain; format=flowed; name="ext_sqlite.txt"; reply-type=original Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ext_sqlite.txt" Index: ext/sqlite/CREDITS=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/ext/sqlite/CREDITS,v=0A= retrieving revision 1.7=0A= diff -u -r1.7 CREDITS=0A= --- ext/sqlite/CREDITS 29 Apr 2004 22:57:23 -0000 1.7=0A= +++ ext/sqlite/CREDITS 30 Apr 2006 11:39:39 -0000=0A= @@ -1,2 +1,2 @@=0A= -SQLite=0A= +SQLite 2.x=0A= Wez Furlong, Tal Peer, Marcus Boerger, Ilia Alshanetsky=0A= Index: ext/sqlite/config.w32=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/php-src/ext/sqlite/config.w32,v=0A= retrieving revision 1.8.2.1=0A= diff -u -r1.8.2.1 config.w32=0A= --- ext/sqlite/config.w32 24 Sep 2005 15:13:13 -0000 1.8.2.1=0A= +++ ext/sqlite/config.w32 30 Apr 2006 11:47:28 -0000=0A= @@ -1,7 +1,7 @@=0A= // $Id: config.w32,v 1.8.2.1 2005/09/24 15:13:13 edink Exp $=0A= // vim:ft=3Djavascript=0A= =0A= -ARG_WITH("sqlite", "SQLite support", "no");=0A= +ARG_WITH("sqlite", "SQLite 2.x support", "yes");=0A= =0A= if (PHP_SQLITE !=3D "no") {=0A= copy_and_subst(configure_module_dirname + = "\\libsqlite\\src\\sqlite.h.in",=0A= @@ -13,18 +13,24 @@=0A= FSO.CopyFile(configure_module_dirname + = "\\libsqlite\\src\\sqlite_config.w32.h",=0A= configure_module_dirname + "\\libsqlite\\src\\config.h");=0A= =0A= - if (FSO.FileExists(configure_module_dirname + = "\\..\\pdo\\php_pdo_driver.h")) {=0A= - PHP_SQLITE2_PDO_CFLAGS =3D " /DPHP_SQLITE2_HAVE_PDO=3D1 /I " + = configure_module_dirname + "\\..";=0A= - ADD_EXTENSION_DEP('sqlite', 'pdo')=0A= + if (PHP_PDO !=3D "no") {=0A= +=0A= + if (PHP_PDO_SHARED) {=0A= + PHP_SQLITE_SHARED =3D "shared";=0A= + }=0A= +=0A= + dllname=3D"php_pdo_sqlite2.dll";=0A= + PHP_SQLITE2_PDO_CFLAGS =3D " /D PHP_SQLITE2_HAVE_PDO=3D1 /I " + = configure_module_dirname + "\\..";=0A= + ADD_EXTENSION_DEP("sqlite", "pdo")=0A= } else {=0A= - PHP_SQLITE2_PDO_CFLAGS =3D "";=0A= + dllname=3D"php_sqlite.dll";=0A= + PHP_SQLITE2_PDO_CFLAGS=3D"";=0A= }=0A= - =0A= +=0A= EXTENSION("sqlite", "sqlite.c sess_sqlite.c pdo_sqlite2.c", null,=0A= "/D PHP_SQLITE_EXPORTS /I " + configure_module_dirname + = "/libsqlite/src" +=0A= - PHP_SQLITE2_PDO_CFLAGS);=0A= - =0A= - =0A= + PHP_SQLITE2_PDO_CFLAGS, dllname);=0A= +=0A= ADD_SOURCES(configure_module_dirname + "/libsqlite/src", "opcodes.c = parse.c encode.c \=0A= auth.c btree.c build.c delete.c expr.c func.c hash.c insert.c \=0A= main.c os.c pager.c printf.c random.c select.c table.c tokenize.c \=0A= @@ -35,5 +41,5 @@=0A= if (!PHP_SQLITE_SHARED) {=0A= ADD_DEF_FILE(configure_module_dirname + "\\php_sqlite.def");=0A= }=0A= - ADD_EXTENSION_DEP('sqlite', 'spl')=0A= + ADD_EXTENSION_DEP("sqlite", "spl")=0A= }=0A= ------=_NextPart_000_0BA3_01C66C5E.E17D2AC0--