#!/bin/sh :<<'########################################################################' Usage: make_luajit-dev.sh This script downloads and constructs the luajit extension. See ------------------------------------------------------------------------ Change-log: 2011-12-15 First version. ------------------------------------------------------------------------ This script was written in 2011 by vitex from forum.tinycorelinux.net. To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. See http://creativecommons.org/publicdomain/zero/1.0/ for a copy of the CC0 Public Domain Dedication under which this work is distributed. ######################################################################## # Specify the name of the extension. EXTENSION=luajit-dev # Specify the base portion of the extension. EXTENSION0=LuaJIT #----------------------------------------------------------------------- # Install the extensions needed to build this extension. tce-load -wi compiletc.tcz #----------------------------------------------------------------------- # Specify the temporary directory that will contain the build components. TMP=/tmp/tcz # Specify the directory in which the squashfs files will be assembled. SQUASHFS=$TMP/squashfs # Specify the directory in which the submission package will be assembled. PACKAGE=$TMP/package #----------------------------------------------------------------------- # Specify the location containing the software distribution. VERSION=2.0.0-beta9 DOWNLOAD=http://luajit.org/download/LuaJIT-$VERSION.tar.gz #----------------------------------------------------------------------- # Download if necessary. tar tzf $TMP/$(basename $DOWNLOAD) 1>/dev/null 2>&1 || wget -O- $DOWNLOAD >$TMP/$(basename $DOWNLOAD) #----------------------------------------------------------------------- # Save the download for GPL compliance. # cp $TMP/$(basename $DOWNLOAD) $PACKAGE #----------------------------------------------------------------------- # Compute the name of the directory into which the software will be unpacked. DIRECTORY=$TMP/$EXTENSION0-$VERSION #----------------------------------------------------------------------- # Unpack the software. rm -fR $DIRECTORY tar xzf $TMP/$(basename $DOWNLOAD) -C $TMP #----------------------------------------------------------------------- export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export LDFLAGS="-Wl,-O1" #----------------------------------------------------------------------- # Build the software. { cd $DIRECTORY ; make touch $TMP/TIMESTAMP ; sudo make install ; } # Create the luajit executable. ln -sf /usr/local/bin/luajit-$VERSION /usr/local/bin/luajit #----------------------------------------------------------------------- # Copy the installed files (those newer than $TMP/TIMESTAMP) from # /usr/local to $SQUASHFS/usr/local. ( cd / find usr/local -not -type d -newer $TMP/TIMESTAMP | egrep '/include/|/lib/' | cpio -pvd $SQUASHFS ) #----------------------------------------------------------------------- # Create $EXTENSION.tcz.info. cat >$PACKAGE/$EXTENSION.tcz.info <