Added make bundle

This commit is contained in:
bauen1 2017-11-26 19:43:50 +01:00
parent d62f02178e
commit f8cfd22965
No known key found for this signature in database
GPG Key ID: FF0AAF5E0812BA9C
4 changed files with 93 additions and 0 deletions

View File

@ -109,6 +109,12 @@ LINKS_SOURCE_URL=http://links.twibright.com/download/links-2.14.tar.bz2
#
LUA_SOURCE_URL=https://www.lua.org/ftp/lua-5.3.4.tar.gz
# You can find the latest make source bundles here:
#
# http://www.gnu.org/software/make
#
MAKE_SOURCE_URL=ftp://ftp.gnu.org/gnu/make/make-4.2.1.tar.bz2
# You can find the latest nano source bundles here:
#
# https://nano-editor.org/download.php

View File

@ -0,0 +1,41 @@
#!/bin/bash
SRC_DIR=$(pwd)
. ../../common.sh
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i MAKE_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
# Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd $MAIN_SRC_DIR/source/overlay
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading make source bundle file. The '-c' option allows the download to resume.
echo "Downloading make source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL
else
echo "Using local make source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted make.
echo "Removing make work area. This may take a while..."
rm -rf $WORK_DIR/overlay/make
mkdir $WORK_DIR/overlay/make
# Extract make to folder 'work/overlay/make'.
# Full path will be something like 'work/overlay/make/make-8.28'.
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/make
cd $SRC_DIR

View File

@ -0,0 +1,38 @@
#!/bin/bash
SRC_DIR=$(pwd)
. ../../common.sh
cd $WORK_DIR/overlay/make
DESTDIR="$PWD/make_installed"
# Change to the make source directory which ls finds, e.g. 'make-8.28'.
cd $(ls -d make-*)
echo "Preparing make work area. This may take a while..."
make -j $NUM_JOBS clean
rm -rf $DESTDIR
echo "Configuring make..."
CFLAGS="$CFLAGS" ./configure \
--prefix=/usr
echo "Building make..."
make -j $NUM_JOBS
echo "Installing make..."
make -j $NUM_JOBS install DESTDIR=$DESTDIR
echo "Reducing make size..."
strip -g $DESTDIR/usr/bin/*
ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs"
cp -r $DESTDIR/* $ROOTFS
echo "make has been installed."
cd $SRC_DIR

View File

@ -0,0 +1,8 @@
#!/bin/bash
SRC_DIR=$(pwd)
./01_get.sh
./02_build.sh
cd $SRC_DIR