Skip to content

Conversation

phcoder
Copy link
Contributor

@phcoder phcoder commented May 28, 2022

This is the main part of DJGPP support as libretro core. We also need some changes from duktape (svaarala/duktape#2472) and wren (wren-lang/wren#1090)

include(CheckCSourceCompiles)
check_c_source_compiles(
"#ifndef __MSDOS__
#error \"Not DOS\"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, is DJGPP a DOS compiler? Are you building TIC-80 on DOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For DOS. Cross-compiling from Debian

if(IS_DOS)
add_custom_command(TARGET tic80_libretro
POST_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/build/libretro/merge_static.sh $(AR) ${CMAKE_BINARY_DIR}/lib/tic80_libretro${LIBRETRO_SUFFIX}.${LIBRETRO_EXTENSION} ${CMAKE_BINARY_DIR}/lib/tic80_libretro_partial.a ${CMAKE_BINARY_DIR}/lib/libtic80core.a ${CMAKE_BINARY_DIR}/lib/liblua.a ${CMAKE_BINARY_DIR}/lib/libblipbuf.a ${CMAKE_BINARY_DIR}/lib/libduktape.a ${CMAKE_BINARY_DIR}/lib/libwren.a ${CMAKE_BINARY_DIR}/lib/libwasm.a ${CMAKE_BINARY_DIR}/lib/libsquirrel.a ${CMAKE_BINARY_DIR}/lib/libgiflib.a ${CMAKE_BINARY_DIR}/lib/liblpeg.a ${CMAKE_BINARY_DIR}/lib/libzlib.a ${MRUBY_LIB})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we only need zlib on DOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • dynamically linked libretro platforms don't end up in this code path
  • Other statically linked ones pull in system zlib via -lz
  • DOS is special that it doesn't have system or SDK-provided zlib

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addendum: it will also be needed for NGC and Wii but they need endianness patch in first

Copy link
Owner

@nesbox nesbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope you know what you're doing :)
Thank you.

@nesbox nesbox merged commit e76e4a6 into nesbox:main May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants