From 7758fa3edf1fd0344a6e5f206dd1b64c37853ccd Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Fri, 19 Apr 2013 23:59:58 +0200 Subject: CLISP: make it compile on armv7hl --- source.local/d/clisp/README.arm | 18 +++ source.local/d/clisp/clisp-2.49.arm.patch.gz | Bin 0 -> 4768 bytes source.local/d/clisp/clisp-2.49.linux.patch.gz | Bin 0 -> 462 bytes .../d/clisp/clisp-2.49.makemake_arm.patch.gz | Bin 0 -> 327 bytes source.local/d/clisp/clisp-2.49.tar.bz2.sig | Bin 65 -> 0 bytes source.local/d/clisp/clisp.SlackBuild | 127 +++++++++++---------- source.local/d/clisp/source.download | 9 -- 7 files changed, 87 insertions(+), 67 deletions(-) create mode 100644 source.local/d/clisp/README.arm create mode 100644 source.local/d/clisp/clisp-2.49.arm.patch.gz create mode 100644 source.local/d/clisp/clisp-2.49.linux.patch.gz create mode 100644 source.local/d/clisp/clisp-2.49.makemake_arm.patch.gz delete mode 100644 source.local/d/clisp/clisp-2.49.tar.bz2.sig delete mode 100755 source.local/d/clisp/source.download diff --git a/source.local/d/clisp/README.arm b/source.local/d/clisp/README.arm new file mode 100644 index 0000000..f190aff --- /dev/null +++ b/source.local/d/clisp/README.arm @@ -0,0 +1,18 @@ +ffcall: + +URL: http://www.gnu.org/software/libffcall/ +# There has been no official release for several years, and the project web +# site encourages use of a CVS snapshot. Make the tarball as follows: +# cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/libffcall \ +# export -D 2012-04-24 ffcall +# tar cJf ffcall-20120424cvs.tar.xz ffcall + +clisp: + +URL: http://www.clisp.org/ +# The source for this package was pulled from upstream's mercurial repository. +# Use the following commands to generate the tarball: +# hg clone -u 97c19a70b668 \ +# http://clisp.hg.sourceforge.net:8000/hgroot/clisp/clisp clisp-2.49 +# rm -rf clisp-2.49/.hg* +# tar cvjf clisp-2.49-97c19a70b668hg.tar.bz2 clisp-2.49 diff --git a/source.local/d/clisp/clisp-2.49.arm.patch.gz b/source.local/d/clisp/clisp-2.49.arm.patch.gz new file mode 100644 index 0000000..1f78f57 Binary files /dev/null and b/source.local/d/clisp/clisp-2.49.arm.patch.gz differ diff --git a/source.local/d/clisp/clisp-2.49.linux.patch.gz b/source.local/d/clisp/clisp-2.49.linux.patch.gz new file mode 100644 index 0000000..7200833 Binary files /dev/null and b/source.local/d/clisp/clisp-2.49.linux.patch.gz differ diff --git a/source.local/d/clisp/clisp-2.49.makemake_arm.patch.gz b/source.local/d/clisp/clisp-2.49.makemake_arm.patch.gz new file mode 100644 index 0000000..f5e807a Binary files /dev/null and b/source.local/d/clisp/clisp-2.49.makemake_arm.patch.gz differ diff --git a/source.local/d/clisp/clisp-2.49.tar.bz2.sig b/source.local/d/clisp/clisp-2.49.tar.bz2.sig deleted file mode 100644 index 3de36eb..0000000 Binary files a/source.local/d/clisp/clisp-2.49.tar.bz2.sig and /dev/null differ diff --git a/source.local/d/clisp/clisp.SlackBuild b/source.local/d/clisp/clisp.SlackBuild index 92e74a7..22686ae 100755 --- a/source.local/d/clisp/clisp.SlackBuild +++ b/source.local/d/clisp/clisp.SlackBuild @@ -23,41 +23,51 @@ # Modified 2012 by Eric Hameleers for ARM port. -VERSION=2.49 +VERSION=2.49_20130417hg DIRNAME=2.49 BUILD=${BUILD:-1} # Bundled libraries: -FFCALLVER=20100903cvs +FFCALLVER=20130417cvs LIBSIGSEVVER=2.10 -# Automatically determine the architecture we're building on: -MARCH=$( uname -m ) -if [ -z "$ARCH" ]; then - case "$MARCH" in - i?86) export ARCH=i486 ;; - armv7hl) export ARCH=$MARCH ;; - arm*) export ARCH=arm ;; - # Unless $ARCH is already set, use uname -m for all other archs: - *) export ARCH=$MARCH ;; - esac -fi +NUMJOBS=${NUMJOBS:-" -j7 "} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "s390" ]; then - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" -elif [ "$ARCH" = "armv7hl" ]; then - SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" - LIBDIRSUFFIX="" +if [ -e $CWD/machine.conf ]; then + . $CWD/machine.conf ] +elif [ -e /etc/slackbuild/machine.conf ]; then + . /etc/slackbuild/machine.conf ] else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" + # Automatically determine the architecture we're building on: + MARCH=$( uname -m ) + if [ -z "$ARCH" ]; then + case "$MARCH" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$MARCH ;; + esac + fi + # Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX: + if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" + elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" + elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" + elif [ "$ARCH" = "arm" ]; then + SLKCFLAGS="-O2 -march=armv5te" + LIBDIRSUFFIX="" + elif [ "$ARCH" = "armv7hl" ]; then + SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard" + LIBDIRSUFFIX="" + else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" + fi fi case "$ARCH" in @@ -65,8 +75,6 @@ case "$ARCH" in *) TARGET=$ARCH-slackware-linux ;; esac -NUMJOBS=${NUMJOBS:-" -j7 "} - CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-clisp @@ -134,7 +142,8 @@ CFLAGS="$SLKCFLAGS -fPIC -DMAP_VARIABLE=2" \ --mandir=/usr/man \ --build=$TARGET || exit 1 -make $NUMJOBS || make || exit 1 +# Fails in a parallel build: +make -j1 || exit 1 make install DESTDIR=$PKG || exit 1 # We need ffcall installed in order to build clisp: @@ -155,9 +164,25 @@ rmdir $PKG/usr/share/ # OK, now we compile CLISP: cd $TMP -rm -rf clisp-$VERSION -tar xvf $CWD/clisp-$VERSION.tar.bz2 || exit 1 +rm -rf clisp-$DIRNAME +tar xvf $CWD/clisp-$VERSION.tar.?z* || exit 1 cd clisp-$DIRNAME || exit 1 + +case "$ARCH" in +arm*) + # Support ARM assembly: + zcat $CWD/clisp-2.49.arm.patch.gz | patch -p0 --verbose || exit 1 + zcat $CWD/clisp-2.49.makemake_arm.patch.gz | patch -p0 --verbose || exit 1 + # Allows to build bindings/glibc (this requires FFI as well): + zcat $CWD/clisp-2.49.linux.patch | patch -p0 --verbose || exit 1 + # Different things to build (or not) on ARM: + ARCHOPTS="--with-module=bindings/glibc" + ;; +*) + ARCHOPTS="--with-dynamic-ffi" + ;; +esac + chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ @@ -165,9 +190,14 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -CFLAGS="$SLKCFLAGS -DNO_GENERATIONAL_GC -DNO_MULTIMAP_FILE -DNO_SINGLEMAP -Wa,--noexecstack" \ +# Or else the ARM build fails memory-starved with "handle_fault error2"... +ulimit -s unlimited + +CFLAGS="$SLKCFLAGS -Wa,--noexecstack" \ LDFLAGS="-Wl,-z,noexecstack" \ +FORCE_UNSAFE_CONFIGURE=1 \ ./configure \ + $ARCHOPTS \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ @@ -175,34 +205,15 @@ LDFLAGS="-Wl,-z,noexecstack" \ --with-module=clx/new-clx \ --with-module=pcre \ --with-module=rawsock \ - --with-module=wildcard \ --with-module=zlib \ --cbc with-gcc-wall \ - --with-dynamic-ffi || exit 1 + # || exit 1 + # No longer present in clisp: + #--with-module=wildcard \ + # Want to add this but the compilation fails: + #--with-module=asdf \ -cd with-gcc-wall -./makemake \ - --with-dynamic-ffi \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --with-module=clx/new-clx \ - --with-module=pcre \ - --with-module=rawsock \ - --with-module=wildcard \ - --with-module=zlib \ - --srcdir=../src \ - > Makefile -make config.lisp -make init -make allc -make $NUMJOBS lisp.run -make interpreted.mem -make halfcompiled.mem -make lispinit.mem -make manual -make modular - -make install DESTDIR=$PKG || exit 1 +make -C with-gcc-wall install DESTDIR=$PKG || exit 1 # Strip stuff: find $PKG | xargs file | grep -e "executable" -e "shared object" \ diff --git a/source.local/d/clisp/source.download b/source.local/d/clisp/source.download deleted file mode 100755 index ea5041c..0000000 --- a/source.local/d/clisp/source.download +++ /dev/null @@ -1,9 +0,0 @@ -# http://www.haible.de/bruno/packages-ffcall-README.html -# wget -c http://www.haible.de/bruno/gnu/ffcall-1.10.tar.gz -# wget -c ftp://download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/ffcall-1.10-2.20080704cvs.fc10.src.rpm - -# For Slackware 13.37 and onwards: -# There has been no official release for several years, and the project web -# site encourages use of a CVS snapshot. Make the tarball as follows: -# cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/libffcall export -D 2010-09-04 ffcall -# tar cJf ffcall-20100903cvs.tar.xz ffcall -- cgit v1.2.3