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

Add portable makefile definitions #65

Open
wants to merge 1 commit into
base: develop
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
36 changes: 36 additions & 0 deletions Include/Linux-generic/OniPlatformLinux-generic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*****************************************************************************
* *
* 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_GENERIC_H_
#define _ONI_PLATFORM_LINUX_GENERIC_H_

// Start with Linux-x86, and override what's different
#include "../Linux-x86/OniPlatformLinux-x86.h"

//---------------------------------------------------------------------------
// Platform Basic Definition
//---------------------------------------------------------------------------
#undef ONI_PLATFORM
#undef ONI_PLATFORM_STRING
#define ONI_PLATFORM ONI_PLATFORM_LINUX_GENERIC
#define ONI_PLATFORM_STRING "Linux-generic"

#endif //_ONI_PLATFORM_LINUX_GENERIC_H_

3 changes: 3 additions & 0 deletions Include/OniPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define ONI_PLATFORM_LINUX_ARM 3
#define ONI_PLATFORM_MACOSX 4
#define ONI_PLATFORM_ANDROID_ARM 5
#define ONI_PLATFORM_LINUX_GENERIC 6

#if (defined _WIN32)
# ifndef RC_INVOKED
Expand All @@ -41,6 +42,8 @@
# include "Linux-x86/OniPlatformLinux-x86.h"
#elif (__linux__ && __arm__)
# include "Linux-Arm/OniPlatformLinux-Arm.h"
#elif (__linux__)
# include "Linux-generic/OniPlatformLinux-generic.h"
#elif _ARC
# include "ARC/OniPlaformARC.h"
#elif (__APPLE__)
Expand Down
5 changes: 0 additions & 5 deletions Packaging/Harvest.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ def copyRedistFiles(self, targetDir):
self.copySharedObject(binDriversDir, 'Kinect', targetDriversDir)

def copySample(self, samplesDir, targetBinDir, name, isLibrary = False, isGL = False, isJava = False, sourceSamplesDir = None):
if self.arch == 'Arm' and isGL:
return

if sourceSamplesDir is None:
sourceSamplesDir = os.path.join(self.rootDir, 'Samples')

Expand Down Expand Up @@ -306,8 +303,6 @@ def copySample(self, samplesDir, targetBinDir, name, isLibrary = False, isGL = F
self.copyExecutable(self.binDir, name, targetBinDir)

def copyTool(self, toolsDir, name, isGL = False):
if self.arch == 'Arm' and isGL:
return

self.copyExecutable(self.binDir, name, toolsDir)

Expand Down
2 changes: 1 addition & 1 deletion Source/Drivers/PS1080/Sensor/XnDeviceSensorInit.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#define XN_SENSOR_USB_MISC_BUFFER_SIZE 0x1000
#define XN_SENSOR_USB_MISC_BUFFERS 1
#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM_LINUX_GENERIC)
#define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_ISO 32
#define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_BULK 40
#define XN_SENSOR_USB_IMAGE_BUFFER_SIZE_MULTIPLIER_LOWBAND_ISO 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace xn
const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_BUFFER_NUM_PACKETS_BULK = 120;
const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_NUM_BUFFERS_BULK = 8;
const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_TIMEOUT_BULK = 1000;
#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_MACOSX || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM_LINUX_GENERIC )
const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_BUFFER_NUM_PACKETS_ISO = 32;
const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_NUM_BUFFERS_ISO = 16;
const XnUInt32 ClientUSBInDataEndpoint::READ_THREAD_TIMEOUT_ISO = 100;
Expand Down
3 changes: 2 additions & 1 deletion Source/Tools/NiViewer/NiViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
#if (ONI_PLATFORM == ONI_PLATFORM_WIN32)
#include <conio.h>
#include <direct.h>
#elif (ONI_PLATFORM == ONI_PLATFORM_LINUX_X86 || ONI_PLATFORM == ONI_PLATFORM_LINUX_ARM || ONI_PLATFORM == ONI_PLATFORM_MACOSX)
#elif (ONI_PLATFORM == ONI_PLATFORM_LINUX_X86 || ONI_PLATFORM == ONI_PLATFORM_LINUX_ARM \
|| ONI_PLATFORM == ONI_PLATFORM_MACOSX ||ONI_PLATFORM == ONI_PLATFORM_LINUX_GENERIC)
#define _getch() getchar()
#endif

Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/PSCommon/BuildSystem/CommonDefs.mak
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else ifneq (,$(findstring i386,$(MACHINE)))
else ifneq (,$(findstring arm,$(MACHINE)))
HOST_PLATFORM = Arm
else
DUMMY:=$(error Can't determine host platform)
HOST_PLATFORM = generic
endif

# now check if this is a cross-compilation or not
Expand Down
5 changes: 4 additions & 1 deletion ThirdParty/PSCommon/BuildSystem/Platform.Arm
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# some defaults
export GLUT_SUPPORTED=1

ifeq "$(CFG)" "Release"

# Hardware specifying flags
CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8
CFLAGS += -Wno-unused-local-typedefs -march=armv7-a -mtune=cortex-a9 -mfpu=neon #-mfloat-abi=softfp #-mcpu=cortex-a8

# Optimization level, minus currently buggy optimizing methods (which break bit-exact)
CFLAGS += -O3 -fno-tree-pre -fno-strict-aliasing
Expand Down
4 changes: 4 additions & 0 deletions ThirdParty/PSCommon/BuildSystem/Platform.generic
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# some defaults
export GLUT_SUPPORTED=1
FLAGS += -O3 -fno-strict-aliasing

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*****************************************************************************
* *
* PrimeSense PSCommon Library *
* Copyright (C) 2012 PrimeSense Ltd. *
* *
* This file is part of PSCommon. *
* *
* 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 _XN_PLATFORM_LINUX_GENERIC_H_
#define _XN_PLATFORM_LINUX_GENERIC_H_

// Start with Linux-x86, and override what's different
#include "../Linux-x86/XnPlatformLinux-x86.h"

//---------------------------------------------------------------------------
// Platform Basic Definition
//---------------------------------------------------------------------------
#undef XN_PLATFORM
#undef XN_PLATFORM_STRING
#define XN_PLATFORM XN_PLATFORM_LINUX_GENERIC
#define XN_PLATFORM_STRING "Linux-generic"

#endif //_XN_PLATFORM_LINUX_GENERIC_H_

2 changes: 1 addition & 1 deletion ThirdParty/PSCommon/XnLib/Include/XnOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
//---------------------------------------------------------------------------
#if (XN_PLATFORM == XN_PLATFORM_WIN32)
#include "Win32/XnOSWin32.h"
#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM)
#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_ANDROID_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_GENERIC)
#include "Linux-x86/XnOSLinux-x86.h"
#elif (XN_PLATFORM == XN_PLATFORM_MACOSX)
#include "MacOSX/XnOSMacOSX.h"
Expand Down
3 changes: 3 additions & 0 deletions ThirdParty/PSCommon/XnLib/Include/XnPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define XN_PLATFORM_LINUX_ARM 7
#define XN_PLATFORM_MACOSX 8
#define XN_PLATFORM_ANDROID_ARM 9
#define XN_PLATFORM_LINUX_GENERIC 10

#define XN_PLATFORM_IS_LITTLE_ENDIAN 1
#define XN_PLATFORM_IS_BIG_ENDIAN 2
Expand All @@ -53,6 +54,8 @@
#include "Linux-x86/XnPlatformLinux-x86.h"
#elif (__linux__ && __arm__)
#include "Linux-Arm/XnPlatformLinux-Arm.h"
#elif (__linux__)
#include "Linux-generic/XnPlatformLinux-generic.h"
#elif _ARC
#include "ARC/XnPlaformARC.h"
#elif (__APPLE__)
Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/PSCommon/XnLib/Include/XnUSBDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#define USB_DT_DEVICE_SIZE 0
#define USB_DT_DEVICE 0

#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM)
#elif (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_GENERIC)
#include <linux/usb/ch9.h>
typedef struct usb_endpoint_descriptor XnUSBEndpointDescriptor;
typedef struct usb_interface_descriptor XnUSBInterfaceDescriptor;
Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/PSCommon/XnLib/Source/Linux/XnLinuxUSB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <XnOSCpp.h>
#include <XnList.h>

#if (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM)
#if (XN_PLATFORM == XN_PLATFORM_LINUX_X86 || XN_PLATFORM == XN_PLATFORM_LINUX_ARM || XN_PLATFORM == XN_PLATFORM_LINUX_GENERIC)
#include <libudev.h>
#define XN_USE_UDEV
#endif
Expand Down