Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25828 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57395 invoked by uid 1010); 25 Sep 2006 21:17:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57380 invoked from network); 25 Sep 2006 21:17:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2006 21:17:45 -0000 Authentication-Results: pb1.pair.com header.from=antony@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=antony@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 80.74.107.235 as permitted sender) X-PHP-List-Original-Sender: antony@zend.com X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [80.74.107.235] ([80.74.107.235:26094] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/E6-10614-67748154 for ; Mon, 25 Sep 2006 17:17:45 -0400 Received: (qmail 4438 invoked from network); 25 Sep 2006 21:16:23 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 25 Sep 2006 21:16:23 -0000 Message-ID: <45184771.1070602@zend.com> Date: Tue, 26 Sep 2006 01:17:37 +0400 User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: Stut CC: internals@lists.php.net References: <451845A3.4010901@gmail.com> In-Reply-To: <451845A3.4010901@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Building C++ extensions From: antony@zend.com (Antony Dovgal) On 26.09.2006 01:09, Stut wrote: > Ok, so I've built an extension that uses a C++ library. It compiles fine > but the build system is insisting on linking with gcc no matter what I > tell it. Is there some simple trick I'm missing as far as convincing it > to use g++ goes? > > Here is the config.m4 in case I've missed something in there... > > PHP_ARG_ENABLE(mmsr, whether to enable mmsr support, > [ --enable-mmsr=dir Enable mmsr support]) > > if test "$PHP_MMSR" != "no"; then > PHP_ADD_LIBRARY_WITH_PATH(mmsr, "$PHP_MMSR") > PHP_ADD_INCLUDE("$PHP_MMSR/MMSR") > PHP_NEW_EXTENSION(mmsr, mmsr.c "$PHP_MMSR/MMSR/mmsr_bridge.cpp", > $ext_shared) > PHP_REQUIRE_CXX() > fi > > I had expected the PHP_REQUIRE_CXX() macro to trigger a change to the > link command, but it does not seem to have done anything beyond > influencing what is used to compile the extension itself. PECL/rar is C++ (or sort of C++) extension, so you can use its config.m4 as an example. Here it is: http://cvs.php.net/viewvc.cgi/pecl/rar/config.m4?revision=1.6&view=markup -- Wbr, Antony Dovgal