Subject: port-pmax/6776: g++ does not work without -ltermcap
To: None <>
From: None <>
List: netbsd-bugs
Date: 01/09/1999 15:55:39
>Number:         6776
>Category:       port-pmax
>Synopsis:       g++ does not work without -ltermcap
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-pmax-maintainer (NetBSD/pmax Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan  9 07:05:00 1999
>Originator:     Thorsten Frueauf
>Release:        1.3.3
System: NetBSD cyberdec-4 1.3.3 NetBSD 1.3.3 (CYBERDEC-4) #0: Sat Jan 2 01:47:35 MET 1999 milano@cyberdec-4:/usr/src/sys/arch/pmax/compile/CYBERDEC-4 pmax

[frueauf@cyberdec-4]/tmp> g++ -v
 /usr/bin/cc -v
gcc version

I tried to compile pkgsrc/x11/kdelibs, but the configure script

checking for a C++-Compiler... 
checking for g++... g++
checking whether the C++ compiler (g++ -O -Wl,-R/usr/X11R6/lib -Wl,-R/usr/pkg/lib) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.
*** Error code 1

As I was very surprised, I digged into the configure script to find out what
it tries to compile:

#include "confdefs.h"

not too complicated, huh? condefs.h contains:

#define PACKAGE "kdelibs"
#define VERSION "1.0pre"

Now trying to compile by hand:

[frueauf@cyberdec-4]/tmp> g++ -O -Wl,-R/usr/X11R6/lib -Wl,-R/usr/pkg/lib conftest.C -o conftest 
/usr/lib/ undefined reference to `tgetnum'
/usr/lib/ undefined reference to `tgoto'
/usr/lib/ undefined reference to `tgetflag'
/usr/lib/ undefined reference to `tputs'
/usr/lib/ undefined reference to `tgetent'
/usr/lib/ undefined reference to `tgetstr'

Those symbols can be found in libterm, thus:

[frueauf@cyberdec-4]/tmp> g++ -O -Wl,-R/usr/X11R6/lib -Wl,-R/usr/pkg/lib conftest.C -o conftest -ltermcap

I consider this a bug, as this breaks compiling every package that needs
g++ to compile. Please also note that this bug is not on every architecture,
so I suspect this is a pmax-only problem.

At least I tried the very same on NetBSD/amiga 1.3.3, and g++ works there
as expected.

Try to compile anything that needs g++.

The obvoius workaround would be to define LDFLAGS as -ltermcap on pmax
by default, but thats really a hack. I don't know why g++ is not
proporly build on pmax.

If this is fixed for current (egcs is default there, than please make
sure this gets a pullup-request for a possoble 1.3.4.

If someone finds a fix for that I would be glad to get a patch, and it
would be nice if tht patch would get published on the ftp server too.
g++ does not work without -ltermcap