Date: Wed, 29 Jan 1997 12:23:36 -0600 (CST) From: Dave Bodenstab <imdave@synet.net> To: ajohn@cyberforge.com Cc: questions@FreeBSD.ORG Subject: Re: Problems compiling xwpe under FreeBSD 2.1.5 - Help! Message-ID: <199701291823.MAA20074@base486.synet.net>
next in thread | raw e-mail | index | archive | help
Doug White wrote: > On Sun, 26 Jan 1997, Anil John wrote: > > and ran make again. Everything seemed to going along until I got the > > following error: > > gcc -O2 -I/usr/include/ncurses -I/usr/X11R6/lib/../include -DTERMCAP > > -DRANLIB -D"PRNTCMD=\"lpr\"" -DNOVSWTCH -DRANLIB > > -D"DESTDIR=\"/usr/bin\"" -c we_term.c > > we_term.c:11: termio.h: No such file or directory > > I did a locate on 'termio.h'. The only things I could find were: > > /usr/include/sys/termios.h > > /usr/include/termios.h > Ugly. :( The old termio functions will need to be ported to their termios > equivalents. This is *not* easy. > > You might ask on ports@freebsd.org and see if anyone is willing to port > it. > Fairly trivial changes follow -- mostly one-for-one replacements. I didn't try the curses interface other than to see if it came up. The X11 interface seems to work, although there is no interface to display data. When I looked at ddd, it seemed to be more complete. You might want to consider it instead. Good luck. Dave Bodenstab imdave@synet.net ---BEGIN -------------------------------------------------------- --- configure 1995/04/07 12:23:04 14.2 +++ configure 1997/01/27 20:32:21 14.2.1.1 @@ -300,7 +300,7 @@ then echo running find from root echo please wait - tmp_lib=`find / -name libX11.a -exec ls {} \; -a -exec exit \; 2> /dev/null` + tmp_lib=`locate libX11.a` tmp_lib=`dirname $tmp_lib` if test -n "$tmp_lib"; then LIBS="-L${tmp_lib} ${LIBS}" --- Makefile.in 1995/04/07 12:23:04 14.2 +++ Makefile.in 1997/01/27 20:32:23 14.2.1.1 @@ -56,7 +56,7 @@ # LSYSV= -L/usr/5lib #library #If You got a Curses Library -TLIB= -lcurses +TLIB= -lncurses #If You didn't get a Curses Library # TLIB= -ltermlib @@ -104,7 +104,7 @@ ELIBFLAGS= $(LSYSV) $(LXWINDOW) $(TLIB) $(LPOSIX) $(XWINLIB) $(LNET) $(EXTLIBS) -ACFLAGS= $(CFLAGS) $(DEFS) $(ECFLAGS) -D"DESTDIR=\"$(DESTDIR)\"" +ACFLAGS= $(CFLAGS) $(DEFS) -I. $(ECFLAGS) -D"DESTDIR=\"$(DESTDIR)\"" LIBFLAGS= $(LIBS) $(ELIBFLAGS) @@ -174,4 +176,7 @@ +$(OFILES): curses.h +curses.h: + ln -fs /usr/include/ncurses.h $@ --- we_debug.c 1997/01/27 19:31:48 14.2 +++ we_debug.c 1997/01/27 20:32:28 14.2.1.1 @@ -25,7 +25,14 @@ #include <fcntl.h> +#ifdef __FreeBSD__ +#include <termios.h> +#define TERMIO termios +#define mknod(a,b,c) mkfifo(a,0600) +#else #include <termio.h> +#define TERMIO termio +#endif #include <sys/types.h> #include <sys/stat.h> #include <signal.h> @@ -48,7 +55,7 @@ char e_d_tty[80]; extern int wfildes[2], efildes[2]; -extern struct termio otermio, ntermio, ttermio; +extern struct TERMIO otermio, ntermio, ttermio; extern struct e_s_prog e_sv_prog; extern BUFFER *e_p_w_buffer; extern char *att_no; @@ -1361,7 +1368,12 @@ (efildes[0] = open(npipe[2], O_RDONLY)) < 0) { e_error(e_p_msg[1], 0, f->fb); return(0); } if(e_deb_mode) - { ioctl(rfildes[0], TCGETA, &ntermio); + { +#ifdef __FreeBSD__ + tcgetattr(rfildes[0], &ntermio); +#else + ioctl(rfildes[0], TCGETA, &ntermio); +#endif ntermio.c_iflag = 0; ntermio.c_oflag = 0; ntermio.c_lflag = 0; @@ -1370,7 +1382,11 @@ #ifndef NOVSWTCH ntermio.c_cc[VSWTCH] = 0; #endif +#ifdef __FreeBSD__ + tcsetattr(rfildes[0], TCSADRAIN, &ntermio); +#else ioctl(rfildes[0], TCSETA, &ntermio); +#endif } } else @@ -2145,14 +2161,23 @@ int e_g_sys_ini() { if(!e_d_swtch || e_deb_mode) return(0); +#ifdef __FreeBSD__ + tcgetattr(0, &ttermio); + return(tcsetattr(0, TCSADRAIN, &otermio)); +#else ioctl(0, TCGETA, &ttermio); return(ioctl(0, TCSETA, &otermio)); +#endif } int e_g_sys_end() { if(!e_d_swtch || e_deb_mode) return(0); +#ifdef __FreeBSD__ + return(tcsetattr(0, TCSADRAIN, &ttermio)); +#else return(ioctl(0, TCSETA, &ttermio)); +#endif } int e_test_command(str) --- we_term.c 1997/01/27 19:16:53 14.2 +++ we_term.c 1997/01/27 20:32:26 14.2.1.1 @@ -8,7 +8,13 @@ #ifdef UNIX #ifndef DJGPP +#ifndef __FreeBSD__ #include <termio.h> +#define TERMIO termio +#else +#include <termios.h> +#define TERMIO termios +#endif #include <fcntl.h> /* @@ -69,7 +75,7 @@ char *sp_chr[NSPCHR]; int cur_x = -1, cur_y = -1; -struct termio otermio, ntermio, ttermio; +struct TERMIO otermio, ntermio, ttermio; /* TERMINAL *save_term; */ #ifdef TERMCAP char area[315]; @@ -331,7 +337,11 @@ */ int e_t_initscr() { int ret; +#ifdef __FreeBSD__ + ret = tcgetattr(1, &otermio); /* save old settings */ +#else ret = ioctl(1, TCGETA, &otermio); /* save old settings */ +#endif /* if(ret) { printf("Error in Terminal Initialisation Code: %d\n", ret); @@ -363,7 +373,11 @@ { printf("Terminal Not in the right mode\n"); e_exit(1); } +#ifdef __FreeBSD__ + tcgetattr(0, &ntermio); +#else ioctl(0, TCGETA, &ntermio); +#endif ntermio.c_iflag = 0; /* setup new settings */ ntermio.c_oflag = 0; ntermio.c_lflag = 0; @@ -372,7 +386,11 @@ #ifndef NOVSWTCH ntermio.c_cc[VSWTCH] = 0; #endif +#ifdef __FreeBSD__ + tcsetattr(0, TCSADRAIN, &ntermio); +#else ioctl(0, TCSETA, &ntermio); +#endif if(spc_in) e_putp(spc_in); return(0); } @@ -419,7 +437,11 @@ #endif */ fk_putp(ratt_bo); +#ifdef __FreeBSD__ + tcsetattr(0, TCSADRAIN, &otermio); +#else ioctl(0, TCSETA, &otermio); +#endif return(0); } @@ -528,7 +550,11 @@ int e_t_sys_ini() { e_refresh(); +#ifdef __FreeBSD__ + tcgetattr(0, &ttermio); +#else ioctl(0, TCGETA, &ttermio); +#endif svflgs = fcntl( 0, F_GETFL, 0 ); e_endwin(); return(0); @@ -536,7 +562,11 @@ int e_t_sys_end() { +#ifdef __FreeBSD__ + tcsetattr(0, TCSADRAIN, &ttermio); +#else ioctl(0, TCSETA, &ttermio); +#endif fcntl( 0, F_SETFL, svflgs ); e_abs_refr(); fk_locate(0, 0); -- END ----------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701291823.MAA20074>