linux-2.6.18-xen.hg: check that awk supports 'gensub' command
PATCH 1/1 linux-2.6.18-xen.hg: check that awk supports 'gensub' command
The linux-2.6.18-xen.hg/scripts/Makefile.xen.awk script depends on the GNU AWK-specific function "gensub". If another awk is used (e.g., Debian installs mawk by default), the lack of gensub trickles down to cause the -xen.c files to not be compiled. This was time-consuming to track. So we should check that the awk program supports 'gensub'.
scripts/Makefile.build +2 -0
@@ -71,6 +71,8 @@ ifeq ($(CONFIG_XEN),y) ifeq ($(CONFIG_XEN),y) $(objtree)/scripts/Makefile.xen: $(srctree)/scripts/Makefile.xen.awk $(srctree)/scripts/Makefile.build @echo ' Updating $@' + $(if $(shell echo a | $(AWK) '{ print gensub(/a/, "AA", "g"); }'),\ + ,$(error 'Your awk program does not define gensub. Use gawk or another awk with gensub')) @$(AWK) -f $< $(filter-out $<,$^) >$@ xen-src-single-used-m := $(patsubst $(srctree)/%,%,$(wildcard $(addprefix $(srctree)/,$(single-used-m:.o=-xen.c))))
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Michael Abd-El-Malek <[email protected]> 10.10.07 04:53 >>>
The
linux-2.6.18-xen.hg/scripts/Makefile.xen.awkscript depends on the GNU AWK-specific function "gensub". If another awk is used (e.g., Debian installs mawk by default), the lack of gensub trickles down to cause the-xen.cfiles to not be compiled. This was time-consuming to track. So we should check that the awk program supports 'gensub'.Signed-off-by Michael Abd-El-Malek <[email protected]>
Hmm, this seems odd: If I try to use an arbitrary function (with gawk) , I get a failure, which should prevent make from continuing the build. Are you saying this isn't happening for you? Have you determined why?
Jan
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Michael Abd-El-Malek <[email protected]> 10.10.07 04:53 >>>
The
linux-2.6.18-xen.hg/scripts/Makefile.xen.awkscript depends on the GNU AWK-specific function "gensub". If another awk is used (e.g., Debian installs mawk by default), the lack of gensub trickles down to cause the-xen.cfiles to not be compiled. This was time-consuming to track. So we should check that the awk program supports 'gensub'.
Quoted 6 lines
Quoted 1 line
Signed-off-by Michael Abd-El-Malek <[email protected]>Hmm, this seems odd: If I try to use an arbitrary function (with gawk) , I get a
failure, which should prevent make from continuing the build. Are you saying this isn't happening for you? Have you determined why?
The implication seems to be that other awk implementations (most likely mawk in this case) silently continue.
-- Keir
Quoted 16 lines · Keir Fraser
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Michael Abd-El-Malek <[email protected]> 10.10.07 04:53 >>>
The
linux-2.6.18-xen.hg/scripts/Makefile.xen.awkscript depends on the GNU AWK-specific function "gensub". If another awk is used (e.g., Debian installs mawk by default), the lack of gensub trickles down to cause the-xen.cfiles to not be compiled. This was time-consuming to track. So we should check that the awk program supports 'gensub'.Quoted 6 lines
Quoted 1 line
Signed-off-by Michael Abd-El-Malek <[email protected]>Hmm, this seems odd: If I try to use an arbitrary function (with gawk) , I get a
failure, which should prevent make from continuing the build. Are you saying this isn't happening for you? Have you determined why?
Quoted 4 lines
The implication seems to be that other awk implementations (most likely mawk in this case) silently continue.
-- Keir
Yes, the build process would continue with mawk silently failing. The resulting build problems have been encountered by others before; see:
http://lists.xensource.com/archives/html/xen-devel/2007-07/msg00840.html
Mike