Blob Blame History Raw
From a263bf52265fa04aadd522136647d865401c9b9c Mon Sep 17 00:00:00 2001
From: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Date: Thu, 20 Jan 2011 13:15:10 +0100
Subject: [PATCH 1/6] Added useful .gitignore file

---
 .gitignore |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1f07758
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+Release/
+/Source/DoxyGen/html
+/Platform/Linux-x86/Bin
+/Platform/Linux-x86/CreateRedist/Final
+/Platform/Linux-x86/CreateRedist/Output
+/Platform/Linux-x86/Redist
-- 
1.7.3.4


From 1b23db6be3ad71b6fe4b0aa1b27942e033b77adb Mon Sep 17 00:00:00 2001
From: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Date: Thu, 20 Jan 2011 13:17:22 +0100
Subject: [PATCH 2/6] Support sytem libs for tinyxml and libjpeg

For Fedora, packages must use system-wide installed libraries and not
rely on internally bundled ones. This change detects the availability of
the system-wide version and uses the bundled one only as a fallback.
---
 .../Linux-x86/Build/Modules/nimCodecs/Makefile     |   13 +++++++++----
 Platform/Linux-x86/Build/OpenNI/Makefile           |   13 +++++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/Platform/Linux-x86/Build/Modules/nimCodecs/Makefile b/Platform/Linux-x86/Build/Modules/nimCodecs/Makefile
index a6ff666..0317bd9 100644
--- a/Platform/Linux-x86/Build/Modules/nimCodecs/Makefile
+++ b/Platform/Linux-x86/Build/Modules/nimCodecs/Makefile
@@ -2,16 +2,21 @@ BIN_DIR = ../../../Bin
 
 INC_DIRS = \
 	../../../../../Include \
-	../../../../../Source \
-	../../../../../Source/External/LibJPEG
+	../../../../../Source
 
 SRC_FILES = \
-	../../../../../Source/Modules/nimCodecs/*.cpp \
-	../../../../../Source/External/LibJPEG/*.c
+	../../../../../Source/Modules/nimCodecs/*.cpp
 
 LIB_NAME = nimCodecs
 USED_LIBS = OpenNI
 
+ifneq ($(wildcard /usr/lib/libjpeg.so /usr/lib32/libjpeg.so /usr/lib64/libjpeg.so /usr/local/lib/libjpeg.so /usr/local/lib32/libjpeg.so /usr/local/lib64/libjpeg.so),)
+  USED_LIBS += jpeg
+else
+  INC_DIRS  += ../../../../../Source/External/LibJPEG
+  SRC_FILES += ../../../../../Source/External/LibJPEG/*.c
+endif
+  
 include ../../CommonMakefile
 
 
diff --git a/Platform/Linux-x86/Build/OpenNI/Makefile b/Platform/Linux-x86/Build/OpenNI/Makefile
index 563e876..0ad3e53 100644
--- a/Platform/Linux-x86/Build/OpenNI/Makefile
+++ b/Platform/Linux-x86/Build/OpenNI/Makefile
@@ -4,13 +4,11 @@ BIN_DIR = ../../Bin
 
 INC_DIRS = \
 	../../../../Include \
-	../../../../Source \
-	../../../../Source/External/TinyXml
+	../../../../Source
 
 SRC_FILES = \
 	../../../../Source/OpenNI/*.cpp \
-	../../../../Source/OpenNI/Linux-x86/*.cpp \
-	../../../../Source/External/TinyXml/*.cpp
+	../../../../Source/OpenNI/Linux-x86/*.cpp
 
 ifeq ("$(OSTYPE)","Darwin")
 	INC_DIRS += /opt/local/include
@@ -25,6 +23,13 @@ ifneq ("$(OSTYPE)","Darwin")
 endif
 DEFINES = XN_EXPORTS
 
+ifneq ($(wildcard /usr/include/tinyxml.h /usr/local/include/tinyxml.h),)
+  USED_LIBS += tinyxml
+else
+  INC_DIRS += ../../../../Source/External/TinyXml
+  SRC_FILES += ../../../../Source/External/TinyXml/*.cpp
+endif
+
 include ../CommonMakefile
 
 
-- 
1.7.3.4


From 8606266878de544ac09155cfcda216dc97568fca Mon Sep 17 00:00:00 2001
From: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Date: Thu, 20 Jan 2011 13:18:47 +0100
Subject: [PATCH 3/6] Allow setting debug flag explicitly, small fix

For packaging, the package must be built optimized and with debug info.
The debug info is used to create packages that can be installed when
debugging, and it is stripped from the actual library.
---
 Platform/Linux-x86/Build/CommonMakefile |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Platform/Linux-x86/Build/CommonMakefile b/Platform/Linux-x86/Build/CommonMakefile
index 0cb6fc6..be78c65 100644
--- a/Platform/Linux-x86/Build/CommonMakefile
+++ b/Platform/Linux-x86/Build/CommonMakefile
@@ -147,13 +147,17 @@ ifeq "$(CFG)" "Release"
 		ifeq ($(SSE_GENERATION), 3)
 			CFLAGS += -msse3
 		else
-			($error "Only SSE2 and SSE3 are supported")
+			$(error "Only SSE2 and SSE3 are supported")
 		endif
 	endif
 	
 	CSFLAGS += -o+
 endif
 
+ifeq ($(DEBUG),1)
+  CFLAGS += -g
+endif
+
 CFLAGS += $(INC_DIRS_OPTION) $(DEFINES_OPTION)
 LDFLAGS += $(LIB_DIRS_OPTION) $(USED_LIBS_OPTION)
 
-- 
1.7.3.4


From beca88729f13f4316711d1ba7759f1891999e8a1 Mon Sep 17 00:00:00 2001
From: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Date: Thu, 20 Jan 2011 13:20:38 +0100
Subject: [PATCH 4/6] Added missing link lib GL

Samples were not linked against GL. Symbols of GL are used directly, but
linking happens only indirectly. This is forbidden on Fedora.
---
 .../Build/Samples/NiSimpleViewer/Makefile          |    2 +-
 .../Linux-x86/Build/Samples/NiUserTracker/Makefile |    2 +-
 Platform/Linux-x86/Build/Samples/NiViewer/Makefile |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Platform/Linux-x86/Build/Samples/NiSimpleViewer/Makefile b/Platform/Linux-x86/Build/Samples/NiSimpleViewer/Makefile
index cb07c20..6ef2993 100644
--- a/Platform/Linux-x86/Build/Samples/NiSimpleViewer/Makefile
+++ b/Platform/Linux-x86/Build/Samples/NiSimpleViewer/Makefile
@@ -11,7 +11,7 @@ EXE_NAME = Sample-NiSimpleViewer
 ifeq ("$(OSTYPE)","Darwin")
 	LDFLAGS += -framework OpenGL -framework GLUT
 else
-	USED_LIBS += glut
+	USED_LIBS += glut GL
 endif
 
 USED_LIBS += OpenNI
diff --git a/Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile b/Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile
index 9ab5c31..a5d305b 100644
--- a/Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile
+++ b/Platform/Linux-x86/Build/Samples/NiUserTracker/Makefile
@@ -11,7 +11,7 @@ EXE_NAME = Sample-NiUserTracker
 ifeq ("$(OSTYPE)","Darwin")
 	LDFLAGS += -framework OpenGL -framework GLUT
 else
-	USED_LIBS += glut
+	USED_LIBS += glut GL
 endif
 
 USED_LIBS += OpenNI
diff --git a/Platform/Linux-x86/Build/Samples/NiViewer/Makefile b/Platform/Linux-x86/Build/Samples/NiViewer/Makefile
index 561bdcf..600584f 100644
--- a/Platform/Linux-x86/Build/Samples/NiViewer/Makefile
+++ b/Platform/Linux-x86/Build/Samples/NiViewer/Makefile
@@ -11,7 +11,7 @@ SRC_FILES = ../../../../../Samples/NiViewer/*.cpp
 ifeq ("$(OSTYPE)","Darwin")
 	LDFLAGS += -framework OpenGL -framework GLUT
 else
-	USED_LIBS += glut
+	USED_LIBS += glut GL
 endif
 
 USED_LIBS += OpenNI
-- 
1.7.3.4


From 2770ce8e8c0383310c983128b9d51ac18a40c675 Mon Sep 17 00:00:00 2001
From: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Date: Thu, 20 Jan 2011 13:21:42 +0100
Subject: [PATCH 5/6] install.sh: support more overrides

+ Module registration can be omitted. For packaging this needs to be
after installation, not during compilation/installation.
+ Allow overriding the INSTALL_* variables from the outside.
---
 Platform/Linux-x86/CreateRedist/install.sh |   68 +++++++++++++++++++---------
 1 files changed, 47 insertions(+), 21 deletions(-)

diff --git a/Platform/Linux-x86/CreateRedist/install.sh b/Platform/Linux-x86/CreateRedist/install.sh
index b62974e..f71eadb 100755
--- a/Platform/Linux-x86/CreateRedist/install.sh
+++ b/Platform/Linux-x86/CreateRedist/install.sh
@@ -1,9 +1,17 @@
 #!/bin/bash -e
 
-INSTALL_LIB=/usr/lib
-INSTALL_BIN=/usr/bin
-INSTALL_INC=/usr/include/ni
-INSTALL_VAR=/var/lib/ni
+if [ -z "$INSTALL_LIB" ]; then
+  INSTALL_LIB=/usr/lib
+fi
+if [ -z "$INSTALL_BIN" ]; then
+  INSTALL_BIN=/usr/bin
+fi
+if [ -z "$INSTALL_INC" ]; then
+  INSTALL_INC=/usr/include/ni
+fi
+if [ -z "$INSTALL_VAR" ]; then
+  INSTALL_VAR=/var/lib/ni
+fi
 
 if [ "`uname -s`" == "Darwin" ]; then
 	MODULES="libnimMockNodes.dylib libnimCodecs.dylib libnimRecorder.dylib"
@@ -15,6 +23,7 @@ SCRIPT_DIR=`pwd`/`dirname $0`
 
 # read script args
 INSTALL="1"
+REGISTER="1"
 
 while (( "$#" )); do
 	case "$1" in
@@ -24,11 +33,15 @@ while (( "$#" )); do
 	"-u")
 		INSTALL="0"
 		;;
+	"-n")
+		REGISTER="0"
+		;;
 	*)
 		echo "Usage: $0 [options]"
 		echo "Available options:"
 		printf "\t-i\tInstall (default)\n"
 		printf "\t-u\tUninstall\n"
+		printf "\t-n\tDo not (un)register the modules\n"
 		exit 1
 		;;
 	esac
@@ -41,6 +54,11 @@ BIN_FILES=`ls $SCRIPT_DIR/Bin/ni*`
 
 if [ "$INSTALL" == "1" ]; then
 
+	mkdir -p $INSTALL_LIB
+	mkdir -p $INSTALL_BIN
+	mkdir -p $INSTALL_INC
+	mkdir -p $INSTALL_VAR
+
 	# copy libraries
 	printf "copying shared libraries..."
 	cp $LIB_FILES $INSTALL_LIB
@@ -62,27 +80,33 @@ if [ "$INSTALL" == "1" ]; then
 	mkdir -p $INSTALL_VAR
     printf "OK\n"
 
-	# register modules
-	for module in $MODULES; do
-		printf "registering module '$module'..."
-		niReg -r $INSTALL_LIB/$module
-		printf "OK\n"
-	done
+	if [ "$REGISTER" == "1" ]; then
+		# register modules
+		for module in $MODULES; do
+			printf "registering module '$module'..."
+			niReg -r $INSTALL_LIB/$module
+			printf "OK\n"
+		done
+	fi
 
-        # mono
-	if [ -f /usr/bin/gmcs ]
-	then
+	if [ "$REGISTER" == "1" ]; then
+            # mono
+	    if [ -f /usr/bin/gmcs ]
+	    then
 		gacutil -i Bin/OpenNI.net.dll -package 2.0
-	fi
+	    fi
+        fi
 
 else
-	# unregister modules
-	for module in $MODULES; do
-    	printf "unregistering module '$module'..."
-        if niReg -u $INSTALL_LIB/$module; then
-            printf "OK\n"
-        fi
-	done
+	if [ "$REGISTER" == "1" ]; then
+		# unregister modules
+		for module in $MODULES; do
+    			printf "unregistering module '$module'..."
+        		if niReg -u $INSTALL_LIB/$module; then
+            			printf "OK\n"
+        		fi
+		done
+	fi
 
 	# include files
 	printf "removing include files..."
@@ -103,12 +127,14 @@ else
     done
     printf "OK\n"
 
+    if [ "$REGISTER" == "1" ]; then
 	# mono
 	if [ -f /usr/bin/gmcs ]
 	then
 		printf "Removing OpenNI.net: "
 		gacutil -u OpenNI.net
 	fi
+    fi
 fi
 
 printf "\n*** DONE ***\n\n"
-- 
1.7.3.4


From 1fb736cd89cc42b174bff5d585d61f2c684327c0 Mon Sep 17 00:00:00 2001
From: Tim Niemueller <niemueller@kbsg.rwth-aachen.de>
Date: Thu, 20 Jan 2011 14:58:42 +0100
Subject: [PATCH 6/6] CommonMakefile: support external CFLAGS

---
 Platform/Linux-x86/Build/CommonMakefile |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Platform/Linux-x86/Build/CommonMakefile b/Platform/Linux-x86/Build/CommonMakefile
index be78c65..965ce82 100644
--- a/Platform/Linux-x86/Build/CommonMakefile
+++ b/Platform/Linux-x86/Build/CommonMakefile
@@ -48,6 +48,9 @@ SRC_FILES_LIST = $(wildcard $(SRC_FILES))
 
 OSTYPE := $(shell uname -s)
 
+# add CFLAGS that have been passed in
+CFLAGS += $(CFLAGS_EXT)
+
 # change c struct alignment options to be compatable with Win32
 ifneq ("$(OSTYPE)","Darwin")
 	CFLAGS += -malign-double
-- 
1.7.3.4