WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: My last (I promise) tantrum: is it possible to run gcc on a Pentium 166?  (Read 5094 times)

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 375
That looks right and the build script for GCC in Slackware 15 shows that it is built for i586 (as are other programs/libraries), so that shouldn't be a problem after all. Still I'd try compiling Xterm in x86 Tiny Core Linux in Virtualbox, since it could be that something went wrong with the architecture setting in Slackware when GCC was compiled, and anyway it avoids potential problems with different library versions between Slackware and Tiny Core (although that shouldn't cause "illegal instruction" errors).

Offline t18

  • Full Member
  • ***
  • Posts: 123
So, Xterm looks for ncurses and I've got it installed on a separate dir.

It looks for curses.h in /usr/include (not /usr/local/include) so I've linked it from the ncurses dir.

Tried to set LIBS but unsuccessfully (not sure what I did): either the default dir /usr/local/include and the ncurses/include dir seems not to work.

I get the following error:

Code: [Select]
/usr/local/bin/ld: xtermcap.o: in function `loadTermcapStrings':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:238:(.text+0x92): undefined reference to `tgetstr'
/usr/local/bin/ld: xtermcap.o: in function `get_termcap':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:493:(.text+0x4f6): undefined reference to `tgetent'
/usr/local/bin/ld: xtermcap.o: in function `get_tcap_erase':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:540:(.text+0x583): undefined reference to `tgetstr'
/usr/local/bin/ld: xtermcap.o: in function `set_termcap':
/mnt/sda1/_aappz/__SRC/xterm-master/./xtermcap.c:598:(.text+0x6f5): undefined reference to `tgetent'
collect2: error: ld returned 1 exit status
make: *** [Makefile:174: xterm] Error 1

Please help, many thanks.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12187
Hi t18
Did the source package you downloaded include a file called configure?
If it did, run:
Code: [Select]
./configure --helpThat should provide information on how to set the default include path.

I also see this in your Makefile:
Code: [Select]
CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H  ........ Your source package seems to have a configuration header file.

It might be the xtermcfg.h file:
Code: [Select]
$(OBJS1) : xterm.h ptyx.h xtermcfg.h
I also see no reference to curses in the Makefile you posted.

Offline t18

  • Full Member
  • ***
  • Posts: 123
Hi Rich,

if I don't symlink curses.h I get the following error:

Code: [Select]
In file included from ./input.c:90:
./termcap.h:63:10: fatal error: curses.h: No such file or directory
  63 | #include <curses.h>
       |
compilation terminated.
make: *** [Makefile:127: input.o] Error 1

In termcap.h there is the following code block:

Code: [Select]
#ifdef HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
#include <curses.h>
#endif


In xtermcfg.h there is the following:

Code: [Select]
#define HAVE_NCURSES_CURSES_H 1 /* AC_CHECK_HEADERS(ncurses/curses.h) */

configure -h mentions CPPFLAGS that I've already (maybe not properly) set.



Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 375
So, Xterm looks for ncurses and I've got it installed on a separate dir.

It looks for curses.h in /usr/include (not /usr/local/include) so I've linked it from the ncurses dir.

There are no ncurses extensions for TC15 (if I assume that's where you're compiling Xterm now), so I assume you mean you linked to "/usr/local/include/ncursesw" from ncursesw-dev.tcz. That's only half the solution, you also need to link against ncursesw instead of ncurses by changing "-lncurses" to "-lncursesw" on the compiler command line in the Makefile.

Or if you actually copied ncurses header files from somewhere else, you're on the wrong track altogether, you need it to use the ncursesw headers.

Here's what I had to do to compile Cscope, which had the same problem of expecting ncurses not ncursesw:

Code: [Select]
./configure --prefix=/usr/local --with-ncurses=/usr/local/include/ncursesw
sed -i -e 's%-I/usr/local/include/ncursesw/include%-I/usr/local/include/ncursesw%g' -e 's%-lncurses%-lncursesw%g' Makefile src/Makefile

The configure script allowed supplying a custom path to ncurses, but it added a false "/include" directory on the end, and kept linking against ncurses instead of ncursesw. So I used Sed to adjust those parts of the two Makefiles which the configure script had generated. You might have to use symlinks to the ncursesw headers since the path looks to be hardcoded in the Xterm source files themselves (or edit those source files), but you still need to edit the Makefile/s to use "-lncursesw".

Offline t18

  • Full Member
  • ***
  • Posts: 123
So, Xterm looks for ncurses and I've got it installed on a separate dir.

It looks for curses.h in /usr/include (not /usr/local/include) so I've linked it from the ncurses dir.

There are no ncurses extensions for TC15 (if I assume that's where you're compiling Xterm now), so I assume you mean you linked to "/usr/local/include/ncursesw" from ncursesw-dev.tcz.


Not really, I just downloaded and compiled the latest ncurses-6.5 source and installed the binary in a separate dir.

That's because there are a lot of programs that requires it.

It has a include/ncursesw subdir though, containing curses.h.

I linked it to /usr/include to avoid the above error, but the compilation process seems to ignore the CPPFLAGS=-I/<path-to-ncurses_6.5/include/ncursesw>.


I had also changed the termcap.h code to <ncursesw/curses.h> but no way.
« Last Edit: May 30, 2025, 04:42:05 AM by t18 »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15209
I’ll have a look, which source code tarball are you using?

Offline t18

  • Full Member
  • ***
  • Posts: 123
I’ll have a look, which source code tarball are you using?

https://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gz

Thank you so much  :)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15209
Not ncurses, xterm

Offline t18

  • Full Member
  • ***
  • Posts: 123
Sorry, my insomnia hit me again :)

https://github.com/joejulian/xterm.git

Many thanks :)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15209
This works:
Code: [Select]
tce-load -i compiletc ncursesw-dev ncursesw-utils libXaw-dev libXinerama-dev libXft-dev

wget https://invisible-mirror.net/archives/xterm/xterm-399.tgz

tar xf xterm-399.tgz

cd xterm-399

sed -i '/v0/{n;s/new:/new:kb=^?:/}' termcap
printf '\tkbs=\\177,\n' >> terminfo

CPPFLAGS="-I /usr/local/include/ncursesw" TERMINFO="/usr/local/share/terminfo" CC="gcc -flto -march=i486 -mtune=i686 -Os -pipe" CXX="g++ -flto -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"  ./configure --prefix=/usr/local --localstatedir=/var --sysconfdir=/etc --with-app-defaults=/etc/X11/app-defaults --with-tty-group=staff

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;

make [ 0m 50.14s]
sudo make install

Offline t18

  • Full Member
  • ***
  • Posts: 123
¡Muchas gracias, señor!  :)

It seem that what I found is not the "latest xterm" as they stated (it was definitely so at that time).

Well, indeed your work is superb and your settings work.

But I'd like to put it on my P166 and can't do "make install" on it since it's not possible, it seems, to install gcc on it.

Then, my best attempt was to install on a separate dir of my Virtualbox-TC, zip it and unpack it on my P166.

I successfully did that way for other programs yet, but changing the xterm --prefix it seems to me I split the installation somehow.

Not sure on how to set the remaining options:

Code: [Select]
--localstatedir=/var --sysconfdir=/etc --with-app-defaults=/etc/X11/app-defaults
Putting $PREFIX on them causes the old error.

Sorry, my IT knowledge is limited.

Many thanks








Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15209
xterm posted to x86 16.x repo

Offline t18

  • Full Member
  • ***
  • Posts: 123
xterm posted to x86 16.x repo

I'm so grateful.

I had used these option to enable unicode:

Code: [Select]
--enable-16bit-chars --enable-256-color
Are there any alternative methods to enable unicode?

Many thanks


Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15209
You could try uxterm included with xterm or right-click on the xterm window and see if that brings up options?