Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh/system's $errnos empty with recent gcc



On Wed, 7 Sep 2016 10:28:41 +0100
Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> At least on Ubuntu 16.04 and Debian unstable, $errnos comes out
> empty.
> 
> It's down to the generation of errnames.c. Part of that
> involves calling $CPP on an awk generated file, and post-process
> $CPP's output with a second awk script.

We fixed this for signames.c in zsh.mdd in 34977 / 9f9a16f43c:

signames.c: signames1.awk signames2.awk ../config.h @SIGNAL_H@
	$(AWK) -f $(sdir)/signames1.awk @SIGNAL_H@ >sigtmp.c
	case "`$(CPP) --version </dev/null 2>&1`" in \
	*"Free Software Foundation"*) \
	$(CPP) -P sigtmp.c >sigtmp.out;; \
	*) \
	$(CPP) sigtmp.c >sigtmp.out;; \
	esac
	$(AWK) -f $(sdir)/signames2.awk sigtmp.out > $@
	rm -f sigtmp.c sigtmp.out

So it probably needs the same treatment here.

diff --git a/Src/Modules/system.mdd b/Src/Modules/system.mdd
index eed0c1b..00a3e78 100644
--- a/Src/Modules/system.mdd
+++ b/Src/Modules/system.mdd
@@ -15,7 +15,12 @@ errnames.c: errnames1.awk errnames2.awk $(dir_top)/config.h @ERRNO_H@
 		touch errtmp.out; \
 	   else \
 		$(AWK) -f $(sdir)/errnames1.awk @ERRNO_H@ >errtmp.c; \
-		$(CPP) errtmp.c >errtmp.out; \
+		case "`$(CPP) --version </dev/null 2>&1`" in \
+		*"Free Software Foundation"*) \
+		$(CPP) -P errtmp.c >errtmp.out;; \
+		*) \
+		$(CPP) errtmp.c >errtmp.out;; \
+		esac; \
 	   fi
 	   $(AWK) -f $(sdir)/errnames2.awk errtmp.out > $@
 	   rm -f errtmp.c errtmp.out



Messages sorted by: Reverse Date, Date, Thread, Author