Date: Fri, 8 Aug 2008 15:36:18 +0200 (CEST) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-stable@FreeBSD.ORG, unga888@yahoo.com Subject: Re: sysinstall compilation issue Message-ID: <200808081336.m78DaIoV018488@lurza.secnetix.de> In-Reply-To: <255533.64647.qm@web57001.mail.re3.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Unga <unga888@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808081336.m78DaIoV018488>