Skip to content
Tcl Source Code View Ticket
Login

View Ticket

When compiling for Solaris 2.6, the Makefile must be hacked

Closed / Invalid218292ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:55:47
OriginalBugID: 3510 Bug
Version: 8.2.1
SubmitDate: '1999-11-08'
LastModified: '1999-11-08'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
OSVersion: SunOS  5.7 Generic_106541-02 sun4u sparc SUNW,Ultra-5_10System =
Machine: Sun Ultra-10
FixedDate: '2000-10-25'
ClosedDate: '1999-11-08'


Name:
Eric J. Meyer

Comments:
Solution:  Remove bad switches from AC_FLAGS variable in the Makefile and add "-lsocket" to the Makefile LIBS variable.

ReproducibleScript:
./unix/configure 
# Generated automatically using autoconf version 2.13 

1)  The configure script reported there was no "gettimeofday" function defined even though one existed in my /usr/include/sys/time.h.  This erroneously turns on the -DNO_GETTOD=1 and the  -DGETTOD_NOT_DECLARED=1 switches in the Makefile.

2)  The configure script erroneously adds the -DHAVE_NET_ERRNO_H=1 switch even though there is no errno.h file in my /usr/include/net directory.  There is an errno.h in /usr/include.

3)  The "-lsocket" library switch is not included in the Makefile.  I'm not sure where configure decides this, but it looks to be around line 3696.

ObservedBehavior:
1)  The bad -DNO_GETTOD=1 and -DGETTOD_NOT_DECLARED=1 switches in the Makefile cause the following compilation error:

../generic/../unix/tclUnixPort.h:255: conflicting types for `gettimeofday'
/usr/include/sys/time.h:389: previous declaration of `gettimeofday'
*** Error code 1
make: Fatal error: Command failed for target `tclAlloc.o'

2)  The bad -DHAVE_NET_ERRNO_H=1 switch in the Makefile causes the following compilation error:

../generic/../unix/tclUnixPort.h:42: net/errno.h: No such file or directory
In file included from ../generic/tclInt.h:30,

3)  The missing "-lsocket" causes the following linker error:

gcc -pipe  tclAppInit.o -L/cirrus/src/tcl8.2.1/unix -ltcl8.2 -ldl  -lm -lc  -Wl,-R,/usr/local/lib -o tclsh
Undefined                       first referenced
 symbol                             in file
socket                              /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
getpeername                         /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
recv                                /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
gethostbyname                       /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
accept                              /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
send                                /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
bind                                /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
setsockopt                          /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
getservbyname                       /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
gethostbyaddr                       /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
getsockopt                          /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
inet_addr                           /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
inet_ntoa                           /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
getsockname                         /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
listen                              /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
connect                             /cirrus/src/tcl8.2.1/unix/libtcl8.2.so
ld: fatal: Symbol referencing errors. No output written to tclsh
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `tclsh'

DesiredBehavior:
I expect not to get the compilation errors ;>



This was due to not using 'make distclean' between 2.7 and 2.6. 
-- 11/08/1999 hobbs
welch Closed ticket [218292ffff]. [History diff]2000-10-26 08:18:58
dgp Ticket [218292ffff]: 4 changes [History diff]2001-04-19 04:11:35
Log in (anonymous is fine) to add a comment.