Code

build system (Perl bindings): Make Makefile.PL's PREFIX/INSTALL_BASE optional.
authorSebastian Harl <sh@tokkee.org>
Tue, 20 Nov 2012 13:44:43 +0000 (14:44 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 6 Apr 2013 18:02:48 +0000 (11:02 -0700)
Both options may cause problems:

 - PREFIX might clash with INSTALL_BASE being set in $PERL_MM_OPT.
 - INSTALL_BASE without any further options set will install into non-standard
   directories in many cases.

Rather, use PREFIX=${prefix} as default but overwrite that if
--with-perl-bindings=... has been used.

Thanks to faxm0dem for reporting the INSTALL_BASE problems on IRC and
bvarner and nirik for reporting this in GH #177 and #196.

This is a follow-up / fix for 97e8f346a88eccf4d1608c21d5cc6ee9620c1c41.

Fixes Github issue #290.

Signed-off-by: Florian Forster <octo@collectd.org>
bindings/Makefile.am
configure.in

index 50cd727fc9030be20efd30f3b856c8c0baf814e7..b2ee4c113f187630bed46ad8df73a9c8db4b81b6 100644 (file)
@@ -45,7 +45,7 @@ perl: buildperl/Makefile
 
 buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \
        $(top_builddir)/config.status
-       cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(DESTDIR)$(prefix) @PERL_BINDINGS_OPTIONS@
+       cd buildperl && @PERL@ Makefile.PL @PERL_BINDINGS_OPTIONS@
 
 buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status
 
index 4f96b15054f77fb60445ea84d1b9ec4682b8c09e..a20a25f48e81f5eabd97800b57cd0981cae7b3fe 100644 (file)
@@ -5084,6 +5084,7 @@ then
 fi
 
 dnl Perl bindings
+PERL_BINDINGS_OPTIONS="PREFIX=${prefix}"
 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
 [
        if test "x$withval" != "xno" && test "x$withval" != "xyes"
@@ -5091,12 +5092,10 @@ AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@
                PERL_BINDINGS_OPTIONS="$withval"
                with_perl_bindings="yes"
        else
-               PERL_BINDINGS_OPTIONS=""
                with_perl_bindings="$withval"
        fi
 ],
 [
-       PERL_BINDINGS_OPTIONS=""
        if test -n "$perl_interpreter"
        then
                with_perl_bindings="yes"