Subject: | Unable to build Net::SSH2 on Mac OS X Lion when specifying include directory |
I first ran into this problem on Snow Leopard but I didn't have time to fix it then.
I ran into the problem again today on Lion.
libssh2 is installed in ${HOME}/Library/Perl/
Because of this I have to use the lib= and inc= flags to specify the installation, like:
perl Makefile.PL PREFIX=${HOME}/Library/Perl \
lib=$HOME/Library/Perl/lib \
inc=$HOME/Library/Perl/include
When running make, it starts with:
$ make
llvm-gcc-4.2 -c /Volumes/Users/Users/gyoungbl/Library/Perl/include -arch x86_64 -arch
i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -
I/usr/local/include -Os -DVERSION=\"0.39\" -DXS_VERSION=\"0.39\" "-
I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE" SSH2.c
i686-apple-darwin11-llvm-gcc-4.2: /Volumes/Users/Users/gyoungbl/Library/Perl/include:
linker input file unused because linking not done
i686-apple-darwin11-llvm-gcc-4.2: /Volumes/Users/Users/gyoungbl/Library/Perl/include:
linker input file unused because linking not done
SSH2.xs:16:21: error: libssh2.h: No such file or directory
SSH2.xs:17:26: error: libssh2_sftp.h: No such file or directory
SSH2.xs:18:31: error: libssh2_publickey.h: No such file or directory
Note after -c it has the inc value I specified, but no -I. Tweaking the Makefile so it uses -I$(INC)
instead of $(INC) allows make to build (with a couple of warnings) and make test to pass.