summaryrefslogtreecommitdiff
path: root/source/d/p2c
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/p2c')
-rwxr-xr-xsource/d/p2c/p2c.SlackBuild29
-rw-r--r--source/d/p2c/p2c.getline.diff118
-rw-r--r--source/d/p2c/slack-desc12
3 files changed, 144 insertions, 15 deletions
diff --git a/source/d/p2c/p2c.SlackBuild b/source/d/p2c/p2c.SlackBuild
index 4c2508d3..4f6c255d 100755
--- a/source/d/p2c/p2c.SlackBuild
+++ b/source/d/p2c/p2c.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,29 +20,39 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
# Sources:
# ftp://ftp.pal.xgw.fi/pub/gnu/alpha/gnu/p2c-1.21alpha2.tar.gz
# ftp://ftp.clara.net/pub/mirrors/gnu/hurd/p2c-1.21alpha2.tar.gz
# ftp://ftp.obspm.fr/pub1/computing/gnu/hurd/p2c-1.21alpha2.tar.gz
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=p2c
VERSION=${VERSION:-1.21alpha2}
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
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 "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
@@ -55,7 +65,6 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-p2c
@@ -80,6 +89,8 @@ find . \
zcat $CWD/p2c_1.21alpha2-2.1.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
zcat $CWD/p2c_time.diff.gz | patch -p0 --verbose --backup --suffix=.orig || exit 1
+zcat $CWD/p2c.getline.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+
find . -name "*.orig" | xargs rm --verbose
# Fix library paths:
sed -i -e "s#/lib #/lib${LIBDIRSUFFIX} #g" \
@@ -89,7 +100,7 @@ sed -i -e "s#/lib #/lib${LIBDIRSUFFIX} #g" \
cd src
make OPT="$SLKCFLAGS" || exit 1
-make p2cc
+make p2cc || exit 1
mv $PKG/usr/lib $PKG/usr/lib${LIBDIRSUFFIX} 2>/dev/null
cat p2c > $PKG/usr/bin/p2c
diff --git a/source/d/p2c/p2c.getline.diff b/source/d/p2c/p2c.getline.diff
new file mode 100644
index 00000000..25df12c1
--- /dev/null
+++ b/source/d/p2c/p2c.getline.diff
@@ -0,0 +1,118 @@
+--- ./src/lex.c.orig 1993-12-07 23:36:49.000000000 -0600
++++ ./src/lex.c 2018-02-01 15:27:54.224877642 -0600
+@@ -1044,7 +1044,7 @@
+
+
+
+-void getline()
++void p2c_getline()
+ {
+ char *cp, *cp2;
+
+@@ -1071,7 +1071,7 @@
+ infname = stralloc(cp);
+ infname[cp2 - cp] = 0;
+ }
+- getline();
++ p2c_getline();
+ return;
+ }
+ if (copysource && *inbuf) {
+@@ -1088,7 +1088,7 @@
+ fprintf(stderr, "\n");
+ if (inputkind == INP_INCFILE) {
+ pop_input();
+- getline();
++ p2c_getline();
+ } else
+ strcpy(inbuf, "\001");
+ }
+@@ -1179,7 +1179,7 @@
+ infname = fname;
+ inf_lnum = 0;
+ } else
+- inf_lnum--; /* adjust for extra getline() */
++ inf_lnum--; /* adjust for extra p2c_getline() */
+ *inbuf = 0;
+ inbufptr = inbuf;
+ gettok();
+@@ -2367,7 +2367,7 @@
+ else
+ commentline(CMT_POST);
+ trailing = 0;
+- getline();
++ p2c_getline();
+ i = 0;
+ for (;;) {
+ if (*inbufptr == ' ') {
+@@ -2419,7 +2419,7 @@
+ if (isspace(*inbufptr)) {
+ inbufptr++;
+ } else if (!*inbufptr) {
+- getline();
++ p2c_getline();
+ } else if (*inbufptr == '{') {
+ inbufptr++;
+ comment(0);
+@@ -2513,7 +2513,7 @@
+ switch (*inbufptr++) {
+
+ case 0:
+- getline();
++ p2c_getline();
+ break;
+
+ case ' ':
+@@ -2765,7 +2765,7 @@
+ case 0:
+ if (commenting_flag)
+ saveinputcomment(inbufptr-1);
+- getline();
++ p2c_getline();
+ cp = curtokbuf;
+ for (;;) {
+ inbufindent = 0;
+@@ -2782,7 +2782,7 @@
+ }
+ if (!*inbufptr && !commenting_flag) { /* blank line */
+ *cp++ = '\001';
+- getline();
++ p2c_getline();
+ } else
+ break;
+ }
+@@ -2797,10 +2797,10 @@
+ *cp++ = '\001';
+ *cp++ = '\014';
+ if (!*inbufptr && !commenting_flag) {
+- getline();
++ p2c_getline();
+ while (!*inbufptr) {
+ *cp++ = '\001';
+- getline();
++ p2c_getline();
+ }
+ }
+ *cp = 0;
+--- ./src/parse.c.orig 2018-02-01 15:25:56.206878896 -0600
++++ ./src/parse.c 2018-02-01 15:28:00.997877570 -0600
+@@ -5073,7 +5073,7 @@
+ out_include(fname, 1);
+ outsection(majorspace);
+ pop_input();
+- getline();
++ p2c_getline();
+ gettok();
+ }
+
+--- ./src/TAGS.orig 1993-12-07 23:36:55.000000000 -0600
++++ ./src/TAGS 2018-02-01 15:27:50.927877677 -0600
+@@ -176,7 +176,7 @@
+ char getchartok(2466,60243
+ Static int getflag(2451,60064
+ char *getinlinepart(2414,59241
+-void getline(1047,22000
++void p2c_getline(1047,22000
+ char *getparenstr(2481,60499
+ void gettok(2728,65611
+ void gettok(2752,66193
diff --git a/source/d/p2c/slack-desc b/source/d/p2c/slack-desc
index 058ac204..18e6e69f 100644
--- a/source/d/p2c/slack-desc
+++ b/source/d/p2c/slack-desc
@@ -1,19 +1,19 @@
# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description. Line
+# 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
+# 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------------------------------------------------------|
p2c: p2c (Pascal to C translator)
p2c:
-p2c: P2c is a tool for translating Pascal programs into C. The input
+p2c: P2c is a tool for translating Pascal programs into C. The input
p2c: consists of a set of source files in any of the following Pascal
-p2c: dialects: HP Pascal, Turbo/UCSD Pascal, DEC VAX Pascal, Oregon
+p2c: dialects: HP Pascal, Turbo/UCSD Pascal, DEC VAX Pascal, Oregon
p2c: Software Pascal/2, Macintosh Programmer's Workshop Pascal,
p2c: Sun/Berkeley Pascal, Texas Instruments Pascal, Apollo Domain Pascal.
-p2c: Modula-2 syntax is also supported. Output is a set of .c and .h
+p2c: Modula-2 syntax is also supported. Output is a set of .c and .h
p2c: files that comprise an equivalent program in any of several dialects
p2c: of C.
p2c: