GOT IT. For anyone interested:
- In Solaris, run the shell with perlgcc and configure CPAN for GCC:
(Maybe some of these options are irrelevant - feel free to correct me)
o conf make /usr/sfw/bin/gmake
o conf make_arg ''
o conf make_install_arg ''
o conf make_install_make_command '/usr/sfw/bin/gmake'
o conf mbuild_arg ''
o conf mbuild_install_arg ''
o conf tar /usr/sfw/bin/gtar
- In makepl_arg:
- Don't add 'LIBS=-L /your_unixodbc_home/lib'; use '-o /your_unixODBC_home', or just export UNIXODBC=/your_unixODBC_home before running the CPAN shell - Makefile.PL will set -L and -l for you.
- To avoid using the dreaded LD_LIBRARY_PATH, add 'LDDLFLAGS="-Wl,-rpath,your_unixODBC_home/lib -G"' to makepl_arg. This will tell GCC to tell ld to add the location of your ODBC libraries to the runtime path (RPATH). Because you're overriding the LDDLFLAGS, you need to add "-G" so that GCC produces a shared object.
So, this incantation should work:
o conf makepl_arg 'LDDLFLAGS="-G -Wl,-rpath,/your_unixodbc_home/lib" -o /your_unixodbc_home'
Note: in my setup, I had to issue o conf commit, exit the shell and run it again for these changes to work. Don't ask.
Note 2: Turns out that the relocation error happened because ld.so.1 was loading the *wrong* library from /my_unixodbc_home/lib. I got the clue from 'Enabling ODBC support in Perl with Perl DBI and DBD::ODBC' by Easysoft:
The undefined symbol SQLParamData is reported by the dynamic linker as the first symbol it looked for but could not find.
This happens when building DBD::ODBC with unixODBC because the Makefile.PL is now incompatible with newer unixODBC releases. The Makefile.PL searches ODBCHOME/lib for *odbc*.* and finds libodbc.so AND libodbcinst.so. It then goes on to choose libodbcinst.so which is the incorrect shared object.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||