Mailing List Archive

Q: platform independent installation
Ok, I keep getting these questions on the perl installation and
unfortunately I am at a loss. I have a few questions which I hope will
straighten things out. - Thanks in advance for any illumination.

What does the Configure script do when asks if you intend to run these
scripts on multiple machines? It mentions something about portability -
how might this help me deploy perl on multiple architectures?

the lib directory into which perl installs (e.g., /usr/local/lib/perl5 )
has and 'auto' subdirectory and 'sun4-sunos/auto' dir. Is the 'auto'
dir platform dependent?

Is it possible for multiple platforms to use the same lib dir (e.g.,
/usr/local/lib/perl5 )?

GNU followers have complained to me that it is difficult to compile perl
for multiple platforms compared to the GNU Configure way. Is there an
easier way in perl to deploy on multiple architectures other than
rerunning Configure from scratch?

While I am asking questions - is there a way to indicate on the command
line that the perl lib is located some place else before running a
script - basically pre-setting the @INC variable to point someplace else?

-GSM
Re: Q: platform independent installation [ In reply to ]
Excerpts from the mail message of Joe Marzot:
) What does the Configure script do when asks if you intend to run these
) scripts on multiple machines? It mentions something about portability -
) how might this help me deploy perl on multiple architectures?

I believe this question was removed by perl5.001m. Here is a quote
from that version's Configure:

: We might as well always be portable. It makes no difference for
: perl5, and makes people happy.
d_portable=define

So, yes, go ahead and answer that one "yes" for older versions. It
is a general Configure question that doesn't really apply to Perl.
If you are still getting asked this in perl5.001m, then something
is wrong.

) the lib directory into which perl installs (e.g., /usr/local/lib/perl5 )
) has and 'auto' subdirectory and 'sun4-sunos/auto' dir. Is the 'auto'
) dir platform dependent?

No. sun4-sunos and all subdirectories are platform dependent.

) Is it possible for multiple platforms to use the same lib dir (e.g.,
) /usr/local/lib/perl5 )?

Yes. I guess "make install" will overwrite most everything each
time but that shouldn't be a problem once you've upgrade all systems
to use the same version of Perl.

) GNU followers have complained to me that it is difficult to compile perl
) for multiple platforms compared to the GNU Configure way. Is there an
) easier way in perl to deploy on multiple architectures other than
) rerunning Configure from scratch?

The trick is to use Perl Configure like you use GNU configure. Perl's
Configure supports both interactive and non-interactive configuration.
GNU configure only supports non-interactive. If you are on a platform
where GNU configure works, then it is probably also a platform where
Perl's non-interactive Configure will also work just fine. If you're
not on such a platform then Perl's Configure is much easier to make
work than GNU configure that just dies.

Perl5.001m even comes with "configure" (as opposed to "Configure") which
emulates several of the most common GNU configure command-line switches.

) While I am asking questions - is there a way to indicate on the command
) line that the perl lib is located some place else before running a
) script - basically pre-setting the @INC variable to point someplace else?

Several:

perl -I/dir/ect/ory script-name args
[env] PERLLIB=/dir/ect/ory script-name args
[env] PERL5LIB=/dir/ect/ory perl5-script args

where "env" is required if using csh, for example.
--
Tye McQueen tye@metronet.com || tye@doober.usu.edu
Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
Re: Q: platform independent installation [ In reply to ]
[Citation date: Tue, 26 Sep 1995 15:38:25 -0500 (CDT)]
TM == Tye McQueen <tye@metronet.com>

JM> What does the Configure script do when asks if you intend to run these
JM> scripts on multiple machines?

TM> I believe this question was removed by perl5.001m. [...] If you are
TM> still getting asked this in perl5.001m, then something is wrong.

I have built Perl 5.001m dozens of times across four architectures, and it
has always asked me if I intend to run scripts on multiple machines. It
doesn't do this for you?

--
jared@organic.com / Organic Online / <URL:http://www.hmc.edu/~jared/home>

"To live is to war with trolls." -- Ibsen
Re: Q: platform independent installation [ In reply to ]
On Wed, 27 Sep 1995, Jared Rhine wrote:

> [Citation date: Tue, 26 Sep 1995 15:38:25 -0500 (CDT)]
> TM == Tye McQueen <tye@metronet.com>
>
> JM> What does the Configure script do when asks if you intend to run these
> JM> scripts on multiple machines?

Nothing of any relevance for perl5.001m. If you write scripts that call
things like $cat (which expands to /bin/cat on most systems), then Configure
will change the full pathname $cat back to plain cat, and rely on the
shell finding 'cat' somewhere in PATH. The idea is that on some old
systems, searches through PATH were time consuming.

None of the scripts supplied with perl5.001m call programs such as $cat
by their full pathnames, so this is not an issue for perl.

In earlier versions of metaconfig, the "Unit" that asked the portable
question did a number of things with the answer, and I was reluctant to
fiddle with it. In a recent metaconfig patch, Raphael reorganized things
so that it is now trivial for me to make the "portable" prompt go away.

> I have built Perl 5.001m dozens of times across four architectures, and it
> has always asked me if I intend to run scripts on multiple machines. It
> doesn't do this for you?

It doesn't do it anymore in my copy:-) Once I fix & test & document a few
more things, I'll be posting my current version of Configure.

Andy Dougherty doughera@lafcol.lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
Re: Q: platform independent installation [ In reply to ]
In <9509261934.AA09506@BayNetworks.com>
On Tue, 26 Sep 95 15:34:36 EDT
<gmarzot@BayNetworks.com> writes:
>Ok, I keep getting these questions on the perl installation and
>unfortunately I am at a loss. I have a few questions which I hope will
>straighten things out. - Thanks in advance for any illumination.
>
>What does the Configure script do when asks if you intend to run these
>scripts on multiple machines? It mentions something about portability -
>how might this help me deploy perl on multiple architectures?

Strips the pathname from certain programs and assumes they
can be found via PATH.

>
>the lib directory into which perl installs (e.g., /usr/local/lib/perl5 )
>has and 'auto' subdirectory and 'sun4-sunos/auto' dir. Is the 'auto'
>dir platform dependent?

Bits of it are - e.g. dynamicaly loaded executables.

>
>Is it possible for multiple platforms to use the same lib dir (e.g.,
>/usr/local/lib/perl5 )?

Yes, but beware the 1st install of a new revision will overwrite
the common bits and all the other architectures will die mysteriously.
I believe it is better to have a

/usr/local/lib/perl5.001m

>
>GNU followers have complained to me that it is difficult to compile perl
>for multiple platforms compared to the GNU Configure way. Is there an
>easier way in perl to deploy on multiple architectures other than
>rerunning Configure from scratch?

I use a symbolic link tree to keep primary source area un-poluted.
It is built by this script:

#!/usr/local/bin/perl -w

sub makedir
{
my $path = shift;
unless (-d $path)
{
&makedir($1) if ($path =~ m#^(.+)/\S+$#);
mkdir($path,0777) || die "Cannot mkdir $path:$!";
}
}

sub domanifest
{my $src = shift;
return if ($::done{$src});
$::done{$src} = 1;
my $fl = "$src/MANIFEST";
if (open($fl,"<$fl"))
{
$::dirs{$src} = 1;
while (<$fl>)
{
if (/^(\S*)/)
{
my $leaf = $1;
my $path = "$src/$leaf";
if (-r $path)
{
if ($leaf =~ m#^(.*)/\S+$#)
{
my $dir = "$src/$1";
die "No $dir" unless (-d $dir);
$::dirs{$dir} = 1;
}
$::files{$path} = 1 unless (!-l $path && -d $path);
}
else
{
warn "No $path:$!";
}
}
else
{
die "Odd line:$_";
}
}
close($fl);
}
}

$::src = shift;
$::dst = shift;

sub pwd
{
my $pwd;
chomp($pwd = `pwd`);
$pwd =~ s,^/tmp_mnt,,;
return $pwd;
}

$::here = &pwd;
chdir($::src) || die "Cannot cd to $::src:$!";
$::src = &pwd;

print STDERR "Reading $::src\n";

&domanifest(".");

foreach (<./ext/*>)
{
&domanifest($_);
}

chdir($::here) || die "Cannot cd back to $::here:$!";

&makedir($::dst);

print STDERR "Creating Directories\n";

foreach (keys %::dirs)
{
s#^\./##;
makedir("$::dst/$_");
}

print STDERR "Making links\n";

foreach (keys %::files)
{
s#^\./##;
unlink("$::dst/$_") if (-l "$::dst/$_");
symlink("$::src/$_","$::dst/$_") || warn "Cannot link $::src/$_ to $::dst/$_;$!";
}
Re: Q: platform independent installation [ In reply to ]
Excerpts from the mail message of Jared Rhine:
)
) [Citation date: Tue, 26 Sep 1995 15:38:25 -0500 (CDT)]
) TM == Tye McQueen <tye@metronet.com>
)
) TM> I believe this question was removed by perl5.001m. [...] If you are
) TM> still getting asked this in perl5.001m, then something is wrong.
)
) I have built Perl 5.001m dozens of times across four architectures, and it
) has always asked me if I intend to run scripts on multiple machines. It
) doesn't do this for you?

Perl's Configure never asks me any questions because I don't have
the patience to ever run it interactively. I don't see any reason
to run it interactively unless I'm on a system that hasn't been
tested enough for the automatic configure to work well. Even then
I tend to run an auto configure, figure out what didn't work and
edit config.sh, rebuild, test, then patch Configure so it works
the next time.

But it is good to have the option to run it interactively.

But rereading the Perl5.001m Configure I see where I got confused.
I thought the questions only came up if d_portable hadn't already
been defined (didn't see that "esac" and wasn't thinking clearly).
The part I quoted from Configure:

: We might as well always be portable. It makes no difference for
: perl5, and makes people happy.
d_portable=define

hints that we shouldn't bother asking, but the patch to stop it
from asking wasn't in Perl5.001m Configure. Since Andy has a patch
to eliminate the question, it will probably be in the next release.

Sorry for the confusion and thanks Andy.
--
Tye McQueen tye@metronet.com || tye@doober.usu.edu
Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)