Solved ngspice_rework34

Hello. I'm trying to build the last version of ngspice on FreeBSD. I stuck on the following error:


../../../../src/frontend/parser/complete.c: In function 'cp_ccon':
../../../../src/frontend/parser/complete.c:394:24: error: 'TCGETS' undeclared (first use in this function); did you mean 'TIOCGETA'?
394 | # define TERM_GET TCGETS
| ^~~~~~
../../../../src/frontend/parser/complete.c:413:37: note: in expansion of macro 'TERM_GET'
413 | (void) ioctl(fileno(cp_in), TERM_GET, &OS_Buf);
| ^~~~~~~~
../../../../src/frontend/parser/complete.c:394:24: note: each undeclared identifier is reported only once for each function it appears in
394 | # define TERM_GET TCGETS
| ^~~~~~
../../../../src/frontend/parser/complete.c:413:37: note: in expansion of macro 'TERM_GET'
413 | (void) ioctl(fileno(cp_in), TERM_GET, &OS_Buf);
| ^~~~~~~~
../../../../src/frontend/parser/complete.c:395:24: error: 'TCSETS' undeclared (first use in this function); did you mean 'TIOCSETD'?
395 | # define TERM_SET TCSETS
| ^~~~~~
../../../../src/frontend/parser/complete.c:422:37: note: in expansion of macro 'TERM_SET'
422 | (void) ioctl(fileno(cp_in), TERM_SET, &sbuf);
| ^~~~~~~~


After some research I found that TCGETS and TCSETS are linux specific ioctls. Since this is complete terra incognita for me, would you please give some hint on what to use as replacement for these definitions on FreeBSD?
Many thanks!

===========
Edit
===========
I was able to build ngspice_rework34 successfully once I added ``--enable-shared'' option. Here is my configure command:
CPPFLAGS="-I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/ncurses" ../configure --enable-cider --with-x --disable-debug --prefix=/opt/ngspice34 --with-readline=yes --enable-shared

Here are most of the packages that I installed (reading the INSTALL file from ngspice archive
pkg install bison flex libXaw libXmu libXext libXft fontconfig libXrender libX11 readline freetype2


Probably some other tools like autotools and gmake are required.

Also please refer to the port's Makefile:

I didn't run any simulations yet, but I hope it works well.
Good luck!

PS: Also I changed two Makefiles (one in release direcory, where I did 'configure' and one in the main directory) and replaced cc with gcc9. Don't know if this is required, just the change stood there after I discovered ``--enable-shared''
 
did you google it even? it's not linux-specific if it's in bsd's tty. obviously you need to include the header which declares it. cd /usr/include (or maybe /usr/local/include or ports), grep -r "TCGETS" *, and see which files use TCGETS.

You may need have installed base source to find it, which is a different howto and is in the handbook. (not all development headers are included in /usr/include, but if tty is build then tty's .h are in the source directory)

when porting you might have to mind if ncurses or curses is installed which is a related tty issue. they aren't the same and some apps accept only one of the two while others accept either when notified before compiling.

 
Back
Top