Update GCC scripts

This commit is contained in:
doylet 2024-04-30 15:54:30 +10:00
parent 6cffa10d2b
commit c9eb79df59
4 changed files with 56 additions and 11 deletions

0
Internal/unix_build_template.sh Normal file → Executable file
View File

25
Internal/unix_gcc_build.sh Normal file → Executable file
View File

@ -1,20 +1,33 @@
#!/bin/bash #!/bin/bash
# Run script and build GCC versions
# ./unix_gcc_build.sh 13.2.0 12.3.0 11.4.0 10.4.0 9.5.0 8.5.0 7.5.0 6.5.0
# Extract and install the build using
# tar --use-compress-program=zstd -xf gcc-mostlyportable-13.2.0.tar.zst -C ~/Dev/Linux/GCC
for gcc_version in "$@" for gcc_version in "$@"
do do
image_name=mostlyportable-gcc-image image_name=mostlyportable-gcc-image
container_name=mostlyportable-gcc container_name=mostlyportable-gcc
docker build -t ${image_name} --build-arg GCC_VERSION=${gcc_version} . || exit tar_file=gcc-mostlyportable-${gcc_version}.tar
archive_file=${tar_file}.zst
if [ ! -e "${archive_file}" ]; then
docker build -t ${image_name} --build-arg GCC_VERSION=${gcc_version} -f unix_gcc_dockerfile . || exit
docker container rm ${container_name} > /dev/null 2>&1 docker container rm ${container_name} > /dev/null 2>&1
docker create --name ${container_name} ${image_name} || exit docker create --name ${container_name} ${image_name} || exit
mkdir --parent build || exit
docker cp ${container_name}:/usr/local/docker/mostlyportable-gcc/mostly-built/gcc-mostlyportable-${gcc_version} . || exit docker cp ${container_name}:/usr/local/docker/mostlyportable-gcc/mostly-built/gcc-mostlyportable-${gcc_version} . || exit
docker container rm ${container_name} || exit docker container rm ${container_name} || exit
mv --force gcc-mostlyportable-${gcc_version} ${gcc_version} || exit
tar cf ${tar_file} -p ${gcc_version} || exit
zstd --rm ${tar_file} || exit
rm -rf ./${gcc_version} || exit
fi
done done
if [[ $EUID == 0 ]]; then # if [[ $EUID == 0 ]]; then
chown --recursive ${USER} gcc-mostlyportable-* # chown --recursive ${USER} gcc-mostlyportable-*
fi # fi

View File

@ -17,6 +17,8 @@ RUN set -ex \
libgmp-dev \ libgmp-dev \
libz-dev \ libz-dev \
m4 \ m4 \
file \
bison \
schedtool \ schedtool \
texinfo \ texinfo \
texlive \ texlive \
@ -30,8 +32,8 @@ RUN set -ex \
&& cd mostlyportable-gcc \ && cd mostlyportable-gcc \
&& git checkout $MOSTLY_PORTABLE_GIT_BRANCH && git checkout $MOSTLY_PORTABLE_GIT_BRANCH
ARG GCC_VERSION=11.3.0 ARG GCC_VERSION=13.2.0
ARG BIN_UTILS_VERSION=2.38 ARG BIN_UTILS_VERSION=2.41
RUN set -ex \ RUN set -ex \
&& cd mostlyportable-gcc \ && cd mostlyportable-gcc \
&& sed --in-place "s/^_use_gcc_git=\".*\"$/_use_gcc_git=\"false\"/" mostlyportable-gcc.cfg \ && sed --in-place "s/^_use_gcc_git=\".*\"$/_use_gcc_git=\"false\"/" mostlyportable-gcc.cfg \

30
Linux/Scripts/gcc_env.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
base_path="$devenver_root/GCC"
# Check for help argument
if [[ "$1" == "help" || "$1" == "" || "$1" == "--help" || "$1" == "/?" ]]; then
echo "USAGE: gcc_env.sh <version> <command>"
echo
echo "VERSIONS:"
ls "$base_path"
exit 0
fi
# Check if a version is provided
if [[ -z "$1" ]]; then
echo "Error: No version specified."
echo "USAGE: gcc_env.sh <version> <command>"
exit 1
fi
# Extract the version and remaining arguments
version="$1"
shift
remaining_args="$@"
# Execute the command
echo "[SCRIPT] Executing $remaining_args"
root_path="$base_path/$version"
PATH=${root_path}/bin:${root_path}/lib:${root_path}/include:${PATH}
$remaining_args