#!/bin/sh # ###################################################### # Build script # # # # See .info for details # ###################################################### # !!! CA's and startup script added manually to .tcz # !!! not part of build script STD_DEPS="compiletc squashfs-tools libtool perl5" BUILD_DEPS="" TCZ_DEPS="" DEV_TCZ_DEPS="" FULL_DEPS="$STD_DEPS $BUILD_DEPS" for deps in $FULL_DEPS; do tce-status -i | grep -q ${deps%.*} if [ $? -ne 0 ]; then tce-load -i $deps >/dev/null 2>&1 if [ $? -eq 0 ]; then echo "Loaded $deps..." else echo "Failed to load $deps... exiting" exit 1 fi fi done ###################################################### # Configure extension creation parameters # ###################################################### SRCNAM=openssl-1.1.1k.tar.gz WRKDIR=openssl-1.1.1k EXTNAM=openssl TMPDIR=/tmp/openssl ###################################################### # Prepare extension creation # ###################################################### # Remove dirs and files left from previous creation rm -r -f $WRKDIR rm -r -f $TMPDIR rm -r -f $TMPDIR-doc rm -r -f $TMPDIR-dev # Crete temporary directory mkdir -p $TMPDIR ###################################################### # Compile extension # ###################################################### # Export variables needed for compilation export CFLAGS="-Os -pipe -march=armv8-a+crc -mtune=cortex-a72 -fuse-ld=gold" export CXXFLAGS="-Os -pipe -fno-exceptions -fno-rtti -march=armv8-a+crc -mtune=cortex-a72 -fuse-ld=gold" # Unpack source in current directory tar -xf $SRCNAM # Configure it cd $WRKDIR ./Configure \ linux-aarch64 \ -march=armv8-a \ -D__ARMMAX_ARCH__=8 \ --prefix=/usr/local \ zlib \ shared \ --openssldir=/etc/ssl #-Wl,--version-script=/tmp/openssl.ld # Compile make depend make -j4 [ $? -ne 0 ] && exit 1 # 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 # Move files to doc extension mkdir -p $TMPDIR-doc/usr/local mv $TMPDIR/usr/local/share $TMPDIR-doc/usr/local # Move files to dev extension mkdir -p $TMPDIR-dev/usr/local/lib mv $TMPDIR/usr/local/include $TMPDIR-dev/usr/local mv $TMPDIR/usr/local/lib/*.a $TMPDIR-dev/usr/local/lib mv $TMPDIR/usr/local/lib/*.la $TMPDIR-dev/usr/local/lib mv $TMPDIR/usr/local/lib/pkgconfig $TMPDIR-dev/usr/local/lib ################################################### # Create base extension in temp dir # ################################################### cd $TMPDIR cd .. mksquashfs $TMPDIR $EXTNAM.tcz cd $TMPDIR find etc 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 etc rm -r -f usr ################################################### # Create doc extension in temp dir # ################################################### cd $TMPDIR-doc cd .. mksquashfs $TMPDIR-doc $EXTNAM-doc.tcz cd $TMPDIR-doc find usr -not -type d > $EXTNAM-doc.tcz.list mv ../$EXTNAM-doc.tcz . # Create md5 file md5sum $EXTNAM-doc.tcz > $EXTNAM-doc.tcz.md5.txt # Cleanup temp directory rm -r -f usr ################################################### # Create dev extension in temp dir # ################################################### cd $TMPDIR-dev cd .. mksquashfs $TMPDIR-dev $EXTNAM-dev.tcz cd $TMPDIR-dev find usr -not -type d > $EXTNAM-dev.tcz.list mv ../$EXTNAM-dev.tcz . # Create md5 file md5sum $EXTNAM-dev.tcz > $EXTNAM-dev.tcz.md5.txt # Cleanup temp directory rm -r -f usr