* Add a -I flag to the Perl bindings to nix-build and some other

scripts.
* Include the version and architecture in the -I flag so that there is
  at least a chance that a Nix binary built for one Perl version will
  run on another version.
This commit is contained in:
Eelco Dolstra 2012-01-05 20:33:46 +00:00
parent b52966e821
commit a7366a764a
7 changed files with 15 additions and 11 deletions

View file

@ -181,6 +181,14 @@ fi
AC_MSG_RESULT(yes) 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(cat, cat)
NEED_PROG(tr, tr) NEED_PROG(tr, tr)
AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH], 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). # 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], AC_ARG_WITH(dbi, AC_HELP_STRING([--with-dbi=PATH],
[prefix of the Perl DBI library]), [prefix of the Perl DBI library]),

View file

@ -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 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". # Hack required by "make check".
@ -24,7 +20,7 @@ libNixStore_la_LIBADD = $(top_srcdir)/src/libstore/libstore.la
AM_CXXFLAGS = \ AM_CXXFLAGS = \
-I$(top_srcdir)/src -I$(top_srcdir)/src/libutil -I$(top_srcdir)/src/libstore \ -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 lib/Nix/Store.cc: lib/Nix/Store.xs
xsubpp $^ -output $@ xsubpp $^ -output $@

View file

@ -1,4 +1,4 @@
#! @perl@ -w #! @perl@ -w @perlFlags@
use strict; use strict;
use File::Basename; use File::Basename;

View file

@ -1,4 +1,4 @@
#! @perl@ -w -I@libexecdir@/nix #! @perl@ -w @perlFlags@
use strict; use strict;
use Nix::Config; use Nix::Config;

View file

@ -1,4 +1,4 @@
#! @perl@ -w #! @perl@ -w -I@libexecdir@/nix
use strict; use strict;
use Nix::Config; use Nix::Config;

View file

@ -1,4 +1,4 @@
#! @perl@ -w #! @perl@ -w @perlFlags@
use strict; use strict;
use Nix::Config; use Nix::Config;

View file

@ -1,4 +1,4 @@
#! @perl@ -w #! @perl@ -w @perlFlags@
use strict; use strict;
use File::Temp qw(tempdir); use File::Temp qw(tempdir);