Revert "gcc-latest: Removed"

This reverts commit 729946afaf.
This commit is contained in:
Eugen Wissner 2023-02-20 08:57:04 +01:00
parent ad02a3fa38
commit bd84f6bbf0
5 changed files with 250 additions and 0 deletions

View File

@ -0,0 +1,6 @@
GCC 12 with C, C++ and D support.
GCC is the GNU Compiler Collection.
D is a general-purpose programming language with static typing,
systems-level access, and C-like syntax.

View File

@ -0,0 +1,188 @@
#!/bin/bash
# GCC package build script (written by volkerdi@slackware.com)
#
# Copyright 2003, 2004 Slackware Linux, Inc., Concord, California, USA
# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Modified 2011 by Eric Hameleers <alien at slackware.com> for OpenJDK.
# Modified 2022 by Eugen Wissner <belka@caraus.de> for gcc-latest.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=gcc-latest
VERSION=${VERSION:-12.1.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$(uname -m)" in
i?86) ARCH=i586 ;;
arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$(uname -m) ;;
esac
export ARCH
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i386" ]; then
LIBDIRSUFFIX=""
LIB_ARCH=i386
elif [ "$ARCH" = "i486" ]; then
LIBDIRSUFFIX=""
LIB_ARCH=i386
elif [ "$ARCH" = "i586" ]; then
LIBDIRSUFFIX=""
LIB_ARCH=i386
elif [ "$ARCH" = "i686" ]; then
LIBDIRSUFFIX=""
LIB_ARCH=i386
elif [ "$ARCH" = "s390" ]; then
LIBDIRSUFFIX=""
LIB_ARCH=s390
elif [ "$ARCH" = "x86_64" ]; then
LIBDIRSUFFIX="64"
LIB_ARCH=amd64
elif [ "$ARCH" = "armv7hl" ]; then
LIBDIRSUFFIX=""
LIB_ARCH=armv7hl
else
LIBDIRSUFFIX=""
LIB_ARCH=$ARCH
fi
case "$ARCH" in
arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
*) TARGET=$ARCH-slackware-linux ;;
esac
set -e # Exit on most errors
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
tar xvf $CWD/gcc-$VERSION.tar.?z
cd gcc-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Smite the fixincludes:
patch -p1 --verbose -i $CWD/patches/gcc-no_fixincludes.diff
mkdir ../objdir
cd ../objdir
if [ "$ARCH" != "x86_64" ]; then
GCC_ARCHOPTS="--with-arch=$ARCH"
else
GCC_ARCHOPTS="--disable-multilib"
fi
../gcc-$VERSION/configure \
--prefix=/usr \
--libdir=/usr/lib$LIBDIRSUFFIX \
--mandir=/usr/man \
--infodir=/usr/info \
--enable-shared \
--disable-bootstrap \
--enable-languages=c,c++,d \
--enable-threads=posix \
--enable-checking=release \
--with-system-zlib \
--disable-libquadmath-support \
--with-default-libstdcxx-abi=new \
--disable-libstdcxx-pch \
--disable-libunwind-exceptions \
--enable-__cxa_atexit \
--disable-libssp \
--enable-gnu-unique-object \
--enable-plugin \
--enable-lto \
--disable-install-libiberty \
--disable-werror \
--with-gcc-major-version-only \
--with-isl \
--program-suffix=-12 \
--with-arch-directory=$LIB_ARCH \
--disable-gtktest \
--enable-clocale=gnu \
$GCC_ARCHOPTS \
--target=${TARGET} \
--build=${TARGET} \
--host=${TARGET}
make
make install-strip DESTDIR=$PKG
rm $PKG/usr/lib${LIBDIRSUFFIX}/*.la
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/gcc-12
mkdir -p $PKG/usr/share/gdb/auto-load/usr/lib$LIBDIRSUFFIX
mv $PKG/usr/lib$LIBDIRSUFFIX/*-gdb.py \
$PKG/usr/share/gdb/auto-load/usr/lib$LIBDIRSUFFIX/
mv $PKG/usr/lib${LIBDIRSUFFIX}/*.{a,o,spec,so*} \
$PKG/usr/lib${LIBDIRSUFFIX}/gcc-12
cd ../gcc-$VERSION
# They conflict with the stock package.
rm -rf $PKG/usr/man/man7 \
$PKG/usr/info \
$PKG/usr/share/locale
# Compress man pages
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
COPYING* ChangeLog* INSTALL LAST_UPDATED MAINTAINERS NEWS README* \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE

View File

@ -0,0 +1,10 @@
PRGNAM="gcc-latest"
VERSION="12.1.0"
HOMEPAGE="https://gcc.gnu.org/"
DOWNLOAD="https://ftp.gnu.org/gnu/gcc/gcc-12.1.0/gcc-12.1.0.tar.xz"
MD5SUM="ed45b55ee859ada4b25a1e76e0c4d966"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="%README%"
MAINTAINER="Eugen Wissner"
EMAIL="belka@caraus.de"

View File

@ -0,0 +1,27 @@
--- ./gcc/Makefile.in.orig 2018-03-09 09:24:44.000000000 -0600
+++ ./gcc/Makefile.in 2018-05-02 12:25:43.958002771 -0500
@@ -3004,9 +3004,9 @@
chmod a+r $${fix_dir}/limits.h; \
done
# Install the README
- rm -f include-fixed/README
- cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
- chmod a+r include-fixed/README
+# rm -f include-fixed/README
+# cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
+# chmod a+r include-fixed/README
$(STAMP) $@
.PHONY: install-gcc-tooldir
@@ -3087,10 +3087,7 @@
(TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
gcc_dir=`${PWD_COMMAND}` ; \
- export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
- cd $(build_objdir)/fixincludes && \
- $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
- $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
+ export TARGET_MACHINE srcdir SHELL MACRO_LIST ); \
rm -f $${fix_dir}/syslimits.h; \
if [ -f $${fix_dir}/limits.h ]; then \
mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \

View File

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|' on
# the right side marks the last column you can put a character in. You must make
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
gcc-latest: gcc-latest (GCC package with C, C++ and D support)
gcc-latest:
gcc-latest: GCC is the GNU Compiler Collection.
gcc-latest:
gcc-latest: D is a general-purpose programming language with static typing,
gcc-latest: systems-level access, and C-like syntax.
gcc-latest:
gcc-latest:
gcc-latest:
gcc-latest:
gcc-latest: