Ticket #9 (closed defect)

Opened 11 years ago

Last modified 11 years ago

Fails to compile under HPUX 11.11 - HP ANSI C compiler

Reported by: emmanuel-hp Owned by:
Priority: normal Milestone:
Component: Version:
Keywords: Cc: emmanuel-hp, sarag
Blocked By: Blocks:


The library libssh2-0.12 fails to compile under HPXU
11.11 using the HP ANSI C compiler. A few modifications
are required in order to compile the project.

The inline directive is not recognized by the compiler.
Edit the file include/libssh2_priv.h and add the
following lines after the includes:

#ifdef hpux
# define inline

Comment the following lines in the file Makefile:
$(CC) -o ssh2_sample.o ssh2_sample.c $(CFLAGS)
$(CC) -o ssh2_sample ssh2_sample.o $(LIBS)

Modify the following lines in the file src/Makefile:

libssh2.so: $(OBJECTS)

$(CC) -o libssh2.so $(SHLIB_LDFLAGS) $(OBJECTS)

$(LIBS) $(LDFLAGS) -shared -lm


libssh2.so: $(OBJECTS)

ld -b +vnocompatwarnings -L/lib/pa20_64 -o libssh2.so


The shared library has a wrong name, under HPUX the
shared libraries are expected to be named libshh2.sl
and not libssh2.sl

Change History

comment:1 Changed 11 years ago by sarag

Versions of your suggested changed applied to CVS (with the
exception that most of these were applied at to the
Makefile.in templates rather than the generated
Makefiles). I also made ssh2_sample a separate target
(make sample) rather than commenting it out completely.

If you feel adventurous enough to try a CVS build please do
a checkout and:
autoconf && autoheader && ./configure && make

Thanks for the bug report and for the included fixes.

comment:2 Changed 11 years ago by emmanuel-hp

Thanks for the quick follow up!

I tried your 'dangerous' suggestion and the new changes work
like a charm. I was able to compile and install the library
without any modifications.

Although, since my target is HPUX and that I don't have the
GNU utilities I had to perform the CVS checkout, the
autoconf and the autoheader from a linux computer. I am
assuming that this shouldn't affect at all the compilation
steps. I then packed the libssh2 folder and performed the
next steps under the HPUX environment. Everything worked.

Do you know when there will be a next release of the
library? Because until there is a next release I am afraid
that I won't be able to use the CVS version, therefore I
will still need to apply the patches manually.

comment:3 Changed 11 years ago by anonymous

Logged In: NO

Yeah, doing autoconf && automake on one system
then ./configure && make on another is fine. This is
essentially how the release process works in fact.

I run make dist on my dev box (a linux machine) which
tar -zcf libssh2-$(VERSION).tgz file/list/foo

Which sounds like...basicly just what you did... (Note:
okay it does a couple other steps, but these three are the
only really relevant ones).

Anyway, new versions....I'm looking at some performance
issues in the packet loop with another developer at the
moment. If we don't have a good fix by mid-next week I'll
just go ahead and commit the changes that we've got right
now, otherwise we might procrastinate the release to get
the performance stuff in.

Note: See TracTickets for help on using tickets.