[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43324] trunk/blender: Some small fixes to get things compiling on solaris with cmake.

Kent Mein mein at cs.umn.edu
Thu Jan 12 17:31:34 CET 2012


Revision: 43324
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43324
Author:   sirdude
Date:     2012-01-12 16:31:27 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
Some small fixes to get things compiling on solaris with cmake.
There are also some changes that need to be done to libmv but I'm 
leaving those out so I can get it patched upstream first.

(Only works with gcc/g++ if we want to use sun's compiler we would need
to get rid of all of our annonymous structs which I don't think
we want to do at this point, example:

typedef struct wmNDOFMotionData {
        union {
                float tvec[3]; // translation
                struct { float tx, ty, tz; };   // this would need to be fixed
		// something like this or something similar:
                struct { float x, y, z; } t;
                };
...
)

Kent

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/source/blender/blenlib/BLI_fnmatch.h
    trunk/blender/source/blender/blenlib/intern/path_util.c
    trunk/blender/source/blender/editors/space_outliner/outliner_tree.c
    trunk/blender/source/blender/makesrna/RNA_access.h
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2012-01-12 15:56:08 UTC (rev 43323)
+++ trunk/blender/CMakeLists.txt	2012-01-12 16:31:27 UTC (rev 43324)
@@ -620,6 +620,10 @@
 	# CLang is the same as GCC for now.
 	elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 		set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
+	# Solaris CC
+	elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") 
+		set(PLATFORM_CFLAGS "-pipe -features=extensions -fPIC -D__FUNCTION__=__func__")
+		
 	# Intel C++ Compiler
 	elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 		# think these next two are broken

Modified: trunk/blender/source/blender/blenlib/BLI_fnmatch.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_fnmatch.h	2012-01-12 15:56:08 UTC (rev 43323)
+++ trunk/blender/source/blender/blenlib/BLI_fnmatch.h	2012-01-12 16:31:27 UTC (rev 43324)
@@ -51,7 +51,7 @@
 #define	FNM_NOESCAPE	(1 << 1) /* Backslashes don't quote special chars.  */
 #define	FNM_PERIOD	(1 << 2) /* Leading `.' is matched only explicitly.  */
 	
-#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
+#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) || defined( __SUNPRO_C)
 #define	FNM_FILE_NAME	FNM_PATHNAME /* Preferred GNU name.  */
 #define	FNM_LEADING_DIR	(1 << 3) /* Ignore `/...' after a match.  */
 #define	FNM_CASEFOLD	(1 << 4) /* Compare without regard to case.  */

Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/path_util.c	2012-01-12 15:56:08 UTC (rev 43323)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c	2012-01-12 16:31:27 UTC (rev 43324)
@@ -52,7 +52,7 @@
 
 #include "GHOST_Path-api.h"
 
-#if defined WIN32 && !defined _LIBC
+#if defined WIN32 && !defined _LIBC  || defined __sun
 #  include "BLI_fnmatch.h" /* use fnmatch included in blenlib */
 #else
 #  ifndef _GNU_SOURCE

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_tree.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_tree.c	2012-01-12 15:56:08 UTC (rev 43323)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_tree.c	2012-01-12 16:31:27 UTC (rev 43324)
@@ -57,7 +57,7 @@
 #include "BLI_utildefines.h"
 #include "BLI_math_base.h"
 
-#if defined WIN32 && !defined _LIBC
+#if defined WIN32 && !defined _LIBC  || defined __sun
 # include "BLI_fnmatch.h" /* use fnmatch included in blenlib */
 #else
 #  ifndef _GNU_SOURCE

Modified: trunk/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- trunk/blender/source/blender/makesrna/RNA_access.h	2012-01-12 15:56:08 UTC (rev 43323)
+++ trunk/blender/source/blender/makesrna/RNA_access.h	2012-01-12 16:31:27 UTC (rev 43324)
@@ -996,7 +996,9 @@
 
 
 /* macro which inserts the function name */
-#ifdef __GNUC__
+/*
+*/
+#if defined __GNUC__ || defined __sun
 #  define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args)
 #else
 #  define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__)

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp	2012-01-12 15:56:08 UTC (rev 43323)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp	2012-01-12 16:31:27 UTC (rev 43324)
@@ -47,6 +47,12 @@
 #undef _XOPEN_SOURCE
 #endif
 
+#if defined(__sun) || defined(sun) 
+#if defined(_XPG4) 
+#undef _XPG4 
+#endif 
+#endif 
+
 #include <Python.h>
 
 extern "C" {



More information about the Bf-blender-cvs mailing list