----- Original Message -----
From: "Mark T. Kennedy" <[EMAIL PROTECTED]>
.
.
i read ExtUtils::MakeMaker completely and looked at SDBM_File in the
standard
perl dist. it looks like there is a way to add rules to the generated
make
file and you can use that to cd into a subdir and run a make to build a
shared
library. but how do you tell the subdir makefile where to install it?
Good question. I don't know the answer. There are probably others here who
*can* help. Otherwise the MakeMaker mailing list might be the place to ask.
and how do you update the .pm file (the Inline::C 'LIBS' setting) to point
at it when it is local for testing and installed for prod?
The 'LIBS' setting can, of course, point to both locations:
LIBS => '-L/path/for_testing -L/path_after_installation -lyourlib',
I envisage that you can specify the '/path/for_testing' as a relative path,
in which case that's easy, but the '/path_after_installation' is probably
not known in advance.
If the '.pm' file is able to work out where the library is, you could do
something like this:
------------------
BEGIN {
$test_path = # rel path to the lib
# Code that determines the fully qualified location of the lib
after
# installation, and assigns that value to $install_path
}
use Inline C => Config =>
ENABLE => AUTOWRAP,
LIBS = > "-L$test_path -L$install_path -lyourlib",
.
.
-------------------
Of course that BEGIN{} block gets executed every time the module is loaded -
slightly wasteful, but presumably of little significance. And it assumes
that .pm file will have the capability of finding the lib after it has been
installed.
Or you could have the Makefile.PL rewrite the pm file (inserting the correct
value for '/path_after_instalation') once it *does* know where the library
is going to be installed. However, I don't know how the Makefile.PL gathers
that info ..... I think it's do-able (I can think of a kludge - where the
user gets prompted to supply the location, and the Makefile.PL uses that
info when rewriting the pm file), and the only solution I can think of if
other methods, already mentioned, are inapplicable.
Cheers,
Rob