sysinstall compilation issue
Oliver Fromme
olli at lurza.secnetix.de
Fri Aug 8 13:36:39 UTC 2008
Unga <unga888 at yahoo.com> wrote:
> This is i386 RELENG_7.
>
> Following section of the /usr/src/usr.sbin/sysinstall/Makefile does not generate C code properly:
>
> makedevs.c: Makefile rtermcap
> echo '#include <sys/types.h>' > makedevs.c
> ${RTERMCAP} ansi | \
> file2c 'const char termcap_ansi[] = {' ',0};' \
> > > makedevs.c
>
> At compile time, above expands to:
> TERMCAP=/usr/src/usr.sbin/sysinstall/../../share/termcap/termcap.src ./rtermcap ansi | file2c 'const char termcap_ansi[] = {' ',0};' >> makedevs.c
>
> Which generates C code as follows:
> const char termcap_ansi[] = {
>
> ,0};
>
> That is, it generates 3 lines, which results a compilation error.
>
> I presume, intended generated code should be:
> const char termcap_ansi[] = {' ',0};
>
> Am I right?
No, it should generate an array containung a dump of
the "ansi" termcap entry. Please see the file2c(1)
manpage.
> What is wrong at my end?
>
> Note, I linked the rtermcap with ncursesw libraries, can that be the cause? Any ideas?
Yes, that's the cause. Why did you do that?
FreeBSD's ncurses port contains a patch so the tgetent()
function (which is used by rtermcap) returns the actual
termcap entry in the buffer. The original ncurses code
(which is terminfo based) doesn't do that.
When you linked rtermcap with the wrong library, you
restored the original behaviour of tgetent(), so the
output of rtermcap was empty, so file2c produced invalid
source.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart
FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd
"I started using PostgreSQL around a month ago, and the feeling is
similar to the switch from Linux to FreeBSD in '96 -- 'wow!'."
-- Oddbjorn Steffensen
More information about the freebsd-stable
mailing list