Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2008 00:28:46 -0700 (PDT)
From:      Unga <unga888@yahoo.com>
To:        freebsd-stable@FreeBSD.ORG
Cc:        olli@lurza.secnetix.de
Subject:   Re: sysinstall compilation issue
Message-ID:  <76940.80951.qm@web57013.mail.re3.yahoo.com>
In-Reply-To: <200808081336.m78DaIoV018488@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
--- On Fri, 8/8/08, Oliver Fromme <olli@lurza.secnetix.de> wrote:

> From: Oliver Fromme <olli@lurza.secnetix.de>
> Subject: Re: sysinstall compilation issue
> To: freebsd-stable@FreeBSD.ORG, unga888@yahoo.com
> Date: Friday, August 8, 2008, 9:36 PM
> 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.
> 

Sorry for my late reply on this. I was not well during weekend, an eye ache due to over work :(

Here is the situation at my end, no matter whether I link with ncurses widec libs or non-widec libs, its still return the same code as above I mentioned. 

Possible causes can be:
1. The way I compile and install ncurses is not correct.
2. OR some essential files required are missing
3. OR there can be an other option

I used truss as follows:
TERMCAP=/usr/src/usr.sbin/sysinstall/../../share/termcap/termcap.src truss -o truss.log -f ./rtermcap ansi |  file2c 'const char termcap_ansi[] = {' ',0};'  >> makedevs.c

The last few lines of truss.log shows:
9310: stat("/usr/share/misc/terminfo.db",{mode=-rw-r--r-- ,inode=22613331,size=
3170304,blksize=4096}) = 0 (0x0)
 9310: open("/usr/share/misc/terminfo.db",O_RDONLY,0644) = 4 (0x4)
 9310: fcntl(4,F_SETFD,FD_CLOEXEC)               = 0 (0x0)
 9310: read(4,"\0\^F\^Ua\0\0\0\^B\0\0\^D\M-R\0"...,260) = 260 (0x104)
 9310: __sysctl(0xbfbfd574,0x2,0xbfbfd570,0xbfbfd57c,0x0,0x0) = 0 (0x0)
 9310: lseek(4,0x132000,SEEK_SET)                = 1253376 (0x132000)
 9310: read(4,"\^^\0\M-|\^O\M-T\^O\M-K\^O\M-*"...,4096) = 4096 (0x1000)
 9310: lseek(4,0x26b000,SEEK_SET)                = 2535424 (0x26b000)
 9310: read(4,"\n\0\M-Y\^O\^O\n\0\n\r\^D\^E\^D"...,4096) = 4096 (0x1000)
 9310: close(4)                                  = 0 (0x0)
 9310: ioctl(2,TIOCGETA,0xbfbfdba4)              = 0 (0x0)
 9310: ioctl(2,TIOCGETA,0x81020d8)               = 0 (0x0)
 9310: ioctl(2,TIOCGETA,0xbfbfdb64)              = 0 (0x0)
 9310: ioctl(2,TIOCGWINSZ,0xbfbfdbc4)            = 0 (0x0)
 9310: fstat(1,{mode=p--------- ,inode=0,size=0,blksize=4096}) = 0 (0x0)
 9310: process exit, rval = 0

Note, above log has no entry to open /usr/src/usr.sbin/sysinstall/../../share/termcap/termcap.src.

So what can be the issue, ncurses has not been patched correctly or some essential files missing? If you guys think that ncurses has not been patched correctly, then I'll open another thread to discuss that.

Best Regards
Unga




      



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?76940.80951.qm>