diff --git a/CMakeLists.txt b/CMakeLists.txt index 28a599286..21a1ae43b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,7 +196,7 @@ if(UNIX OR MINGW) endif() endif() -if(UNIX AND NOT APPLE) +if(UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") find_package(PkgConfig REQUIRED) if(NOT PKGCONFIG_FOUND) @@ -363,6 +363,11 @@ elseif(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # Enable multi-processor compilation (faster) endif() +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOs") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") +endif() + # Build the angelscript library if not in system if(USE_SYSTEM_ANGELSCRIPT) @@ -686,6 +691,10 @@ if(NOT SERVER_ONLY) endif() endif() +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + target_link_libraries(supertuxkart nsl socket vorbisfile) +endif() + if (USE_DNS_C) target_link_libraries(supertuxkart dnsc) else() diff --git a/cmake/FindFreetype.cmake b/cmake/FindFreetype.cmake index 86ad49b23..184d35168 100644 --- a/cmake/FindFreetype.cmake +++ b/cmake/FindFreetype.cmake @@ -14,7 +14,7 @@ if(WIN32) find_library(FREETYPE_LIBRARY NAMES freetype libfreetype PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib") set(FREETYPE_FOUND 1) set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY}) -elseif(APPLE) +elseif(APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") find_path(FREETYPE_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2 include/freetype2 include) find_library(FREETYPE_LIBRARY NAMES freetype) set(FREETYPE_FOUND 1) diff --git a/lib/irrlicht/source/Irrlicht/CFileSystem.cpp b/lib/irrlicht/source/Irrlicht/CFileSystem.cpp index 1ac19647e..fa5fcc5d0 100644 --- a/lib/irrlicht/source/Irrlicht/CFileSystem.cpp +++ b/lib/irrlicht/source/Irrlicht/CFileSystem.cpp @@ -887,7 +887,7 @@ IFileList* CFileSystem::createFileList(const io::path& directory) size = buf.st_size; isDirectory = S_ISDIR(buf.st_mode); } - #if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) && !defined(__HAIKU__) + #if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) && !defined(__HAIKU__) && !defined(__sun) // only available on some systems else { diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index c5e6a62f3..17d08e175 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -2278,7 +2278,7 @@ bool IrrDriver::OnEvent(const irr::SEvent &event) scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy, float radius, float r, float g, float b, - bool sun, scene::ISceneNode* parent) + bool sun_, scene::ISceneNode* parent) { #ifndef SERVER_ONLY if (CVS->isGLSL()) @@ -2286,7 +2286,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, if (parent == NULL) parent = m_scene_manager->getRootSceneNode(); LightNode *light = NULL; - if (!sun) + if (!sun_) light = new LightNode(m_scene_manager, parent, energy, radius, r, g, b); else @@ -2297,7 +2297,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, m_lights.push_back(light); - if (sun) + if (sun_) { m_renderer->addSunLight(pos); } diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 0699a844b..0f2afdb92 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -410,7 +410,7 @@ public: // ------------------------------------------------------------------------ scene::ISceneNode *addLight(const core::vector3df &pos, float energy, float radius, float r, float g, float b, - bool sun = false, + bool sun_ = false, scene::ISceneNode* parent = NULL); // ------------------------------------------------------------------------ void clearLights(); diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 468b7bb9b..7995916bf 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -1078,9 +1078,9 @@ void PostProcessing::renderGodRays(scene::ICameraSceneNode * const camnode, const SColor col = track->getGodRaysColor(); // The sun interposer - SP::SPDynamicDrawCall* sun = irr_driver->getSunInterposer(); + SP::SPDynamicDrawCall* sun_ = irr_driver->getSunInterposer(); // This will only do thing when you update the sun position - sun->uploadInstanceData(); + sun_->uploadInstanceData(); SP::SPShader* glow_shader = SP::getGlowShader(); glow_shader->use(); SP::SPUniformAssigner* glow_color_assigner = glow_shader @@ -1088,7 +1088,7 @@ void PostProcessing::renderGodRays(scene::ICameraSceneNode * const camnode, assert(glow_color_assigner != NULL); video::SColorf cf(track->getGodRaysColor()); glow_color_assigner->setValue(core::vector3df(cf.r, cf.g, cf.b)); - sun->draw(); + sun_->draw(); glow_shader->unuse(); glDisable(GL_DEPTH_TEST); diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 5f327963e..081f1822e 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -2135,9 +2135,9 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id) #ifndef SERVER_ONLY if (!CVS->isGLSL()) { - scene::ILightSceneNode *sun = (scene::ILightSceneNode *) m_sun; + scene::ILightSceneNode *sun_ = (scene::ILightSceneNode *) m_sun; - sun->setLightType(video::ELT_DIRECTIONAL); + sun_->setLightType(video::ELT_DIRECTIONAL); // The angle of the light is rather important - let the sun // point towards (0,0,0). @@ -2148,7 +2148,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id) else m_sun->setRotation((-m_sun_position).getHorizontalAngle()); - sun->getLightData().SpecularColor = m_sun_specular_color; + sun_->getLightData().SpecularColor = m_sun_specular_color; } else { diff --git a/src/utils/crash_reporting.cpp b/src/utils/crash_reporting.cpp index 7dc55279b..3c93f3fb7 100644 --- a/src/utils/crash_reporting.cpp +++ b/src/utils/crash_reporting.cpp @@ -429,6 +429,8 @@ path = realpath("/proc/self/exe", NULL); #elif defined(__NetBSD__) path = realpath("/proc/curproc/exe", NULL); +#elif defined(__sun) + path = realpath("/proc/self/path/a.out", NULL); #elif defined(__APPLE__) path = (char*)malloc(PATH_MAX+1); uint32_t len = PATH_MAX; diff --git a/src/utils/vs.hpp b/src/utils/vs.hpp index 0bf688507..b4630a953 100644 --- a/src/utils/vs.hpp +++ b/src/utils/vs.hpp @@ -40,7 +40,7 @@ # include #endif -#if (defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)) || defined(__NetBSD__) || defined(__APPLE__) +#if (defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)) || defined(__NetBSD__) || defined(__APPLE__) || defined(__sun) # include #endif @@ -95,7 +95,7 @@ namespace VS static void setThreadName(const char* name) { #if defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) -#if __GLIBC__ > 2 || __GLIBC_MINOR__ > 11 +#if __GLIBC__ > 2 || __GLIBC_MINOR__ > 11 || defined(__sun) pthread_setname_np(pthread_self(), name); #endif #elif defined(__FreeBSD__) || defined(__DragonFly__)