From a1a614d36f4b00dd72e8cbd63dafffc455520e0c Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 6 Sep 2017 22:31:08 +0200 Subject: [PATCH] UCW::Configure::Perl: Split off configuration of Perl paths We now query the %Config hash of Perl itself to determine the right installation paths. --- configure | 1 + ucw/perl/Filelock/Makefile | 6 +++--- ucw/perl/UCW/Configure/Makefile | 2 +- ucw/perl/UCW/Configure/Perl.pm | 24 ++++++++++++++++++++++++ ucw/perl/Ulimit/Makefile | 6 +++--- 5 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 ucw/perl/UCW/Configure/Perl.pm diff --git a/configure b/configure index 79d60190..d3fca740 100755 --- a/configure +++ b/configure @@ -30,6 +30,7 @@ require UCW::Configure::Paths; require UCW::Configure::C; require UCW::Configure::LibUCW; require UCW::Configure::Doc; +require UCW::Configure::Perl; Finish(); Log "\nConfigured, run `make' to build everything.\n"; diff --git a/ucw/perl/Filelock/Makefile b/ucw/perl/Filelock/Makefile index ca761376..a6d92e45 100644 --- a/ucw/perl/Filelock/Makefile +++ b/ucw/perl/Filelock/Makefile @@ -25,7 +25,7 @@ $(o)/$(FILELOCK_DIR)/Makefile.PL: $(s)/$(FILELOCK_DIR)/Makefile.PL UCW_PERL_INSTALL+=install-perl-ucw-filelock install-perl-ucw-filelock: - install -d -m 755 $(DESTDIR)$(INSTALL_PERL_DIR)/UCW/ $(DESTDIR)$(INSTALL_LIB_DIR) - install -m 644 $(s)/$(FILELOCK_DIR)/Filelock.pm $(DESTDIR)$(INSTALL_PERL_DIR)/UCW/ - install -m 644 $(o)/ucw/perl/Filelock/arch/auto/UCW/Filelock/Filelock.$(SOEXT) $(DESTDIR)$(INSTALL_LIB_DIR) + install -d -m 755 $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/UCW/ $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/auto/UCW/ + install -m 644 $(s)/$(FILELOCK_DIR)/Filelock.pm $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/UCW/ + install -m 644 $(o)/ucw/perl/Filelock/arch/auto/UCW/Filelock/Filelock.$(SOEXT) $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/auto/UCW/ .PHONY: install-perl-ucw-filelock diff --git a/ucw/perl/UCW/Configure/Makefile b/ucw/perl/UCW/Configure/Makefile index 7f743f9e..37a8af0f 100644 --- a/ucw/perl/UCW/Configure/Makefile +++ b/ucw/perl/UCW/Configure/Makefile @@ -2,7 +2,7 @@ DIRS+=ucw/perl/UCW/Configure EXTRA_RUNDIRS+=lib/perl5/UCW/Configure -UCW_CONFIGURE_PERL_MODULES=$(addsuffix .pm, C Doc Paths Pkg Build) +UCW_CONFIGURE_PERL_MODULES=$(addsuffix .pm, C Doc Paths Pkg Build Perl) CONFIGURE_MODULES=$(addprefix $(o)/ucw/perl/UCW/Configure/,$(UCW_CONFIGURE_PERL_MODULES)) PROGS+=$(CONFIGURE_MODULES) diff --git a/ucw/perl/UCW/Configure/Perl.pm b/ucw/perl/UCW/Configure/Perl.pm new file mode 100644 index 00000000..5c1b83f4 --- /dev/null +++ b/ucw/perl/UCW/Configure/Perl.pm @@ -0,0 +1,24 @@ +# UCW Library configuration system: Perl paths +# (c) 2017 Martin Mares + +package UCW::Configure::Perl; +use UCW::Configure; + +use strict; +use warnings; +use Config; + +Log "Determining Perl module path ... "; +my $prefix = $Config{installprefix}; +$prefix .= '/' unless $prefix =~ m{/$}; +my $lib = substr($Config{installvendorlib}, length $prefix); +Set('INSTALL_PERL_DIR', Get('INSTALL_USR_PREFIX') . $lib); +Log Get('INSTALL_PERL_DIR') . "\n"; + +Log "Determining Perl arch-dependent module path ... "; +my $archlib = substr($Config{installvendorarch}, length $prefix); +Set('INSTALL_PERL_ARCH_DIR', Get('INSTALL_USR_PREFIX') . $archlib); +Log Get('INSTALL_PERL_ARCH_DIR') . "\n"; + +# We succeeded +1; diff --git a/ucw/perl/Ulimit/Makefile b/ucw/perl/Ulimit/Makefile index f492fbf4..348fd9e7 100644 --- a/ucw/perl/Ulimit/Makefile +++ b/ucw/perl/Ulimit/Makefile @@ -25,7 +25,7 @@ $(o)/$(ULIMIT_DIR)/Makefile.PL: $(s)/$(ULIMIT_DIR)/Makefile.PL UCW_PERL_INSTALL+=install-perl-ucw-ulimit install-perl-ucw-ulimit: - install -d -m 755 $(DESTDIR)$(INSTALL_PERL_DIR)/UCW/ $(DESTDIR)$(INSTALL_LIB_DIR) - install -m 644 $(s)/$(ULIMIT_DIR)/Ulimit.pm $(DESTDIR)$(INSTALL_PERL_DIR)/UCW/ - install -m 644 $(o)/ucw/perl/Ulimit/arch/auto/UCW/Ulimit/Ulimit.$(SOEXT) $(DESTDIR)$(INSTALL_LIB_DIR) + install -d -m 755 $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/UCW/ $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/auto/UCW/ + install -m 644 $(s)/$(ULIMIT_DIR)/Ulimit.pm $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/UCW/ + install -m 644 $(o)/ucw/perl/Ulimit/arch/auto/UCW/Ulimit/Ulimit.$(SOEXT) $(DESTDIR)$(INSTALL_PERL_ARCH_DIR)/auto/UCW/ .PHONY: install-perl-ucw-ulimit -- 2.39.5