diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-01-13 23:17:20 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-01-13 23:17:20 +0000 |
commit | dd1628807a800c86b45495218cb19260bae8a846 (patch) | |
tree | 0f0616362ad4d70ec8fb072e475987d9968fb76c | |
parent | daeae9f1962fe408495f786c2d29098e7b13b36b (diff) | |
download | gcc-dd1628807a800c86b45495218cb19260bae8a846.zip gcc-dd1628807a800c86b45495218cb19260bae8a846.tar.gz gcc-dd1628807a800c86b45495218cb19260bae8a846.tar.bz2 |
mksysinfo: Pick up TIOCGWINSZ even if expression is too complex.
From-SVN: r183169
-rwxr-xr-x | libgo/mksysinfo.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index f389795..2d3aa8f 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -89,6 +89,15 @@ cat > sysinfo.c <<EOF #if defined(HAVE_NET_IF_H) #include <net/if.h> #endif + +/* Constants that may only be defined as expressions on some systems, + expressions too complex for -fdump-go-spec to handle. These are + handled specially below. */ +enum { +#ifdef TIOCGWINSZ + TIOCGWINSZ_val = TIOCGWINSZ, +#endif +}; EOF ${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c @@ -524,7 +533,14 @@ grep '^type _passwd ' gen-sysinfo.go | \ # The ioctl flags for the controlling TTY. grep '^const _TIOC' gen-sysinfo.go | \ + grep -v '_val =' | \ sed -e 's/^\(const \)_\(TIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} +# We need TIOCGWINSZ. +if ! grep '^const TIOCGWINSZ' ${OUT} >/dev/null 2>&1; then + if grep '^const _TIOCGWINSZ_val' ${OUT} >/dev/null 2>&1; then + echo 'const TIOCGWINSZ = TIOCGWINSZ_val' >> ${OUT} + fi +fi # The ioctl flags for terminal control grep '^const _TC[GS]ET' gen-sysinfo.go | \ |