Browse Source

Fix amiga build (#5479)

pull/5498/head
Artur Jarosik 3 years ago committed by GitHub
parent
commit
8bee40dca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .circleci/config.yml
  2. 2
      CMake/platforms/amiga.cmake
  3. 2
      Packaging/amiga/prep.sh
  4. 4
      Source/utils/paths.cpp
  5. 12
      Source/utils/sdl2_to_1_2_backports.cpp

2
.circleci/config.yml

@ -52,7 +52,7 @@ jobs:
steps:
- checkout
- run: Packaging/amiga/prep.sh
- run: PKG_CONFIG_PATH=/opt/m68k-amigaos/lib/pkgconfig/:/opt/m68k-amigaos/share/pkgconfig/ cmake -S. -Bbuild -DM68K_CPU=68040 -DM68K_FPU=hard -DM68K_COMMON="-s -ffast-math -O3 -noixemul -D__BIG_ENDIAN__ -D__AMIGA__ -fpermissive" ..
- run: PKG_CONFIG_PATH=/opt/m68k-amigaos/lib/pkgconfig/:/opt/m68k-amigaos/share/pkgconfig/ cmake -S. -Bbuild -DM68K_CPU=68040 -DM68K_FPU=hard -DM68K_COMMON="-s -fbbb=- -m68040 -ffast-math -O2 -noixemul -D__BIG_ENDIAN__ -D__AMIGA__ -fpermissive" ..
- run: cd build && make -j2
- store_artifacts: {path: ./build/devilutionx, destination: devilutionx_m68k}
vita:

2
CMake/platforms/amiga.cmake

@ -20,7 +20,7 @@ add_definitions(-Dfseeko=fseek)
list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES ZLIB::ZLIB)
if(NOT WARPOS)
list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES -ldebug)
list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES -ldebug -noixemul)
endif()
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/amiga/devilutionx.info" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")

2
Packaging/amiga/prep.sh

@ -9,7 +9,7 @@ export SYSROOT=/opt/$TARGET
export M68K_CPU=68040
export M68K_FPU=hard
export M68K_CPU_FPU="-m${M68K_CPU} -m${M68K_FPU}-float"
export M68K_COMMON="-s -ffast-math -fomit-frame-pointer"
export M68K_COMMON="-s -ffast-math -fomit-frame-pointer -fbbb=-"
export M68K_CFLAGS="${M68K_CPU_FPU} ${M68K_COMMON}"
export M68K_CXXFLAGS="${M68K_CPU_FPU} ${M68K_COMMON}"

4
Source/utils/paths.cpp

@ -88,9 +88,11 @@ const std::string &PrefPath()
prefPath = NxdkGetPrefPath();
#else
prefPath = FromSDL(SDL_GetPrefPath("diasurgical", "devilution"));
#if !defined(__amigaos__)
if (FileExistsAndIsWriteable("diablo.ini")) {
prefPath = std::string("." DIRECTORY_SEPARATOR_STR);
}
#endif
#endif
}
return *prefPath;
@ -105,9 +107,11 @@ const std::string &ConfigPath()
configPath = NxdkGetPrefPath();
#else
configPath = FromSDL(SDL_GetPrefPath("diasurgical", "devilution"));
#if !defined(__amigaos__)
if (FileExistsAndIsWriteable("diablo.ini")) {
configPath = std::string("." DIRECTORY_SEPARATOR_STR);
}
#endif
#endif
}
return *configPath;

12
Source/utils/sdl2_to_1_2_backports.cpp

@ -696,7 +696,7 @@ char *SDL_GetPrefPath(const char *org, const char *app)
#else
namespace {
#if !defined(__QNXNTO__)
#if !defined(__QNXNTO__) && !defined(__amigaos__)
char *readSymLink(const char *path)
{
// From sdl2-2.0.9/src/filesystem/unix/SDL_sysfilesystem.c
@ -778,8 +778,9 @@ char *SDL_GetBasePath()
#endif
#if defined(__3DS__)
retval = SDL_strdup("file:sdmc:/3ds/devilutionx/");
return retval;
#endif
#elif defined(__amigaos__)
retval = SDL_strdup("PROGDIR:");
#else
/* is a Linux-style /proc filesystem available? */
if (!retval && (access("/proc", F_OK) == 0)) {
@ -826,7 +827,7 @@ char *SDL_GetBasePath()
if (ptr != NULL)
retval = ptr; /* oh well if it failed. */
}
#endif
return retval;
}
@ -849,6 +850,9 @@ char *SDL_GetPrefPath(const char *org, const char *app)
#if defined(__3DS__)
retval = SDL_strdup("sdmc:/3ds/devilutionx/");
return retval;
#elif defined(__amigaos__)
retval = SDL_strdup("PROGDIR:");
return retval;
#endif
if (!app) {

Loading…
Cancel
Save