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

Strange bug with -Dprefix=/usr and -Dversiononly #15377

Closed
p5pRT opened this issue May 30, 2016 · 18 comments
Closed

Strange bug with -Dprefix=/usr and -Dversiononly #15377

p5pRT opened this issue May 30, 2016 · 18 comments

Comments

@p5pRT
Copy link

p5pRT commented May 30, 2016

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

Searchable as RT128295$

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

From @cpansprout

I have tried installing perl 5.24.0 on an old PPC machine, with the configuration below, but it installed the perl binary and the scripts in /bin, even though I specified a prefix of /usr.

I don’t know exactly which option is responsible for the bug, but I do find it really strange.

This is what is *really* unhelpful​:

$ which cpan5.24.0
/bin/cpan5.24.0
$ cpan5.24.0
-bash​: /bin/cpan5.24.0​: /usr/bin/perl5.24.0​: bad interpreter​: No such file or directory
$ head -3 `which cpan5.24.0`
#!/usr/bin/perl5.24.0
  eval 'exec /usr/bin/perl5.24.0 -S $0 ${1+"$@​"}'
  if $running_under_some_shell;

So the #! line is correct in using /usr/bin/, which is what I asked for, but every got plopped in /bin instead, so nothing5.24.0 works. I have to use perl5.24.0 -S whatever5.24.0. Grrr!!!

More info follows. Also attached are config.sh and Policy.sh.

$ which perl5.24.0
/bin/perl5.24.0
$ perl5.24.0 -V
Summary of my perl5 (revision 5 version 24 subversion 0) configuration​:
 
  Platform​:
  osname=darwin, osvers=9.7.0, archname=darwin-2level
  uname='darwin treebeard.local 9.7.0 darwin kernel version 9.7.0​: tue mar 31 22​:54​:29 pdt 2009; root​:xnu-1228.12.14~1release_ppc power macintosh '
  config_args='-de -Dprefix=/usr -Doptimize=-O3 -Accflags=-DNO_MATHOMS -Dversiononly'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-common -DPERL_DARWIN -DNO_MATHOMS -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV',
  optimize='-O3',
  cppflags='-fno-common -DPERL_DARWIN -DNO_MATHOMS -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.0.1 (Apple Inc. build 5465)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321, doublekind=4
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=6
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib
  libs=-lpthread -ldbm -ldl -lm -lutil -lc
  perllibs=-lpthread -ldl -lm -lutil -lc
  libc=, so=dylib, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl)​:
  Compile-time options​: HAS_TIMES NO_MATHOMS PERLIO_LAYERS PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
  PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV
  USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
  USE_PERLIO USE_PERL_ATOF
  Built under darwin
  Compiled at May 26 2016 13​:38​:00
  @​INC​:
  /Library/Perl/5.24.0/darwin-2level
  /Library/Perl/5.24.0
  /Network/Library/Perl/5.24.0/darwin-2level
  /Network/Library/Perl/5.24.0
  /System/Library/Perl/5.24.0/darwin-2level
  /System/Library/Perl/5.24.0
  /Library/Perl
  /Network/Library/Perl
  .

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

From @cpansprout

Policy.sh

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

From @cpansprout

config.sh

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

From @jkeenan

On Mon May 30 14​:30​:17 2016, sprout wrote​:

I have tried installing perl 5.24.0 on an old PPC machine, with the
configuration below, but it installed the perl binary and the scripts
in /bin, even though I specified a prefix of /usr.

I don’t know exactly which option is responsible for the bug, but I do
find it really strange.

This is what is *really* unhelpful​:

$ which cpan5.24.0
/bin/cpan5.24.0
$ cpan5.24.0
-bash​: /bin/cpan5.24.0​: /usr/bin/perl5.24.0​: bad interpreter​: No such
file or directory
$ head -3 `which cpan5.24.0`
#!/usr/bin/perl5.24.0
eval 'exec /usr/bin/perl5.24.0 -S $0 ${1+"$@​"}'
if $running_under_some_shell;

So the #! line is correct in using /usr/bin/, which is what I asked
for, but every got plopped in /bin instead, so nothing5.24.0 works. I
have to use perl5.24.0 -S whatever5.24.0. Grrr!!!

More info follows. Also attached are config.sh and Policy.sh.

$ which perl5.24.0
/bin/perl5.24.0
$ perl5.24.0 -V
Summary of my perl5 (revision 5 version 24 subversion 0)
configuration​:

Platform​:
osname=darwin, osvers=9.7.0, archname=darwin-2level
uname='darwin treebeard.local 9.7.0 darwin kernel version 9.7.0​: tue
mar 31 22​:54​:29 pdt 2009; root​:xnu-1228.12.14~1release_ppc power
macintosh '
config_args='-de -Dprefix=/usr -Doptimize=-O3 -Accflags=-DNO_MATHOMS
-Dversiononly'

In Porting/Glossary, I find​:

#####
versiononly (versiononly.U)​:
  If set, this symbol indicates that only the version-specific
  components of a perl installation should be installed.
  This may be useful for making a test installation of a new
  version without disturbing the existing installation.
  Setting versiononly is equivalent to setting installperl's -v option.
  In particular, the non-versioned scripts and programs such as
  a2p, c2ph, h2xs, pod2*, and perldoc are not installed
  (see INSTALL for a more complete list). Nor are the man
  pages installed.
  Usually, this is undef.
#####

If you reconfigure without '-Dversiononly', do you get better results?

That being said, when I configured perl-5.24.0 on an even older Darwin/PPC with the exact same arguments as you, I got entries in config.sh like​:

#####
installbin='//bin'
...
installman1dir='//share/man/man1'
...
installprefix='/'
...
installscript=''/bin'
...
installsitebin='//local/bin'
etc.
#####

All of which is similar to your undesired results.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

From @jkeenan

On Mon May 30 16​:27​:34 2016, jkeenan wrote​:

On Mon May 30 14​:30​:17 2016, sprout wrote​:

config_args='-de -Dprefix=/usr -Doptimize=-O3 -Accflags=-
DNO_MATHOMS
-Dversiononly'

In Porting/Glossary, I find​:

#####
versiononly (versiononly.U)​:
If set, this symbol indicates that only the version-specific
components of a perl installation should be installed.
This may be useful for making a test installation of a new
version without disturbing the existing installation.
Setting versiononly is equivalent to setting installperl's -v
option.

And, in installperl, I see that the '-v' option is described thus​:

#####
  -v Only install perl as a binary with the version number in the name.
  (Override whatever config.sh says)
#####

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

From @jkeenan

On Mon May 30 16​:32​:47 2016, jkeenan wrote​:

On Mon May 30 16​:27​:34 2016, jkeenan wrote​:

On Mon May 30 14​:30​:17 2016, sprout wrote​:

config_args='-de -Dprefix=/usr -Doptimize=-O3 -Accflags=-
DNO_MATHOMS
-Dversiononly'

In Porting/Glossary, I find​:

#####
versiononly (versiononly.U)​:
If set, this symbol indicates that only the version-specific
components of a perl installation should be installed.
This may be useful for making a test installation of a new
version without disturbing the existing installation.
Setting versiononly is equivalent to setting installperl's -v
option.

And, in installperl, I see that the '-v' option is described thus​:

#####
-v Only install perl as a binary with the version number in the
name.
(Override whatever config.sh says)
#####

But, on still *more* investigation, it seems that if I configure *with* '-Dprefix=/usr' but *without* '-Dversionly', I reproduce the same puzzling values in the '^install*' section of config.sh as you got. See attachment.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented May 30, 2016

@p5pRT
Copy link
Author

p5pRT commented May 31, 2016

From @tonycoz

On Mon May 30 14​:30​:17 2016, sprout wrote​:

I have tried installing perl 5.24.0 on an old PPC machine, with the
configuration below, but it installed the perl binary and the scripts
in /bin, even though I specified a prefix of /usr.

I don’t know exactly which option is responsible for the bug, but I do
find it really strange.

I think it's caused by the hints on darwin, from hints/darwin.sh​:

case "$prefix" in
...
'/usr') # We are building/replacing the built-in perl
  prefix='/';
  installprefix='/'; # used to set installbin
  bin='/usr/bin';
  siteprefix='/usr/local';
...

That said, replacing your system perl is probably dangerous (OS X 10.11 doesn't allow it AFAIK.)

Tony

@p5pRT
Copy link
Author

p5pRT commented May 31, 2016

From @cpansprout

On Mon May 30 17​:19​:13 2016, tonyc wrote​:

On Mon May 30 14​:30​:17 2016, sprout wrote​:

I have tried installing perl 5.24.0 on an old PPC machine, with the
configuration below, but it installed the perl binary and the scripts
in /bin, even though I specified a prefix of /usr.

I don’t know exactly which option is responsible for the bug, but I
do
find it really strange.

I think it's caused by the hints on darwin, from hints/darwin.sh​:

case "$prefix" in
...
'/usr') # We are building/replacing the built-in perl
prefix='/';
installprefix='/'; # used to set installbin
bin='/usr/bin';
siteprefix='/usr/local';
...

That said, replacing your system perl is probably dangerous

People always say that, though I’ve done it numerous times with impunity.

In any case, I’m *not* trying to replace the system perl here (-Dversiononly), and I’ve used this incantation before.

A bisect points to v5.23.4-46-g41d7307​:

$ ../perl.git/porting/bisect.pl -Dprefix=/usr --target config.sh --end v5.24.0 --match installbin=\'/usr config.sh
...
41d7307 is the first bad commit
commit 41d7307
Author​: Ivan Pozdeev <vano@​mail.mipt.ru>
Date​: Wed Aug 12 20​:33​:12 2015 +0300

  Make -O behaviour the default

I can’t see how that commit causes that.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented May 31, 2016

From @arc

Father Chrysostomos via RT <perlbug-followup@​perl.org> wrote​:

On Mon May 30 17​:19​:13 2016, tonyc wrote​:

On Mon May 30 14​:30​:17 2016, sprout wrote​:

I have tried installing perl 5.24.0 on an old PPC machine, with the
configuration below, but it installed the perl binary and the scripts
in /bin, even though I specified a prefix of /usr.

I don’t know exactly which option is responsible for the bug, but I
do
find it really strange.

I think it's caused by the hints on darwin, from hints/darwin.sh​:

case "$prefix" in
...
'/usr') # We are building/replacing the built-in perl
prefix='/';
installprefix='/'; # used to set installbin
bin='/usr/bin';
siteprefix='/usr/local';
...

This looks like a Very Bad Idea, imho.

AFAICT, hints/darwin.sh has overridden the user's configured paths
"forever", modulo some back-and-forth in summer 2003. But the
impression I get from the Git history is that this has been done to
make life easier for Apple building the perl installation that they
actually supply as part of Mac OS. This strikes me as the epitome of a
special-purpose requirement; we should not make all users building a
Perl explicitly unpick path mangling that's needed only by Apple
engineers.

In any case, I’m *not* trying to replace the system perl here (-Dversiononly), and I’ve used this incantation before.

At the very least, hints/darwin.sh must avoid overriding the user's
chosen prefix under -Dversiononly.

But I honestly can't see a good argument against simply jettisoning
the path mangling in the "/usr" case in hints/darwin.sh. And I think
this is a good time to do it​: we've got a large fraction of a year to
shake out any Mac OS build problems before the 5.26 freeze.

If I don't hear a counterargument, I'll make that change in the next few days.

$ ../perl.git/porting/bisect.pl -Dprefix=/usr --target config.sh --end v5.24.0 --match installbin=\'/usr config.sh
...
41d7307 is the first bad commit
commit 41d7307
Author​: Ivan Pozdeev <vano@​mail.mipt.ru>
Date​: Wed Aug 12 20​:33​:12 2015 +0300

Make \-O behaviour the default

I can’t see how that commit causes that.

I share your puzzlement; I see signs of the same brokenness under
5.22, even when running Configure with the -O option. Though
admittedly this is based on looking at the config.sh generated by
Configure, rather than by building and installing.

--
Aaron Crane ** http​://aaroncrane.co.uk/

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2016

From @doughera88

On Tue, May 31, 2016 at 09​:04​:32PM +0100, Aaron Crane wrote​:

Father Chrysostomos via RT <perlbug-followup@​perl.org> wrote​:

On Mon May 30 17​:19​:13 2016, tonyc wrote​:

On Mon May 30 14​:30​:17 2016, sprout wrote​:

I have tried installing perl 5.24.0 on an old PPC machine, with the
configuration below, but it installed the perl binary and the scripts
in /bin, even though I specified a prefix of /usr.

I don’t know exactly which option is responsible for the bug, but I
do
find it really strange.

I think it's caused by the hints on darwin, from hints/darwin.sh​:

case "$prefix" in
...
'/usr') # We are building/replacing the built-in perl
prefix='/';
installprefix='/'; # used to set installbin
bin='/usr/bin';
siteprefix='/usr/local';
...

This looks like a Very Bad Idea, imho.

Yes, I agree. If the user specified -Dprefix=/usr, changing it to /
seems wrong. A better way to do this sort of thing is to do something
like openbsd does, which is to use a specific flag

  ./Configure -des -Dopenbsd_distribution

AFAICT, hints/darwin.sh has overridden the user's configured paths
"forever", modulo some back-and-forth in summer 2003. But the
impression I get from the Git history is that this has been done to
make life easier for Apple building the perl installation that they
actually supply as part of Mac OS. This strikes me as the epitome of a
special-purpose requirement; we should not make all users building a
Perl explicitly unpick path mangling that's needed only by Apple
engineers.

In any case, I’m *not* trying to replace the system perl here (-Dversiononly), and I’ve used this incantation before.

At the very least, hints/darwin.sh must avoid overriding the user's
chosen prefix under -Dversiononly.

But I honestly can't see a good argument against simply jettisoning
the path mangling in the "/usr" case in hints/darwin.sh. And I think
this is a good time to do it​: we've got a large fraction of a year to
shake out any Mac OS build problems before the 5.26 freeze.

If I don't hear a counterargument, I'll make that change in the next few days.

I agree with the sentiment, but I'd suggest wrapping it up in an
apple_distribution variable instead.

$ ../perl.git/porting/bisect.pl -Dprefix=/usr --target config.sh --end v5.24.0 --match installbin=\'/usr config.sh
...
41d7307 is the first bad commit
commit 41d7307
Author​: Ivan Pozdeev <vano@​mail.mipt.ru>
Date​: Wed Aug 12 20​:33​:12 2015 +0300

Make \-O behaviour the default

I can’t see how that commit causes that.

I share your puzzlement; I see signs of the same brokenness under
5.22, even when running Configure with the -O option. Though
admittedly this is based on looking at the config.sh generated by
Configure, rather than by building and installing.

What happened is that Father C specified -Dprefix=/usr, the hints
file changed both prefix and installprefix to '/', but then the -O
option re-instated the origin prefix=/usr setting. config.sh was then
left in the confused state where prefix='/usr' and installprefix='/'.
Obviously, that doesn't work well. Prior to that patch, the -O option
didn't reinstate the command-line version of prefix, so both prefix and
installprefix were set to '/', which is at least consistent.

Having the -O switch as the default also makes Configure behave
differently if you specify -Dprefix on the command line versus specifying
it interactively at the Configure prompt.

I'm now wondering what else -O might break.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2016

From @cpansprout

On Wed Jun 01 20​:47​:48 2016, doughera wrote​:

On Tue, May 31, 2016 at 09​:04​:32PM +0100, Aaron Crane wrote​:

But I honestly can't see a good argument against simply jettisoning
the path mangling in the "/usr" case in hints/darwin.sh. And I think
this is a good time to do it​: we've got a large fraction of a year to
shake out any Mac OS build problems before the 5.26 freeze.

If I don't hear a counterargument, I'll make that change in the next
few days.

I agree with the sentiment, but I'd suggest wrapping it up in an
apple_distribution variable instead.

BTW, I honestly couldn’t care whether the modules get installed in /usr or in /Library.

It does seem to me that -O is problematic, and that things are happening the wrong order. Changing the darwin hints may just paper over the problem.

$ ../perl.git/porting/bisect.pl -Dprefix=/usr --target config.sh
--end v5.24.0 --match installbin=\'/usr config.sh
...
41d7307 is the first bad commit
commit 41d7307
Author​: Ivan Pozdeev <vano@​mail.mipt.ru>
Date​: Wed Aug 12 20​:33​:12 2015 +0300

Make -O behaviour the default

I can’t see how that commit causes that.

I share your puzzlement; I see signs of the same brokenness under
5.22, even when running Configure with the -O option. Though
admittedly this is based on looking at the config.sh generated by
Configure, rather than by building and installing.

What happened is that Father C specified -Dprefix=/usr, the hints
file changed both prefix and installprefix to '/', but then the -O
option re-instated the origin prefix=/usr setting. config.sh was then
left in the confused state where prefix='/usr' and installprefix='/'.
Obviously, that doesn't work well. Prior to that patch, the -O option
didn't reinstate the command-line version of prefix, so both prefix
and
installprefix were set to '/', which is at least consistent.

Having the -O switch as the default also makes Configure behave
differently if you specify -Dprefix on the command line versus
specifying
it interactively at the Configure prompt.

I'm now wondering what else -O might break.

It seems that -O/optdef.sh is happening too late. It should probably happen *before* hints files are read, should it not?

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2016

From @doughera88

On Wed, Jun 01, 2016 at 09​:42​:17PM -0700, Father Chrysostomos via RT wrote​:

It does seem to me that -O is problematic, and that things are happening the wrong order. Changing the darwin hints may just paper over the problem.

On Wed Jun 01 20​:47​:48 2016, doughera wrote​:

$ ../perl.git/porting/bisect.pl -Dprefix=/usr --target config.sh
--end v5.24.0 --match installbin=\'/usr config.sh
...
41d7307 is the first bad commit
commit 41d7307
Author​: Ivan Pozdeev <vano@​mail.mipt.ru>
Date​: Wed Aug 12 20​:33​:12 2015 +0300

Make -O behaviour the default

I can’t see how that commit causes that.

I share your puzzlement; I see signs of the same brokenness under
5.22, even when running Configure with the -O option. Though
admittedly this is based on looking at the config.sh generated by
Configure, rather than by building and installing.

What happened is that Father C specified -Dprefix=/usr, the hints
file changed both prefix and installprefix to '/', but then the -O
option re-instated the origin prefix=/usr setting. config.sh was then
left in the confused state where prefix='/usr' and installprefix='/'.
Obviously, that doesn't work well. Prior to that patch, the -O option
didn't reinstate the command-line version of prefix, so both prefix
and
installprefix were set to '/', which is at least consistent.

I'm now wondering what else -O might break.

It seems that -O/optdef.sh is happening too late. It should probably happen *before* hints files are read, should it not?

It actually gets run twice -- once before the hints are read (that's as
it always has been) and a second time after the hints are read (that's
what the -O option used to do, and what is now the default.)

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Jun 15, 2016

From @tonycoz

On Wed Jun 01 21​:42​:16 2016, sprout wrote​:

On Wed Jun 01 20​:47​:48 2016, doughera wrote​:

On Tue, May 31, 2016 at 09​:04​:32PM +0100, Aaron Crane wrote​:

But I honestly can't see a good argument against simply jettisoning
the path mangling in the "/usr" case in hints/darwin.sh. And I
think
this is a good time to do it​: we've got a large fraction of a year
to
shake out any Mac OS build problems before the 5.26 freeze.

If I don't hear a counterargument, I'll make that change in the
next
few days.

I agree with the sentiment, but I'd suggest wrapping it up in an
apple_distribution variable instead.

BTW, I honestly couldn’t care whether the modules get installed in
/usr or in /Library.

It does seem to me that -O is problematic, and that things are
happening the wrong order. Changing the darwin hints may just paper
over the problem.

$ ../perl.git/porting/bisect.pl -Dprefix=/usr --target config.sh
--end v5.24.0 --match installbin=\'/usr config.sh
...
41d7307 is the first bad commit
commit 41d7307
Author​: Ivan Pozdeev <vano@​mail.mipt.ru>
Date​: Wed Aug 12 20​:33​:12 2015 +0300

Make -O behaviour the default

I can’t see how that commit causes that.

I share your puzzlement; I see signs of the same brokenness under
5.22, even when running Configure with the -O option. Though
admittedly this is based on looking at the config.sh generated by
Configure, rather than by building and installing.

What happened is that Father C specified -Dprefix=/usr, the hints
file changed both prefix and installprefix to '/', but then the -O
option re-instated the origin prefix=/usr setting. config.sh was
then
left in the confused state where prefix='/usr' and installprefix='/'.
Obviously, that doesn't work well. Prior to that patch, the -O
option
didn't reinstate the command-line version of prefix, so both prefix
and
installprefix were set to '/', which is at least consistent.

Having the -O switch as the default also makes Configure behave
differently if you specify -Dprefix on the command line versus
specifying
it interactively at the Configure prompt.

I'm now wondering what else -O might break.

It seems that -O/optdef.sh is happening too late. It should probably
happen *before* hints files are read, should it not?

The hints are still pretty strange, the attached makes the special hints require a special option.

Apple appear to do their own thing, appending specific settings to hints/darwin.sh to do all the things we have the hints doing, but they're still using perl 5.18.2.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jun 15, 2016

From @tonycoz

0001-perl-128295-don-t-treat-Dprefix-usr-as-special.patch
From 227846bdf8a9d954258dffd1580e353feeed3ecd Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 15 Jun 2016 15:02:48 +1000
Subject: (perl #128295) don't treat -Dprefix=/usr as special

but instead require an extra option -Ddarwin_distribution to produce
the same results.
---
 hints/darwin.sh | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/hints/darwin.sh b/hints/darwin.sh
index e1cd91b..ef2e106 100644
--- a/hints/darwin.sh
+++ b/hints/darwin.sh
@@ -35,15 +35,10 @@ esac
 # but that caused too much grief.
 # vendorlib="/System/Library/Perl/${version}"; # Apple-supplied modules
 
-# BSD paths
-case "$prefix" in
-'')	# Default install; use non-system directories
-	prefix='/usr/local';
-	siteprefix='/usr/local';
-	;;
-'/usr')	# We are building/replacing the built-in perl
-	prefix='/';
-	installprefix='/';
+case "$darwin_distribution" in
+$define) # We are building/replacing the built-in perl
+	prefix='/usr';
+	installprefix='/usr';
 	bin='/usr/bin';
 	siteprefix='/usr/local';
 	# We don't want /usr/bin/HEAD issues.
@@ -68,8 +63,6 @@ case "$prefix" in
 	siteman1dir='/usr/local/share/man/man1';
 	siteman3dir='/usr/local/share/man/man3';
 	;;
-  *)	# Anything else; use non-system directories, use Configure defaults
-	;;
 esac
 
 ##
-- 
2.7.4 (Apple Git-66)

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2016

From @arc

Tony Cook via RT <perlbug-followup@​perl.org> wrote​:

The hints are still pretty strange, the attached makes the special hints require a special option.

Apple appear to do their own thing, appending specific settings to hints/darwin.sh to do all the things we have the hints doing, but they're still using perl 5.18.2.

Sorry for the long delay in following up on this, but that patch makes
FC's Configure options do the right thing for me on Darwin, and
retains the forced-/usr layout under -Ddarwin_distribution, so I've
applied it as 67bdb7a. Thanks, Tony.

--
Aaron Crane ** http​://aaroncrane.co.uk/

@p5pRT p5pRT closed this as completed Nov 12, 2016
@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2016

@arc - 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