Re: Howto build statically linked PHP CGI (without shared libs)

From: Date: Thu, 11 Sep 2008 07:57:55 +0000
Subject: Re: Howto build statically linked PHP CGI (without shared libs)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-40458@lists.php.net to get a copy of this message
Santi Saez wrote:
Jani Taskinen escribió:
Wrong: --disable-shared --enable-static Might or might not work, no guarantees.
Dear Jani, Thanks for your reply, I have tried with a very simple: # ./configure --disable-all --disable-shared --enable-static 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 = $(LIBTOOL) --mode=link $(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 all static too. I tested this and it worked, with some nasty notices but those can be ignored. :) BEWARE: You need ALL the libraries that PHP links to as static libs for this to work! --Jani

« previous php.internals (#40458) next »