Fossil

View Ticket
Login

View Ticket

Ticket Hash: 6981de95b677bcc5ba7da4818015f1e5c049463f
Title: Makefile for OpenSolaris/Solaris is not correct
Status: Closed Type: Build_Problem
Severity: Important Priority:
Subsystem: Resolution: Fixed
Last Modified: 2011-11-18 05:21:55
Version Found In: Fossil-86cbb69af2
Description:
With following diff of Makefile,
root@600m:/export/home/tjyang/Fossil-076f7adff2# diff Makefile Makefile.orig
39c39
< # LIB += -lsocket
---
> # LIB += lsocket
41c41
< LIB += -lsocket -lnsl
---
> # LIB += -lsocket -lnsl
root@600m:/export/home/tjyang/Fossil-076f7adff2#

I was able to build fossil on opensolaris b124.

root@600m:/export/home/tjyang/Fossil-076f7adff2# uname -a
SunOS 600m 5.11 snv_122 i86pc i386 i86pc Solaris
root@600m:/export/home/tjyang/Fossil-076f7adff2# cat /etc/release
                       OpenSolaris Development snv_122 X86
           Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 28 August 2009
root@600m:/export/home/tjyang/Fossil-076f7adff2# ls -l fossil
-rwxr-xr-x 1 root root 1582864 2009-10-13 23:37 fossil
root@600m:/export/home/tjyang/Fossil-076f7adff2#

stephan added on 2009-10-17 12:07:44:
This seems to depend on the OpenSolaris version. i added those lines about a year ago, and -lnsl wasn't needed on the Nexenta OpenSolaris i used at the time. i don't remember if it was an error to link against it, though.


anonymous added on 2009-10-18 02:26:59:
at least following diff need to be applied. "lsocket" need to be typed as "-lsocket".

< # LIB += -lsocket
---
> # LIB += lsocket

tj yang


anonymous added on 2009-12-29 19:15:49:
Hi, Can someone with upload/write permission to correct the error for Solaris/OpenSolaris OS.

1.

.o sync.o tag.o th_main.o timeline.o tkt.o tktsetup.o undo.o update.o url.o user.o verify.o vfile.o wiki.o wikiformat.o winhttp.o xfer.o zip.o sqlite3.o th.o th_lang.o -lz  -lsocket
Undefined                       first referenced
 symbol                             in file
gethostbyname                       http_socket.o  (symbol belongs to implicit dependency /lib/libnsl.so.1)
inet_addr                           http_socket.o  (symbol belongs to implicit dependency /lib/libnsl.so.1)
inet_ntoa                           cgi.o  (symbol belongs to implicit dependency /lib/libnsl.so.1)
ld: fatal: symbol referencing errors. No output written to fossil
collect2: ld returned 1 exit status
gmake: *** [fossil] Error 1
root@600m:/pub/fossil/Fossil-86cbb69af2#

anonymous added on 2009-12-29 19:24:56:
Please apply following patch to Makefile. I tested on on Solaris 10(sparc and x86) and OpenSolaris 124 up to 130 revision.

--- Makefile.orig       2009-12-29 13:20:21.449765912 -0600
+++ Makefile    2009-12-29 13:20:54.935476106 -0600
@@ -35,9 +35,7 @@
 #    chroot jail.
 #
 LIB = -lz $(LDFLAGS)
-# If you're on OpenSolaris:
-# LIB += lsocket
-# Solaris 10 needs:
+# Solaris 10/OpenSolaris  needs:
 # LIB += -lsocket -lnsl
 # My assumption is that the Sol10 flags will work for Sol8/9 and possibly 11.


anonymous added on 2009-12-29 20:19:21:
Correction, OpenSoaris 130 has following linking error.


gcc -Os -Wall -o fossil add.o allrepo.o bag.o blob.o branch.o browse.o captcha.o cgi.o checkin.o checkout.o clearsign.o clone.o comformat.o configure.o construct.o content.o db.o delta.o deltacmd.o descendants.o diff.o diffcmd.o doc.o encode.o file.o finfo.o http.o http_socket.o http_transport.o info.o login.o main.o manifest.o md5.o merge.o merge3.o name.o pivot.o pqueue.o printf.o rebuild.o report.o rss.o rstats.o schema.o search.o setup.o sha1.o shun.o skins.o stat.o style.o sync.o tag.o th_main.o timeline.o tkt.o tktsetup.o undo.o update.o url.o user.o verify.o vfile.o wiki.o wikiformat.o winhttp.o xfer.o zip.o sqlite3.o th.o th_lang.o -lsocket -lnsl

Undefined first referenced symbol in file crc32 zip.o deflateEnd blob.o deflateInit2_ zip.o uncompress blob.o compress blob.o deflate blob.o deflateInit_ blob.o ld: fatal: symbol referencing errors. No output written to fossil collect2: ld returned 1 exit status gmake: *** [fossil] Error 1 root@600m:/pub/fossil/Fossil-86cbb69af2# root@600m:/pub/fossil/Fossil-86cbb69af2# cat /etc/release OpenSolaris Development snv_130 X86 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 18 December 2009 root@600m:/pub/fossil/Fossil-86cbb69af2#


anonymous added on 2009-12-29 20:30:15:
This is the new patch for OpenSolaris 130, zlib need to be described in LIB variable.


--- Makefile.orig 2009-12-29 13:20:21.449765912 -0600 +++ Makefile 2009-12-29 14:27:05.946202215 -0600 @@ -35,10 +35,8 @@ # chroot jail. # LIB = -lz $(LDFLAGS) -# If you're on OpenSolaris: -# LIB += lsocket -# Solaris 10 needs: -# LIB += -lsocket -lnsl +# Solaris 10/OpenSolaris needs: +LIB += -lsocket -lnsl # My assumption is that the Sol10 flags will work for Sol8/9 and possibly 11.

gcc info on opensolaris 130.

root@600m:/pub/fossil/Fossil-86cbb69af2# gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs
Configured with: /builds2/sfwnv-gate/usr/src/cmd/gcc/gcc-3.4.3/configure 
<snip>
-languages=c,c++,f77,objc --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-20050802)
root@600m:/pub/fossil/Fossil-86cbb69af2#


steveb added on 2011-07-22 22:46:36 UTC:
Can you test with the latest version?

./configure; make

It should find and link against all the appropriate libraries.


steveb added on 2011-11-18 05:21:55 UTC:
No response from the OP, but it should be fixed.