Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40458 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36612 invoked from network); 11 Sep 2008 07:58:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Sep 2008 07:58:05 -0000 Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.179 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.179 mho-02-bos.mailhop.org Received: from [63.208.196.179] ([63.208.196.179:51270] helo=mho-02-bos.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/33-30769-D8FC8C84 for ; Thu, 11 Sep 2008 03:58:05 -0400 Received: from a88-112-30-186.elisa-laajakaista.fi ([88.112.30.186] helo=localhost.localdomain) by mho-02-bos.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1Kdh3v-0006ci-BK; Thu, 11 Sep 2008 07:57:59 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 88.112.30.186 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/KV9FUErAX2k52maDOVpyFzwl9U6Rtsyw= Message-ID: <48C8CF83.1060604@sci.fi> Date: Thu, 11 Sep 2008 10:57:55 +0300 Reply-To: jani.taskinen@iki.fi User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: Santi Saez CC: jani.taskinen@iki.fi, =?UTF-8?B?Q3Jpc3RpYW4gUm9kcsOtZ3Vleg==?= , internals@lists.php.net References: <48C7E278.5040204@suse.de> <48C7F390.90003@sci.fi> <48C83EA3.1050107@usansolo.net> In-Reply-To: <48C83EA3.1050107@usansolo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Howto build statically linked PHP CGI (without shared libs) From: jani.taskinen@sci.fi (Jani Taskinen) Santi Saez wrote: > Jani Taskinen escribi=C3=B3: >> Wrong: --disable-shared --enable-static >> >> Might or might not work, no guarantees. >=20 > Dear Jani, >=20 > Thanks for your reply, I have tried with a very simple: >=20 > # ./configure --disable-all --disable-shared --enable-static >=20 > But, generated binary uses shared libs ;-( Yes, that wasn't really the thing. Libtool is nasty but it is possible. With this small Makefile modification you'll get what you want: BUILD_CLI =3D $(LIBTOOL) --mode=3Dlink $(CC) -all-static ^^^^^^^^^^^ Just add the '-all-static' option there after $(CC) and before any other = stuff on the line. And same for BUILD_CGI line too if you want that as=20 all static too. I tested this and it worked, with some nasty notices but those can be=20 ignored. :) BEWARE: You need ALL the libraries that PHP links to as static libs for=20 this to work! --Jani