When examining build failures, it is useful to know in which directory the compilation failed. When looking on some programs\' build output, it is not clear in which directory it happened, because the top-level make doesn\'t print the initial directory. I suggest that rpmbuild appends --print-directory to MAKEFLAGS environment variable (or some alternative way to get the same beahviour). --- For example, pine build: Making Pine and rpload/rpdump. make CC=cc DEBUG= OPTIMIZE=-pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686 EXTRADRIVERS=mbox maildir EXTRASPECIALS=MAILSPOOL=/var/mail SSLDIR=/var/lib/ssl SSLINCLUDE=/usr/include SSLLIB=/usr/lib SSLCERTS=/var/lib/ssl/certs -f makefile.lnx cc -pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686 -DLNX -DSYSTYPE=\\\"LNX\\\" -DMOUSE -Imy_util -Ipure_recode -DRECODEG_PINE -c -o mailview.o mailview.c mailview.c: In function `encoding_editorial\': mailview.c:2002: `ENCODING_DISCLAIMER\' undeclared (first use in this function) mailview.c:2002: (Each undeclared identifier is reported only once mailview.c:2002: for each function it appears in.) mailview.c:4086:9: warning: \"_WINDOWS\" is not defined make: *** [mailview.o] Error 1 error: Bad exit status from /home/ivan/rpm/tmp/rpm-tmp.33535 (%build) After appending --print-directory to MAKEFLAGS in pine.spec like this: %build MAKEFLAGS=\"$MAKEFLAGS --print-directory\" \\ ./build .... the output contains more information: Making Pine and rpload/rpdump. make CC=cc DEBUG= OPTIMIZE=-pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686 EXTRADRIVERS=mbox maildir EXTRASPECIALS=MAILSPOOL=/var/mail SSLDIR=/var/lib/ssl SSLINCLUDE=/usr/include SSLLIB=/usr/lib SSLCERTS=/var/lib/ssl/certs -f makefile.lnx make: Entering directory `/var/SRC/ivan/rpm/BUILD/pine4.51/pine\' cc -pipe -Wundef -Wformat -O2 -fexpensive-optimizations -march=i686 -DLNX -DSYSTYPE=\\\"LNX\\\" -DMOUSE -Imy_util -Ipure_recode -DRECODEG_PINE -c -o mailview.o mailview.c mailview.c: In function `encoding_editorial\': mailview.c:2002: `ENCODING_DISCLAIMER\' undeclared (first use in this function) mailview.c:2002: (Each undeclared identifier is reported only once mailview.c:2002: for each function it appears in.) mailview.c:4086:9: warning: \"_WINDOWS\" is not defined make: *** [mailview.o] Error 1 make: Leaving directory `/var/SRC/ivan/rpm/BUILD/pine4.51/pine\' error: Bad exit status from /home/ivan/rpm/tmp/rpm-tmp.33535 (%build) --- The directory information can be parsed by Emacs compilation mode, and the places can be found. rpm-build-4.0.4-alt12
Added setting of MAKEFLAGS=\"--print-directory\" variable to %___build_pre macro. Will be available in next rpm-build release.
Implemented in 4.0.4-alt13
I see it: rpm --eval=%dump 2>&1 | grep MAKEFLAGS MAKEFLAGS=\"--print-directory\" but it doesn\'t seem to work (tested on pine.spec). Perhaps, the variable should exported. (In pine.spec, make is called as a subprocess of a script.)
Indeed.
Will be fixed in upcoming release.