aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac10
-rw-r--r--perl/Makefile.am6
-rwxr-xr-xscripts/copy-from-other-stores.pl.in2
-rwxr-xr-xscripts/nix-build.in2
-rwxr-xr-xscripts/nix-channel.in2
-rwxr-xr-xscripts/nix-collect-garbage.in2
-rwxr-xr-xscripts/nix-install-package.in2
7 files changed, 15 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 1e8665992..1b6154a2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,14 @@ fi
AC_MSG_RESULT(yes)
+# Figure out where to install Perl modules.
+AC_MSG_CHECKING([for the Perl installation prefix])
+perlversion=$($perl -e 'use Config; print $Config{version};')
+perlarchname=$($perl -e 'use Config; print $Config{archname};')
+AC_SUBST(perllibdir, [$\(libdir\)/perl5/site_perl/$perlversion/$perlarchname])
+AC_MSG_RESULT($perllibdir)
+
+
NEED_PROG(cat, cat)
NEED_PROG(tr, tr)
AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH],
@@ -283,7 +291,7 @@ fi
# Check for the required Perl dependencies (DBI and DBD::SQLite).
-perlFlags="-I${libdir}/perl5/site_perl"
+perlFlags="-I$perllibdir"
AC_ARG_WITH(dbi, AC_HELP_STRING([--with-dbi=PATH],
[prefix of the Perl DBI library]),
diff --git a/perl/Makefile.am b/perl/Makefile.am
index ccb08b447..12293fc05 100644
--- a/perl/Makefile.am
+++ b/perl/Makefile.am
@@ -1,7 +1,3 @@
-perlversion := $(shell perl -e 'use Config; print $$Config{version};')
-perlarchname := $(shell perl -e 'use Config; print $$Config{archname};')
-perllibdir = $(libdir)/perl5/site_perl/$(perlversion)/$(perlarchname)
-
PERL_MODULES = lib/Nix/Store.pm lib/Nix/Manifest.pm lib/Nix/GeneratePatches.pm lib/Nix/SSH.pm lib/Nix/CopyClosure.pm lib/Nix/Config.pm.in
# Hack required by "make check".
@@ -24,7 +20,7 @@ libNixStore_la_LIBADD = $(top_srcdir)/src/libstore/libstore.la
AM_CXXFLAGS = \
-I$(top_srcdir)/src -I$(top_srcdir)/src/libutil -I$(top_srcdir)/src/libstore \
- -I$(shell perl -e 'use Config; print $$Config{archlibexp};')/CORE
+ -I$(shell $(perl) -e 'use Config; print $$Config{archlibexp};')/CORE
lib/Nix/Store.cc: lib/Nix/Store.xs
xsubpp $^ -output $@
diff --git a/scripts/copy-from-other-stores.pl.in b/scripts/copy-from-other-stores.pl.in
index 10130c089..b930b7207 100755
--- a/scripts/copy-from-other-stores.pl.in
+++ b/scripts/copy-from-other-stores.pl.in
@@ -1,4 +1,4 @@
-#! @perl@ -w
+#! @perl@ -w @perlFlags@
use strict;
use File::Basename;
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 68c24b75d..a4615e4bd 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -1,4 +1,4 @@
-#! @perl@ -w -I@libexecdir@/nix
+#! @perl@ -w @perlFlags@
use strict;
use Nix::Config;
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in
index 9bfa04722..e54d0d370 100755
--- a/scripts/nix-channel.in
+++ b/scripts/nix-channel.in
@@ -1,4 +1,4 @@
-#! @perl@ -w
+#! @perl@ -w -I@libexecdir@/nix
use strict;
use Nix::Config;
diff --git a/scripts/nix-collect-garbage.in b/scripts/nix-collect-garbage.in
index 00e61a24b..835213226 100755
--- a/scripts/nix-collect-garbage.in
+++ b/scripts/nix-collect-garbage.in
@@ -1,4 +1,4 @@
-#! @perl@ -w
+#! @perl@ -w @perlFlags@
use strict;
use Nix::Config;
diff --git a/scripts/nix-install-package.in b/scripts/nix-install-package.in
index 178b14c74..951c2918f 100755
--- a/scripts/nix-install-package.in
+++ b/scripts/nix-install-package.in
@@ -1,4 +1,4 @@
-#! @perl@ -w
+#! @perl@ -w @perlFlags@
use strict;
use File::Temp qw(tempdir);