proper choice between universal and multiversal

This commit is contained in:
Wolfgang Thaller 2019-09-26 19:30:45 +02:00
parent 1f59b5f87f
commit 26153cccf4
3 changed files with 76 additions and 13 deletions

View File

@ -48,6 +48,8 @@ function usage()
echo " --host-cxx-compiler specify C++ compiler (needed on Mac OS X 10.4)" echo " --host-cxx-compiler specify C++ compiler (needed on Mac OS X 10.4)"
echo " --host-c-compiler specify C compiler (needed on Mac OS X 10.4)" echo " --host-c-compiler specify C compiler (needed on Mac OS X 10.4)"
echo " --ninja use ninja for cmake builds" echo " --ninja use ninja for cmake builds"
echo " --universal use Apple's universal interfaces (default: autodetect)"
echo " --multiversal use the open-source multiversal interfaces (default: autodetect)"
echo " --help show this help message" echo " --help show this help message"
} }
@ -83,6 +85,12 @@ for ARG in $*; do
--ninja) --ninja)
CMAKE_GENERATOR=-GNinja CMAKE_GENERATOR=-GNinja
;; ;;
--universal)
INTERFACES_KIND=universal
;;
--multiversal)
INTERFACES_KIND=multiversal
;;
--help) --help)
usage usage
exit 0 exit 0
@ -180,6 +188,12 @@ INTERFACES_DIR="$SRC/InterfacesAndLibraries"
. "$SRC/interfaces-and-libraries.sh" . "$SRC/interfaces-and-libraries.sh"
locateAndCheckInterfacesAndLibraries locateAndCheckInterfacesAndLibraries
if [ ${INTERFACES_KIND} = multiversal ] && [ ${BUILD_CARBON} != false ]; then
echo
echo "Unfortunately, the Multiversal Interfaces don't yet support the Carbon API."
echo "Use either --universal or --no-carbon."
exit 1
fi
##################### Third-Party components: binutils, gcc, hfsutils ##################### Third-Party components: binutils, gcc, hfsutils
@ -336,7 +350,7 @@ export PATH=$PREFIX/bin:$PATH
mkdir -p "${PREFIX}/multiversal/libppc" mkdir -p "${PREFIX}/multiversal/libppc"
cp "${SRC}/ImportLibraries"/*.a "${PREFIX}/multiversal/libppc/" cp "${SRC}/ImportLibraries"/*.a "${PREFIX}/multiversal/libppc/"
setUpInterfacesAndLibraries setUpInterfacesAndLibraries
linkInterfacesAndLibraries universal linkInterfacesAndLibraries ${INTERFACES_KIND}
##################### Build target libraries and samples ##################### Build target libraries and samples
@ -387,7 +401,21 @@ if [ $BUILD_CARBON != false ]; then
fi fi
echo echo
echo "==============================================================================="
echo "Done building Retro68." echo "Done building Retro68."
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
if [ $BUILD_68K != false ]; then if [ $BUILD_68K != false ]; then
echo "You will find 68K sample appliations in build-target/Samples/." echo "You will find 68K sample appliations in build-target/Samples/."
fi fi

View File

@ -36,9 +36,23 @@ function locateInterfaceThing()
function explainInterfaces() function explainInterfaces()
{ {
echo "Please get a copy of Apple's Universal Interfaces & Libraries, " if [ "$INTERFACES_KIND" = "multiversal" ]; then
echo "version 3.x, and place it in the InterfacesAndLibraries directory inside" echo "Apple's Universal Interfaces & Libraries will not be installed."
echo "the Retro68 source directory." echo "Continuing with the open-source Multiversal Interfaces."
echo
return
fi
echo "==============================================================================="
if [ -z "$INTERFACES_KIND" ]; then
echo "If you want to use Apple's Universal Interfaces & Libraries "
echo "rather than the open-source Multiversal Interfaces, get a copy of"
echo "version 3.x, and place it in the InterfacesAndLibraries directory inside"
echo "the Retro68 source directory."
else
echo "Please get a copy of Apple's Universal Interfaces & Libraries, "
echo "version 3.x, and place it in the InterfacesAndLibraries directory inside"
echo "the Retro68 source directory."
fi
echo echo
echo "The exact directory layout does not matter, but there has to be" echo "The exact directory layout does not matter, but there has to be"
echo " - a directory with C header files (usually \"CIncludes\")" echo " - a directory with C header files (usually \"CIncludes\")"
@ -49,7 +63,17 @@ function explainInterfaces()
echo echo
echo "The Interfaces&Libraries folder from Apple's last MPW release (MPW 3.5 " echo "The Interfaces&Libraries folder from Apple's last MPW release (MPW 3.5 "
echo "aka MPW GM 'Golden Master') is known to work." echo "aka MPW GM 'Golden Master') is known to work."
exit 1
if [ -z "$INTERFACES_KIND" ]; then
INTERFACES_KIND=multiversal
echo
echo "Continuing with the open-source Multiversal Interfaces."
echo "==============================================================================="
echo
else
echo "==============================================================================="
exit 1
fi
} }
function locateAndCheckInterfacesAndLibraries() function locateAndCheckInterfacesAndLibraries()
@ -59,17 +83,19 @@ function locateAndCheckInterfacesAndLibraries()
if locateInterfaceThing CONDITIONALMACROS_H ConditionalMacros.h; then if locateInterfaceThing CONDITIONALMACROS_H ConditionalMacros.h; then
CINCLUDES=`dirname "$CONDITIONALMACROS_H"` CINCLUDES=`dirname "$CONDITIONALMACROS_H"`
else else
echo "Could not find ConditionalMacros.h anywhere inside InterfaceAndLibraries/" echo "Could not find ConditionalMacros.h anywhere inside $INTERFACES_DIR"
echo echo
explainInterfaces explainInterfaces
return
fi fi
if locateInterfaceThing CONDITIONALMACROS_R ConditionalMacros.r; then if locateInterfaceThing CONDITIONALMACROS_R ConditionalMacros.r; then
RINCLUDES=`dirname "$CONDITIONALMACROS_R"` RINCLUDES=`dirname "$CONDITIONALMACROS_R"`
else else
echo "Could not find ConditionalMacros.r anywhere inside InterfaceAndLibraries/" echo "Could not find ConditionalMacros.r anywhere inside $INTERFACES_DIR"
echo echo
explainInterfaces explainInterfaces
return
fi fi
if [ $BUILD_68K != false ]; then if [ $BUILD_68K != false ]; then
@ -79,10 +105,11 @@ function locateAndCheckInterfacesAndLibraries()
elif locateInterfaceThing INTERFACELIB_68K libInterface.a; then elif locateInterfaceThing INTERFACELIB_68K libInterface.a; then
M68KLIBRARIES=`dirname "$INTERFACELIB_68K"` M68KLIBRARIES=`dirname "$INTERFACELIB_68K"`
else else
echo "Could not find Interface.o anywhere inside InterfaceAndLibraries/" echo "Could not find Interface.o anywhere inside $INTERFACES_DIR"
echo "(This file is required for 68K support only)" echo "(This file is required for 68K support only)"
echo echo
explainInterfaces explainInterfaces
return
fi fi
fi fi
@ -99,10 +126,9 @@ function locateAndCheckInterfacesAndLibraries()
if locateInterfaceThing OPENTRANSPORTAPPPPC OpenTransportAppPPC.o; then if locateInterfaceThing OPENTRANSPORTAPPPPC OpenTransportAppPPC.o; then
PPCLIBRARIES=`dirname "$OPENTRANSPORTAPPPPC"` PPCLIBRARIES=`dirname "$OPENTRANSPORTAPPPPC"`
else else
echo "Could not find OpenTransportAppPPC.o anywhere inside InterfaceAndLibraries/" echo "Could not find OpenTransportAppPPC.o anywhere inside $INTERFACES_DIR"
echo "(This file is required for OpenTransport on PPC only)" echo "(This file is required for OpenTransport on PPC only)"
fi fi
fi fi
if [ $BUILD_CARBON != false ]; then if [ $BUILD_CARBON != false ]; then
@ -113,12 +139,14 @@ function locateAndCheckInterfacesAndLibraries()
echo "This is confusing." echo "This is confusing."
echo echo
explainInterfaces explainInterfaces
return
fi fi
else else
echo "Could not find Carbon.h anywhere inside InterfaceAndLibraries/" echo "Could not find Carbon.h anywhere inside $INTERFACES_DIR"
echo "(This file is required for Carbon support only)" echo "(This file is required for Carbon support only)"
echo echo
explainInterfaces explainInterfaces
return
fi fi
if locateInterfaceThing CARBONLIB CarbonLib; then if locateInterfaceThing CARBONLIB CarbonLib; then
carbondir=`dirname "$CARBONLIB"` carbondir=`dirname "$CARBONLIB"`
@ -127,14 +155,20 @@ function locateAndCheckInterfacesAndLibraries()
echo "This is confusing." echo "This is confusing."
echo echo
explainInterfaces explainInterfaces
return
fi fi
else else
echo "Could not find CarbonLib anywhere inside InterfaceAndLibraries/" echo "Could not find CarbonLib anywhere inside $INTERFACES_DIR"
echo "(This file is required for Carbon support only)" echo "(This file is required for Carbon support only)"
echo echo
explainInterfaces explainInterfaces
return
fi fi
fi fi
if [ -z "$INTERFACES_KIND" ]; then
INTERFACES_KIND=universal
fi
} }
@ -309,6 +343,7 @@ else
unlinkInterfacesAndLibraries unlinkInterfacesAndLibraries
linkInterfacesAndLibraries "universal" linkInterfacesAndLibraries "universal"
else else
INTERFACES_KIND=universal
locateAndCheckInterfacesAndLibraries locateAndCheckInterfacesAndLibraries
removeInterfacesAndLibraries removeInterfacesAndLibraries
setUpInterfacesAndLibraries setUpInterfacesAndLibraries

@ -1 +1 @@
Subproject commit 4484dc64227508484043151a2dee89a24c58bb98 Subproject commit cd0ef356ba7410cefd95cd28b753a59b317fdc8d