Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MakeMaker generates ``PREFIX=<...>''-ingnorant Makefile #853

Closed
p5pRT opened this issue Nov 15, 1999 · 3 comments
Closed

MakeMaker generates ``PREFIX=<...>''-ingnorant Makefile #853

p5pRT opened this issue Nov 15, 1999 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 15, 1999

Migrated from rt.perl.org#1782 (status was 'resolved')

Searchable as RT1782$

@p5pRT
Copy link
Author

p5pRT commented Nov 15, 1999

From mp@dfki.de

I experienced this, while trying to build mod_perl /*with a little
help of rpm*/ in a non-root and relocated environment,
i.e. my perl-5.00503 has been relocated after its ``make install''
and this movement has been ``documented'' in Config.pm.
The perl installation seems to work fine, as far as tested up to now.

Trying to build mod_perl-1.21 under these conditions shows up, that
MakeMaker takes its information about filesystem locations out of
Config.pm, so that the corresponding section of the generated
Makefile looks as follows​:
-----8<-------
# --- MakeMaker constants section​:
AR_STATIC_ARGS = cr
NAME = mod_perl
DISTNAME = mod_perl
NAME_SYM = mod_perl
VERSION = 1.21
VERSION_SYM = 1_21
XS_VERSION = 1.21
INST_BIN = blib/bin
INST_EXE = blib/script
INST_LIB = blib/lib
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
PREFIX = /usr
INSTALLDIRS = site
INSTALLPRIVLIB = /export/mp/lib/perl5/5.00503
INSTALLARCHLIB = /export/mp/lib/perl5/5.00503/sparc-solaris
INSTALLSITELIB = /export/mp/lib/perl5/site_perl/5.005
INSTALLSITEARCH = /export/mp/lib/perl5/site_perl/5.005/sparc-solaris
INSTALLBIN = /export/mp/bin
INSTALLSCRIPT = /export/mp/bin
PERL_LIB = /export/mp/lib/perl5/5.00503
PERL_ARCHLIB = /export/mp/lib/perl5/5.00503/sparc-solaris
SITELIBEXP = /export/mp/lib/perl5/site_perl/5.005
SITEARCHEXP = /export/mp/lib/perl5/site_perl/5.005/sparc-solaris
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /export/mp/lib/perl5/5.00503/sparc-solaris/CORE
PERL = /export/mp/bin/perl
FULLPERL = /export/mp/bin/perl
------8<---------

I'd like to use

  make install PREFIX=$RPM_BUILD_ROOT%{prefix}

to get my mod_perl files installed to the temporary install
location on $RPM_BUILD_ROOT%{prefix}, which of course does not
work, since the PREFIX-setting isn't propagated into the
corresponding definitions for the target directories.
For this purpose it would require to declare​:
------8<------
INSTALLPRIVLIB = $(PREFIX)/lib/perl5/5.00503
INSTALLARCHLIB = $(PREFIX)/lib/perl5/5.00503/sparc-solaris
INSTALLSITELIB = $(PREFIX)/lib/perl5/site_perl/5.005
INSTALLSITEARCH = $(PREFIX)/lib/perl5/site_perl/5.005/sparc-solaris
INSTALLBIN = $(PREFIX)/bin
INSTALLSCRIPT = $(PREFIX)/bin
------8<------
and may be some analogous replacement for other variables.

Furthermore, we have to have a clear distinction between variable
definitions, which determine target directories for installation
and others, which refer to perl stuff, needed for the installation
process itself. The latter should of course refer to Config.pm

Should I have not been precise enough, I'll certainly be more
explicit on request,

  Markus

PS​: ... or would the proper location for my proposed changes be
  Config.pm itself??

@p5pRT
Copy link
Author

p5pRT commented Jul 16, 2003

From @schwern

[mp <!--c--> <i>at</i> <!--a--> dfki.de - Mon Nov 15 02​:18​:21 1999]​:

Trying to build mod_perl-1.21 under these conditions shows up, that
MakeMaker takes its information about filesystem locations out of
Config.pm, so that the corresponding section of the generated
Makefile looks as follows​:
-----8<-------
# --- MakeMaker constants section​:
AR_STATIC_ARGS = cr
NAME = mod_perl
DISTNAME = mod_perl
NAME_SYM = mod_perl
VERSION = 1.21
VERSION_SYM = 1_21
XS_VERSION = 1.21
INST_BIN = blib/bin
INST_EXE = blib/script
INST_LIB = blib/lib
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
PREFIX = /usr
INSTALLDIRS = site
INSTALLPRIVLIB = /export/mp/lib/perl5/5.00503
INSTALLARCHLIB = /export/mp/lib/perl5/5.00503/sparc-solaris
INSTALLSITELIB = /export/mp/lib/perl5/site_perl/5.005
INSTALLSITEARCH = /export/mp/lib/perl5/site_perl/5.005/sparc-solaris
INSTALLBIN = /export/mp/bin
INSTALLSCRIPT = /export/mp/bin
PERL_LIB = /export/mp/lib/perl5/5.00503
PERL_ARCHLIB = /export/mp/lib/perl5/5.00503/sparc-solaris
SITELIBEXP = /export/mp/lib/perl5/site_perl/5.005
SITEARCHEXP = /export/mp/lib/perl5/site_perl/5.005/sparc-solaris
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /export/mp/lib/perl5/5.00503/sparc-solaris/CORE
PERL = /export/mp/bin/perl
FULLPERL = /export/mp/bin/perl
------8<---------

I'd like to use

make install PREFIX=$RPM_BUILD_ROOT%{prefix}

to get my mod_perl files installed to the temporary install
location on $RPM_BUILD_ROOT%{prefix}, which of course does not
work, since the PREFIX-setting isn't propagated into the
corresponding definitions for the target directories.

As of 6.06_01, MakeMaker will *always* set up the $(INSTALL*) variables using
$(PREFIX) provided you specifiy it using​:

  perl Makefile.PL PREFIX=foo

it is then available for override using

  make install PREFIX=bar

MakeMaker cannot guarantee that $(PREFIX) will be used for $(INSTALL*) variables if no
PREFIX argument is given to the Makefile.PL for reasons which are obvious from the
example you gave above​: often Perl is not configured to install to a single prefix but rather
several, so there's no sensible single $(PREFIX) to use.

For your specific desire, ie. building an RPM, the DESTDIR variable is now supported.

  make install DESTDIR=/tmp/rpm-root

This was also introduced in 6.06_01 but currently contains a known bug. See​:
http​://rt.cpan.org/NoAuth/Bug.html?id=2954

For this purpose it would require to declare​:
------8<------
INSTALLPRIVLIB = $(PREFIX)/lib/perl5/5.00503
INSTALLARCHLIB = $(PREFIX)/lib/perl5/5.00503/sparc-solaris
INSTALLSITELIB = $(PREFIX)/lib/perl5/site_perl/5.005
INSTALLSITEARCH = $(PREFIX)/lib/perl5/site_perl/5.005/sparc-solaris
INSTALLBIN = $(PREFIX)/bin
INSTALLSCRIPT = $(PREFIX)/bin
------8<------
and may be some analogous replacement for other variables.

Furthermore, we have to have a clear distinction between variable
definitions, which determine target directories for installation
and others, which refer to perl stuff, needed for the installation
process itself. The latter should of course refer to Config.pm

The INSTALL* variables refer to installation targets. The original Config.pm information, as
much as is needed for installation, is in variables such as PERL_LIB, PERL_ARCH, SITELIBEXP
and SITEARCHEXP.

@p5pRT p5pRT closed this as completed Jul 16, 2003
@p5pRT
Copy link
Author

p5pRT commented Jul 16, 2003

@schwern - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant