Commits

Volker Braun committed 8f0e1fc

add spkg template

Comments (0)

Files changed (5)

 doc/pdf
 spkg/compilerwrapper-*.spkg
 test/*pyc
-test/local
+test/local
+spkg/sage

spkg/make_spkg.sh

 tar xf "$TARBALL"
 mv "compilerwrapper-$VERSION" src
 echo 'src' > .hgignore
-hg add
+hg init
 hg commit -m "Updated to compilerwrapper-$VERSION"
 
 cd "$TOPDIR/spkg"

spkg/template/.hgignore

+src
+.*~

spkg/template/SPKG.txt

+= Compiler Wrapper =
+
+== Description ==
+
+A wrapper for compiler and binutils that sets rpath, removes
+optimizations on broken archs and gcc versions, and generally helps to
+compile Sage more easily.
+
+== License ==
+
+GPL v2+
+
+== SPKG Maintainers ==
+
+ * Volker Braun <vbraun.name@gmail.com>
+
+== Upstream Contact ==
+
+https://bitbucket.org/vbraun/compilerwrapper
+Volker Braun <vbraun.name@stp.dias.ie>
+
+== Dependencies ==
+
+ * None
+
+== Special Update/Build Instructions ==
+
+The src/ subdirectory is a clone of my mercurial repository at
+https://bitbucket.org/vbraun/compilerwrapper. You can update the
+source tree with "hg pull -u".
+
+== Changelog ==
+
+=== compilerwrapper-1.2 (Volker Braun, June 4, 2013) ===
+ * Add Sage support (configure --enable-sage, see documentation)
+
+=== compilerwrapper-1.1 (Volker Braun, May 28th, 2011) ===
+ * New release with configureable gcc names, documentation, ...
+ 
+=== compilerwrapper-1.0 (Volker Braun, Jan 8th, 2011) ===
+ * Initial version

spkg/template/spkg-install

+#!/usr/bin/env bash
+
+if [ "$SAGE_LOCAL" = "" ]; then
+   echo "SAGE_LOCAL undefined ... exiting";
+   echo "Maybe run 'sage -sh'?"
+   exit 1
+fi
+
+# remove wrapper if it is already installed
+rm -f $SAGE_LOCAL/bin/gcc 
+rm -f $SAGE_LOCAL/bin/cc
+rm -f $SAGE_LOCAL/bin/c89 
+rm -f $SAGE_LOCAL/bin/c99
+rm -f $SAGE_LOCAL/bin/c++
+rm -f $SAGE_LOCAL/bin/g++
+rm -f $SAGE_LOCAL/bin/ld
+
+CC_FILENAME=`src/scripts/find_executable.sh --CC --exclude="$SAGE_LOCAL/bin"`
+CC_PATH=`dirname "$CC_FILENAME"`
+
+LD_FILENAME=`src/scripts/find_executable.sh --LD --exclude="$SAGE_LOCAL/bin"`
+LD_PATH=`dirname "$LD_FILENAME"`
+
+echo "Setting up the compiler/binutils wrapper"
+echo "Real location of compiler: $CC_PATH" 
+echo "Real location of binutils: $LD_PATH" 
+
+cd src
+./configure --prefix="$SAGE_LOCAL" \
+            --with-ccpath="$CC_PATH" \
+            --with-ldpath="$LD_PATH" \
+            --enable-sage
+if [ $? -ne 0 ]; then
+  echo "Error configuring the compiler wrapper."
+  exit 1
+fi
+
+$MAKE
+if [ $? -ne 0 ]; then
+  echo "Error building the compiler wrapper."
+  exit 1
+fi
+
+$MAKE install
+if [ $? -ne 0 ]; then
+  echo "Error installing the gcc wrapper."
+  exit 1
+fi
+
+