Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Haiku support #691

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
project(OCE)

set(OCE_VERSION_MAJOR 0)
set(OCE_VERSION_MINOR 18)
set(OCE_VERSION_MINOR 19)
# OCE_VERSION_PATCH is used for bugfixes releases only
# (uncomment following line)
set(OCE_VERSION_PATCH 3)
set(OCE_VERSION_PATCH)
# Empty for official releases, set to -dev, -rc1, etc for development releases
set(OCE_VERSION_DEVEL)
set(OCE_VERSION_DEVEL -dev)

# bugfix release: add ${OCE_VERSION_PATCH} to OCE_VERSION
set(OCE_VERSION ${OCE_VERSION_MAJOR}.${OCE_VERSION_MINOR}${OCE_VERSION_DEVEL})
Expand Down Expand Up @@ -472,9 +472,9 @@ if(OCE_VISUALISATION)
endif(WIN32)
endif(OCE_WITH_FREEIMAGE)

if (NOT WIN32 AND NOT OCE_OSX_USE_COCOA)
if (NOT WIN32 AND NOT OCE_OSX_USE_COCOA AND NOT HAIKU)
find_package(X11 REQUIRED)
endif(NOT WIN32 AND NOT OCE_OSX_USE_COCOA)
endif(NOT WIN32 AND NOT OCE_OSX_USE_COCOA AND NOT HAIKU)

if (NOT APPLE OR OCE_OSX_USE_COCOA)
find_package(OpenGL REQUIRED)
Expand Down Expand Up @@ -716,6 +716,11 @@ if(UNIX)
# remark #981 "operands are evaluated in unspecified order", e.g. a = b() + c()
add_definitions("-diag-disable 383,522,858,981")
endif(INTEL)
if(HAIKU)
# Haiku networking resides in libnetwork
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lnetwork")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lnetwork")
endif(HAIKU)
endif(APPLE)
add_definitions(-DHAVE_CONFIG_H -DCSFDB -DOCC_CONVERT_SIGNALS)
else(UNIX)
Expand Down Expand Up @@ -898,7 +903,11 @@ endif(NOT DEFINED OCE_INSTALL_SCRIPT_DIR)
# Data
if(NOT DEFINED OCE_INSTALL_DATA_DIR)
if(NOT MSVC)
set(OCE_INSTALL_DATA_DIR share/oce-${OCE_VERSION})
if(NOT HAIKU)
set(OCE_INSTALL_DATA_DIR share/oce-${OCE_VERSION})
else ()
set(OCE_INSTALL_DATA_DIR data/oce-${OCE_VERSION})
endif(NOT HAIKU)
else ()
set(OCE_INSTALL_DATA_DIR "share/oce")
endif(NOT MSVC)
Expand All @@ -922,8 +931,13 @@ if(NOT DEFINED OCE_INSTALL_CMAKE_DATA_DIR)
set(OCE_INSTALL_CMAKE_DATA_DIR
OCE.framework/Versions/${OCE_VERSION}/Resources)
else(APPLE)
set(OCE_INSTALL_CMAKE_DATA_DIR
lib${LIB_SUFFIX}/oce-${OCE_VERSION})
if(NOT HAIKU)
set(OCE_INSTALL_CMAKE_DATA_DIR
lib${LIB_SUFFIX}/oce-${OCE_VERSION})
else(NOT HAIKU)
set(OCE_INSTALL_CMAKE_DATA_DIR
lib${LIB_SUFFIX}/cmake)
endif(NOT HAIKU)
endif(APPLE)
endif(WIN32)
endif(NOT DEFINED OCE_INSTALL_CMAKE_DATA_DIR)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Below are listed all the oce releases since the beginning of the project, the ma

| OCE release number | ABI Change | OCE release date | OCCT version |
| ------------- | ------------- | ------------- |------------- |
| [0.18.3](https://github.com/tpaviot/oce/releases/tag/OCE-0.18.3) | No | February | 6.9.1
| [0.18.3](https://github.com/tpaviot/oce/releases/tag/OCE-0.18.3) | No | February 2018 | 6.9.1
| [0.18.2](https://github.com/tpaviot/oce/releases/tag/OCE-0.18.2) | No | August 2017 | 6.9.1
| [0.18.1](https://github.com/tpaviot/oce/releases/tag/OCE-0.18.1) | No | May 2017 | 6.9.1
| [0.18](https://github.com/tpaviot/oce/releases/tag/OCE-0.18) | Yes | January 2017 | 6.9.1
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: oce-0.18.3.{build}
version: oce-0.19.{build}

environment:
oce_version: 0.18.3
oce_version: 0.19
matrix:
- generator: "MinGW Makefiles"
ARCH: "i686"
Expand Down
6 changes: 3 additions & 3 deletions src/Aspect/Aspect_DisplayConnection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection, Standard_Transient)
// =======================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection()
{
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__HAIKU__)
OSD_Environment anEnv ("DISPLAY");
myDisplayName = anEnv.Value();
Init();
Expand All @@ -38,15 +38,15 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
// =======================================================================
Aspect_DisplayConnection::~Aspect_DisplayConnection()
{
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__HAIKU__)
if (myDisplay != NULL)
{
XCloseDisplay (myDisplay);
}
#endif
}

#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__HAIKU__)
// =======================================================================
// function : Aspect_DisplayConnection
// purpose :
Expand Down
4 changes: 2 additions & 2 deletions src/Aspect/Aspect_DisplayConnection.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <TCollection_AsciiString.hxx>
#include <NCollection_DataMap.hxx>

#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__HAIKU__)
#include <InterfaceGraphic.hxx>
#endif

Expand All @@ -39,7 +39,7 @@ public:
//! Destructor. Close opened connection.
Standard_EXPORT ~Aspect_DisplayConnection();

#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__HAIKU__)
//! Constructor. Creates connection with display specified in theDisplayName.
//! Display name should be in format "hostname:number" or "hostname:number.screen_number", where:
//! hostname - Specifies the name of the host machine on which the display is physically attached.
Expand Down
2 changes: 1 addition & 1 deletion src/InterfaceGraphic/InterfaceGraphic.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#undef DrawText
#endif

#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__HAIKU__)

#include <stdio.h>

Expand Down
2 changes: 1 addition & 1 deletion src/OSD/OSD_signal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typedef void (* SIG_PFV) (int);

#include <signal.h>

#if !defined(__ANDROID__)
#if !defined(__ANDROID__) && !defined(__HAIKU__)
#include <sys/signal.h>
#endif

Expand Down
4 changes: 4 additions & 0 deletions src/Standard/Standard_MMgrOpt.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
# include <sys/mman.h> /* mmap() */
#endif

#ifdef __HAIKU__
# include <errno.h>
#endif

#include <fcntl.h>
//
#if defined (__sun) || defined(SOLARIS)
Expand Down
4 changes: 4 additions & 0 deletions src/Standard/Standard_Mutex.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <Standard_Mutex.hxx>
#include <Standard_OStream.hxx>

#ifdef __HAIKU__
#include <Errors.h>
#endif

//=============================================
// Standard_Mutex::Standard_Mutex
//=============================================
Expand Down
4 changes: 3 additions & 1 deletion src/Standard/Standard_Mutex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
#include <windows.h>
#else
#include <pthread.h>
#include <sys/errno.h>
#ifndef __HAIKU__
#include <sys/errno.h>
#endif
#include <unistd.h>
#include <time.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Xw/Xw_Window.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include <Xw_Window.hxx>

#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__HAIKU__)

#include <Aspect_Convert.hxx>
#include <Aspect_WindowDefinitionError.hxx>
Expand Down
2 changes: 1 addition & 1 deletion src/Xw/Xw_Window.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef _Xw_Window_H__
#define _Xw_Window_H__

#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__HAIKU__)

#include <Aspect_Window.hxx>

Expand Down