Hi all,
I'm having a tremendous amount of difficulty figuring out how to get my sw
to work with autoconf.
I've read through the autoconf manual, the m4 manual, and even went out and
bought a copy of "Gnu Autoconf, automake, and libtool". However, none of
these texts seem to be aimed at the beginner, nor do they address the use of
autoconf with software made up of what amounts to just shell scripts.
The problem I'm having is this. I've written a utility in perl which relies
upon a perl library module I've written as well. I want to be able to allow
the end-user of my package install it where ever they wish. Part of the
problem I have is that perl has a list of built-in paths it searches for
loadable modules in. The user may or may not want to install my package such
that my module ends up in one of these paths.
Here's what I need to test for within my configure.in file, but can't seem to
figure out how:
if user specified --libdir
then
if --libdir is in perl's search path
then
do nothing
else
add BEGIN block to main perl program
# Assuming I'd use AC_SUBST_FILE somehow
fi
else
place library into site_perl libdir
fi
What I have figured out so far is that I can test for --libdir within
configure.in by testing the $libdir variable. What I need now is to:
- figure out whether that is contained within the list of
directories perl already uses
- figure out what the default location for installing
3rd party modules into is.
Both of these are simple from the command line, it's the incorporating into
configure.in that I'm having trouble with.
You can find the answers to both questions using 'perl -V':
perl "-V:install.*" will return the locations to install
various perl-related things under.
perl "-V:installsitelib" will return the location of where to install
local site related libraries under
(this is where I want to install by default
if no other location is specified)
perl -le 'print join $/, @INC' will return the ordered list of locations
where perl searches for libraries
I guess the thing I'm having the most difficulty in compreheding is how do I
execute a shell command and store the output into a variable to then use later
in various tests.
I'd greatly appreciate any help anyone can provide in writing a configure.in
to accomplish these tasks.
Thanks a lot,
--
Seeya,
Paul
----
I'm in shape, my shape just happens to be pear!
If you're not having fun, you're not doing it right!