On Sun, May 30, 2010, Mike Hommey wrote: > PS: for sizes purpose, you should actually rebuild libxml2 with the > minimal set of options you require for your program. I doubt you need > all the APIs, especially the mostly deprecated ones.
Here's a second patch on top of the first one adding a separate pass for the udeb. I didn't actually test the runtime lib, but I did testbuild it and it produced the expected smaller files. Unfortunately, it probably conflicts with the python-dbg support changes. Thanks -- Loïc Minier
>From 8591035f6635d01cd60db542f7804dbff5189547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <l...@dooz.org> Date: Sun, 30 May 2010 17:28:06 +0200 Subject: [PATCH 2/2] Build the udeb in a separate pass Disable almost all features except tree manipulation APIs. --- debian/rules | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/debian/rules b/debian/rules index 7203244..b006924 100755 --- a/debian/rules +++ b/debian/rules @@ -13,32 +13,39 @@ else CFLAGS += -O2 -fno-strict-aliasing endif -override_dh_auto_configure: configure-main $(PYVERS:%=configure-%) +override_dh_auto_configure: configure-main configure-udeb $(PYVERS:%=configure-%) configure-main: dh_auto_configure --builddirectory=build -- --with-history --without-python CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" --cache-file="$(CURDIR)/build/config.cache" +configure-udeb: + # turn everything off except tree manipulation APIs + dh_auto_configure --builddirectory=build/udeb -- --without-c14n --without-catalog --without-debug --without-docbook --without-ftp --without-html --without-http --without-iconv --without-iso8859x --without-legacy --without-mem-debug --with-minimum --without-output --without-pattern --without-push --without-python --without-reader --without-readline --without-regexps --without-sax1 --without-schemas --without-schematron --without-threads --without-valid --without-xinclude --without-xpath --without-xptr --without-modules --without-zlib CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" --cache-file="$(CURDIR)/build/config.cache" + configure-python%: configure-main dh_auto_configure --builddirectory=build-python$* -- --with-history --with-python=/usr/bin/python$* CC="gcc -Wl,--as-needed" CFLAGS="$(CFLAGS)" --cache-file="$(CURDIR)/build/config.cache" mv build-python$*/python build/python$* -override_dh_auto_build: build-main $(PYVERS:%=build-%) +override_dh_auto_build: build-main build-udeb $(PYVERS:%=build-%) build-main: dh_auto_build --builddirectory=build +build-udeb: + dh_auto_build --builddirectory=build/udeb + build-python%: dh_auto_build --builddirectory=build/python$* override_dh_auto_clean: - rm -rf build build-python* + rm -rf build build-python* debian/tmp-udeb -test -r /usr/share/misc/config.sub && \ cp -f /usr/share/misc/config.sub config.sub -test -r /usr/share/misc/config.guess && \ cp -f /usr/share/misc/config.guess config.guess -override_dh_auto_install: install-main $(PYVERS:%=install-%) +override_dh_auto_install: install-main install-udeb $(PYVERS:%=install-%) install-main: dh_auto_install --builddirectory=build @@ -60,6 +67,9 @@ install-main: doc/html \ doc/tutorial debian/tmp/usr/share/doc/libxml2-doc +install-udeb: + dh_auto_install --builddirectory=build/udeb --destdir=debian/tmp-udeb + install-python%: dh_auto_install --builddirectory=build/python$* @@ -75,7 +85,8 @@ override_dh_installchangelogs: dh_installchangelogs -Nlibxml2 -XChangeLog override_dh_install: - dh_install + dh_install -Nlibxml2-udeb + dh_install -plibxml2-udeb --sourcedir=debian/tmp-udeb sed "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/libxml2.la > debian/libxml2-dev/usr/lib/libxml2.la override_dh_strip: -- 1.7.0.4