Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Solaris support (merged from yvt/openspades)
Browse files Browse the repository at this point in the history
  • Loading branch information
nonperforming committed Apr 10, 2022
2 parents 180cf90 + f99252f commit 9991126
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Resources/downloadpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
OS_BASE="`uname`"
SRC_DIR="`dirname "$0"`"
# no color, not -m flag for OpenBSD
if [[ "$OS_BASE" != 'OpenBSD' ]]; then
if [[ "$OS_BASE" != 'OpenBSD' ]] && [[ "$OS_BASE" != 'SunOS' ]]; then
PAK_URL=$(grep --max-count=1 --no-filename --context=0 --color=never \
"OpenSpadesDevPackage" "$SRC_DIR/PakLocation.txt")
else
PAK_URL=$(grep --no-filename \
PAK_URL=$(grep -h \
"OpenSpadesDevPackage" "$SRC_DIR/PakLocation.txt" | head -n1)
fi
echo "BASEURL ************ $PAK_URL"
Expand Down
2 changes: 1 addition & 1 deletion Sources/AngelScript/addons/scriptbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ string GetCurrentDir()
#else
return _getcwd(buffer, (int)1024);
#endif // _MSC_VER
#elif defined(__APPLE__) || defined(__linux__)
#elif defined(__APPLE__) || defined(__linux__) || defined(__sun)
return getcwd(buffer, 1024);
#else
return "";
Expand Down
7 changes: 5 additions & 2 deletions Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ elseif(UNIX AND NOT APPLE)
endif()

if(UNIX)
if(NOT(CMAKE_SYSTEM_NAME MATCHES "BSD" OR APPLE))
if (NOT CMAKE_SYSTEM_NAME MATCHES "Haiku")
if(NOT(${CMAKE_SYSTEM_NAME} MATCHES "BSD" OR APPLE))
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
target_link_libraries(OpenSpades rt)
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
target_link_libraries(OpenSpades socket nsl ogg vorbis vorbisfile opus)
endif()
else()
target_link_libraries(OpenSpades network)
endif()
Expand Down
2 changes: 2 additions & 0 deletions Sources/Core/VersionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ std::string VersionInfo::GetVersionInfo() {
buffer = "DragonFly BSD";
#elif defined(__NetBSD__)
buffer = "NetBSD";
#elif defined(__sun)
buffer = "Solaris / Illumos";
#elif defined(__HAIKU__)
buffer = "Haiku OS";
#else
Expand Down
3 changes: 2 additions & 1 deletion Sources/Gui/PackageUpdateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ namespace spades {
curl.get(), CURLOPT_XFERINFOFUNCTION,
static_cast<int (*)(void *, curl_off_t, curl_off_t, curl_off_t, curl_off_t)>(
[](void *, curl_off_t total, curl_off_t downloaded, curl_off_t, curl_off_t) -> int {
SPLog("Downloaded %zd bytes/%zd bytes", downloaded, total);
if (total > 0)
SPLog("Downloaded %zd bytes/%zd bytes", downloaded, total);
return 0;
}));

Expand Down
2 changes: 2 additions & 0 deletions Sources/Gui/SDLRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,13 @@ namespace spades {

Handle<client::IAudioDevice> audio(CreateAudioDevice(), false);

#ifndef __sun
if (rtype == RendererType::GL) {
if (SDL_GL_SetSwapInterval(r_vsync) != 0) {
SPRaise("SDL_GL_SetSwapInterval failed: %s", SDL_GetError());
}
}
#endif

RunClientLoop(renderer.GetPointerOrNull(), audio.GetPointerOrNull());

Expand Down
2 changes: 2 additions & 0 deletions Sources/Gui/StartupScreenHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,8 @@ namespace spades {
return "DragonFlyBSD";
#elif defined(__OpenBSD__)
return "OpenBSD";
#elif defined(__sun)
return "Solaris";
#elif defined(__HAIKU__)
return "Haiku";
#else
Expand Down
4 changes: 4 additions & 0 deletions Sources/Imports/OpenGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
#include <OpenGL/gl3.h>
#include <OpenGL/gl3ext.h>
#else
#ifndef __sun
#include <GL/glew.h>
#else
#include <glew.h>
#endif

// v3.3 / GL_ARB_occlusion_query2
#ifndef GL_ANY_SAMPLES_PASSED
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindGLEW2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ IF (WIN32)
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library")
ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
FIND_PATH( GLEW_INCLUDE_DIR NAMES GL/glew.h glew.h
/usr/include
/usr/local/include
/sw/include
Expand All @@ -44,4 +44,4 @@ ELSE (GLEW_INCLUDE_DIR)
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ENDIF (GLEW_INCLUDE_DIR)

MARK_AS_ADVANCED( GLEW_FOUND )
MARK_AS_ADVANCED( GLEW_FOUND )

0 comments on commit 9991126

Please sign in to comment.