Commits (11)
  • Ben Avison's avatar
    Refactor cross-compilation environment scripts · 09cc90ae
    Ben Avison authored
    Detail:
      In tentative efforts to support cross-compilation to date, a few
      components have had mk.sh scripts inserted. These are functionally
      equivalent to the !Mk* TaskObey files, in that they are a convenience for
      developers working on that component in isolation. However, unlike their
      RISC OS equivalents, the nature of shell scripts means that they are
      relatively complex, and are therefore relatively burdensome to create and
      maintain. This commit replaces this mechanism with a shell function which
      is defined when you source the Env file. This enables a build phase to be
      applied to the component at the working directory to be built with a
      simple "mk export", "mk install", "mk rom", "mk clean" and so on.
      Previously, the build variables COMPONENT, TARGET and INSTDIR were encoded
      in the mk.sh script, and where a component had multiple targets, the mk.sh
      script would run the phase on all such components; now the mk function
      scans the ModuleDB to locate this information instead. You can even target
      a component in another directory using the -C switch (chosen to match
      make's equivalent switch). Some efforts have also been made to support
      Posix shells other than bash. The only feature dropped is the ability to
      build the component using a different environment within a subshell.
      However it's relatively simple to construct this at the command line if
      desired.
    
    Version 1.38. Tagged as 'Env-1_38'
    09cc90ae
  • Ben Avison's avatar
    Fix for cross-compilation of components with TARGET or INSTDIR undefined in ModuleDB · e6b68db6
    Ben Avison authored
    In cases where mk's environment didn't define these, the null definition from
    ModuleDB was overriding any default definitions in the Makefile, which is very
    unhelpful!
    e6b68db6
  • Ben Avison's avatar
  • Ben Avison's avatar
  • Ben Avison's avatar
    Cross-compilation make wrapper: tighten rule about inferring COMPONENT from ModuleDB · eab290ea
    Ben Avison authored
    Version 1.39. Tagged as 'Env-1_39'
    eab290ea
  • Ben Avison's avatar
    Detect AMU version number and feature at runtime · 4ecd3b18
    Ben Avison authored
    Extract the version number from AMU's help message and set `AMU$Version`
    accordingly. Also set `AMU$HasWorkingWildcard` depending upon whether the
    installed version of AMU has a fully functional `$(wildcard)` function.
    
    Version 1.40. Tagged as 'Env-1_40'
    4ecd3b18
  • Ben Avison's avatar
    Correction: AMU$HasWorkingWildcard requires *SetEval, not *Set · 9e938db3
    Ben Avison authored
    Version 1.41. Tagged as 'Env-1_41'
    9e938db3
  • Ben Avison's avatar
    Fix changes in Env 1.40-1.41 so they work after a clean boot · 1533dafc
    Ben Avison authored
    These relied on calling the GNU.gawk binary, but did so *before* the run path
    was guaranteed to point at it. Move that block of lines lower down.
    
    Also remove unused (and commented) Src$Dir definition within the lines that
    we move it past.
    1533dafc
  • Ben Avison's avatar
    Make Env files work with default 640K again · 8d84772b
    Ben Avison authored
    Changes in Env 1.40-1.41 require GNU.gawk and amu within the same application
    slot at the same time, which exceeds the default 640K WimpSlot. There isn't
    actually any need for the awk script to run within a Makefile (it's not
    testing the Makefile's behaviour directly) so by moving the lines up to
    !Common, the memory usage is reduced.
    
    Version 1.42. Tagged as 'Env-1_42'
    8d84772b
  • Robert Sprowson's avatar
    Shrink oversize HALs · b7e58533
    Robert Sprowson authored
    Now the HALs don't carry copies of the USB stack, these 2 are overweight.
    OMAP3 -> 64k (still approx 23k free)
    iMx6 -> 96k (still approx 32k free)
    
    Version 1.43. Tagged as 'Env-1_43'
    b7e58533
  • James Byrne's avatar
    Make the !Common.sh mk function exit on an error · 47627fdd
    James Byrne authored
    Detail:
    The mk function had the bad habit of hiding failed builds by always
    returning an exit code of zero. It will now exit with 1 on a failure.
    
    Version 1.44. Tagged as 'Env-1_44'
    47627fdd
......@@ -44,17 +44,6 @@ RMEnsure SharedUnixLibrary 1.12 RMLoad <Build$Dir>.Modules.SharedULib
RMEnsure SharedCLibrary 5.18 RMLoad System:Modules.CLib
RMEnsure SharedCLibrary 5.18
|
| Determine whether we have a working or broken amu - if it is working (5.13 or later), the system variable
| BuildSys$AMU$Fixed will be set to "yes" - otherwise "yes". To cope with the broken Makefiles in the build
| tree, for the time being the compatibility option is required for the fixed version of AMU. Older versions
| do not require this fix, but also need to pass environment variables in explicitly.
|
/<Tools$Dir>.Acorn.amu -f <Build$Dir>.Env.Makefile FIXED=yes find-amu-version
set alias$amu_machine amu MACHINE=<Machine> LOCALE=<Locale> SYSTEM=<System> BUILD=<Build> UserIF=<UserIF> APCS=<APCS> %%*0
if "<BuildSys$AMU$Fixed>"="yes" Then set alias$amu_machine amu -E %%*0
|
| This is setup so this can be run multiple times without extending Run$Path
if "<Build$Setup>" = "" then set Run$Path Build:,Apps:,<Run$Path>
setmacro Build$Path <Tools$Dir>.Acorn.,<Tools$Dir>.Build.,<Tools$Dir>.Unix.,<Tools$Dir>.Misc.,<Tools$Dir>.,<Tools$Dir>.DrSmiths.Utilities.
......@@ -62,10 +51,18 @@ set BASIC$Path Build:
Set Apps$Path <Build$Dir>.Apps.
Set Makefiles$Path <Build$Dir>.BuildSys.Makefiles.
|
|set Src$Dir <Build$Dir>.Sources
set Install$Dir <Build$Dir>.Install
setmacro Install$Path <Install$Dir>.
| Determine amu features
amu -help { > <Wimp$ScrapDir>.amu }
GNU.gawk "NR==2 { print \"Set AMU$Version \" $3*100 }" < <Wimp$ScrapDir>.amu > Pipe:$.amu
Remove <Wimp$ScrapDir>.amu
Obey Pipe:$.amu
SetEval AMU$HasWorkingWildcard <AMU$Version> > 532
|
Set Alias$amu_machine amu -E %%*0
| Locate the export directories and set the tool options
/Build:ToolOptions.<APCS>
|
......
# Common setup for build environment
# Include from an Env file, with "RiscOS" as the current directory
# Include from an Env file
#
[ "$MACHINE" != "" ] || { echo "No build selected - Run an Env file"; exit 1; }
export BUILDDIR=`pwd`
export TOOLSDIR=$BUILDDIR/Library
export ROOL_BIN=/opt/rool/bin
[ "$GCCSDK_INSTALL_CROSSBIN" != "" ] || export GCCSDK_INSTALL_CROSSBIN=/opt/gccsdk/cross/bin
# Replace existing entries on PATH to prevent it growing indefinitely
export PATH=$TOOLSDIR/Build:$TOOLSDIR/Misc:$ROOL_BIN:$GCCSDK_INSTALL_CROSSBIN:`echo -n $PATH | awk 'BEGIN{P="('$TOOLSDIR'|'$ROOL_BIN'|'$GCCSDK_INSTALL_CROSSBIN')";RS=":";ORS=":"}$0!~P' | sed 's/:$//'`
PATH=$TOOLSDIR/Build:$TOOLSDIR/Misc:$ROOL_BIN:$GCCSDK_INSTALL_CROSSBIN:$(printf "%s" "$PATH" | awk 'BEGIN{P="('"$TOOLSDIR"'|'"$ROOL_BIN"'|'"$GCCSDK_INSTALL_CROSSBIN"')";RS=":";ORS=":"}$0!~P' | sed 's/:$//')
export PATH
export APPDIR=$BUILDDIR/Apps
export MAKEFILEDIR=$BUILDDIR/BuildSys/GNUmakefiles
#export SRCDIR=$BUILDDIR/Sources
export INSTALLDIR=$BUILDDIR/Install
if [ "$APCS" == "APCS-R" ]; then
if [ "$APCS" = "APCS-R" ]; then
TOOLOPTIONS="-26bit"
ASASM_TOOLOPTIONS="-apcs26 -apcsfpv2"
CMUNGE_TOOLOPTIONS="-26bit -apcs 3/26bit/fpe2"
GCC_TOOLOPTIONS="-mapcs-26 -march=armv2 -mfpu=fpe2"
NCC_TOOLOPTIONS="-APCS 3/26bit/fpe2"
OBJASM_TOOLOPTIONS="-APCS 3/26bit"
elif [ "$APCS" == "APCS-32" ]; then
elif [ "$APCS" = "APCS-32" ]; then
TOOLOPTIONS="-32bit"
ASASM_TOOLOPTIONS="-apcs32 -apcsfpv3"
CMUNGE_TOOLOPTIONS="-32bit -apcs 3/32bit/fpe3"
......@@ -92,4 +91,49 @@ export CEXPORTDIR=$APCSEXPORTDIR/C
export LIBDIR=$APCSEXPORTDIR/Lib
# This enables you to simply type "make all" from the command line
alias make="make -I$MAKEFILEDIR --no-print-directory"
alias make="make -I\"\$MAKEFILEDIR\" --no-print-directory"
# This is similar, but infers COMPONENT, TARGET and INSTDIR from the ModuleDB
# if possible. Where a source directory occurs multiple times within the
# ModuleDB, make is invoked once for each possible COMPONENT, unless a single
# COMPONENT is specified in the environment. Settings of TARGET and INSTDIR
# from the environment also override those from the ModuleDB. You can also
# use the -C switch to avoid having to cd to a component first, just like
# with make. Any additional arguments (make targets etc) are passed to make.
mk ()
{(
COMPONENTDIR=$(pwd)
if [ "$1" = "-C" ]; then
COMPONENTDIR="$(cd "$2" && pwd)"
shift
shift
fi
RELPATH=$(echo "${COMPONENTDIR#*$BUILDDIR/}" | tr / .)
MYTMP=$(mktemp)
if [ -n "$COMPONENT" ]; then
grep "^$COMPONENT " "$BUILDDIR/BuildSys/ModuleDB" > "$MYTMP"
else
grep "$RELPATH\( \|$\)" "$BUILDDIR/BuildSys/ModuleDB" > "$MYTMP"
fi
if [ $? -ne 0 ]; then
# Component not found in ModuleDB - can't infer anything
make -C "$COMPONENTDIR" "$@" || { rm "$MYTMP"; exit 1; }
else
while read -r DB_COMPONENT _ _ DB_INSTDIR DB_TARGET; do
ARGS=""
if [ -z "$COMPONENT" ]; then
ARGS="$ARGS COMPONENT=$DB_COMPONENT"
fi
if [ -z "$TARGET" ] && [ -n "$DB_TARGET" ]; then
ARGS="$ARGS TARGET=$DB_TARGET"
fi
if [ -z "$INSTDIR" ] && [ -n "$DB_INSTDIR" ]; then
ARGS="$ARGS INSTDIR=\"$INSTALLDIR/$DB_INSTDIR\""
fi
make -C "$COMPONENTDIR" $ARGS "$@" || { rm "$MYTMP"; exit 1; }
done < "$MYTMP"
fi
rm "$MYTMP"
)}
......@@ -23,9 +23,3 @@ bbe-env: bbe-generic-resources-get-alias
BBE_Export_File !Common
${CP} MakefileBBE ${BBEDIR}.Makefile ${CPFLAGS}
BBE_Export_File VersionNum
# Determine whether the macro processor in amu works or not
FIXED = no
find-amu-version:
@set BuildSys$AMU$Fixed ${FIXED}
#!/bin/bash
# Environment to build ROM for Raspberry Pi (BCM2835-based board)
#
# This can either be applied to the current shell using the "source" command,
# or executed directly. In the latter case, you will want to describe a
# a command to be executed by a subshell using the parameters to this script.
# In either case, the working directory must be set to the root of your sandbox on entry.
# This script is applied to the current shell using the "." or "source" builtin shell commands.
export LOCALE=UK
export KEYBOARD=All
......@@ -17,6 +13,15 @@ export HALSIZE=64K
export BUILD=ROOL/BCM2835
export APCS=APCS-32
. Env/!Common.sh
# Get the location of this script when sourced from a variety of common Posix shells: bash, dash, ksh or zsh
[ -z "$@" ] || bash -c "$@"
if [ -n "$BASH" ]; then script=${BASH_SOURCE[0]}
elif [ -n "$TMOUT" ]; then script=${.sh.file}
elif [ -n "$ZSH_NAME" ]; then script=${(%):-%x}
elif [ ${0##*/} = dash ]; then x=$(lsof -p $$ -Fn0 | tail -1); script=${x#*n}
fi
BUILDDIR="$(cd "$(dirname "$(readlink -f "$script")")"/../.. && pwd)"
export BUILDDIR
. "$BUILDDIR/Env/!Common.sh"
#!/bin/bash
# Environment to build core parts of the build environment - executed by the host RISC OS system
#
# This can either be applied to the current shell using the "source" command,
# or executed directly. In the latter case, you will want to describe a
# a command to be executed by a subshell using the parameters to this script.
# In either case, the working directory must be set to the root of your sandbox on entry.
# This script is applied to the current shell using the "." or "source" builtin shell commands.
export LOCALE=UK
export KEYBOARD=All
......@@ -17,6 +13,15 @@ export HALSIZE=64K
export BUILD=ROOL/CTools
export APCS=APCS-32
. Env/!Common.sh
# Get the location of this script when sourced from a variety of common Posix shells: bash, dash, ksh or zsh
[ -z "$@" ] || bash -c "$@"
if [ -n "$BASH" ]; then script=${BASH_SOURCE[0]}
elif [ -n "$TMOUT" ]; then script=${.sh.file}
elif [ -n "$ZSH_NAME" ]; then script=${(%):-%x}
elif [ ${0##*/} = dash ]; then x=$(lsof -p $$ -Fn0 | tail -1); script=${x#*n}
fi
BUILDDIR="$(cd "$(dirname "$(readlink -f "$script")")"/../.. && pwd)"
export BUILDDIR
. "$BUILDDIR/Env/!Common.sh"
#!/bin/bash
# Environment to build cross-compiling versions of the toolchain
#
# This can either be applied to the current shell using the "source" command,
# or executed directly. In the latter case, you will want to describe a
# a command to be executed by a subshell using the parameters to this script.
# In either case, the working directory must be set to the root of your sandbox on entry.
# This script is applied to the current shell using the "." or "source" builtin shell commands.
export LOCALE=UK
export KEYBOARD=All
......@@ -18,6 +14,15 @@ export BUILD=ROOL/CrossTools
export APCS=Host
export TOOLCHAIN=GNU
. Env/!Common.sh
# Get the location of this script when sourced from a variety of common Posix shells: bash, dash, ksh or zsh
[ -z "$@" ] || bash -c "$@"
if [ -n "$BASH" ]; then script=${BASH_SOURCE[0]}
elif [ -n "$TMOUT" ]; then script=${.sh.file}
elif [ -n "$ZSH_NAME" ]; then script=${(%):-%x}
elif [ ${0##*/} = dash ]; then x=$(lsof -p $$ -Fn0 | tail -1); script=${x#*n}
fi
BUILDDIR="$(cd "$(dirname "$(readlink -f "$script")")"/../.. && pwd)"
export BUILDDIR
. "$BUILDDIR/Env/!Common.sh"
#!/bin/bash
# Environment to build user disc image (also useful for any other soft-loadable binaries)
#
# This can either be applied to the current shell using the "source" command,
# or executed directly. In the latter case, you will want to describe a
# a command to be executed by a subshell using the parameters to this script.
# In either case, the working directory must be set to the root of your sandbox on entry.
# This script is applied to the current shell using the "." or "source" builtin shell commands.
export LOCALE=UK
export KEYBOARD=All
......@@ -17,6 +13,15 @@ export HALSIZE=64K
export BUILD=ROOL/Disc
export APCS=APCS-32
. Env/!Common.sh
# Get the location of this script when sourced from a variety of common Posix shells: bash, dash, ksh or zsh
[ -z "$@" ] || bash -c "$@"
if [ -n "$BASH" ]; then script=${BASH_SOURCE[0]}
elif [ -n "$TMOUT" ]; then script=${.sh.file}
elif [ -n "$ZSH_NAME" ]; then script=${(%):-%x}
elif [ ${0##*/} = dash ]; then x=$(lsof -p $$ -Fn0 | tail -1); script=${x#*n}
fi
BUILDDIR="$(cd "$(dirname "$(readlink -f "$script")")"/../.. && pwd)"
export BUILDDIR
. "$BUILDDIR/Env/!Common.sh"
......@@ -23,7 +23,7 @@ set System Ursula
set UserIF Sovereign
set Display PAL
set ImageSize 5120K
set HALSize 96K
set HALSize 64K
set Build ROOL.OMAP3
set APCS APCS-32
Unset LocaleList
......
......@@ -23,7 +23,7 @@ set System Ursula
set UserIF Sovereign
set Display PAL
set ImageSize 5120K
set HALSize 128K
set HALSize 96K
set Build ROOL.iMx6
set APCS APCS-32
Unset LocaleList
......
/* (1.37)
/* (1.44)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.37
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 21 Jan 2017
#define Module_MajorVersion_CMHG 1.44
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 26 May 2020
#define Module_MajorVersion "1.37"
#define Module_Version 137
#define Module_MajorVersion "1.44"
#define Module_Version 144
#define Module_MinorVersion ""
#define Module_Date "21 Jan 2017"
#define Module_Date "26 May 2020"
#define Module_ApplicationDate "21-Jan-17"
#define Module_ApplicationDate "26-May-20"
#define Module_ComponentName "Env"
#define Module_ComponentPath "castle/RiscOS/Env"
#define Module_FullVersion "1.37"
#define Module_HelpVersion "1.37 (21 Jan 2017)"
#define Module_LibraryVersionInfo "1:37"
#define Module_FullVersion "1.44"
#define Module_HelpVersion "1.44 (26 May 2020)"
#define Module_LibraryVersionInfo "1:44"