Fix whitespace in build-toolchain.bash

This commit is contained in:
Ezra Buehler 2019-07-21 15:37:32 +02:00 committed by Wolfgang Thaller
parent b6ad702a0f
commit e107fb0dfb

View File

@ -75,9 +75,9 @@ for ARG in $*; do
HOST_CMAKE_FLAGS[${#HOST_CMAKE_FLAGS[@]}]="-DCMAKE_C_COMPILER=${ARG#*=}" HOST_CMAKE_FLAGS[${#HOST_CMAKE_FLAGS[@]}]="-DCMAKE_C_COMPILER=${ARG#*=}"
HOST_C_COMPILER="${ARG#*=}" HOST_C_COMPILER="${ARG#*=}"
;; ;;
--ninja) --ninja)
CMAKE_GENERATOR=-GNinja CMAKE_GENERATOR=-GNinja
;; ;;
--help) --help)
usage usage
exit 0 exit 0
@ -164,14 +164,14 @@ INTERFACES_DIR="$SRC/InterfacesAndLibraries"
function verifyInterfaceDirNames() function verifyInterfaceDirNames()
{ {
printf "Searching for special characters in subdirs of $INTERFACES_DIR" printf "Searching for special characters in subdirs of $INTERFACES_DIR"
local found=`find "$INTERFACES_DIR" -type d -name "*" -print ` local found=`find "$INTERFACES_DIR" -type d -name "*" -print `
if [ "`echo $found | grep \&`" ]; then if [ "`echo $found | grep \&`" ]; then
echo "\n$found Contained special character &" echo "\n$found Contained special character &"
return 1 # failure return 1 # failure
else else
return 0 # success return 0 # success
fi fi
} }
function locateInterfaceThing() function locateInterfaceThing()
@ -211,12 +211,12 @@ function explainInterfaces()
echo "Looking for various files in $INTERFACES_DIR/..." echo "Looking for various files in $INTERFACES_DIR/..."
if verifyInterfaceDirNames; then if verifyInterfaceDirNames; then
echo "Directory name looks clean" echo "Directory name looks clean"
else else
echo "Directory name contained special character & that would break build" echo "Directory name contained special character & that would break build"
echo "Please install the Interfaces and Libraries files in a path under" echo "Please install the Interfaces and Libraries files in a path under"
echo "$INTERFACES_DIR that does not contain the & character" echo "$INTERFACES_DIR that does not contain the & character"
exit 1 exit 1
fi fi
if locateInterfaceThing CONDITIONALMACROS_H ConditionalMacros.h; then if locateInterfaceThing CONDITIONALMACROS_H ConditionalMacros.h; then
@ -264,7 +264,7 @@ if [ $BUILD_PPC != false ]; then
else else
echo "Could not find OpenTransportAppPPC.o anywhere inside InterfaceAndLibraries/" echo "Could not find OpenTransportAppPPC.o anywhere inside InterfaceAndLibraries/"
echo "(This file is required for OpenTransport on PPC only)" echo "(This file is required for OpenTransport on PPC only)"
fi fi
fi fi
@ -466,41 +466,41 @@ function linkheaders()
{ {
# incompatible with Universal Interfaces on case-insensitive file systems # incompatible with Universal Interfaces on case-insensitive file systems
# (and does not currently work anyways) # (and does not currently work anyways)
rm -f "$1"/threads.h rm -f "$1"/threads.h
# the following command doesn't work on older Mac OS X versions. # the following command doesn't work on older Mac OS X versions.
# allow it to fail quietly, at worst we leave some dangling symlinks around # allow it to fail quietly, at worst we leave some dangling symlinks around
# in the rare situation that headers are removed from the input directory # in the rare situation that headers are removed from the input directory
find "$1" -lname "../../CIncludes/*" -delete || true find "$1" -lname "../../CIncludes/*" -delete || true
(cd "$1" && find "../../CIncludes/" -name '*.h' -exec ln -s {} . \;) (cd "$1" && find "../../CIncludes/" -name '*.h' -exec ln -s {} . \;)
} }
echo "Creating Symlinks for CIncludes and RIncludes..." echo "Creating Symlinks for CIncludes and RIncludes..."
if [ $BUILD_68K != false ]; then if [ $BUILD_68K != false ]; then
ln -sf ../RIncludes toolchain/m68k-apple-macos/RIncludes ln -sf ../RIncludes toolchain/m68k-apple-macos/RIncludes
linkheaders toolchain/m68k-apple-macos/include linkheaders toolchain/m68k-apple-macos/include
fi fi
if [ $BUILD_PPC != false ]; then if [ $BUILD_PPC != false ]; then
ln -sf ../RIncludes toolchain/powerpc-apple-macos/RIncludes ln -sf ../RIncludes toolchain/powerpc-apple-macos/RIncludes
linkheaders toolchain/powerpc-apple-macos/include linkheaders toolchain/powerpc-apple-macos/include
fi fi
if [ $BUILD_68K != false ]; then if [ $BUILD_68K != false ]; then
echo "Converting 68K static libraries..." echo "Converting 68K static libraries..."
for macobj in "${M68KLIBRARIES}/"*.o; do for macobj in "${M68KLIBRARIES}/"*.o; do
if [ -r $macobj ]; then if [ -r $macobj ]; then
libname=`basename "$macobj"` libname=`basename "$macobj"`
libname=${libname%.o} libname=${libname%.o}
printf " %30s => %-30s\n" ${libname}.o lib${libname}.a printf " %30s => %-30s\n" ${libname}.o lib${libname}.a
obj="toolchain/m68k-apple-macos/lib/$libname.o" obj="toolchain/m68k-apple-macos/lib/$libname.o"
lib="toolchain/m68k-apple-macos/lib/lib${libname}.a" lib="toolchain/m68k-apple-macos/lib/lib${libname}.a"
rm -f $lib rm -f $lib
(ConvertObj "$macobj" | m68k-apple-macos-as - -o $obj) && m68k-apple-macos-ar cqs $lib $obj (ConvertObj "$macobj" | m68k-apple-macos-as - -o $obj) && m68k-apple-macos-ar cqs $lib $obj
fi fi
done done
fi fi
if [ $BUILD_PPC != false ]; then if [ $BUILD_PPC != false ]; then
@ -522,20 +522,20 @@ if [ $BUILD_PPC != false ]; then
;; ;;
esac esac
if [ -d ${PPCLIBRARIES} ]; then if [ -d ${PPCLIBRARIES} ]; then
echo "Copying static PPC libraries" echo "Copying static PPC libraries"
for obj in ${PPCLIBRARIES}/OpenT*.o ${PPCLIBRARIES}/CarbonAccessors.o ${PPCLIBRARIES}/CursorDevicesGlue.o; do for obj in ${PPCLIBRARIES}/OpenT*.o ${PPCLIBRARIES}/CarbonAccessors.o ${PPCLIBRARIES}/CursorDevicesGlue.o; do
if [ -r $obj ]; then if [ -r $obj ]; then
# copy the library: # copy the library:
cp $obj toolchain/powerpc-apple-macos/lib/ cp $obj toolchain/powerpc-apple-macos/lib/
# and wrap it in a .a archive for convenience # and wrap it in a .a archive for convenience
lib=toolchain/powerpc-apple-macos/lib/lib`basename "${obj%.o}"`.a lib=toolchain/powerpc-apple-macos/lib/lib`basename "${obj%.o}"`.a
rm -f $lib rm -f $lib
toolchain/bin/powerpc-apple-macos-ar cqs $lib $obj toolchain/bin/powerpc-apple-macos-ar cqs $lib $obj
fi fi
done done
fi fi
fi fi
@ -550,11 +550,11 @@ if [ $BUILD_68K != false ]; then
cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intree.toolchain.cmake \ cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intree.toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \ -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
${CMAKE_GENERATOR} ${CMAKE_GENERATOR}
cd .. cd ..
cmake --build build-target --target install cmake --build build-target --target install
echo 'subdirs("build-target")' >> CTestTestfile.cmake echo 'subdirs("build-target")' >> CTestTestfile.cmake
fi fi
if [ $BUILD_PPC != false ]; then if [ $BUILD_PPC != false ]; then
@ -565,11 +565,11 @@ if [ $BUILD_PPC != false ]; then
cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intreeppc.toolchain.cmake \ cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intreeppc.toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \ -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
${CMAKE_GENERATOR} ${CMAKE_GENERATOR}
cd .. cd ..
cmake --build build-target-ppc --target install cmake --build build-target-ppc --target install
echo 'subdirs("build-target-ppc")' >> CTestTestfile.cmake echo 'subdirs("build-target-ppc")' >> CTestTestfile.cmake
fi fi
if [ $BUILD_CARBON != false ]; then if [ $BUILD_CARBON != false ]; then
@ -580,11 +580,11 @@ if [ $BUILD_CARBON != false ]; then
cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intreecarbon.toolchain.cmake \ cmake ${SRC} -DCMAKE_TOOLCHAIN_FILE=../build-host/cmake/intreecarbon.toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \ -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
${CMAKE_GENERATOR} ${CMAKE_GENERATOR}
cd .. cd ..
cmake --build build-target-carbon --target install cmake --build build-target-carbon --target install
echo 'subdirs("build-target-carbon")' >> CTestTestfile.cmake echo 'subdirs("build-target-carbon")' >> CTestTestfile.cmake
fi fi
echo echo