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

Bug fixes and patches to build on FreeBSD #699

Open
teamblubee opened this issue Jul 5, 2018 · 0 comments
Open

Bug fixes and patches to build on FreeBSD #699

teamblubee opened this issue Jul 5, 2018 · 0 comments

Comments

@teamblubee
Copy link

This is an edit to CMakeLists.txt to find X11 on FreeBSD

--- CMakeLists.txt.orig	2018-07-04 11:12:46 UTC
+++ CMakeLists.txt
@@ -486,6 +486,24 @@ if(OCE_VISUALISATION)
 		set(OPENGL_LIBRARIES /usr/X11R6/lib/libGL.dylib /usr/X11R6/lib/libGLU.dylib)
 	endif (NOT APPLE OR OCE_OSX_USE_COCOA)
 
+        if (UNIX AND NOT APPLE)
+                message(WARNING "FreeBSD LOOKING FOR X11")
+                find_package(X11 REQUIRED)
+                if ( NOT ${X11_FOUND} )
+                        message(FATAL_ERROR "FreeBSD X11 NOT FOUND?")
+                else (${X11_FOUND} )
+                        include_directories(${X11_INCLUDE_DIR})
+                        link_directories(${X11_LIBRARIES})
+                endif( NOT ${X11_FOUND} )
+        endif(UNIX AND NOT APPLE)
+
+        get_cmake_property(_variableNames VARIABLES)
+        list (SORT _variableNames)
+        foreach (_variableName ${_variableNames})
+                message(STATUS "${_variableName}=${${_variableName}}")
+        endforeach()
+        # message(FATAL_ERROR "----------------====================--------------------")
+
 	## GL2PS
 	if(OCE_WITH_GL2PS)
 		find_path(GL2PS_INCLUDE_DIR gl2ps.h DOC "Location of header files for GL2PS (containing gl2ps.h)" ${CMAKE_SYSTEM_INCLUDE_PATH})

FreeBSD has malloc defined in stdlib.h

--- inc/config.h.orig	2018-07-04 12:22:31 UTC
+++ inc/config.h
@@ -1866,6 +1866,18 @@
 #endif   
 
 
+/*-----------------------------------------------------------*/
+/* Adaptation for FreeBSD */
+/*-----------------------------------------------------------*/
+
+#elif defined(__FreeBSD__)
+
+#define HAVE_MALLOC_H 1
+#define HAVE_STDLIB_H 1
+ 
+#endif   
+
+
 /*--------------------------------------------------------- */
 /*  */
 /*--------------------------------------------------------- */

Another file removing malloc for FreeBSD

--- src/OSD/OSD_MemInfo.cxx.orig	2018-02-13 18:38:59 UTC
+++ src/OSD/OSD_MemInfo.cxx
@@ -29,6 +29,8 @@
   #include <mach/task.h>
   #include <mach/mach.h>
   #include <malloc/malloc.h>
+#elif (defined(__FreeBSD__))
+  #include <unistd.h>
 #else
   #include <unistd.h>
   #include <malloc.h>
--- src/StepFile/recfile.pc.orig	2018-02-13 18:38:59 UTC
+++ src/StepFile/recfile.pc
@@ -16,7 +16,7 @@
 #include "stdio.h"
 #include "string.h"
 #include "stdlib.h"
-#if (!defined(_WIN32) && !defined(__APPLE__))
+#if (!defined(__FreeBSD__) && !defined(_WIN32) && !defined(__APPLE__))
 #include "malloc.h"
 #endif
 #include "recfile.ph" 

clang is more pedantic than gcc

--- src/STEPConstruct/STEPConstruct_AP203Context.cxx.orig	2018-07-04 12:43:42 UTC
+++ src/STEPConstruct/STEPConstruct_AP203Context.cxx
@@ -109,7 +109,7 @@ Handle(StepBasic_DateAndTime) STEPConstruct_AP203Conte
     long shift = 0;
     _get_timezone (&shift);
   #else
-    Standard_Integer shift = Standard_Integer(timezone);
+    Standard_Integer shift = Standard_Integer((size_t)timezone);
   #endif
     Standard_Integer shifth = abs ( shift ) / 3600;
     Standard_Integer shiftm = ( abs ( shift ) - shifth * 3600 ) / 60;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant