Checkout
Joe Orton
committed
on 20 Jun
Add an --enable-reduced-exports configure option to link libmain.a
using ld's --whole-archive mode and avoid building exports.c entirely.
Th… Show more
Add an --enable-reduced-exports configure option to link libmain.a

using ld's --whole-archive mode and avoid building exports.c entirely.

This reduces the size of a minimal httpd binary by 18% on Linux/x86_64

(687K to 560K) with no difference to the set of symbols available to

modules.

This option is only appropriate to use if using a shared libapr*

build, hence is non-default.

* configure.in: Add --enable-reduced-exports; disable httpdunit build

 if used.  Define AP_FORCE_EXPORTS if not enabled (default) in place

 of AP_USING_AUTOCONF.

* server/main.c (ap_suck_in_APR): Only build if AP_FORCE_EXPORTS is

 defined.

* Makefile.in: Link libmain.la using LIBMAIN_LIB.

* server/Makefile.in: Conditionally build exports.c into libmain.

Show less