development/gcc5: Speed up find/chmod.

Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2022-02-28 13:17:58 -05:00 committed by Willy Sudiarto Raharjo
parent 69e67750d4
commit 151eceb506
No known key found for this signature in database
GPG key ID: 3F617144D7238786
4 changed files with 29 additions and 28 deletions

View file

@ -1,24 +1,25 @@
This gcc5 package can be installed alongside Slackware's gcc-7 packages.
These version 7 compilers can sometimes be quite a bit more strict about
what they accept as valid code. As a consequence, you will regularly run
into compilation issues with software. Not just the software made with
the scripts on slackbuilds.org, but also some of the software in
the Slackware core distribution requires patches in order to get them
to compile.
This gcc5 package can be installed alongside Slackware's gcc-11
packages. These version 11 compilers can sometimes be quite a bit
more strict about what they accept as valid code. As a consequence,
you will regularly run into compilation issues with software. Not just
the software made with the scripts on slackbuilds.org, but also some
of the software in the Slackware core distribution requires patches in
order to get them to compile.
Still having the gcc version 5 compilers can sometimes be a lifesaver.
Particulars of the gcc5 package:
- The gcc5 binaries were given a suffix '-5' to make them stand apart
from Slackware's default compilers.
- The gcc5 package only contains the C, C++ and Java language compilers.
- The gcc5 package only contains the C, C++ and Java compilers.
- One all-encompassing package is built by the SlackBuild script.
- Profile scripts are added to /etc/profile.d/. You can 'source'
the profile script to prefer the gcc-5 compilers over gcc-7.
- On 64bit Slackware, the gcc5.SlackBuild will detect an existing gcc
multilib compiler and will then build a multilib capable gcc5.
If you run pure 64bit Slackware, then a pure 64bit gcc5 package is built.
If you run pure 64bit Slackware, then a pure 64bit gcc5 package is
built.
How to use these gcc5 compilers instead of Slackware's default C and C++?
How to use these gcc5 compilers instead of Slackware's default ones?
Simple:
In your console or terminal, you 'source' the provided profile script,
like this (a c-shell compatible script is available as well):
@ -26,8 +27,9 @@ like this (a c-shell compatible script is available as well):
source /etc/profile.d/gcc5.sh
The command 'source' is equivalent to the dot command ' . '.
The profile script will (re-)define the common variables that are used
by make and other programs to determine which binary to run as the compiler:
The profile script will (re-)define the common variables that are
used by make and other programs to determine which binary to run as
the compiler:
export CC=gcc-5
export CPP=cpp-5
@ -38,9 +40,9 @@ export RANLIB=gcc-ranlib-5
Nothing else needs to be done after sourcing the profile script.
All you do next is run your compile job as usual in that same console.
Your program will be compiled with the binaries provided by the gcc5 package.
** WARNING:
** The temporary build location used by the script (defaulting here to /tmp/SBo)
** should *NOT* be a directory path a non-root user could create later...
Your program will be compiled with the binaries provided by the gcc5
package.
** WARNING: The temporary build location used by the script
** (defaulting here to /tmp/SBo) should *NOT* be a directory path a
** non-root user could create later...

View file

@ -169,7 +169,7 @@ if [ ${MULTILIB} = "YES" ]; then
else
SLDESC=""
fi
cat $CWD/slack-desc.gcc5 | sed -e "s/@MULTILIB@/${SLDESC}/" \
cat $CWD/slack-desc | sed -e "s/@MULTILIB@/${SLDESC}/" \
> $PKG/install/slack-desc
# Unpack the gcc sources:
@ -222,10 +222,10 @@ ANTLJAR=$(echo $CWD/antlr-*.jar | tail -1)
# Fix perms/owners
chown -R root:root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 754 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \+
find . -perm 775 -exec chmod 755 {} \+
find . -perm 754 -exec chmod 755 {} \+
find . -perm 664 -exec chmod 644 {} \+
mkdir -p $PKG/usr/doc/gcc-$VERSION
cp -a \
COPYING* ChangeLog* INSTALL \
@ -331,9 +331,9 @@ ANTLJAR=$(echo $CWD/antlr-*.jar | tail -1)
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
-exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-exec chmod 644 {} \+
for patch in $CWD/fastjar-patches/* ; do
cat $patch | patch -p1 --verbose || exit 1
done
@ -573,8 +573,8 @@ cat $CWD/libgcj-5.pc \
## Strip bloated binaries and libraries:
( cd $PKG
find . -name "lib*so*" -exec strip --strip-unneeded "{}" \;
find . -name "lib*a" -exec strip -g "{}" \;
find . -name "lib*so*" -exec strip --strip-unneeded "{}" \+
find . -name "lib*a" -exec strip -g "{}" \+
strip --strip-unneeded usr/bin/* 2> /dev/null
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

View file

@ -14,4 +14,3 @@ MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Eric Hameleers"
EMAIL="alien@slackware.com"

View file

@ -14,6 +14,6 @@ gcc5: This package contains those parts of the compiler collection needed to
gcc5: compile C and C++ code and programs written in the Java programming
gcc5: language.@MULTILIB@
gcc5:
gcc5: This gcc5 package must be co-installed with Slackware's gcc7 compiler.
gcc5: This gcc5 package must be co-installed with Slackware's gcc11 compiler.
gcc5:
gcc5: