Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-11-17 00:48:21 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-17 00:48:21 +0400
commit6e9fd309b84b201784270b9f090e6ff365b0a964 (patch)
tree383f3e4d7ee354df68e8847b33e6e26773b846c3 /extern
parent25a0ff4110b4e4419dc360a3fb2aca2fa16c1751 (diff)
parent9f51785c4d0038d24fed473dc1d803458f838884 (diff)
Merged trunk up to rev41928
Diffstat (limited to 'extern')
-rw-r--r--extern/colamd/CMakeLists.txt5
-rw-r--r--extern/libmv/CMakeLists.txt25
-rw-r--r--extern/libmv/SConscript4
-rwxr-xr-xextern/libmv/bundle.sh15
-rw-r--r--extern/libmv/libmv-capi.cpp13
-rw-r--r--extern/libmv/libmv/multiview/euclidean_resection.cc2
-rw-r--r--extern/libmv/libmv/tracking/esm_region_tracker.cc2
-rw-r--r--extern/libmv/patches/mingw.patch158
-rw-r--r--extern/libmv/third_party/glog/src/config.h2
-rw-r--r--extern/libmv/third_party/glog/src/config_linux.h2
-rw-r--r--extern/libmv/third_party/glog/src/utilities.h4
-rw-r--r--extern/libmv/third_party/glog/src/windows/glog/logging.h18
-rw-r--r--extern/libmv/third_party/glog/src/windows/port.h37
13 files changed, 253 insertions, 34 deletions
diff --git a/extern/colamd/CMakeLists.txt b/extern/colamd/CMakeLists.txt
index 34389f5efd0..5b565518e4f 100644
--- a/extern/colamd/CMakeLists.txt
+++ b/extern/colamd/CMakeLists.txt
@@ -23,7 +23,7 @@
# ***** END GPL LICENSE BLOCK *****
set(INC
- ./Include
+ Include
)
set(INC_SYS
@@ -34,7 +34,8 @@ set(SRC
Source/colamd.c
Source/colamd_global.c
- Include//colamd.h
+ Include/colamd.h
+ Include/UFconfig.h
)
blender_add_lib(extern_colamd "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt
index 8c069375ff0..cd1f572197c 100644
--- a/extern/libmv/CMakeLists.txt
+++ b/extern/libmv/CMakeLists.txt
@@ -25,8 +25,8 @@
set(INC
.
../Eigen3
- ./third_party/ssba
- ./third_party/ldl/Include
+ third_party/ssba
+ third_party/ldl/Include
../colamd/Include
)
@@ -134,7 +134,7 @@ set(SRC
third_party/msinttypes/inttypes.h
)
-IF(WIN32)
+if(WIN32)
list(APPEND SRC
third_party/glog/src/logging.cc
third_party/glog/src/raw_logging.cc
@@ -162,18 +162,23 @@ IF(WIN32)
)
list(APPEND INC
- ./third_party/glog/src/windows
- ./third_party/msinttypes
+ third_party/glog/src/windows
)
- IF(MSVC)
+ if(NOT MINGW)
+ list(APPEND INC
+ third_party/msinttypes
+ )
+ endif()
+
+ if(MSVC)
set(MSVC_OFLAGS O1 O2 Ox)
foreach(FLAG )
string(REPLACE "" "Od" CMAKE_CXX_FLAGS_RELEASE "")
string(REPLACE "" "Od" CMAKE_C_FLAGS_RELWITHDEBINFO "")
endforeach()
- ENDIF(MSVC)
-ELSE(WIN32)
+ endif()
+else(WIN32)
list(APPEND SRC
third_party/glog/src/utilities.cc
third_party/glog/src/symbolize.cc
@@ -205,9 +210,9 @@ ELSE(WIN32)
)
list(APPEND INC
- ./third_party/glog/src
+ third_party/glog/src
)
-ENDIF(WIN32)
+endif()
add_definitions(-DV3DLIB_ENABLE_SUITESPARSE -DGOOGLE_GLOG_DLL_DECL=)
diff --git a/extern/libmv/SConscript b/extern/libmv/SConscript
index 1ffc6233c1d..60705e913f7 100644
--- a/extern/libmv/SConscript
+++ b/extern/libmv/SConscript
@@ -30,7 +30,9 @@ incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
- incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog ./third_party/msinttypes'
+ incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
+ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
+ incs += ' ./third_party/msinttypes'
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
src += ['./third_party/glog/src/windows/port.cc']
diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh
index c8df8ae7341..690f78df387 100755
--- a/extern/libmv/bundle.sh
+++ b/extern/libmv/bundle.sh
@@ -168,6 +168,16 @@ IF(WIN32)
list(APPEND INC
./third_party/glog/src/windows
+ )
+
+ IF(NOT MINGW)
+ list(APPEND INC
+ ./third_party/msinttypes
+ )
+ ENDIF(MINGW)
+
+ list(APPEND INC
+ ./third_party/glog/src/windows
./third_party/msinttypes
)
@@ -219,7 +229,10 @@ incs += ' ' + env['BF_PNG_INC']
incs += ' ' + env['BF_ZLIB_INC']
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
- incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog ./third_party/msinttypes'
+ incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
+ incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
+ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
+ incs += ' ./third_party/msinttypes'
${win_src}
src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
src += ['./third_party/glog/src/windows/port.cc']
diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp
index 9d6cfd5d17a..8c453944e9d 100644
--- a/extern/libmv/libmv-capi.cpp
+++ b/extern/libmv/libmv-capi.cpp
@@ -368,14 +368,11 @@ libmv_Reconstruction *libmv_solveReconstruction(libmv_Tracks *tracks, int keyfra
intrinsics->SetPrincipalPoint(principal_x, principal_y);
intrinsics->SetRadialDistortion(k1, k2, k3);
- if(focal_length) {
- /* do a lens undistortion if focal length is non-zero only */
- for (int i = 0; i < markers.size(); ++i) {
- intrinsics->InvertIntrinsics(markers[i].x,
- markers[i].y,
- &(markers[i].x),
- &(markers[i].y));
- }
+ for (int i = 0; i < markers.size(); ++i) {
+ intrinsics->InvertIntrinsics(markers[i].x,
+ markers[i].y,
+ &(markers[i].x),
+ &(markers[i].y));
}
libmv::Tracks normalized_tracks(markers);
diff --git a/extern/libmv/libmv/multiview/euclidean_resection.cc b/extern/libmv/libmv/multiview/euclidean_resection.cc
index 6d918a1a8bc..92862515d7e 100644
--- a/extern/libmv/libmv/multiview/euclidean_resection.cc
+++ b/extern/libmv/libmv/multiview/euclidean_resection.cc
@@ -32,6 +32,8 @@
namespace libmv {
namespace euclidean_resection {
+typedef unsigned int uint;
+
bool EuclideanResection(const Mat2X &x_camera,
const Mat3X &X_world,
Mat3 *R, Vec3 *t,
diff --git a/extern/libmv/libmv/tracking/esm_region_tracker.cc b/extern/libmv/libmv/tracking/esm_region_tracker.cc
index 2e5c255e153..01edee3bbb5 100644
--- a/extern/libmv/libmv/tracking/esm_region_tracker.cc
+++ b/extern/libmv/libmv/tracking/esm_region_tracker.cc
@@ -18,6 +18,8 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
+#define _USE_MATH_DEFINES
+
#include "libmv/tracking/esm_region_tracker.h"
#include "libmv/logging/logging.h"
diff --git a/extern/libmv/patches/mingw.patch b/extern/libmv/patches/mingw.patch
index 0b08a483bea..029e7d7f979 100644
--- a/extern/libmv/patches/mingw.patch
+++ b/extern/libmv/patches/mingw.patch
@@ -1,3 +1,16 @@
+diff --git a/src/libmv/multiview/euclidean_resection.cc b/src/libmv/multiview/euclidean_resection.cc
+index 6d918a1..9286251 100644
+--- a/src/libmv/multiview/euclidean_resection.cc
++++ b/src/libmv/multiview/euclidean_resection.cc
+@@ -32,6 +32,8 @@
+ namespace libmv {
+ namespace euclidean_resection {
+
++typedef unsigned int uint;
++
+ bool EuclideanResection(const Mat2X &x_camera,
+ const Mat3X &X_world,
+ Mat3 *R, Vec3 *t,
diff --git a/src/libmv/numeric/numeric.h b/src/libmv/numeric/numeric.h
index f39d126..21e0f06 100644
--- a/src/libmv/numeric/numeric.h
@@ -11,3 +24,148 @@ index f39d126..21e0f06 100644
inline long lround(double d) {
return (long)(d>0 ? d+0.5 : ceil(d-0.5));
}
+diff --git a/src/third_party/glog/src/config.h b/src/third_party/glog/src/config.h
+index ed8d56e..06ed686 100644
+--- a/src/third_party/glog/src/config.h
++++ b/src/third_party/glog/src/config.h
+@@ -4,6 +4,8 @@
+ /* Namespace for Google classes */
+ #ifdef __APPLE__
+ #include "config_mac.h"
++#elif __MINGW32__
++ #include "windows/config.h"
+ #elif __GNUC__
+ #include "config_linux.h"
+ #elif _MSC_VER
+diff --git a/src/third_party/glog/src/utilities.h b/src/third_party/glog/src/utilities.h
+index ee54f94..c4ae256 100644
+--- a/src/third_party/glog/src/utilities.h
++++ b/src/third_party/glog/src/utilities.h
+@@ -101,7 +101,9 @@
+ // correctly when GetStackTrace() is called with max_depth == 0.
+ // Some code may do that.
+
+-#if defined(HAVE_LIB_UNWIND)
++#if __MINGW32__
++# undef STACKTRACE_H
++#elif defined(HAVE_LIB_UNWIND)
+ # define STACKTRACE_H "stacktrace_libunwind-inl.h"
+ #elif !defined(NO_FRAME_POINTER)
+ # if defined(__i386__) && __GNUC__ >= 2
+diff --git a/src/third_party/glog/src/windows/glog/logging.h b/src/third_party/glog/src/windows/glog/logging.h
+index 7a6df74..4257375 100755
+--- a/src/third_party/glog/src/windows/glog/logging.h
++++ b/src/third_party/glog/src/windows/glog/logging.h
+@@ -59,7 +59,7 @@
+
+ // Annoying stuff for windows -- makes sure clients can import these functions
+ #ifndef GOOGLE_GLOG_DLL_DECL
+-# if defined(_WIN32) && !defined(__CYGWIN__)
++# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+ # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
+ # else
+ # define GOOGLE_GLOG_DLL_DECL
+@@ -86,6 +86,15 @@
+ #include <gflags/gflags.h>
+ #endif
+
++#ifdef __MINGW32__
++# include <stdlib.h>
++# include <unistd.h>
++# include <stdint.h> // the normal place uint16_t is defined
++# include <sys/types.h> // the normal place u_int16_t is defined
++# include <inttypes.h> // a third place for uint16_t or u_int16_t
++# define _exit(x) exit(x)
++#endif
++
+ namespace google {
+
+ #if 0 // the C99 format
+@@ -98,11 +107,16 @@ typedef int32_t int32;
+ typedef u_int32_t uint32;
+ typedef int64_t int64;
+ typedef u_int64_t uint64;
+-#elif 1 // the windows (vc7) format
++#elif defined(_MSC_VER)
+ typedef __int32 int32;
+ typedef unsigned __int32 uint32;
+ typedef __int64 int64;
+ typedef unsigned __int64 uint64;
++#elif defined(__MINGW32__)
++typedef int32_t int32;
++typedef uint32_t uint32;
++typedef int64_t int64;
++typedef uint64_t uint64;
+ #else
+ #error Do not know how to define a 32-bit integer quantity on your system
+ #endif
+diff --git a/src/third_party/glog/src/windows/port.h b/src/third_party/glog/src/windows/port.h
+index d093bf5..d507812 100755
+--- a/src/third_party/glog/src/windows/port.h
++++ b/src/third_party/glog/src/windows/port.h
+@@ -59,14 +59,16 @@
+ * used by both C and C++ code, so we put all the C++ together.
+ */
+
+-/* 4244: otherwise we get problems when substracting two size_t's to an int
+- * 4251: it's complaining about a private struct I've chosen not to dllexport
+- * 4355: we use this in a constructor, but we do it safely
+- * 4715: for some reason VC++ stopped realizing you can't return after abort()
+- * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
+- * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
+- */
+-#pragma warning(disable:4244 4251 4355 4715 4800 4996)
++#if _MSC_VER
++ /* 4244: otherwise we get problems when substracting two size_t's to an int
++ * 4251: it's complaining about a private struct I've chosen not to dllexport
++ * 4355: we use this in a constructor, but we do it safely
++ * 4715: for some reason VC++ stopped realizing you can't return after abort()
++ * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
++ * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
++ */
++# pragma warning(disable:4244 4251 4355 4715 4800 4996)
++#endif
+
+ /* file I/O */
+ #define PATH_MAX 1024
+@@ -108,7 +110,9 @@ extern int snprintf(char *str, size_t size,
+ extern int safe_vsnprintf(char *str, size_t size,
+ const char *format, va_list ap);
+ #define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
++#if !defined(__MINGW32__)
+ #define va_copy(dst, src) (dst) = (src)
++#endif
+
+ /* Windows doesn't support specifying the number of buckets as a
+ * hash_map constructor arg, so we leave this blank.
+@@ -130,13 +134,30 @@ enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
+ #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
+
+ inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
++#if __MINGW32__
++ struct tm *local_result;
++ local_result = localtime (timep);
++
++ if (local_result == NULL || result == NULL)
++ return NULL;
++
++ memcpy (result, local_result, sizeof (result));
++
++ return result;
++#else
+ localtime_s(result, timep);
+ return result;
++#endif
+ }
+
+ inline char* strerror_r(int errnum, char* buf, size_t buflen) {
++#if __MINGW32__
++ strncpy(buf, "Not implemented yet", buflen);
++ return buf;
++#else
+ strerror_s(buf, buflen, errnum);
+ return buf;
++#endif
+ }
+
+ #ifndef __cplusplus
diff --git a/extern/libmv/third_party/glog/src/config.h b/extern/libmv/third_party/glog/src/config.h
index ed8d56e7799..06ed686f87c 100644
--- a/extern/libmv/third_party/glog/src/config.h
+++ b/extern/libmv/third_party/glog/src/config.h
@@ -4,6 +4,8 @@
/* Namespace for Google classes */
#ifdef __APPLE__
#include "config_mac.h"
+#elif __MINGW32__
+ #include "windows/config.h"
#elif __GNUC__
#include "config_linux.h"
#elif _MSC_VER
diff --git a/extern/libmv/third_party/glog/src/config_linux.h b/extern/libmv/third_party/glog/src/config_linux.h
index df6956c9ecf..ffd4e778de6 100644
--- a/extern/libmv/third_party/glog/src/config_linux.h
+++ b/extern/libmv/third_party/glog/src/config_linux.h
@@ -131,7 +131,7 @@
#define PACKAGE_VERSION "0.3.1"
/* How to access the PC from a struct ucontext */
-#if defined(_M_X64) || defined(__amd64__)
+#if defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP]
#else
#define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_EIP]
diff --git a/extern/libmv/third_party/glog/src/utilities.h b/extern/libmv/third_party/glog/src/utilities.h
index 2d4e99e595e..5c841a0b90b 100644
--- a/extern/libmv/third_party/glog/src/utilities.h
+++ b/extern/libmv/third_party/glog/src/utilities.h
@@ -101,7 +101,9 @@
// correctly when GetStackTrace() is called with max_depth == 0.
// Some code may do that.
-#if defined(HAVE_LIB_UNWIND)
+#if __MINGW32__
+# undef STACKTRACE_H
+#elif defined(HAVE_LIB_UNWIND)
# define STACKTRACE_H "stacktrace_libunwind-inl.h"
#elif !defined(NO_FRAME_POINTER)
# if defined(__i386__) && __GNUC__ >= 2
diff --git a/extern/libmv/third_party/glog/src/windows/glog/logging.h b/extern/libmv/third_party/glog/src/windows/glog/logging.h
index de51586f8e3..2f41681edbe 100644
--- a/extern/libmv/third_party/glog/src/windows/glog/logging.h
+++ b/extern/libmv/third_party/glog/src/windows/glog/logging.h
@@ -59,7 +59,7 @@
// Annoying stuff for windows -- makes sure clients can import these functions
#ifndef GOOGLE_GLOG_DLL_DECL
-# if defined(_WIN32) && !defined(__CYGWIN__)
+# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
# else
# define GOOGLE_GLOG_DLL_DECL
@@ -86,6 +86,15 @@
#include "third_party/gflags/gflags.h"
#endif
+#ifdef __MINGW32__
+# include <stdlib.h>
+# include <unistd.h>
+# include <stdint.h> // the normal place uint16_t is defined
+# include <sys/types.h> // the normal place u_int16_t is defined
+# include <inttypes.h> // a third place for uint16_t or u_int16_t
+# define _exit(x) exit(x)
+#endif
+
namespace google {
#if 0 // the C99 format
@@ -98,11 +107,16 @@ typedef int32_t int32;
typedef u_int32_t uint32;
typedef int64_t int64;
typedef u_int64_t uint64;
-#elif 1 // the windows (vc7) format
+#elif defined(_MSC_VER)
typedef __int32 int32;
typedef unsigned __int32 uint32;
typedef __int64 int64;
typedef unsigned __int64 uint64;
+#elif defined(__MINGW32__)
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;
#else
#error Do not know how to define a 32-bit integer quantity on your system
#endif
diff --git a/extern/libmv/third_party/glog/src/windows/port.h b/extern/libmv/third_party/glog/src/windows/port.h
index d093bf5d34c..d5078120009 100644
--- a/extern/libmv/third_party/glog/src/windows/port.h
+++ b/extern/libmv/third_party/glog/src/windows/port.h
@@ -59,14 +59,16 @@
* used by both C and C++ code, so we put all the C++ together.
*/
-/* 4244: otherwise we get problems when substracting two size_t's to an int
- * 4251: it's complaining about a private struct I've chosen not to dllexport
- * 4355: we use this in a constructor, but we do it safely
- * 4715: for some reason VC++ stopped realizing you can't return after abort()
- * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
- * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
- */
-#pragma warning(disable:4244 4251 4355 4715 4800 4996)
+#if _MSC_VER
+ /* 4244: otherwise we get problems when substracting two size_t's to an int
+ * 4251: it's complaining about a private struct I've chosen not to dllexport
+ * 4355: we use this in a constructor, but we do it safely
+ * 4715: for some reason VC++ stopped realizing you can't return after abort()
+ * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
+ * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
+ */
+# pragma warning(disable:4244 4251 4355 4715 4800 4996)
+#endif
/* file I/O */
#define PATH_MAX 1024
@@ -108,7 +110,9 @@ extern int snprintf(char *str, size_t size,
extern int safe_vsnprintf(char *str, size_t size,
const char *format, va_list ap);
#define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
+#if !defined(__MINGW32__)
#define va_copy(dst, src) (dst) = (src)
+#endif
/* Windows doesn't support specifying the number of buckets as a
* hash_map constructor arg, so we leave this blank.
@@ -130,13 +134,30 @@ enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
#define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
+#if __MINGW32__
+ struct tm *local_result;
+ local_result = localtime (timep);
+
+ if (local_result == NULL || result == NULL)
+ return NULL;
+
+ memcpy (result, local_result, sizeof (result));
+
+ return result;
+#else
localtime_s(result, timep);
return result;
+#endif
}
inline char* strerror_r(int errnum, char* buf, size_t buflen) {
+#if __MINGW32__
+ strncpy(buf, "Not implemented yet", buflen);
+ return buf;
+#else
strerror_s(buf, buflen, errnum);
return buf;
+#endif
}
#ifndef __cplusplus