[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: build two binary packages with different configure parameters

On Sat, May 05, 2007 at 03:07:53PM +0200, Marc Haber wrote:
> Hi,
> I have a package which uses debhelper at build time, and is built by a
> rather simple configure - make - make install triathlon. As it fails
> badly on xen, the xen people ask to provide a xen-enabled binary
> package.
> Thus, I need to build the package once with a normal configure, and a
> second time with configure --with-extra-libs=foo. The rest of the
> build process is identical.
> All packages that I have seen which do this duplicate the entire build
> process in debian/rules by having configure-foo, configure-bar,
> build-foo, build-bar, install-foo and install-bar targets along with
> all stamps explicitly doubled. I hate the idea of having to do this
> with my package just to have a single different configure call.
> Is there any more elegant way to do this? If so, which package uses it
> that I can steal from?
vim is referenced as a prototype for multiple binary packages with
different compilation variations.  It's perhaps not clear from the
large rules, but it really does handle 10+ such packages, and only
calls configure once ("configure-stamp-%:", this is quite probably not
portable make) and this includes a "make clean" to remove the
earlier-compiled binaries objects and such for compilation of the
current binary.

Usually make is supposed to be as parallelized as possible; as such,
rules that call $(MAKE) again are pretty inelegant.  However, for this
case, you want to avoid parallelizing it: the compilations must be
serial not concurrent.

In fact the template debian/rules created by dhmake does this:

[... dh foo ...]
|# Build architecture independant packages using the common target.
|binary-indep: build-indep install-indep
|        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|# Build architecture dependant packages using the common target.
|binary-arch: build-arch install-arch
|        $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common

The debhelper commands look at the DH_OPTIONS from the environment so the
arch/indep targets do different things and build different packages.


Reply to: