summaryrefslogtreecommitdiffstats
path: root/development/pcc
diff options
context:
space:
mode:
Diffstat (limited to 'development/pcc')
-rw-r--r--development/pcc/README38
-rw-r--r--development/pcc/pcc.SlackBuild74
-rw-r--r--development/pcc/pcc.info12
-rw-r--r--development/pcc/slack-desc2
4 files changed, 83 insertions, 43 deletions
diff --git a/development/pcc/README b/development/pcc/README
index 37a36505d5..eae8f47b89 100644
--- a/development/pcc/README
+++ b/development/pcc/README
@@ -1,20 +1,30 @@
-pcc (Portable C Compiler) is based on the original Portable C Compiler
-by S. C. Johnson, written in the late 70's. About 50% of the frontend
-code and 80% of the backend code has been rewritten.
+pcc (Portable C Compiler)
+
+pcc is based on the original Portable C Compiler by S. C. Johnson,
+written in the late 1970s. About 50% of the frontend code and 80% of
+the backend code has been rewritten.
Build options (environment variables):
+
TLS - Enable thread local storage? Default=no, export TLS=yes to enable.
-CC - Compiler to use. Default is to look for pcc, gcc, clang (in that order).
+CC - Compiler to use. Default: look for pcc and clang (in that order).
+ It's no longer possible to use CC=gcc.
+
+Notes:
+
+1. To bootstrap pcc, first remove any old versions of pcc
+ (and pcc-libs, if present), then build and install pcc twice
+ (without setting CC). The first time, pcc will be built with
+ clang. The second time, it will be built with itself.
-This build is for the 1.1.0 release of pcc. The 1.0 release no longer
-works on modern Slackware versions (newer than 13.37). The old pcc
-1.0 had separate builds for pcc and pcc-libs; this build includes the
-libraries so no separate pcc-libs is needed (or exists).
+2. This build is for a post-1.1.0 snapshot of pcc. The 1.0 release no
+ longer works on modern Slackware versions (newer than 13.37), and
+ the 1.1.0 release no longer works on Slackware 15.0. The old pcc
+ 1.0 had separate builds for pcc and pcc-libs; this build includes
+ the libraries so no separate pcc-libs is needed (or exists).
-Optional step: To bootstrap pcc, first remove any old versions of pcc
-(and pcc-libs, if present), then build and install pcc twice (without
-setting CC). The first time, pcc will be built with gcc. The second time,
-it will be built with itself.
+3. pcc is a C compiler only. There is experimental, incomplete
+ support for C++ and Fortran 77 in the pcc codebase, but neither is
+ usable yet.
-Note: pcc is a C compiler only. There is experimental, incomplete support
-for C++ and Fortran 77 in the pcc codebase, but neither is usable yet.
+See also: http://pcc.ludd.ltu.se/ftp/pub/pcc-docs/
diff --git a/development/pcc/pcc.SlackBuild b/development/pcc/pcc.SlackBuild
index af48a94e74..2d24b68b61 100644
--- a/development/pcc/pcc.SlackBuild
+++ b/development/pcc/pcc.SlackBuild
@@ -1,10 +1,22 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for pcc (Portable C Compiler)
-# Originally written by Armin Besirovic <armin[at]linux[dot]org[dot]ba>
+# Originally written by Armin Besirovic <email removed>
+# Modified by B. Watson <urchlay@slackware.uk>
-# Modified by B. Watson <yalhcru@gmail.com>
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20230108 bkw: updated for 1.2.0.DEVEL+20230108.
+
+# 20210906 bkw:
+# - updated for 1.2.0.DEVEL+20210905. Putting the .DEVEL in VERSION
+# is a bit unsightly, but it matches the output of "pcc --version"
+# and also Debian's version numbering scheme.
+# - compiling with gcc no longer works, use clang or pcc. actually,
+# compiling with gcc gives us a pcc that seems to compile stuff OK,
+# but anything compiled with that pcc will segfault on startup.
+# - add WTPL (since there was no license at all).
# 20141031 bkw:
# - took over maintentance.
@@ -25,10 +37,21 @@
# - upgraded for pcc-1.1.0 release, no more beta
# - add seddery to fix typo in cc.c (ifdef => ifndef)
+# Note to self: when updating to a new CVS snapshot, first download
+# the latest: http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-current.tgz Then
+# look at the file DATESTAMP inside that tarball, and use that date's
+# snapshot. This is because the CVS snap tarballs are generated
+# nightly, whether or not there actually were any code changes,
+# and we want VERSION to be the date of the last actual code change.
+# For pcc-libs, just use the same snapshot date as pcc.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=pcc
-VERSION=${VERSION:-1.1.0}
+VERSION=${VERSION:-1.2.0.DEVEL+20230108}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -38,11 +61,17 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+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}
+TARVER=${VERSION/*+}
+
# non-standard stanza here: we're not going to use -march= or -mtune=
# on 32-bit Slackware, because doing so prevents pcc from being used
# to compile itself. I could add logic to use those flags only if
@@ -61,15 +90,23 @@ if [ "$CC" = "" ]; then
# user didn't specify, autodetect.
if pcc --version &>/dev/null; then
CC=pcc
- elif gcc --version &>/dev/null; then
- CC=gcc
elif clang --version &>/dev/null; then
CC=clang
+ SLKCFLAGS+=" -fcommon"
else
- echo "Can't find any of pcc, gcc, or clang in \$PATH. Giving up." 1>&2
+ echo "Can't find pcc or clang in \$PATH. Giving up." 1>&2
fi
fi
+# let the user shoot himself in the foot if he insists, but at least
+# warn him how much it's going to hurt.
+if [ "$CC" = "gcc" ]; then
+ echo
+ echo "!!! CC is gcc, this will produce a non-working pcc. You asked for it..."
+ echo
+ sleep 3
+fi
+
export CC
WITHCC="$( basename $CC )"
[ "$CC" = "pcc" ] && WITHCC="pcc itself"
@@ -83,23 +120,16 @@ fi
rm -rf $PKG $TMP/$PRGNAM
mkdir -p $TMP/$PRGNAM $PKG $OUTPUT
cd $TMP/$PRGNAM
-tar xvf $CWD/$PRGNAM-$VERSION.tgz
-tar xvf $CWD/$PRGNAM-libs-$VERSION.tgz
+tar xvf $CWD/$PRGNAM-$TARVER.tgz
+tar xvf $CWD/$PRGNAM-libs-$TARVER.tgz
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 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# first, the compiler itself:
-cd $PRGNAM-$VERSION
-
-# fix typo, ref http://marc.info/?l=pcc-list&m=141824411830017&w=2
-sed -i '0,/^#ifdef MULTI/!s,^#ifdef \(MULTI\),#ifndef \1,' cc/cc/cc.c
+cd $PRGNAM-$TARVER
CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
./configure \
$TLSOPT \
--prefix=/usr \
@@ -126,7 +156,7 @@ sed -n '/Copyright/,/^ *$/s,^...,,p' cc/cc/cc.c \
# now, build the libs. we don't attempt to build them with the just-built
# pcc (maybe possible, but not worth the effort).
-cd $TMP/$PRGNAM/$PRGNAM-libs-$VERSION
+cd $TMP/$PRGNAM/$PRGNAM-libs-$TARVER
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -148,4 +178,4 @@ sed -e "s,@WITHCC@,$WITHCC," \
$CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/development/pcc/pcc.info b/development/pcc/pcc.info
index 9bd158fca7..c8c63575a1 100644
--- a/development/pcc/pcc.info
+++ b/development/pcc/pcc.info
@@ -1,12 +1,12 @@
PRGNAM="pcc"
-VERSION="1.1.0"
+VERSION="1.2.0.DEVEL+20230108"
HOMEPAGE="http://pcc.ludd.ltu.se/"
-DOWNLOAD="http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/pcc-1.1.0.tgz \
- http://pcc.ludd.ltu.se/ftp/pub/pcc-releases/pcc-libs-1.1.0.tgz"
-MD5SUM="1c0f22440753075d64f9f2c6ed0e8278 \
- 360c157bbf6a7a931c4760ccf4ad704a"
+DOWNLOAD="http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-20230108.tgz \
+ http://pcc.ludd.ltu.se/ftp/pub/pcc-libs/pcc-libs-20230108.tgz"
+MD5SUM="bb6efe9e9cf4c34d9dc91bd8d875aac3 \
+ f3758725f766df5721d106ab8b21926a"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="B. Watson"
-EMAIL="yalhcru@gmail.com"
+EMAIL="urchlay@slackware.uk"
diff --git a/development/pcc/slack-desc b/development/pcc/slack-desc
index a04f018fea..f105427ffe 100644
--- a/development/pcc/slack-desc
+++ b/development/pcc/slack-desc
@@ -9,7 +9,7 @@
pcc: pcc (Portable C Compiler)
pcc:
pcc: The compiler is based on the original Portable C Compiler by S. C.
-pcc: Johnson, written in the late 70's. About 50% of the frontend code
+pcc: Johnson, written in the late 1970s. About 50% of the frontend code
pcc: and 80% of the backend code has been rewritten. See the PCC History
pcc: wiki page for details.
pcc: