Add --with-perlbase configure option to specify
an alternative location for installing the Perl modules. This
can be useful for setups that want to run the Perl modules
from a shared filesystem or environments that need to run
multiple versions of OpenSRF simultaneously.
Users of --with-perlbase are responsible for ensuring that
PERL5LIB is set appropriately.
To test
-------
[1] Use --with-perlbase during the configure step, e.g.,
./configure --perl-base /tmp/perl
[2] Run make; make check; sudo make install
[3] Verify that the Perl modules are installed under
/tmp/perl.
[4] Make a change to a Perl source file, then
go to src/perl, then run sudo ./Build install. Verify
that it remembers the --with-perlbase directory
and installs the updated module there.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
export SOCK = @localstatedir@/lock/opensrf
export LOG = @localstatedir@/log/opensrf
export srcdir = @srcdir@
+export PERL_BASE = @PERL_BASE@
opensrfincludedir = @includedir@/opensrf
AM_CFLAGS = $(DEF_CFLAGS)
fi
AC_SUBST([APR_HEADERS])
+AC_ARG_WITH([perlbase],
+[ --with-perlbase=path base location to install Perl modules (default based on Config.pm)],
+[PERL_BASE=${withval}],
+[PERL_BASE=x])
+AC_SUBST([PERL_BASE])
+
# The following Apache version detection code is adapted from
# http://www.gnu.org/software/autoconf-archive/ax_prog_apache.html
# licensed under version 2 of the GNU General Public License, or
./Build install
build-perl:
- perl Build.PL --destdir $(DESTDIR) || make -s build-perl-fail
+ @if [ "${PERL_BASE}" = 'x' ]; then perl Build.PL --destdir $(DESTDIR) || make -s build-perl-fail; else perl Build.PL --install_base ${PERL_BASE} --destdir $(DESTDIR) || make -s build-perl-fail; fi;
build-perl-fail:
echo