]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/MKlib_gen.sh
ncurses 5.9 - patch 20150328
[ncurses.git] / ncurses / base / MKlib_gen.sh
index d8cc3c9751faa157d0c8cb8e16fbe4217703966b..b91398c740a266f10edbbce19f19c52b9709556f 100755 (executable)
@@ -2,10 +2,10 @@
 #
 # MKlib_gen.sh -- generate sources from curses.h macro definitions
 #
-# ($Id: MKlib_gen.sh,v 1.46 2011/06/04 19:14:08 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.47 2014/12/06 18:56:25 tom Exp $)
 #
 ##############################################################################
-# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2011,2014 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -474,11 +474,22 @@ sed -n -f $ED1 \
        -e 's/gen_$//' \
        -e 's/  / /g' >>$TMP
 
+cat >$ED1 <<EOF
+s/  / /g
+s/^ //
+s/ $//
+s/P_NCURSES_BOOL/NCURSES_BOOL/g
+EOF
+
+# A patch discussed here:
+#      https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+# introduces spurious #line markers.  Work around that by ignoring the system's
+# attempt to define "bool" and using our own symbol here.
+sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
+cat $ED2 >$TMP
+
 $preprocessor $TMP 2>/dev/null \
-| sed \
-       -e 's/  / /g' \
-       -e 's/^ //' \
-       -e 's/_Bool/NCURSES_BOOL/g' \
+| sed -f $ED1 \
 | $AWK -f $AW2 \
 | sed -f $ED3 \
 | sed \