From ed5a2e9bd493b678ebe36141cb6df7ccffa9c2bd Mon Sep 17 00:00:00 2001 From: Hauke Wintjen Date: Wed, 30 Jan 2013 21:33:49 +0100 Subject: [PATCH 1/3] Fix platfom include bugs --- Include/OniPlatform.h | 2 +- ThirdParty/PSCommon/XnLib/Include/XnPlatform.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Include/OniPlatform.h b/Include/OniPlatform.h index 9bdb4c04..caa9cc1f 100644 --- a/Include/OniPlatform.h +++ b/Include/OniPlatform.h @@ -43,7 +43,7 @@ #elif (linux && (i386 || __x86_64__)) # include "Linux-x86/OniPlatformLinux-x86.h" #elif (linux && __arm__) -# include "Linux-x86/OniPlatformLinux-Arm.h" +# include "Linux-Arm/OniPlatformLinux-Arm.h" #elif _ARC # include "ARC/OniPlaformARC.h" #elif (__APPLE__) diff --git a/ThirdParty/PSCommon/XnLib/Include/XnPlatform.h b/ThirdParty/PSCommon/XnLib/Include/XnPlatform.h index 22da820b..15ba44d0 100644 --- a/ThirdParty/PSCommon/XnLib/Include/XnPlatform.h +++ b/ThirdParty/PSCommon/XnLib/Include/XnPlatform.h @@ -55,7 +55,7 @@ #elif (linux && (i386 || __x86_64__)) #include "Linux-x86/XnPlatformLinux-x86.h" #elif (linux && __arm__) -#include "Linux-x86/XnPlatformLinux-Arm.h" +#include "Linux-Arm/XnPlatformLinux-Arm.h" #elif _ARC #include "ARC/XnPlaformARC.h" #elif (__APPLE__) From 9ae6d6ca4e8a3e17149d307bf97e5d0ac0f931d0 Mon Sep 17 00:00:00 2001 From: Hauke Wintjen Date: Wed, 30 Jan 2013 21:38:18 +0100 Subject: [PATCH 2/3] Added Armv6l as new target platform and created missing OniPlatformLinux-Arm.h header --- Include/Linux-Arm/OniPlatformLinux-Arm.h | 102 ++++++++++++++++++ .../PSCommon/BuildSystem/CommonDefs.mak | 2 + .../PSCommon/BuildSystem/Platform.Armv6l | 14 +++ 3 files changed, 118 insertions(+) create mode 100644 Include/Linux-Arm/OniPlatformLinux-Arm.h create mode 100644 ThirdParty/PSCommon/BuildSystem/Platform.Armv6l diff --git a/Include/Linux-Arm/OniPlatformLinux-Arm.h b/Include/Linux-Arm/OniPlatformLinux-Arm.h new file mode 100644 index 00000000..16a26dbf --- /dev/null +++ b/Include/Linux-Arm/OniPlatformLinux-Arm.h @@ -0,0 +1,102 @@ +/***************************************************************************** +* * +* OpenNI 2.x Alpha * +* Copyright (C) 2012 PrimeSense Ltd. * +* * +* This file is part of OpenNI. * +* * +* Licensed under the Apache License, Version 2.0 (the "License"); * +* you may not use this file except in compliance with the License. * +* You may obtain a copy of the License at * +* * +* http://www.apache.org/licenses/LICENSE-2.0 * +* * +* Unless required by applicable law or agreed to in writing, software * +* distributed under the License is distributed on an "AS IS" BASIS, * +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +* See the License for the specific language governing permissions and * +* limitations under the License. * +* * +*****************************************************************************/ +#ifndef _ONI_PLATFORM_LINUX_ARM_H_ +#define _ONI_PLATFORM_LINUX_ARM_H_ + +//--------------------------------------------------------------------------- +// Prerequisites +//--------------------------------------------------------------------------- + +//--------------------------------------------------------------------------- +// Includes +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include + +//--------------------------------------------------------------------------- +// Platform Basic Definition +//--------------------------------------------------------------------------- +#define ONI_PLATFORM ONI_PLATFORM_LINUX_X86 +#define ONI_PLATFORM_STRING "Linux-arm" + +//--------------------------------------------------------------------------- +// Platform Capabilities +//--------------------------------------------------------------------------- +#define ONI_PLATFORM_ENDIAN_TYPE ONI_PLATFORM_IS_LITTLE_ENDIAN + +#define ONI_PLATFORM_SUPPORTS_DYNAMIC_LIBS 1 + +//--------------------------------------------------------------------------- +// Memory +//--------------------------------------------------------------------------- +/** The default memory alignment. */ +#define ONI_DEFAULT_MEM_ALIGN 16 + +/** The thread static declarator (using TLS). */ +#define ONI_THREAD_STATIC __thread + +//--------------------------------------------------------------------------- +// Files +//--------------------------------------------------------------------------- +/** The maximum allowed file path size (in bytes). */ +#define ONI_FILE_MAX_PATH 256 + +//--------------------------------------------------------------------------- +// Call back +//--------------------------------------------------------------------------- +/** The std call type. */ +#define ONI_STDCALL __stdcall + +/** The call back calling convention. */ +#define ONI_CALLBACK_TYPE + +/** The C and C++ calling convension. */ +#define ONI_C_DECL + +//--------------------------------------------------------------------------- +// Macros +//--------------------------------------------------------------------------- +/** Returns the date and time at compile time. */ +#define ONI_TIMESTAMP __DATE__ " " __TIME__ + +/** Converts n into a pre-processor string. */ +#define ONI_STRINGIFY(n) ONI_STRINGIFY_HELPER(n) +#define ONI_STRINGIFY_HELPER(n) #n + +//--------------------------------------------------------------------------- +// API Export/Import Macros +//--------------------------------------------------------------------------- +/** Indicates an exported shared library function. */ +#define ONI_API_EXPORT __attribute__ ((visibility("default"))) + +/** Indicates an imported shared library function. */ +#define ONI_API_IMPORT + +/** Indicates a deprecated function */ +#define ONI_API_DEPRECATED(msg) __attribute__((warning("This function is deprecated: " msg))) + +#endif //_ONI_PLATFORM_LINUX_X86_H_ + diff --git a/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak b/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak index dd88b04c..de4a17de 100644 --- a/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak +++ b/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak @@ -16,6 +16,8 @@ else ifneq (,$(findstring i686,$(MACHINE))) HOST_PLATFORM = x86 else ifneq (,$(findstring i386,$(MACHINE))) HOST_PLATFORM = x86 +else ifneq (,$(findstring armv6l,$(MACHINE))) + HOST_PLATFORM = Armv6l else ifneq (,$(findstring arm,$(MACHINE))) HOST_PLATFORM = Arm else diff --git a/ThirdParty/PSCommon/BuildSystem/Platform.Armv6l b/ThirdParty/PSCommon/BuildSystem/Platform.Armv6l new file mode 100644 index 00000000..be11a0c8 --- /dev/null +++ b/ThirdParty/PSCommon/BuildSystem/Platform.Armv6l @@ -0,0 +1,14 @@ +# Platform defs for Raspberry PI Hard floats + +ifeq "$(CFG)" "Release" + + # Hardware specifying flags + CFLAGS += -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard + + # Optimization level, minus currently buggy optimizing methods (which break bit-exact) + CFLAGS += -O3 -fno-tree-pre -fno-strict-aliasing + + # More optimization flags + CFLAGS += -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant + +endif From 21e4563c2434bffafe2db30f854321a38e22f865 Mon Sep 17 00:00:00 2001 From: Hauke Wintjen Date: Wed, 30 Jan 2013 21:39:26 +0100 Subject: [PATCH 3/3] XnLinuxUSBDevice is unused in source, and fails to compile if arm is enabled. Quick fix is to disable file completely --- ThirdParty/PSCommon/XnLib/Source/Linux/XnLinuxUSBDevice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ThirdParty/PSCommon/XnLib/Source/Linux/XnLinuxUSBDevice.cpp b/ThirdParty/PSCommon/XnLib/Source/Linux/XnLinuxUSBDevice.cpp index 3a496302..22b589d8 100644 --- a/ThirdParty/PSCommon/XnLib/Source/Linux/XnLinuxUSBDevice.cpp +++ b/ThirdParty/PSCommon/XnLib/Source/Linux/XnLinuxUSBDevice.cpp @@ -23,7 +23,8 @@ //--------------------------------------------------------------------------- #include -#if (XN_PLATFORM == XN_PLATFORM_LINUX_ARM) +// #if (XN_PLATFORM == XN_PLATFORM_LINUX_ARM) +#if 0 #include #include