-
Notifications
You must be signed in to change notification settings - Fork 560
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
plan9perl setup.rc script update #22844
Open
ealvar3z
wants to merge
1
commit into
Perl:blead
Choose a base branch
from
ealvar3z:9front-setup-rc-script
base: blead
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,55 +5,103 @@ | |
# appropriate permissions. | ||
# First modified 6/30/96 by: | ||
# Luther Huffman, Strategic Computer Solutions, Inc., [email protected] | ||
# Last modified May 2020 by: | ||
# Modified May 2020 by: | ||
# David Romano, [email protected] | ||
# Last Modified December 2024 by: | ||
# e. alvarez, ~eax/[email protected] | ||
|
||
# these default paths can be overridden by environment variables | ||
if (! ~ $privroot '') privroot=/sys/lib/perl | ||
if (! ~ $builddir '') builddir=`{cd .. ; pwd} | ||
|
||
required_files = (plan9.c plan9ish.h mkfile ../patchlevel.h 9front.patch) | ||
for(file in $required_files){ | ||
if (! test -e $file) { | ||
echo 'Error: Required file not found: $file' >[1=2] | ||
exit | ||
} | ||
} | ||
|
||
# Get the Perl version information | ||
awk -f versnum ../patchlevel.h | ||
if (! test -e buildinfo) { | ||
echo 'Error: buildinfo file is missing.' >[1=2] | ||
exit | ||
} | ||
. buildinfo | ||
|
||
builddir = `{ cd .. ; pwd } | ||
|
||
# 'typestr' is used by /sys/src/cmd/cc/lex.c, but not sure when/if it is ever used. | ||
# Patch sv.c from afar, which uses 'typestr' as a variable name, and uses bit-fields. | ||
# Also patch some other things: | ||
echo 'Applying patch...' | ||
status=`{cd $builddir; ape/patch -p1 <plan9/9front.patch} | ||
if (! ~ $status 0) { | ||
echo 'Error: Patching failed.' >[1=2] | ||
exit | ||
} | ||
|
||
if (~ $#* 0) platforms = $objtype | ||
if not switch($1) { | ||
case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) | ||
case * ; echo 'Usage: setup.rc [-a]' >[1=2] ; exit | ||
case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) | ||
case * ; echo 'Usage: setup.rc [-a]' >[1=2] ; exit | ||
} | ||
|
||
# Update some files | ||
echo 'Updating build files...' | ||
cp plan9.c plan9ish.h mkfile $builddir | ||
if (! ~ $? 0) { | ||
echo 'Error: Failed to copy files to build directory.' >[1=2] | ||
exit | ||
} | ||
|
||
exit; | ||
# Why is this done during setup and not during 'mk install'? | ||
# Build library directories | ||
echo Building library directories ... | ||
privroot=/sys/lib/perl | ||
echo 'Creating library directories...' | ||
privlib=$privroot/$p9pvers | ||
sitelib=$privlib/site_perl | ||
|
||
if (test ! -d $privroot) mkdir $privroot | ||
if (test ! -d $privlib) mkdir $privlib | ||
if (test ! -d $privlib/auto) mkdir $privlib/auto | ||
if (test ! -d $sitelib) mkdir $sitelib | ||
for(dir in $privroot $privlib $privlib/auto $sitelib){ | ||
if (! test -d $dir) { | ||
mkdir $dir | ||
if (! ~ $? 0) { | ||
echo 'Error: Failed to create directory: $dir' >[1=2] | ||
exit | ||
} | ||
} | ||
} | ||
|
||
for(i in $platforms){ | ||
archroot=/$i/lib/perl | ||
archlib=$archroot/$p9pvers | ||
sitearch=$archlib/site_perl | ||
corelib=$archlib/CORE | ||
arpalib=$corelib/arpa | ||
if (test ! -d $archroot) mkdir $archroot | ||
if (test ! -d $archlib) mkdir $archlib | ||
if (test ! -d $sitearch) mkdir $sitearch | ||
if (test ! -d $corelib) mkdir $corelib | ||
if (test ! -d $arpalib) mkdir $arpalib | ||
cp $builddir/*.h *.h $corelib | ||
cp arpa/*.h $arpalib | ||
} | ||
|
||
# Populate library directories | ||
echo "Creating directories for platform: $i..." | ||
archroot=/$i/lib/perl | ||
archlib=$archroot/$p9pvers | ||
sitearch=$archlib/site_perl | ||
corelib=$archlib/CORE | ||
arpalib=$corelib/arpa | ||
|
||
for(dir in $archroot $archlib $sitearch $corelib $arpalib){ | ||
if (! test -d $dir) { | ||
mkdir $dir | ||
if (! ~ $? 0) { | ||
echo 'Error: Failed to create directory: $dir' >[1=2] | ||
exit | ||
} | ||
} | ||
} | ||
|
||
cp $builddir/*.h *.h $corelib | ||
if (! ~ $? 0) { | ||
echo 'Error: Failed to copy header files to $corelib' >[1=2] | ||
exit | ||
} | ||
cp arpa/*.h $arpalib | ||
if (! ~ $? 0) { | ||
echo 'Error: Failed to copy arpa headers to $arpalib' >[1=2] | ||
exit | ||
} | ||
} | ||
|
||
echo 'Populating private libraries...' | ||
{cd $builddir/lib ; tar c . } | {cd $privlib ; tar x } | ||
if (! ~ $? 0) { | ||
echo 'Error: Failed to populate private libraries.' >[1=2] | ||
exit | ||
} | ||
|
||
echo 'Setup completed successfully.' | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'arm' value is listed twice.