Convert all MPW .o files from InterfacesAndLibraries

This commit is contained in:
Wolfgang Thaller 2019-01-24 17:37:28 +01:00
parent 0d6bcac631
commit 693abc1998
5 changed files with 27 additions and 20 deletions

View File

@ -55,6 +55,7 @@ const char * textSection = R"ld(/* ld script for Elf2Mac */
*/libretrocrt.a:start.c.obj(.text*) */libretrocrt.a:start.c.obj(.text*)
*/libretrocrt.a:relocate.c.obj(.text*) */libretrocrt.a:relocate.c.obj(.text*)
*/libretrocrt.a:*(.text*) */libretrocrt.a:*(.text*)
*/libInterface.a:*(.text*)
*(.text*) *(.text*)
*(.stub) *(.stub)

View File

@ -35,6 +35,7 @@ SegmentMap::SegmentMap()
"*/libretrocrt.a:MultiSegApp.c.obj", "*/libretrocrt.a:MultiSegApp.c.obj",
"*/libretrocrt.a:LoadSeg.s.obj", "*/libretrocrt.a:LoadSeg.s.obj",
"*/libretrocrt.a:*", "*/libretrocrt.a:*",
"*/libInterface.a:*",
"*/libgcc.a:*", "*/libgcc.a:*",
"*/libc.a:*" "*/libc.a:*"
); );
@ -65,6 +66,7 @@ SegmentMap::SegmentMap(std::string filename)
"*/libretrocrt.a:MultiSegApp.c.obj", "*/libretrocrt.a:MultiSegApp.c.obj",
"*/libretrocrt.a:LoadSeg.s.obj", "*/libretrocrt.a:LoadSeg.s.obj",
"*/libretrocrt.a:*", "*/libretrocrt.a:*",
"*/libInterface.a:*",
"*/libgcc.a:*", "*/libgcc.a:*",
"*/libc.a:*" "*/libc.a:*"
); );

View File

@ -238,7 +238,7 @@ fi
if [ $BUILD_68K != false ]; then if [ $BUILD_68K != false ]; then
if locateInterfaceThing INTERFACE_O Interface.o; then if locateInterfaceThing INTERFACE_O Interface.o; then
true M68KLIBRARIES=`dirname "$INTERFACE_O"`
else else
echo "Could not find Interface.o anywhere inside InterfaceAndLibraries/" echo "Could not find Interface.o anywhere inside InterfaceAndLibraries/"
echo "(This file is required for 68K support only)" echo "(This file is required for 68K support only)"
@ -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
@ -487,6 +487,22 @@ if [ $BUILD_PPC != false ]; then
linkheaders toolchain/powerpc-apple-macos/include linkheaders toolchain/powerpc-apple-macos/include
fi fi
if [ $BUILD_68K != false ]; then
echo "Converting 68K static libraries..."
for macobj in "${M68KLIBRARIES}/"*.o; do
if [ -r $macobj ]; then
libname=`basename "$macobj"`
libname=${libname%.o}
printf " %30s => %-30s\n" ${libname}.o lib${libname}.a
obj="toolchain/m68k-apple-macos/lib/$libname.o"
lib="toolchain/m68k-apple-macos/lib/lib${libname}.a"
rm -f $lib
(ConvertObj "$macobj" | m68k-apple-macos-as - -o $obj) && m68k-apple-macos-ar cqs $lib $obj
fi
done
fi
if [ $BUILD_PPC != false ]; then if [ $BUILD_PPC != false ]; then
case `ResInfo -n "$INTERFACELIB" || echo 0` in case `ResInfo -n "$INTERFACELIB" || echo 0` in
0) 0)
@ -531,12 +547,9 @@ if [ $BUILD_68K != false ]; then
mkdir -p build-target mkdir -p build-target
cd build-target cd build-target
INTERFACE_O=`find "$SRC/InterfacesAndLibraries" -name ".*" -prune -o -name Interface.o -print`
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 \
"-DINTERFACE_O=${INTERFACE_O}" \
${CMAKE_GENERATOR} ${CMAKE_GENERATOR}
cd .. cd ..
cmake --build build-target --target install cmake --build build-target --target install

View File

@ -1,11 +1,11 @@
#define LIBGCC_SPEC "--start-group -lretrocrt -lgcc --end-group" #define LIBGCC_SPEC "--start-group -lretrocrt -lgcc --end-group -lInterface"
#define LINK_SPEC "-elf2mac -q -undefined=_consolewrite" #define LINK_SPEC "-elf2mac -q -undefined=_consolewrite"
#undef LIB_SPEC #undef LIB_SPEC
#define LIB_SPEC "--start-group -lc -lretrocrt --end-group" #define LIB_SPEC "--start-group -lc -lretrocrt --end-group -lInterface"
#define LINK_GCC_C_SEQUENCE_SPEC "--start-group -lgcc -lc -lretrocrt --end-group" #define LINK_GCC_C_SEQUENCE_SPEC "--start-group -lgcc -lc -lretrocrt --end-group -lInterface"
#undef STARTFILE_SPEC #undef STARTFILE_SPEC

View File

@ -22,15 +22,7 @@
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
if(CMAKE_SYSTEM_NAME MATCHES Retro68) if(CMAKE_SYSTEM_NAME MATCHES Retro68)
find_program(CONVERT_OBJ ConvertObj PATH "${CMAKE_INSTALL_PREFIX}/../bin/")
set(INTERFACE_O InterfaceO_NOTFOUND CACHE STRING "path to MPW Interface.o file")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Interface.s
COMMAND ${CONVERT_OBJ} ${INTERFACE_O} > ${CMAKE_CURRENT_BINARY_DIR}/Interface.s
)
enable_language(ASM) enable_language(ASM)
set(ARCH_FILES set(ARCH_FILES
Retro68Runtime.h Retro68Runtime.h
start.c start.c
@ -39,7 +31,6 @@ if(CMAKE_SYSTEM_NAME MATCHES Retro68)
MultiSegApp.c MultiSegApp.c
LoadSeg.s LoadSeg.s
# glue.c # glue.c
${CMAKE_CURRENT_BINARY_DIR}/Interface.s
qdglobals.c qdglobals.c
Retro68.r Retro68.r
Retro68APPL.r Retro68APPL.r