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:relocate.c.obj(.text*)
*/libretrocrt.a:*(.text*)
*/libInterface.a:*(.text*)
*(.text*)
*(.stub)

View File

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

View File

@ -238,7 +238,7 @@ fi
if [ $BUILD_68K != false ]; then
if locateInterfaceThing INTERFACE_O Interface.o; then
true
M68KLIBRARIES=`dirname "$INTERFACE_O"`
else
echo "Could not find Interface.o anywhere inside InterfaceAndLibraries/"
echo "(This file is required for 68K support only)"
@ -264,7 +264,7 @@ if [ $BUILD_PPC != false ]; then
else
echo "Could not find OpenTransportAppPPC.o anywhere inside InterfaceAndLibraries/"
echo "(This file is required for OpenTransport on PPC only)"
fi
fi
fi
@ -487,6 +487,22 @@ if [ $BUILD_PPC != false ]; then
linkheaders toolchain/powerpc-apple-macos/include
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
case `ResInfo -n "$INTERFACELIB" || echo 0` in
0)
@ -531,12 +547,9 @@ if [ $BUILD_68K != false ]; then
mkdir -p 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 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
"-DINTERFACE_O=${INTERFACE_O}" \
${CMAKE_GENERATOR}
cd ..
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"
#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

View File

@ -22,15 +22,7 @@
# <http://www.gnu.org/licenses/>.
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)
set(ARCH_FILES
Retro68Runtime.h
start.c
@ -39,7 +31,6 @@ if(CMAKE_SYSTEM_NAME MATCHES Retro68)
MultiSegApp.c
LoadSeg.s
# glue.c
${CMAKE_CURRENT_BINARY_DIR}/Interface.s
qdglobals.c
Retro68.r
Retro68APPL.r