This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pre-ITP: apache/mod_php

Brian Dessent schrieb:
Reini Urban wrote:
Not talking about building static. The binary still links to the shared
system libs for all the things for which there exist system libs. The
only thing that's duplicated between CLI and DSO are the PHP extensions
that you don't build shared.

ah, ok. this reduces size.

# ldd /usr/local/bin/php => /lib/ (0x4001b000) => /usr/local/lib/ (0x40048000) => /usr/local/lib/ (0x4006c000) => /usr/local/pgsql/lib/ (0x40071000) => /usr/lib/ (0x40139000) => /usr/local/lib/ (0x4015c000) => /lib/ (0x40163000) => /usr/lib/ (0x40167000) => /usr/lib/ (0x4016e000) => /lib/ (0x401a0000) => /usr/lib/ (0x401af000) => /usr/local/BerkeleyDB.4.2/lib/
(0x401ce000) => /usr/lib/ (0x40278000) => /lib/ (0x4027f000) => /lib/ (0x40292000) => /lib/ (0x402b4000) => /usr/local/lib/ (0x402ca000) => /usr/local/lib/ (0x403a7000) => /lib/ (0x404b5000) => /lib/ (0x404cb000)
        /lib/ => /lib/ (0x40000000)

That's quite a mouthful. Here is Debian's:

$ ldd /usr/bin/php4 => /lib/ (0x4001f000) => /lib/ (0x4004c000) => /usr/lib/ (0x40061000) => /usr/lib/ (0x40081000) => /usr/lib/ (0x40092000) => /usr/lib/ (0x40168000) => /usr/lib/ (0x40178000) => /usr/lib/i586/ (0x40189000) => /lib/ (0x401b6000) => /lib/ (0x401c8000) => /lib/ (0x401eb000) => /lib/ (0x401ee000) => /usr/lib/i586/
/lib/ => /lib/ (0x40000000)

Everything else is shared - there are a ton of php4-foo packages.

for apache2 and lighttpd we must make our own php libs then, with the
same configure quirks. that's what I wanted to avoid with the general

It would be nice, I agree.  But it would take some serious hacking to
the buildscripts.  And as I said the more I get to know them the less I
want to.  :-)

no serious hacking, just simply avoiding the libtool section their buildscripts. because I wanted to add some static libs which are not in the cygwin distro: pdflib, fastcgi, libzzip

# apply brians patch
#patch -p1 < ../php-all.patch

# apply reini's dba patch
#patch -p0 < ../php-dba.patch

# re-autoconf, tatata...

# pdflib-lite (static):
# cd /usr/src; wget -q
# tar xfz PDFlib-Lite-6.0.0p1.tar.gz; cd PDFlib-Lite-6.0.0p1
# ./configure --disable-shared; make; make install
# fastcgi (static for CGI php.exe only):
# cd /usr/src; wget -q
# tar xfz fcgi-2.4.0.tar.gz; cd fcgi-2.4.0;
# ./configure; make; make install
# libzzip (static for --with-zip,
# cd /usr/src; wget -q
# tar xfj zziplib-0.10.82.tar.bz2; cd zziplib-0.10.82
# ./configure --prefix=/usr/local --libdir=/usr/local/lib includedir=/usr/local/include --disable-shared; make; make install

./configure --mandir=/usr/share/man --with-mysql=/usr/local/mysql --with-apxs=/usr/sbin/apxs --enable-track-vars --prefix=/usr --enable-safe-mode --enable-cli --enable-cgi --enable-fastcgi --with-openssl=shared --enable-bcmath --with-bzip2=shared --enable-calendar --with-curl=shared --enable-dba --with-gdbm --with-db4 --with-cdb --with-inifile --with-flatfile --with-dom=shared --with-dom-xslt=shared --with-dom-exslt=shared --with-gd --enable-gd-native-ttf --with-jpeg-dir=/usr/lib --with-gettext=shared --with-gmp=shared --with-ldap --enable-mbstring --with-libmbfl --with-mcrypt=shared --with-mhash=shared --with-iconv=shared --with-ncurses=shared --enable-pcntl --with-pdflib --with-pgsql=shared --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xmlrpc --with-domxml --with-zip --with-zlib --with-zlib-dir=/usr/lib --enable-memory-limit --enable-zend-multibyte 2>&1 | tee .build/log.config

# hmm, sablotron missing...

# this will fail after building the lo's. this is ok
# I just didn't grok how to create the lo's more easily
make 2>&1 | tee .build/log.make

# now create libphp4.dll.a
# all .lo's but the sapi stuff. link the sapi's then seperately.
# avoid the php build system because the tend to duplicate
# all libs and garble the correct order
libtool --mode=link gcc -shared -O2 -o -module -avoid-version -L/usr/local/mysql/lib/mysql -L/usr/local/lib -o `find . \( -name x_dummymain -o -name sapi \) -prune -o -name \*.lo | grep .lo` -lcrypt -lz -liconv -lexpat -lzzip -lpdf -lpng -ljpeg -lmysqlclient -lldap -llber -ldb-4.2 -lgdbm -lresolv -lssl 2>&1 | tee .build/

# just the final steps are missing: libphp4.dll.a => cygphp4.dll
# and link the sapi stuff seperately against it.
# have to read more about libtool...

It's not that bad - cygphp4.dll is 1.3M stripped, and that's with the
"kitchen sink" config. Linking to external mysqlclient and pcre and/or
getting the remaining bundled libs shared would shrink that further. There's another 1.2M of loadable extensions but those should be shared
between the CLI / DSO versions.

ah, that's also good. -- Reini Urban

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]