Subject: [libssh2] Compiling on Solaris 10 64Bit??

[libssh2] Compiling on Solaris 10 64Bit??

From: Heiko Jansen <jansen_at_hbz-nrw.de>
Date: Tue, 14 Nov 2006 18:12:30 +0100

Hi all.

I´m trying to compile libssh2 0.14 on Solaris 10, using OpenSSL 0.9.8b,
Sun C 5.8 2005/10/13 (Sun Studio 11), the solaris ld and GNU make 3.80.
It does not work. configure runs fine (see below), but make won´t.

First problem is hardcoded "-Wall" in ~/src/Makefile.in ("-fPIC" seems
also wrong) and ~/Makefile.in.

Removing them gives me a large number of warnings (most of them concerning
incompatible prototypes with prototype: pointer to const char and argument:
pointer to unsigned char) and a new error:
-- snip --
cc -o libssh2.so -shared -lsocket -lm channel.o comp.o crypt.o hostkey.o kex.o mac.o misc.o packet.o publickey.o scp.o session.o sftp.o userauth.o -lsocket -lpthread -xarch=v9b -L/digibib/tools/lib -lcrypto -L/digibib/tools/lib -lz
ld: fatal: option -h and building a dynamic executable are incompatible
ld: fatal: Flags processing errors
make[1]: *** [libssh2.so] Error 1
-- /snip --

This comes from
-- snip --
case "$host" in
    *-cygwin)
    SHLIB_SUFFIX_NAME="dll"
    SHLIB_LDFLAGS="-shared"
    CFLAGS="$CFLAGS -DLIBSSH2_WIN32"
    ;;
    *darwin*)
    SHLIB_SUFFIX_NAME="dylib"
    SHLIB_LDFLAGS="-dynamiclib -flat_namespace"
    CFLAGS="$CFLAGS -DLIBSSH2_DARWIN"
    ;;
    *hpux*)
    SHLIB_SUFFIX_NAME="sl"
    SHLIB_LDFLAGS="-b +vnocompatwarnings -L/lib/pa20_64"
    LDCC="ld"
    ;;
    *)
    SHLIB_SUFFIX_NAME="so"
    SHLIB_LDFLAGS="-shared"
    ;;
esac
-- /snip --
in configure.

After "make clean", setting 'SHLIB_LDFLAGS=""' and rerunning my
configure I get

-- snip --
cc -o libssh2.so -lsocket -lm channel.o comp.o crypt.o hostkey.o kex.o mac.o misc.o packet.o publickey.o scp.o session.o sftp.o userauth.o -lsocket -lpthread -xarch=v9b -L/digibib/tools/lib -lcrypto -L/digibib/tools/lib -lz
Undefined first referenced
 symbol in file
main /opt/SUNWspro/prod/lib/v9/crt1.o
libssh2_poll_channel_write session.o
libssh2_packet_x11_open packet.o
libssh2_packet_queue_listener packet.o
libssh2_poll_listener_queued session.o
ld: fatal: Symbol referencing errors. No output written to libssh2.so
make[1]: *** [libssh2.so] Error 1
-- / snip --

It is possible to have "make" find the libssh2_* symbols by
removing the "inline" from the signature in packet.c and session.c
but that doesn`t look like a clean solution to me.

Also, I have no idea why it looks for a symbol "main", referenced
in crt1.o.

Any help on getting the lib compiled would be highly welcome.
If any other data is needed to locate the problem just tell me.

Heiko

Output from my configure:
-- snip --
~/src/libssh2-0.14> ./configure --prefix=/digibib/tools --with-openssl=/digibib/tools --with-libz=/digibib/tools
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking for gcc... no
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking for socket in -lsocket... yes
checking for ceil in -lm... yes
checking for gcc... (cached) cc
checking whether we are using the GNU C compiler... (cached) no
checking whether cc accepts -g... (cached) yes
checking for cc option to accept ANSI C... (cached) none needed
checking for a BSD-compatible install... /digibib/tools/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for ranlib... ranlib
checking whether byte ordering is bigendian... yes
checking for pkg-config... /usr/bin/pkg-config
checking for OpenSSL... Using explicit path /digibib/tools
checking for libz... Found in /digibib/tools/include /digibib/tools/lib
checking how to run the C preprocessor... cc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for poll... yes
checking for gettimeofday... yes
checking for select... yes
checking for an ANSI C-conforming const... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/libssh2_config.h
-- /snip --

-------------------------------------------------------------------------
SF.net email is sponsored by: A Better Job is Waiting for You - Find it Now.
Check out Slashdot's new job board. Browse through tons of technical jobs
posted by companies looking to hire people just like you.
http://jobs.slashdot.org/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2006-11-14