2024-05-11 00:15:41 +00:00
|
|
|
#!/usr/bin/env bash
|
2014-10-17 20:19:31 +00:00
|
|
|
# Copyright 2014 Wolfgang Thaller.
|
2012-04-24 01:22:36 +00:00
|
|
|
#
|
|
|
|
# This file is part of Retro68.
|
|
|
|
#
|
|
|
|
# Retro68 is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Retro68 is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Retro68. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-08-30 13:36:27 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Set up paths.
|
2012-04-06 18:56:16 +00:00
|
|
|
SRC=$(cd `dirname $0` && pwd -P)
|
2019-07-21 13:41:37 +00:00
|
|
|
DEFAULT_PREFIX=`pwd -P`/toolchain/
|
|
|
|
PREFIX=$DEFAULT_PREFIX
|
2015-08-30 13:36:27 +00:00
|
|
|
BINUTILS=`pwd -P`/binutils-build
|
2024-08-02 16:55:09 +00:00
|
|
|
BUILD_JOBS=$(nproc || sysctl -n hw.physicalcpu)
|
2015-09-08 16:04:15 +00:00
|
|
|
|
2019-11-13 22:23:28 +00:00
|
|
|
##################### Prerequisites check
|
|
|
|
|
|
|
|
if [ ! -d "$SRC/multiversal" ]; then
|
|
|
|
echo "Could not find directory '$SRC/multiversal'."
|
|
|
|
echo "It looks like you did not clone the git submodules."
|
|
|
|
echo "Please run:"
|
|
|
|
echo " git submodule update --init"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
##################### Command-line Options
|
|
|
|
|
|
|
|
SKIP_THIRDPARTY=false
|
2017-04-12 09:56:34 +00:00
|
|
|
BUILD_68K=true
|
|
|
|
BUILD_PPC=true
|
|
|
|
BUILD_CARBON=true
|
2017-04-23 00:15:02 +00:00
|
|
|
CLEAN_AFTER_BUILD=false
|
|
|
|
HOST_CMAKE_FLAGS=()
|
2018-01-06 02:13:05 +00:00
|
|
|
CMAKE_GENERATOR=
|
2017-04-23 00:15:02 +00:00
|
|
|
|
|
|
|
function usage()
|
|
|
|
{
|
|
|
|
echo "Usage: $0 [options]"
|
|
|
|
echo
|
|
|
|
echo "Options: "
|
2019-07-21 13:41:37 +00:00
|
|
|
echo " --prefix the path to install the toolchain to"
|
2017-04-23 00:15:02 +00:00
|
|
|
echo " --skip-thirdparty do not rebuild gcc & third party libraries"
|
|
|
|
echo " --no-68k disable support for 68K Macs"
|
|
|
|
echo " --no-ppc disable classic PowerPC CFM support"
|
|
|
|
echo " --no-carbon disable Carbon CFM support"
|
|
|
|
echo " --clean-after-build remove intermediate build files right after building"
|
2019-07-21 13:37:32 +00:00
|
|
|
echo " --host-cxx-compiler specify C++ compiler (needed on Mac OS X 10.4)"
|
2017-10-05 13:32:12 +00:00
|
|
|
echo " --host-c-compiler specify C compiler (needed on Mac OS X 10.4)"
|
2018-01-06 02:13:05 +00:00
|
|
|
echo " --ninja use ninja for cmake builds"
|
2019-09-26 17:30:45 +00:00
|
|
|
echo " --universal use Apple's universal interfaces (default: autodetect)"
|
|
|
|
echo " --multiversal use the open-source multiversal interfaces (default: autodetect)"
|
2017-04-23 00:15:02 +00:00
|
|
|
echo " --help show this help message"
|
|
|
|
}
|
2017-04-12 09:56:34 +00:00
|
|
|
|
2016-06-17 20:58:32 +00:00
|
|
|
for ARG in $*; do
|
|
|
|
case $ARG in
|
2019-07-21 13:41:37 +00:00
|
|
|
--prefix=*)
|
|
|
|
PREFIX="${ARG#*=}"
|
|
|
|
;;
|
2017-04-23 00:15:02 +00:00
|
|
|
--skip-thirdparty)
|
|
|
|
SKIP_THIRDPARTY=true
|
2016-06-17 20:58:32 +00:00
|
|
|
;;
|
2017-04-12 09:56:34 +00:00
|
|
|
--no-68k)
|
2017-04-23 00:15:02 +00:00
|
|
|
BUILD_68K=false
|
2017-04-12 09:56:34 +00:00
|
|
|
;;
|
|
|
|
--no-ppc)
|
2017-04-23 00:15:02 +00:00
|
|
|
BUILD_PPC=false
|
|
|
|
BUILD_CARBON=false
|
2017-04-12 09:56:34 +00:00
|
|
|
;;
|
|
|
|
--no-carbon)
|
2017-04-23 00:15:02 +00:00
|
|
|
BUILD_CARBON=false
|
|
|
|
;;
|
|
|
|
--clean-after-build)
|
|
|
|
CLEAN_AFTER_BUILD=true
|
|
|
|
;;
|
|
|
|
--host-cxx-compiler=*)
|
2017-10-05 12:52:17 +00:00
|
|
|
HOST_CMAKE_FLAGS[${#HOST_CMAKE_FLAGS[@]}]="-DCMAKE_CXX_COMPILER=${ARG#*=}"
|
2017-10-08 00:36:59 +00:00
|
|
|
HOST_CXX_COMPILER="${ARG#*=}"
|
2017-10-05 12:52:17 +00:00
|
|
|
;;
|
|
|
|
--host-c-compiler=*)
|
|
|
|
HOST_CMAKE_FLAGS[${#HOST_CMAKE_FLAGS[@]}]="-DCMAKE_C_COMPILER=${ARG#*=}"
|
|
|
|
HOST_C_COMPILER="${ARG#*=}"
|
2017-04-23 00:15:02 +00:00
|
|
|
;;
|
2019-07-21 13:37:32 +00:00
|
|
|
--ninja)
|
|
|
|
CMAKE_GENERATOR=-GNinja
|
|
|
|
;;
|
2019-09-26 17:30:45 +00:00
|
|
|
--universal)
|
|
|
|
INTERFACES_KIND=universal
|
|
|
|
;;
|
|
|
|
--multiversal)
|
|
|
|
INTERFACES_KIND=multiversal
|
|
|
|
;;
|
2017-04-23 00:15:02 +00:00
|
|
|
--help)
|
|
|
|
usage
|
|
|
|
exit 0
|
2017-04-12 09:56:34 +00:00
|
|
|
;;
|
2016-06-17 20:58:32 +00:00
|
|
|
*)
|
|
|
|
echo "unknown option $ARG"
|
2017-04-23 00:15:02 +00:00
|
|
|
usage
|
2016-06-17 20:58:32 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
##################### Sanity checks
|
2017-04-12 09:56:34 +00:00
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
if [ `pwd -P` == "$SRC" ]; then
|
2021-04-17 05:22:59 +00:00
|
|
|
echo "Please do not invoke `basename $0` from the source directory."
|
2017-04-23 00:15:02 +00:00
|
|
|
echo "Instead, create a separate build directory:"
|
|
|
|
echo " cd .."
|
|
|
|
echo " mkdir Retro68-build"
|
2021-04-17 05:22:59 +00:00
|
|
|
echo " cd Retro68-build"
|
|
|
|
echo " ../`basename $SRC`/`basename $0`"
|
2017-04-23 00:15:02 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2012-03-29 08:30:42 +00:00
|
|
|
|
2019-07-21 13:41:37 +00:00
|
|
|
if [ "$PREFIX" != "$DEFAULT_PREFIX" -a -d "$PREFIX" -a $SKIP_THIRDPARTY != true ]; then
|
|
|
|
if [ ! -w "$PREFIX" ]; then
|
|
|
|
echo "$PREFIX is not writable, cannot install to there."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ "`ls -A "$PREFIX"`" ]; then
|
|
|
|
echo "$PREFIX is not empty, cannot install to there."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2017-04-12 09:56:34 +00:00
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
if [ $SKIP_THIRDPARTY != false ]; then
|
|
|
|
MISSING=false
|
2019-07-21 13:41:37 +00:00
|
|
|
if [ ! -d $PREFIX ]; then MISSING=true; fi
|
2017-04-23 00:15:02 +00:00
|
|
|
if [ $BUILD_68K != false ]; then
|
|
|
|
if [ ! -d binutils-build ]; then MISSING=true; fi
|
|
|
|
if [ ! -d gcc-build ]; then MISSING=true; fi
|
|
|
|
fi
|
|
|
|
if [ $BUILD_PPC != false ]; then
|
|
|
|
if [ ! -d binutils-build-ppc ]; then MISSING=true; fi
|
|
|
|
if [ ! -d gcc-build-ppc ]; then MISSING=true; fi
|
|
|
|
fi
|
|
|
|
if [ ! -d hfsutils ]; then MISSING=true; fi
|
2019-07-21 13:37:32 +00:00
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
if [ $MISSING != false ]; then
|
|
|
|
echo "Not all third-party components have been built yet, ignoring --skip-thirdparty."
|
|
|
|
SKIP_THIRDPARTY=false
|
|
|
|
fi
|
|
|
|
fi
|
2012-03-29 08:30:42 +00:00
|
|
|
|
2017-10-08 08:40:47 +00:00
|
|
|
### Running on a Power Mac (tested with 10.4 Tiger)
|
|
|
|
|
|
|
|
if [ "`uname -m`" = "Power Macintosh" ]; then
|
2019-07-21 13:37:32 +00:00
|
|
|
# The default compiler won't work,
|
2017-10-08 08:40:47 +00:00
|
|
|
# check whether the compiler has been explictly specified
|
|
|
|
# on the command line
|
|
|
|
if [ $SKIP_THIRDPARTY = false ]; then
|
|
|
|
if [ -z "$HOST_CXX_COMPILER" -o -z "$HOST_C_COMPILER" ]; then
|
|
|
|
echo "**** Apple's version of GCC on Power Macs is too old."
|
|
|
|
echo "**** Please explicitly specify the C and C++ compilers"
|
|
|
|
echo "**** using the --host-c-compiler and --host-cxx-compiler options."
|
|
|
|
echo "**** You can install a usable compiler using tigerbrew."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# work around a problem with building gcc-7 with homebrew's gcc-5
|
|
|
|
export gcc_cv_c_no_fpie=no
|
|
|
|
fi
|
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
##################### Locate and check Interfaces & Libraries
|
2017-04-12 09:56:34 +00:00
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
if [ -d "$SRC/CIncludes" -o -d "$SRC/RIncludes" ]; then
|
|
|
|
echo
|
|
|
|
echo "### WARNING:"
|
|
|
|
echo "### Different from previous versions, Retro68 now expects to find"
|
|
|
|
echo "### header files and libraries inside the InterfacesAndLibraries diretory."
|
|
|
|
echo
|
2017-04-12 09:56:34 +00:00
|
|
|
fi
|
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
INTERFACES_DIR="$SRC/InterfacesAndLibraries"
|
2017-04-12 09:56:34 +00:00
|
|
|
|
2019-08-17 09:37:22 +00:00
|
|
|
. "$SRC/interfaces-and-libraries.sh"
|
2018-07-18 12:35:05 +00:00
|
|
|
|
2019-08-17 09:37:22 +00:00
|
|
|
locateAndCheckInterfacesAndLibraries
|
2017-04-23 00:15:02 +00:00
|
|
|
|
2017-09-27 22:10:50 +00:00
|
|
|
##################### Third-Party components: binutils, gcc, hfsutils
|
2017-04-23 00:15:02 +00:00
|
|
|
|
|
|
|
if [ $SKIP_THIRDPARTY != true ]; then
|
|
|
|
|
2019-07-21 13:41:37 +00:00
|
|
|
if [ "$PREFIX" = "$DEFAULT_PREFIX" ]; then
|
|
|
|
# Remove old install tree
|
|
|
|
rm -rf $PREFIX
|
|
|
|
fi
|
|
|
|
mkdir -p $PREFIX
|
2017-04-23 00:15:02 +00:00
|
|
|
|
2021-02-06 14:30:43 +00:00
|
|
|
if [ `uname` = Darwin ]; then
|
2017-04-23 00:15:02 +00:00
|
|
|
# present-day Mac users are likely to install dependencies
|
2021-02-06 14:30:43 +00:00
|
|
|
# via the homebrew package manager
|
2021-05-05 18:27:59 +00:00
|
|
|
if [ "`uname -m`" = arm64 ]; then
|
2021-02-06 14:30:43 +00:00
|
|
|
export CPPFLAGS="-I/opt/homebrew/include"
|
|
|
|
export LDFLAGS="-L/opt/homebrew/lib"
|
|
|
|
else
|
|
|
|
export CPPFLAGS="-I/usr/local/include"
|
|
|
|
export LDFLAGS="-L/usr/local/lib"
|
|
|
|
fi
|
2018-01-17 22:01:08 +00:00
|
|
|
# or they could be using MacPorts. Default install
|
|
|
|
# location is /opt/local
|
|
|
|
if [ -d "/opt/local/include" ]; then
|
|
|
|
export CPPFLAGS="$CPPFLAGS -I/opt/local/include"
|
|
|
|
export LDFLAGS="$LDFLAGS -L/opt/local/lib"
|
|
|
|
fi
|
2021-02-06 14:30:43 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Components needed for targeting 68K: binutils, gcc
|
|
|
|
if [ $BUILD_68K != false ]; then
|
2017-10-08 00:36:59 +00:00
|
|
|
export CC=$HOST_C_COMPILER
|
|
|
|
export CXX=$HOST_CXX_COMPILER
|
2019-07-21 13:37:32 +00:00
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
# Build binutils for 68K
|
|
|
|
mkdir -p binutils-build
|
|
|
|
cd binutils-build
|
|
|
|
$SRC/binutils/configure --target=m68k-apple-macos --prefix=$PREFIX --disable-doc
|
2024-05-05 19:06:27 +00:00
|
|
|
make -j$BUILD_JOBS
|
2017-04-23 00:15:02 +00:00
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Build gcc for 68K
|
|
|
|
mkdir -p gcc-build
|
|
|
|
cd gcc-build
|
2018-05-02 07:09:12 +00:00
|
|
|
export target_configargs="--disable-nls --enable-libstdcxx-dual-abi=no --disable-libstdcxx-verbose"
|
2017-04-23 00:15:02 +00:00
|
|
|
$SRC/gcc/configure --target=m68k-apple-macos --prefix=$PREFIX \
|
|
|
|
--enable-languages=c,c++ --with-arch=m68k --with-cpu=m68000 \
|
|
|
|
--disable-libssp MAKEINFO=missing
|
|
|
|
# There seems to be a build failure in parallel builds; ignore any errors and try again without -j8.
|
2024-05-05 19:06:27 +00:00
|
|
|
make -j$BUILD_JOBS || make
|
2017-04-23 00:15:02 +00:00
|
|
|
make install
|
|
|
|
unset target_configargs
|
|
|
|
cd ..
|
|
|
|
|
2017-10-08 00:36:59 +00:00
|
|
|
unset CC
|
|
|
|
unset CXX
|
2017-04-23 00:15:02 +00:00
|
|
|
|
2017-09-23 01:56:37 +00:00
|
|
|
# Move the real linker aside and install symlinks to Elf2Mac
|
|
|
|
# (Elf2Mac is built by cmake below)
|
|
|
|
mv $PREFIX/bin/m68k-apple-macos-ld $PREFIX/bin/m68k-apple-macos-ld.real
|
|
|
|
mv $PREFIX/m68k-apple-macos/bin/ld $PREFIX/m68k-apple-macos/bin/ld.real
|
2021-04-17 04:37:22 +00:00
|
|
|
ln -s Elf2Mac $PREFIX/bin/m68k-apple-macos-ld
|
|
|
|
ln -s ../../bin/Elf2Mac $PREFIX/m68k-apple-macos/bin/ld
|
2017-09-23 01:56:37 +00:00
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
if [ $CLEAN_AFTER_BUILD != false ]; then
|
|
|
|
rm -rf binutils-build
|
|
|
|
rm -rf gcc-build
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Components needed for targeting PPC (including Carbon): binutils, gcc
|
|
|
|
if [ $BUILD_PPC != false ]; then
|
2017-10-08 00:36:59 +00:00
|
|
|
export CC=$HOST_C_COMPILER
|
|
|
|
export CXX=$HOST_CXX_COMPILER
|
2019-07-21 13:37:32 +00:00
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
# Build binutils for PPC
|
|
|
|
mkdir -p binutils-build-ppc
|
|
|
|
cd binutils-build-ppc
|
2019-01-01 23:19:19 +00:00
|
|
|
$SRC/binutils/configure --disable-plugins --target=powerpc-apple-macos --prefix=$PREFIX --disable-doc
|
2024-05-05 19:06:27 +00:00
|
|
|
make -j$BUILD_JOBS
|
2017-04-23 00:15:02 +00:00
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Build gcc for PPC
|
|
|
|
mkdir -p gcc-build-ppc
|
|
|
|
cd gcc-build-ppc
|
2018-05-02 07:09:12 +00:00
|
|
|
export target_configargs="--disable-nls --enable-libstdcxx-dual-abi=no --disable-libstdcxx-verbose"
|
2017-04-23 00:15:02 +00:00
|
|
|
$SRC/gcc/configure --target=powerpc-apple-macos --prefix=$PREFIX \
|
|
|
|
--enable-languages=c,c++ --disable-libssp --disable-lto MAKEINFO=missing
|
2024-05-05 19:06:27 +00:00
|
|
|
make -j$BUILD_JOBS
|
2017-04-23 00:15:02 +00:00
|
|
|
make install
|
|
|
|
unset target_configargs
|
|
|
|
cd ..
|
|
|
|
|
2017-10-08 00:36:59 +00:00
|
|
|
unset CC
|
|
|
|
unset CXX
|
2017-04-23 00:15:02 +00:00
|
|
|
|
|
|
|
if [ $CLEAN_AFTER_BUILD != false ]; then
|
|
|
|
rm -rf binutils-build-ppc
|
|
|
|
rm -rf gcc-build-ppc
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-02-06 14:30:43 +00:00
|
|
|
unset CPPFLAGS
|
|
|
|
unset LDFLAGS
|
|
|
|
|
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
# Build hfsutil
|
|
|
|
mkdir -p $PREFIX/lib
|
2019-08-24 02:20:54 +00:00
|
|
|
mkdir -p $PREFIX/share/man/man1
|
2020-10-11 17:13:25 +00:00
|
|
|
mkdir -p hfsutils
|
2017-04-23 00:15:02 +00:00
|
|
|
cd hfsutils
|
2020-10-04 13:34:17 +00:00
|
|
|
$SRC/hfsutils/configure --prefix=$PREFIX --mandir=$PREFIX/share/man --enable-devlibs
|
2017-04-23 00:15:02 +00:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
if [ $CLEAN_AFTER_BUILD != false ]; then
|
|
|
|
rm -rf hfsutils
|
|
|
|
fi
|
2019-08-18 20:26:29 +00:00
|
|
|
else # SKIP_THIRDPARTY
|
|
|
|
removeInterfacesAndLibraries
|
2017-04-23 00:15:02 +00:00
|
|
|
fi # SKIP_THIRDPARTY
|
|
|
|
|
|
|
|
##################### Build host-based components: MakePEF, MakeImport, ConvertObj, Rez, ...
|
|
|
|
|
2017-04-23 15:02:11 +00:00
|
|
|
echo "Building host-based tools..."
|
|
|
|
|
2012-04-06 18:56:16 +00:00
|
|
|
mkdir -p build-host
|
|
|
|
cd build-host
|
2018-01-06 02:13:05 +00:00
|
|
|
cmake ${SRC} -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Debug "${HOST_CMAKE_FLAGS[@]}" ${CMAKE_GENERATOR}
|
2012-04-06 18:56:16 +00:00
|
|
|
cd ..
|
2017-04-23 00:15:02 +00:00
|
|
|
cmake --build build-host --target install
|
|
|
|
|
2019-01-09 07:39:09 +00:00
|
|
|
echo 'subdirs("build-host")' > CTestTestfile.cmake
|
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
# make tools (such as MakeImport and the compilers) available for later commands
|
|
|
|
export PATH=$PREFIX/bin:$PATH
|
|
|
|
|
2019-08-17 09:37:22 +00:00
|
|
|
##################### Set up Interfaces & Libraries
|
2017-04-23 00:15:02 +00:00
|
|
|
|
2019-09-25 23:13:28 +00:00
|
|
|
(cd "${SRC}/multiversal" && ruby make-multiverse.rb -G CIncludes -o "${PREFIX}/multiversal")
|
|
|
|
mkdir -p "${PREFIX}/multiversal/libppc"
|
|
|
|
cp "${SRC}/ImportLibraries"/*.a "${PREFIX}/multiversal/libppc/"
|
2019-08-17 09:37:22 +00:00
|
|
|
setUpInterfacesAndLibraries
|
2019-09-26 17:30:45 +00:00
|
|
|
linkInterfacesAndLibraries ${INTERFACES_KIND}
|
2017-04-23 00:15:02 +00:00
|
|
|
|
2019-08-17 09:37:22 +00:00
|
|
|
##################### Build target libraries and samples
|
2014-10-12 18:04:55 +00:00
|
|
|
|
2017-04-12 09:56:34 +00:00
|
|
|
if [ $BUILD_68K != false ]; then
|
2017-04-23 00:15:02 +00:00
|
|
|
echo "Building target libraries and samples for 68K..."
|
|
|
|
# Build target-based components for 68K
|
|
|
|
mkdir -p build-target
|
|
|
|
cd build-target
|
|
|
|
|
|
|
|
cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intree.toolchain.cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2019-01-01 23:18:26 +00:00
|
|
|
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
|
2019-07-21 13:37:32 +00:00
|
|
|
${CMAKE_GENERATOR}
|
2017-04-23 00:15:02 +00:00
|
|
|
cd ..
|
|
|
|
cmake --build build-target --target install
|
|
|
|
|
2019-07-21 13:37:32 +00:00
|
|
|
echo 'subdirs("build-target")' >> CTestTestfile.cmake
|
2017-04-12 09:56:34 +00:00
|
|
|
fi
|
2015-08-30 23:17:52 +00:00
|
|
|
|
2017-04-12 09:56:34 +00:00
|
|
|
if [ $BUILD_PPC != false ]; then
|
2017-04-23 00:15:02 +00:00
|
|
|
echo "Building target libraries and samples for PowerPC..."
|
|
|
|
# Build target-based components for PPC
|
|
|
|
mkdir -p build-target-ppc
|
|
|
|
cd build-target-ppc
|
|
|
|
cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intreeppc.toolchain.cmake \
|
2018-01-06 02:13:05 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2019-01-01 23:18:26 +00:00
|
|
|
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
|
2019-07-21 13:37:32 +00:00
|
|
|
${CMAKE_GENERATOR}
|
2017-04-23 00:15:02 +00:00
|
|
|
cd ..
|
|
|
|
cmake --build build-target-ppc --target install
|
2019-01-09 07:39:09 +00:00
|
|
|
|
2019-07-21 13:37:32 +00:00
|
|
|
echo 'subdirs("build-target-ppc")' >> CTestTestfile.cmake
|
2017-04-12 09:56:34 +00:00
|
|
|
fi
|
2015-10-06 22:03:28 +00:00
|
|
|
|
2017-04-12 09:56:34 +00:00
|
|
|
if [ $BUILD_CARBON != false ]; then
|
2017-04-23 00:15:02 +00:00
|
|
|
echo "Building target libraries and samples for Carbon..."
|
|
|
|
# Build target-based components for Carbon
|
|
|
|
mkdir -p build-target-carbon
|
|
|
|
cd build-target-carbon
|
|
|
|
cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intreecarbon.toolchain.cmake \
|
2018-01-06 02:13:05 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2019-01-01 23:18:26 +00:00
|
|
|
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
|
2019-07-21 13:37:32 +00:00
|
|
|
${CMAKE_GENERATOR}
|
2017-04-23 00:15:02 +00:00
|
|
|
cd ..
|
|
|
|
cmake --build build-target-carbon --target install
|
2019-01-09 07:39:09 +00:00
|
|
|
|
2019-07-21 13:37:32 +00:00
|
|
|
echo 'subdirs("build-target-carbon")' >> CTestTestfile.cmake
|
2017-04-23 00:15:02 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
2019-09-26 17:30:45 +00:00
|
|
|
echo "==============================================================================="
|
2017-04-23 00:15:02 +00:00
|
|
|
echo "Done building Retro68."
|
2019-09-26 17:30:45 +00:00
|
|
|
echo "The toolchain has been installed to: ${PREFIX}"
|
|
|
|
if [ `which Rez` != $PREFIX/bin/Rez ]; then
|
|
|
|
echo "you might want to add ${PREFIX}/bin to your PATH."
|
|
|
|
fi
|
|
|
|
case "${INTERFACES_KIND}" in
|
|
|
|
universal)
|
|
|
|
echo "Using Apple's Universal Interfaces."
|
|
|
|
;;
|
|
|
|
multiversal)
|
|
|
|
echo "Using the open-source Multiversal Interfaces."
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2017-04-23 00:15:02 +00:00
|
|
|
if [ $BUILD_68K != false ]; then
|
2021-04-15 20:27:58 +00:00
|
|
|
echo "You will find 68K sample applications in build-target/Samples/."
|
2017-04-23 00:15:02 +00:00
|
|
|
fi
|
|
|
|
if [ $BUILD_PPC != false ]; then
|
2021-04-15 20:27:58 +00:00
|
|
|
echo "You will find PowerPC sample applications in build-target-ppc/Samples/."
|
2017-04-23 00:15:02 +00:00
|
|
|
fi
|
|
|
|
if [ $BUILD_CARBON != false ]; then
|
2021-04-15 20:27:58 +00:00
|
|
|
echo "You will find Carbon sample applications in build-target-carbon/Samples/."
|
2017-04-12 09:56:34 +00:00
|
|
|
fi
|