diff --git a/premake4.lua b/premake4.lua index c9b5617d1..7e60d73b0 100644 --- a/premake4.lua +++ b/premake4.lua @@ -193,6 +193,12 @@ function os.is_real( os_name ) return os.get_real() == os_name end +if os.is_real("haiku") then + premake.gcc.cc = "gcc-x86" + premake.gcc.cxx = "g++-x86" + premake.gcc.ar = "ar-x86" +end + function print_table( table_ref ) for _, value in pairs( table_ref ) do print(value) @@ -342,8 +348,10 @@ function fix_shared_lib_linking_path( package_name, libname ) if ( "4.4-beta5" == _PREMAKE_VERSION or "HEAD" == _PREMAKE_VERSION ) and not _OPTIONS["with-static-eepp"] and package_name == "eepp" then if os.is("macosx") then linkoptions { "-install_name " .. libname .. ".dylib" } - elseif os.is("linux") or os.is("freebsd") or os.is("haiku") then + elseif os.is("linux") or os.is("freebsd") then linkoptions { "-Wl,-soname=\"" .. libname .. "\"" } + elseif os.is("haiku") then + linkoptions { "-Wl,-soname=\"" .. libname .. ".so" .. "\"" } end end end @@ -464,7 +472,7 @@ function generate_os_links() elseif os.is_real("freebsd") then multiple_insert( os_links, { "rt", "pthread", "X11", "openal", "GL", "Xcursor" } ) elseif os.is_real("haiku") then - multiple_insert( os_links, { "openal", "GL" } ) + multiple_insert( os_links, { "openal", "GL", "network" } ) elseif os.is_real("ios") then multiple_insert( os_links, { "OpenGLES.framework", "OpenAL.framework", "AudioToolbox.framework", "CoreAudio.framework", "Foundation.framework", "CoreFoundation.framework", "UIKit.framework", "QuartzCore.framework", "CoreGraphics.framework" } ) elseif os.is_real("emscripten") then diff --git a/src/eepp/network/socketselector.cpp b/src/eepp/network/socketselector.cpp index dbc4377f6..010875cca 100644 --- a/src/eepp/network/socketselector.cpp +++ b/src/eepp/network/socketselector.cpp @@ -4,6 +4,10 @@ #include #include +#if EE_PLATFORM == EE_PLATFORM_HAIKU +#include +#endif + #ifdef _MSC_VER #pragma warning(disable : 4127) // "conditional expression is constant" generated by the FD_SET macro #endif diff --git a/src/eepp/network/tcpsocket.cpp b/src/eepp/network/tcpsocket.cpp index d00f4051e..2a4382e87 100644 --- a/src/eepp/network/tcpsocket.cpp +++ b/src/eepp/network/tcpsocket.cpp @@ -5,6 +5,10 @@ #include #include +#if EE_PLATFORM == EE_PLATFORM_HAIKU +#include +#endif + #ifdef _MSC_VER #pragma warning(disable : 4127) // "conditional expression is constant" generated by the FD_SET macro #endif diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 87f868055..d4b6388a2 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -10,7 +10,6 @@ #include #include #include - #include #include #include @@ -65,8 +64,11 @@ WindowSDL::WindowSDL( WindowSettings Settings, ContextSettings Context ) : Window( Settings, Context, eeNew( ClipboardSDL, ( this ) ), eeNew( InputSDL, ( this ) ), eeNew( CursorManagerSDL, ( this ) ) ), mSDLWindow( NULL ), mGLContext( NULL ), - mGLContextThread( NULL ), + mGLContextThread( NULL ) +#ifdef EE_USE_WMINFO + , mWMinfo( NULL ) +#endif #if EE_PLATFORM == EE_PLATFORM_ANDROID , mZip( eeNew( Zip, () ) ) @@ -312,7 +314,7 @@ void WindowSDL::createPlatform() { #elif EE_PLATFORM == EE_PLATFORM_MACOSX mPlatform = eeNew( Platform::OSXImpl, ( this ) ); #else - Window::CreatePlatform(); + Window::createPlatform(); #endif } @@ -482,10 +484,11 @@ void WindowSDL::setGamma( Float Red, Float Green, Float Blue ) { } eeWindowHandle WindowSDL::getWindowHandler() { +#ifdef EE_USE_WMINFO if ( NULL != mWMinfo ) { return mWMinfo->getWindowHandler(); } - +#endif return 0; } diff --git a/src/eepp/window/backend/SDL2/wminfo.cpp b/src/eepp/window/backend/SDL2/wminfo.cpp index a883f0739..19e1a06d5 100644 --- a/src/eepp/window/backend/SDL2/wminfo.cpp +++ b/src/eepp/window/backend/SDL2/wminfo.cpp @@ -3,6 +3,8 @@ #ifdef EE_BACKEND_SDL2 #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_IOS || EE_PLATFORM_ANDROID == EE_PLATFORM + #define EE_WMINFO + #if !defined( EE_COMPILER_MSVC ) && EE_PLATFORM != EE_PLATFORM_ANDROID && EE_PLATFORM != EE_PLATFORM_IOS && !defined( EE_SDL2_FROM_ROOTPATH ) #include #else @@ -12,6 +14,7 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { +#ifdef EE_WMINFO WMInfo::WMInfo( SDL_Window * win ) : mWMInfo( eeNew( SDL_SysWMinfo, () ) ) { @@ -19,10 +22,17 @@ WMInfo::WMInfo( SDL_Window * win ) : SDL_VERSION( &info->version ); SDL_GetWindowWMInfo ( win, info ); } +#else +WMInfo::WMInfo( SDL_Window * win ) : + mWMInfo( NULL ) +{} +#endif WMInfo::~WMInfo() { +#ifdef EE_WMINFO SDL_SysWMinfo * info = static_cast ( mWMInfo ); eeSAFE_DELETE( info ); +#endif } #if defined( EE_X11_PLATFORM )