Skip to content

Commit

Permalink
Merge f0312d1 into 60eec70
Browse files Browse the repository at this point in the history
  • Loading branch information
Corion committed Apr 6, 2021
2 parents 60eec70 + f0312d1 commit deeac62
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 33 deletions.
48 changes: 48 additions & 0 deletions Configure
Expand Up @@ -2337,6 +2337,9 @@ $define|true|[yY]*)
case "$versiononly" in
'') versiononly="$define" ;;
esac
case "$installmajorversion" in
'') installmajorversion="$define" ;;
esac
case "$installusrbinperl" in
'') installusrbinperl="$undef" ;;
esac
Expand Down Expand Up @@ -8270,6 +8273,51 @@ fi
set installusrbinperl
eval $setvar

: determine whether to install perl also as /usr/bin/perl5

echo " "
if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
$cat <<EOM
Many scripts expect perl to be installed as /usr/bin/perl5.

If you want to, I can install the perl you are about to compile
as /usr/bin/perl5 (in addition to $bin/perl).
EOM
if test -f /usr/bin/perl5; then
$cat <<EOM

However, please note that because you already have a /usr/bin/perl5,
overwriting that with a new Perl would very probably cause problems.
Therefore I'm assuming you don't want to do that (unless you insist).

EOM
case "$installusrbinperl_major" in
"$define"|[yY]*) dflt='y';;
*) dflt='n';;
esac
else
$cat <<EOM

Since you don't have a /usr/bin/perl5 I'm assuming creating one is okay.

EOM
case "$installusrbinperl_major" in
"$undef"|[nN]*) dflt='n';;
*) dflt='y';;
esac
fi
rp="Do you want to install perl as /usr/bin/perl5?"
. ./myread
case "$ans" in
[yY]*) val="$define";;
*) val="$undef" ;;
esac
else
val="$undef"
fi
set installusrbinperl_major
eval $setvar

: see if dlopen exists
xxx_runnm="$runnm"
xxx_ccflags="$ccflags"
Expand Down
1 change: 1 addition & 0 deletions Makefile.SH
Expand Up @@ -446,6 +446,7 @@ INSTALLPREFIXEXP = $prefix
# not used by Makefile but by installperl;
# mentioned here so that metaconfig picks these up
# $installusrbinperl
# $installusrbinperl_major
# $versiononly

case "${osname}:${osvers}" in
Expand Down
6 changes: 6 additions & 0 deletions config_h.SH
Expand Up @@ -1298,6 +1298,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$installusrbinperl INSTALL_USR_BIN_PERL /**/
/* INSTALL_USR_BIN_PERL_MAJOR:
* This symbol, if defined, indicates that Perl is to be installed
* also as /usr/bin/perl5.
*/
#$installusrbinperl INSTALL_USR_BIN_PERL_MAJOR /**/
/* PERL_OTHERLIBDIRS:
* This variable contains a colon-separated set of paths for the perl
* binary to search for additional library files or modules.
Expand Down
84 changes: 52 additions & 32 deletions installperl
Expand Up @@ -49,6 +49,9 @@ my $exe_ext = $Config{exe_ext};

# Allow "make install PERLNAME=something_besides_perl":
my $perl = defined($ENV{PERLNAME}) ? $ENV{PERLNAME} : 'perl';
my $perl_major = defined($ENV{PERLNAME_MAJOR})
? $ENV{PERLNAME_MAJOR}
: ('perl' . int $]);

# This is the base used for versioned names, like "perl5.6.0".
# It's separate because a common use of $PERLNAME is to install
Expand Down Expand Up @@ -290,6 +293,9 @@ if ($Is_VMS) {
safe_unlink("$installbin/$dbg$perl$exe_ext");
copy("$dbg$perl$exe_ext", "$installbin/$dbg$perl$exe_ext");
chmod(0755, "$installbin/$dbg$perl$exe_ext");
safe_unlink("$installbin/$dbg$perl_major$exe_ext");
copy("$dbg$perl$exe_ext", "$installbin/$dbg$perl_major$exe_ext");
chmod(0755, "$installbin/$dbg$perl_major$exe_ext");
safe_unlink("$installbin/$dbg${perl}shr$exe_ext");
copy("$dbg${perl}shr$exe_ext", "$installbin/$dbg${perl}shr$exe_ext");
chmod(0755, "$installbin/$dbg${perl}shr$exe_ext");
Expand All @@ -306,6 +312,12 @@ elsif ($^O ne 'dos') {
strip("$installbin/$perl_verbase$ver$exe_ext");
fix_dep_names("$installbin/$perl_verbase$ver$exe_ext");
chmod(0755, "$installbin/$perl_verbase$ver$exe_ext");

safe_unlink("$installbin/$perl_major$exe_ext");
copy("perl$exe_ext", "$installbin/$perl_major$exe_ext");
strip("$installbin/$perl_major$exe_ext");
fix_dep_names("$installbin/$perl_major$exe_ext");
chmod(0755, "$installbin/$perl_major$exe_ext");
}
else {
# If installing onto a NetWare server
Expand Down Expand Up @@ -413,9 +425,13 @@ if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VM
# VOS doesn't support hard links, so use a symlink.
symlink("$installbin/$perl_verbase$ver$exe_ext",
"$installbin/$perl$exe_ext");
symlink("$installbin/$perl_verbase$ver$exe_ext",
"$installbin/$perl_major$exe_ext");
} else {
link("$installbin/$perl_verbase$ver$exe_ext",
"$installbin/$perl$exe_ext");
link("$installbin/$perl_verbase$ver$exe_ext",
"$installbin/$perl_major$exe_ext");
}
}

Expand All @@ -433,39 +449,43 @@ if ($opts{archname} && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_V
}
}

# Offer to install perl in a "standard" location

my $mainperl_is_instperl = 0;

if ($Config{installusrbinperl} && $Config{installusrbinperl} eq 'define' &&
!$versiononly && !$opts{notify} && !$Is_W32 && !$Is_NetWare && !$Is_VMS && -t STDIN && -t STDERR
&& -w $mainperldir && ! samepath($mainperldir, $installbin)) {
my($usrbinperl) = "$mainperldir/$perl$exe_ext";
my($instperl) = "$installbin/$perl$exe_ext";
my($expinstperl) = "$binexp/$perl$exe_ext";

# First make sure $usrbinperl is not already the same as the perl we
# just installed.
if (-x $usrbinperl) {
# Try to be clever about mainperl being a symbolic link
# to binexp/perl if binexp and installbin are different.
$mainperl_is_instperl =
samepath($usrbinperl, $instperl) ||
samepath($usrbinperl, $expinstperl) ||
(($binexp ne $installbin) &&
(-l $usrbinperl) &&
((readlink $usrbinperl) eq $expinstperl));
}
if (! $mainperl_is_instperl) {
unlink($usrbinperl);
( $Config{'d_link'} eq 'define' &&
eval { CORE::link $instperl, $usrbinperl } ) ||
eval { symlink $expinstperl, $usrbinperl } ||
copy($instperl, $usrbinperl);

$mainperl_is_instperl = 1;
# Offer to install perl in a "standard" location, both as /usr/bin/perl
# and as /usr/bin/perl7

for my $set ([installusrbinperl => "$mainperldir/$perl$exe_ext"],
[installusrbinperl_major => "$mainperldir/$perl_major$exe_ext"]) {
my ($item,$target) = @$set;
my $mainperl_is_instperl = 0;
if ($Config{$item} && $Config{$item} eq 'define' &&
!$versiononly && !$opts{notify} && !$Is_W32 && !$Is_NetWare && !$Is_VMS && -t STDIN && -t STDERR
&& -w $mainperldir && ! samepath($mainperldir, $installbin)) {
my($usrbinperl) = $target;
my($instperl) = "$installbin/$perl$exe_ext";
my($expinstperl) = "$binexp/$perl$exe_ext";

# First make sure $usrbinperl is not already the same as the perl we
# just installed.
if (-x $usrbinperl) {
# Try to be clever about mainperl being a symbolic link
# to binexp/perl if binexp and installbin are different.
$mainperl_is_instperl =
samepath($usrbinperl, $instperl) ||
samepath($usrbinperl, $expinstperl) ||
(($binexp ne $installbin) &&
(-l $usrbinperl) &&
((readlink $usrbinperl) eq $expinstperl));
}
if (! $mainperl_is_instperl) {
unlink($usrbinperl);
( $Config{'d_link'} eq 'define' &&
eval { CORE::link $instperl, $usrbinperl } ) ||
eval { symlink $expinstperl, $usrbinperl } ||
copy($instperl, $usrbinperl);

$mainperl_is_instperl = 1;
}
}
}
};

# cppstdin is just a script, but it is architecture-dependent, so
# it can't safely be shared. Place it in $installbin.
Expand Down
8 changes: 7 additions & 1 deletion uconfig.h
Expand Up @@ -1263,6 +1263,12 @@
*/
/*#define INSTALL_USR_BIN_PERL / **/

/* INSTALL_USR_BIN_PERL_MAJOR:
* This symbol, if defined, indicates that Perl is to be installed
* also as /usr/bin/perl5.
*/
/*#define INSTALL_USR_BIN_PERL_MAJOR / **/

/* PERL_OTHERLIBDIRS:
* This variable contains a colon-separated set of paths for the perl
* binary to search for additional library files or modules.
Expand Down Expand Up @@ -5282,6 +5288,6 @@
#endif

/* Generated from:
* 6edd641b187b02d0daa8cb53f5d22f2dcca115a0d3e744f51b0292d2db484ca5 config_h.SH
* 76f3ca123d0dfd99b485934855496b00a3c6403fae4dd9ce7808a13f935253e2 config_h.SH
* b53784d20c0f250807f47a3130cdc8e01a92da948e6747af87ebc24f11904722 uconfig.sh
* ex: set ro: */
1 change: 1 addition & 0 deletions win32/config.gc
Expand Up @@ -839,6 +839,7 @@ installsiteman3dir=''
installsitescript=''
installstyle='lib'
installusrbinperl='undef'
installusrbinperl_major='undef'
installvendorarch=''
installvendorbin=''
installvendorhtml1dir=''
Expand Down
1 change: 1 addition & 0 deletions win32/config.vc
Expand Up @@ -838,6 +838,7 @@ installsiteman3dir=''
installsitescript=''
installstyle='lib'
installusrbinperl='undef'
installusrbinperl_major='undef'
installvendorarch=''
installvendorbin=''
installvendorhtml1dir=''
Expand Down

0 comments on commit deeac62

Please sign in to comment.