n-t-roff / heirloom-doctools

The Heirloom Documentation Tools: troff, nroff, and related utilities
http://n-t-roff.github.io/heirloom/doctools.html
Other
127 stars 23 forks source link

Compile failure at at file /usr/include/bits/stat.h #109

Open APIPLM opened 3 years ago

APIPLM commented 3 years ago

System info:

Linux liaohaiwen 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Build steps:

1. yum -y install centos-release-scl
2. yum install devtoolset-7-gcc*
3. scl enable devtoolset-7 bash
4. gcc --version
1. git clone git://github.com/n-t-roff/heirloom-doctools
2. cd heirloom-doctools
3. ./configure
4. make

Compile failure at the file /usr/include/bits/stat.h. The error information see the below

make[1]: Leaving directory `/root/heirloom-doctools-191015/troff/troff.d/font/devhtml'
make[1]: Entering directory `/root/heirloom-doctools-191015/troff/troff.d/tmac.d'
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' bib.in >bib
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' e.in >e
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' m.in >m
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' s.in >s
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' an.in >an
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' andoc.in >andoc
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' doc.in >doc
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' doc-ditroff.in >doc-ditroff
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' pm.in >pm
sed 's:@MACDIR@:/usr/local/ucblib/doctools/tmac:; s:@LIBDIR@:/usr/local/ucblib:' g.in >g
sed -e 's"/usr/ucblib/doctools/font/devpost/postscript"/usr/local/ucblib/doctools/font/devpost/postscript"' \
    -e 's"/usr/ucblib/doctools/tmac"/usr/local/ucblib/doctools/tmac"' \
    mcolor.7.in > mcolor.7
make[1]: Leaving directory `/root/heirloom-doctools-191015/troff/troff.d/tmac.d'
make[1]: Entering directory `/root/heirloom-doctools-191015/troff/troff.d/postscript'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/heirloom-doctools-191015/troff/troff.d/postscript'
make[1]: Entering directory `/root/heirloom-doctools-191015/troff/troff.d'
cc   -D_GNU_SOURCE   -DUSG -DEUC -I. -I.. -I../../include -DMACDIR='"/usr/local/ucblib/doctools/tmac"' -DFNTDIR='"/usr/local/ucblib/doctools/font"' -DTABDIR='"/usr/local/ucblib/doctools/nterm"' -DHYPDIR='"/usr/local/ucblib/doctools/hyphen"' -DSHELL='"/bin/sh"' -DRELEASE='"release 191015"'  -I../../stuff/bst -c t10.c
In file included from /usr/include/fcntl.h:77:0,
                 from t10.c:56:
/usr/include/bits/stat.h:106:31: error: expected identifier or ‘(’ before ‘[’ token
     __syscall_slong_t __unused[3];
                               ^
/usr/include/bits/stat.h:164:31: error: expected identifier or ‘(’ before ‘[’ token
     __syscall_slong_t __unused[3];
                               ^
make[1]: *** [t10.o] Error 1
make[1]: Leaving directory `/root/heirloom-doctools-191015/troff/troff.d'
make: *** [all] Error 2
n-t-roff commented 3 years ago

The problem could have been caused by a missing include guard. In fact, include guards are rarely used in this software. Unfortunately I don't have this CentOS version to debug the issue. Could you try to put include guards in the files included in t10.c (recursively)? ext.h would be the first candidate I would try.