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

Bug#209008: parallel building: DEB_BUILD_OPTIONS or DEB_BUILD_OPTIONS_PARALLEL

Loïc Minier writes:
> On Sat, Aug 04, 2007, Matthias Klose wrote:
> > Updated the Makefile example to work with whitespace and comma
> > separated values, without using the shell:
> > ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
>  I think this doesn't work as the test in the ifneq doesn't match a
>  DEB_BUILD_OPTIONS with commas; instead, this is perhaps a simple way to
>  support commas between DEB_BUILD_OPTIONS:
> , := ,
>  and then parse DEB_BUILD_OPTIONS as proposed already:
> ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
> NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
> endif
>  But perhaps the biggest problem is that this would block us from ever
>  allowing commas as part of the DEB_BUILD_OPTIONS, for example to pass
>  LDFLAGS=-Wl,something (which would work if only spaces are allowed).

do it without changing DEB_BUILD_OPTIONS:

, := ,
ifneq (,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))
  NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))

but I agree that deprecating the use of comma as a separator in
DEB_BUILD_OPTIONS would be the best thing (or options containing
commata must be separated by whitespace, then simple things like
nocheck,parallel=2,nostrip still work).


Reply to: