diff options
-rw-r--r-- | development/as31/README | 5 | ||||
-rw-r--r-- | development/as31/as31-fix-duplicate-line.patch | 24 | ||||
-rw-r--r-- | development/as31/as31.SlackBuild | 94 | ||||
-rw-r--r-- | development/as31/as31.info | 10 | ||||
-rw-r--r-- | development/as31/slack-desc | 19 |
5 files changed, 152 insertions, 0 deletions
diff --git a/development/as31/README b/development/as31/README new file mode 100644 index 0000000000000..f34c466546cbf --- /dev/null +++ b/development/as31/README @@ -0,0 +1,5 @@ +as31 (8031/8051 cross assembler) + +as31 is an assembler for the 8031 and 8051 microcontrollers. It +produces output in several different formats, including Intel hex +format and Motorola s-records. diff --git a/development/as31/as31-fix-duplicate-line.patch b/development/as31/as31-fix-duplicate-line.patch new file mode 100644 index 0000000000000..2d9dfc1e98f3d --- /dev/null +++ b/development/as31/as31-fix-duplicate-line.patch @@ -0,0 +1,24 @@ +diff --git a/as31/run.c b/as31/run.c +index 28c5317..9e5263b 100644 +--- a/as31/run.c ++++ b/as31/run.c +@@ -113,7 +113,8 @@ int run_as31(const char *infile, int lst, int use_stdout, + } + + while (!feof(finPre)) { +- getline(&lineBuffer,&sizeBuf,finPre); ++ if (getline(&lineBuffer,&sizeBuf,finPre) == -1) ++ break; + if ((includePtr=strstr(lineBuffer,INC_CMD))) { + includePtr=includePtr+strlen(INC_CMD); + while ((*includePtr==' ')|| //move includePtr to filename +@@ -138,7 +139,8 @@ int run_as31(const char *infile, int lst, int use_stdout, + mesg_f("Cannot open include file: %s\n",includePtr); + } else { + while (!feof(includeFile)) { +- getline(&incLineBuffer,&incSizeBuf,includeFile); ++ if (getline(&incLineBuffer,&incSizeBuf,includeFile) == -1) ++ break; + fprintf(fin,"%s",incLineBuffer); + if (strlen(incLineBuffer)) { + incLineCount++; diff --git a/development/as31/as31.SlackBuild b/development/as31/as31.SlackBuild new file mode 100644 index 0000000000000..99f0584cf46da --- /dev/null +++ b/development/as31/as31.SlackBuild @@ -0,0 +1,94 @@ +#!/bin/sh + +# Slackware build script for as31 + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +PRGNAM=as31 +VERSION=${VERSION:-2.3.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +# for some reason, upstream uses colons for separators in its URL +if [ -e "wiki:projects:linux:as31:$PRGNAM-$VERSION.tar.gz" ]; then + mv "wiki:projects:linux:as31:$PRGNAM-$VERSION.tar.gz" $PRGNAM-$VERSION.tar.gz +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$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 {} \; + +# Patch from Debian, check return value from getline(), seems like +# a good idea. +patch -p1 < $CWD/as31-fix-duplicate-line.patch + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +sh ./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --build=$ARCH-slackware-linux + +# parser.c is generated from parser.y. Using the supplied one causes +# location counter overlaps errors, on x86_64. +( cd $PRGNAM && rm -f parser.c && make parser.c ) + +make +make install-strip DESTDIR=$PKG + +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/examples +cp -a COPYING AUTHORS ChangeLog NEWS README $PKG/usr/doc/$PRGNAM-$VERSION +cp -a examples/*.asm examples/*.ref $PKG/usr/doc/$PRGNAM-$VERSION/examples +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:-tgz} diff --git a/development/as31/as31.info b/development/as31/as31.info new file mode 100644 index 0000000000000..dad6430a70fa2 --- /dev/null +++ b/development/as31/as31.info @@ -0,0 +1,10 @@ +PRGNAM="as31" +VERSION="2.3.1" +HOMEPAGE="http://wiki.erazor-zone.de/doku.php?id=wiki:projects:linux:as31" +DOWNLOAD="http://wiki.erazor-zone.de/_media/wiki:projects:linux:as31:as31-2.3.1.tar.gz" +MD5SUM="e70d7a2d6b80dc37082e79480bb2d1da" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/development/as31/slack-desc b/development/as31/slack-desc new file mode 100644 index 0000000000000..7c109c50697a5 --- /dev/null +++ b/development/as31/slack-desc @@ -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 ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +as31: as31 (8031/8051 cross assembler) +as31: +as31: as31 is an assembler for the 8031 and 8051 microcontrollers. +as31: It produces output in several different formats, including Intel hex +as31: format and Motorola s-records. +as31: +as31: +as31: +as31: +as31: +as31: |