houst0n has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys,

I'm in the process of getting perl 5.12.1 into to our build system (Solaris), all goes well and I end up with a nice package with 32 and 64 bit perl split up in the correct sort of way. So far so good...

However, I also wrote some scripts to query cpan and add a subsection of common modules to the build system (Our build system is Makefile based, similar to FreeBSD's ports) however modules which require shared objects are not linking properly with their libfoo dependencies.

When I try to build, for example, Crypt::OpenSSL::Random MakeMaker seems to completely ignore the contents of 'LIBS', -lssl is nowhere to be found in the produced Makefile.

(Note, this also happens outside the build system)

As a result, building a module I can see this in the make output:
Note (probably harmless): No library found for -lssl
Note (probably harmless): No library found for -lcrypto

A bit lower down:

gcc -G -L/opt/bw/lib/i386 -L/opt/bw/lib Random.o -o
blib/arch/auto/Crypt/OpenSSL/Random/Random.so \
\

chmod 755 blib/arch/auto/Crypt/OpenSSL/Random/Random.so

So it seems MakeMaker is looking into the wrong place (these libs are present in /opt/bw/lib/i386, and if I add -lssl -lcrypto to the line above then things are linked fine) and these libs are not being added to some MakeMaker Variable or other.

Any suggestions? I spent a while digging through the src (seems this is handled by Kid.pm) but no real progress.

Houst0n
  • Comment on MakeMaker failing to locate libs for shared objects

Replies are listed 'Best First'.
Re: MakeMaker failing to locate libs for shared objects
by Anonymous Monk on Aug 01, 2010 at 19:46 UTC
    Try prefixing LIBS with ":nosearch", don't ask me to explain this idiocy
      Unfortunately that didn't help.

      Thanks for the tip though I'll have a dig around ExtUtils::Liblist next.
        Unfortunately that didn't help.

        How? If -lssl -lcrypto were being removed from the LIBS argument, adding :nosearch would ensure that they aren't removed. I just tested this

        Crypt-OpenSSL-Random-0.04$ perl Makefile.PL Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lssl Note (probably harmless): No library found for -lcrypto Note (probably harmless): No library found for -lmoldname Note (probably harmless): No library found for -lkernel32 Note (probably harmless): No library found for -luser32 Note (probably harmless): No library found for -lgdi32 Note (probably harmless): No library found for -lwinspool Note (probably harmless): No library found for -lcomdlg32 Note (probably harmless): No library found for -ladvapi32 Note (probably harmless): No library found for -lshell32 Note (probably harmless): No library found for -lole32 Note (probably harmless): No library found for -loleaut32 Note (probably harmless): No library found for -lnetapi32 Note (probably harmless): No library found for -luuid Note (probably harmless): No library found for -lws2_32 Note (probably harmless): No library found for -lmpr Note (probably harmless): No library found for -lwinmm Note (probably harmless): No library found for -lversion Note (probably harmless): No library found for -lodbc32 Note (probably harmless): No library found for -lodbccp32 Writing Makefile for Crypt::OpenSSL::Random Crypt-OpenSSL-Random-0.04$ grep lcrypto Makefile # LIBS => [q[-lssl -lcrypto]] Crypt-OpenSSL-Random-0.04$ perl Makefile.PL LIBS=":nosearch -lssl -lcr +ypto" Writing Makefile for Crypt::OpenSSL::Random $ grep lcrypto Makefile # MakeMaker ARGV: (q[LIBS=:nosearch -lssl -lcrypto]) # LIBS => [q[-lssl -lcrypto]] EXTRALIBS = -lssl -lcrypto -lmoldname -lkernel32 -luser32 -lgdi32 -lwi +nspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -lo leaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -l +odbccp32 LDLOADLIBS = -lssl -lcrypto -lmoldname -lkernel32 -luser32 -lgdi32 -lw +inspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -l oleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 - +lodbccp32 cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL "LIBS=:nosearch - +lssl -lcrypto" $(PERLRUN) Makefile.PL "LIBS=:nosearch -lssl -lcrypto" LIBS=':nosearch -lssl -lcrypto' Crypt-OpenSSL-Random-0.04$