#!/bin/sh # ###################################################### # Build script for RPI # # # # See .info for details # # # # September 27, 2012 # ###################################################### ###################################################### # Configure extension creation parameters # ###################################################### SRCNAM=libtool-2.4.2.tar.gz WRKDIR=libtool-2.4.2 EXTNAM=libltdl TMPDIR=/tmp/libltdl ###################################################### # Prepare extension creation # ###################################################### # Remove dirs and files left from previous creation rm -r -f $WRKDIR rm -r -f $TMPDIR # Crete temporary directory mkdir -p $TMPDIR ###################################################### # Compile extension # ###################################################### # Export variables needed for compilation export CFLAGS="-Os -pipe -march=armv6 -mfpu=vfp -mfloat-abi=hard" export CXXFLAGS="-Os -pipe -fno-exceptions -fno-rtti -march=armv6 -mfpu=vfp -mfloat-abi=hard" #export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig # Unpack source in current directory tar -xf $SRCNAM # Configure it cd $WRKDIR ./configure --prefix=/usr/local --enable-shared --enable-static # Compile make # Install in base temp dir make install DESTDIR=$TMPDIR # Delete compilation work directory cd .. rm -r -f $WRKDIR # Adjust directory access rigths find $TMPDIR/ -type d | xargs chmod -v 755; # Strip executables find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded # Delete all files except libs rm -r -f $TMPDIR/usr/local/share rm -r -f $TMPDIR/usr/local/bin rm -r -f $TMPDIR/usr/local/include rm -r -f $TMPDIR/usr/local/lib/*.a rm -r -f $TMPDIR/usr/local/lib/*.la ################################################### # Create base extension in temp dir # ################################################### cd $TMPDIR cd .. mksquashfs $TMPDIR $EXTNAM.tcz cd $TMPDIR find usr -not -type d > $EXTNAM.tcz.list mv ../$EXTNAM.tcz . # Create md5 file md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt # Cleanup temp directory rm -r -f usr