Hi Glenn, On Mon, Dec 04, 2023 at 10:11:21AM -0500, gs-bugs.debian....@gluelogic.com wrote: > On Mon, Dec 04, 2023 at 11:49:30AM +0100, Emanuele Rocca wrote: > > With the attached patch lighttpd cleanly cross-builds from source. > > Thanks, Emanuele. > > A slightly different patch: > > https://salsa.debian.org/debian/lighttpd/-/commit/a7d695d59c9a8bffe154aae29e335102beaaf3f2 > > was committed a few weeks ago to salsa.debian.org, which I based off > comments in > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021292? > > Is your suggested approach (above) preferred to this patch (below)? > > @@ -50,9 +50,9 @@ override_dh_auto_configure: > --with-xxhash \ > --with-zstd \ > $(if $(filter > pkg.lighttpd.libunwind,$(DEB_BUILD_PROFILES)),--with-libunwind) \ > - CFLAGS_FOR_BUILD="$(shell dpkg-buildflags --get CFLAGS)" \ > - LDFLAGS_FOR_BUILD="$(shell dpkg-buildflags --get LDFLAGS)" \ > - CPPFLAGS_FOR_BUILD="$(shell dpkg-buildflags --get CPPFLAGS)" \ > + CFLAGS_FOR_BUILD="$$(dpkg-architecture -a$(DEB_BUILD_ARCH) -f > -c dpkg-buildflags --get CFLAGS)" \ > + LDFLAGS_FOR_BUILD="$$(dpkg-architecture -a$(DEB_BUILD_ARCH) -f > -c dpkg-buildflags --get LDFLAGS)" \ > + CPPFLAGS_FOR_BUILD="$$(dpkg-architecture -a$(DEB_BUILD_ARCH) -f > -c dpkg-buildflags --get CPPFLAGS)" \ > > override_dh_install: > cp NEWS debian/tmp/changelog >
Good question! CFLAGS_FOR_BUILD is a really recent thing in dpkg available since 1.22.1. For going backwards, I suppose CFLAGS_FOR_BUILD will be unknown and dpkg-buildflags will fail without outputting something. Then empty build flags tend to work. For going forward, CFLAGS_FOR_BUILD definitely is something we want to embrace more. In any case, thanks for handling the issue on your side already. Helmut