Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • danc/MicroCART
  • snawerdt/MicroCART_17-18
  • bbartels/MicroCART_17-18
  • jonahu/MicroCART
4 results
Show changes
Showing
with 0 additions and 1627 deletions
/*
*
* VRPN Header Format
*
* +------------+------------+------------+------------+
* | Total Length |
* +------------+------------+------------+------------+
* | Timestamp (Seconds) |
* +------------+------------+------------+------------+
* | Timestamp (Microseconds) |
* +------------+------------+------------+------------+
* | Sender |
* +------------+------------+------------+------------+
* | Type |
* +------------+------------+------------+------------+
* | padding |
* +------------+------------+------------+------------+
*
* Total Length = Padded Payload Length + Padded Header Length.
* Padded Header Length = 24 bytes.
* Padded Payload Length = Payload Length + (Payload Length % 8).
*
* All header fields are 32-bit integers sent in network order.
* Both header and payload are padded to end on 8-byte boundaries.
*
* Implementation in vrpn_Connection::marshall_message().
*
*/
/*
*
* VRPN Connection setup sequence
*
* Server opens a TCP socket and listens() on port - default vrpn_DEFAULT_LISTEN_PORT_NO
* Client connects() to port
* Server and client both write a COOKIE
* Server and client both wait (nonblocking) for a COOKIE and
* verify version #, etc.
* If either peer is requesting remote logging, a log_description message
* is sent.
* Server and client both open UDP sockets.
* Server and client both send udp_description messages.
* Server and client both send sender_description messages for all senders
* registered locally.
* Server and client both send type_description messages for all types
* registered locally.
*
* Implementation in vrpn_Connection::setup_new_connection(),
* finish_new_connection_setup(),
*/
/*
* VRPN Cookie Format
*
* +------------+------------+------------+------------+
* + 'v' | 'r' | 'p' | 'n' +
* +------------+------------+------------+------------+
* + ':' | ' ' | 'v' | 'e' +
* +------------+------------+------------+------------+
* + 'r' | '.' | ' ' | X +
* +------------+------------+------------+------------+
* + X | '.' | Y | Y +
* +------------+------------+------------+------------+
* + ' ' | ' ' | L | padding |
* +------------+------------+------------+------------+
* + padding |
* +------------+------------+------------+------------+
*
* XX = major version number (2 ASCII characters)
* YY = minor version number (2 ASCII characters)
* L = remote log mode requested (ASCII '0', '1', '2', or '3')
*
* This cookie is in ASCII so that humans scanning a dump can
* quickly determine whether or not it is a VRPN session.
*/
/*
* VRPN Log description message:
*
* type = vrpn_CONNECTION_LOG_DESCRIPTION (-4)
* sender = logging mode (0, 1, 2, or 3)
* payload length = strlen(logfile name) + 1
* data = null-terminated ASCII string giving pathname of file to log to
*/
/*
* VRPN UDP description message:
*
* type = vrpn_CONNECTION_UDP_DESCRIPTION (-3)
* sender = UDP port number to contact
* payload length = strlen(IP address) + 1
* data = ASCII string containing host's IP address
*/
/*
* VRPN Sender description message:
*
* type = vrpn_CONNECTION_SENDER_DESCRIPTION (-1)
* sender = ID of sender
* payload length = 5 + strlen(sender name)
* data =
*
* +------------+------------+------------+------------+
* + length of sender name + 1 |
* +------------+------------+------------+------------+
* + sender name |
* +------------+------------+------------+------------+
* + ... |
* +------------+------------+------------+------------+
*
* N.B. There is redundant length data here
*/
/*
* VRPN Type description message:
*
* type = vrpn_CONNECTION_TYPE_DESCRIPTION (-2)
* sender = ID of type
* payload length = 5 + strlen(sender name)
* data =
*
* +------------+------------+------------+------------+
* + length of type name + 1 |
* +------------+------------+------------+------------+
* + type name |
* +------------+------------+------------+------------+
* + ... |
* +------------+------------+------------+------------+
*
* N.B. There is redundant length data here
*/
/*
* VRPN disconnect message:
*
* type = vrpn_CONNECTION_DISCONNECT_MESSAGE (-5)
* sender = 0
* payload length = 0
*
* This message is never sent over the wire; it is written into logs
* to mark the point at which a connection was broken.
*/
#############################################################################
# Makefile for VRPN libraries. Needs to be built using 'gmake'.
# Should run on any architecture that is currently supported. It should
# be possible to build simultaneously on multiple architectures.
#
# On the sgi, both g++ and CC versions are built by default.
#
# Author: Russ Taylor, 10/2/1997
#
# modified:
# * Andrew Roth June 16/2012
# * Updates for MacOSX builds for 32/64, 64 bit and Xcode 4.3
# * Jeff Juliano, 10/99
# * added "make depend" (see comments at end of this makefile)
# * changed to use RM, RMF, MV, and MVF
# these are overridable as follows:
# gmake RM=/mybin/rm, or gmake RMF="/bin/rm -option"
# * Jeff Juliano, 9/1999
# support for parallel make (see WARNING below)
# * Tom Hudson, 25 Jun 1998
# Support for n32 ABI on sgi. (gmake n32)
# * Hans Weber, ???
# Support for both g++ and native compilers on sgi.
# * Tom Hudson, 13 Feb 1998
# Build two different libraries: client (libvrpn) and server
# (libvrpnserver). Our solution is to compile twice, once with the
# flag -DVRPN_CLIENT_ONLY and once without. Any server-specific code
# (vrpn_3Space, vrpn_Tracker_Fastrak, vrpn_Flock) should ONLY be
# compiled into the server library!
#############################################################################
##########################
# common definitions. For non-UNC sites, uncomment one of the lines
# that defines hw_os for the machine you are on in the section just
# below. Then, the code should compile in your environment.
#
#HW_OS := sgi_irix
#HW_OS := pc_linux
HW_OS := pc_linux64
#HW_OS := pc_linux_ia64
# Try this to cross-compile on a Linux PC for an ARM embedded controller.
#HW_OS := pc_linux_arm
# Try this to cross-compile on a Cygwin PC for an ARM embedded controller.
#HW_OS := pc_cygwin_arm
#HW_OS := pc_cygwin
#HW_OS := pc_FreeBSD
#HW_OS := sparc_solaris
#HW_OS := sparc_solaris_64
#HW_OS := powerpc_aix
#HW_OS := powerpc_macosx
#HW_OS := universal_macosx
#HW_OS := macosx_32_64
#HW_OS := macosx_64
##########################
##########################
# Mac OS X-specific options. If HW_OS is powerpc_macosx or universal_macosx,
# uncomment one line below to choose the minimum targeted OS X version and
# corresponding SDK. If none of the lines below is commented out, 10.5 will
# be the minimum version. 10.7/4.3 removes ppc support. In Xcode 4.3 - you
# must now manually install command line tools from:
# Xcode menu > Preferences > Downloads.
##########################
#MAC_OS_MIN_VERSION := 10.4
#MAC_OS_MIN_VERSION := 10.5
#MAC_OS_MIN_VERSION := 10.6
#MAC_OS_MIN_VERSION := 10.7
#MAC_OS_MIN_VERSION := 10.8
INSTALL_DIR := /usr/local
BIN_DIR := $(INSTALL_DIR)/bin
INCLUDE_DIR := $(INSTALL_DIR)/include
LIB_DIR := $(INSTALL_DIR)/lib
MV = /bin/mv
MVF = $(MV) -f
RM = /bin/rm
RMF = $(RM) -f
ifndef HW_OS
# hw_os does not exist on FreeBSD at UNC or on CYGWIN
UNAME := $(shell uname -s)
ifeq ($(UNAME), FreeBSD)
HW_OS := pc_FreeBSD
else
# pc_cygwin doesn't have HW_OS
ifeq ($(UNAME), CYGWIN_NT-4.0)
HW_OS := pc_cygwin
# On cygwin make is gmake (and gmake doesn't exist)
MAKE := make -f $(MAKEFILE)
else
ifeq ($(UNAME), CYGWIN_98-4.10)
HW_OS := pc_cygwin
MAKE := make -f $(MAKEFILE)
else
ifeq ($(UNAME), CYGWIN_NT-5.0)
HW_OS := pc_cygwin
MAKE := make -f $(MAKEFILE)
else
HW_OS := $(shell hw_os)
endif
endif
endif
endif
endif
# check if its for pxfl
ifdef PBASE_ROOT
HW_OS := hp_flow
ifeq ($(PXFL_COMPILER), aCC)
HW_OS = hp_flow_aCC
endif
endif
ifndef HW_OS
exit
endif
# Which C++ compiler to use. Default is g++, but some don't use this.
#
# IF YOU CHANGE THESE, document either here or in the header comment
# why. Multiple contradictory changes have been made recently.
CC := g++
AR := ar ruv
# need default 'ranlib' to be touch for platforms that don't use it,
# otherwise make fails.
RANLIB := touch
ifeq ($(FORCE_GPP),1)
CC := g++
else
ifeq ($(HW_OS),sparc_solaris)
CC := /opt/SUNWspro/bin/CC
AR := /opt/SUNWspro/bin/CC -xar -o
endif
ifeq ($(HW_OS),sparc_solaris_64)
CC := /opt/SUNWspro/bin/CC -xarch=v9a
AR := /opt/SUNWspro/bin/CC -xarch=v9a -xar -o
endif
ifeq ($(HW_OS),powerpc_aix)
CC := /usr/ibmcxx/bin/xlC_r -g -qarch=pwr3 -w
RANLIB := ranlib
endif
ifeq ($(HW_OS), pc_linux64)
CC := cc -m64 -fPIC
RANLIB := ranlib
endif
ifeq ($(HW_OS), pc_linux)
CC := gcc
RANLIB := ranlib
endif
ifeq ($(HW_OS), pc_linux_ia64)
CC := gcc
RANLIB := ranlib
endif
ifneq (,$(findstring macosx,$(HW_OS)))
ifndef MAC_OS_MIN_VERSION
MAC_OS_MIN_VERSION := 10.5
endif
# Select which compiler and MAC OS X SDK to use
MAC_GCC := g++
ifeq ($(MAC_OS_MIN_VERSION), 10.8)
MAC_OS_SDK := MacOSX10.8.sdk
else
ifeq ($(MAC_OS_MIN_VERSION), 10.7)
MAC_OS_SDK := MacOSX10.7.sdk
else
ifeq ($(MAC_OS_MIN_VERSION), 10.6)
MAC_OS_SDK := MacOSX10.6.sdk
else
ifeq ($(MAC_OS_MIN_VERSION), 10.5)
MAC_OS_SDK := MacOSX10.5.sdk
else
MAC_OS_SDK := MacOSX10.4u.sdk
MAC_GCC := g++-4.0
endif
endif
endif
endif
endif
ifneq (,$(findstring macosx,$(HW_OS)))
ifeq ($(wildcard /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)),/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK))
PATH_TO_DEV := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)
$(info ---> Xcode 4.3+: Platform SDK found. Setting dev path to $(PATH_TO_DEV))
else
PATH_TO_DEV := /Developer/SDKs/$(MAC_OS_SDK)
$(info Xcode 4.3+: Platform SDK not found in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$(MAC_OS_SDK)! Attempting to locate SDK in $(PATH_TO_DEV))
endif
endif
ifeq ($(HW_OS), powerpc_macosx)
CC := $(MAC_GCC) -arch ppc -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION)
RANLIB := ranlib
AR := libtool -static -o
SYSLIBS := -framework CoreFoundation -framework IOKit -framework System
endif
ifeq ($(HW_OS), universal_macosx)
CC := $(MAC_GCC) -arch ppc -arch i386 -arch x86_64 -isysroot /Developer/SDKs/$(MAC_OS_SDK) -mmacosx-version-min=$(MAC_OS_MIN_VERSION)
RANLIB := :
AR := libtool -static -o
SYSLIBS := -framework CoreFoundation -framework IOKit -framework System
endif
ifeq ($(HW_OS), macosx_32_64)
CC := $(MAC_GCC) -arch i386 -arch x86_64 -isysroot $(PATH_TO_DEV) -mmacosx-version-min=$(MAC_OS_MIN_VERSION)
RANLIB := :
AR := libtool -static -o
SYSLIBS := -framework CoreFoundation -framework IOKit -framework System
endif
ifeq ($(HW_OS), macosx_64)
CC := $(MAC_GCC) -arch x86_64 -isysroot $(PATH_TO_DEV) -mmacosx-version-min=$(MAC_OS_MIN_VERSION)
RANLIB := :
AR := libtool -static -o
SYSLIBS := -framework CoreFoundation -framework IOKit -framework System
endif
ifeq ($(HW_OS), pc_linux_arm)
CC := arm-linux-g++
RANLIB := arm-linux-ranlib
AR := arm-linux-ar ruv
endif
ifeq ($(HW_OS), pc_cygwin_arm)
CC := arm-unknown-linux-gnu-g++
RANLIB := arm-unknown-linux-gnu-ranlib
AR := arm-unknown-linux-gnu-ar ruv
endif
ifeq ($(HW_OS),sgi_irix)
ifndef SGI_ABI
SGI_ABI := n32
endif
ifndef SGI_ARCH
SGI_ARCH := mips3
endif
OBJECT_DIR_SUFFIX := .$(SGI_ABI).$(SGI_ARCH)
CC := CC -$(SGI_ABI) -$(SGI_ARCH) -LANG:std
RANLIB := :
endif
ifeq ($(HW_OS),hp700_hpux10)
CC := CC +a1
endif
ifeq ($(HW_OS),pc_cygwin)
CC := g++
endif
ifeq ($(HW_OS),sparc_sunos)
CC := /usr/local/lib/CenterLine/bin/CC
endif
ifeq ($(HW_OS), hp_flow_aCC)
CC := /opt/aCC/bin/aCC
endif
endif
#ifeq ($(HW_OS),sparc_solaris)
# AR := /usr/ccs/bin/ar
#endif
##########################
# directories
#
# subdirectory for make
ifeq ($(FORCE_GPP),1)
OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++
SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/g++/server
AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib
GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib
else
UNQUAL_OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)
UNQUAL_SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server
UNQUAL_AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib
UNQUAL_GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib
OBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)
SOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/server
AOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/atmellib
GOBJECT_DIR := $(HW_OS)$(OBJECT_DIR_SUFFIX)/gpsnmealib
endif
# directories that we can do an rm -f on because they only contain
# object files and executables
SAFE_KNOWN_ARCHITECTURES := \
hp700_hpux/* \
hp700_hpux10/* \
mips_ultrix/* \
pc_linux/* \
sgi_irix.32/* \
sgi_irix.n32/* \
sparc_solaris/* \
sparc_solaris_64/* \
sparc_sunos/* \
pc_cygwin/* \
powerpc_aix/* \
pc_linux_arm/* \
powerpc_macosx/* \
universal_macosx/* \
macosx_32_64/* \
macosx_64/* \
pc_linux64/* \
pc_linux_ia64/*
CLIENT_SKA = $(patsubst %,client_src/%,$(SAFE_KNOWN_ARCHITECTURES))
SERVER_SKA = $(patsubst %,server_src/%,$(SAFE_KNOWN_ARCHITECTURES))
##########################
# Include flags
#
#SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include
SYS_INCLUDE :=
ifeq ($(HW_OS),powerpc_macosx)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),universal_macosx)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),macosx_32_64)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),macosx_64)
# SYS_INCLUDE := -I/usr/include
SYS_INCLUDE :=-DMACOSX -I../isense
endif
ifeq ($(HW_OS),pc_linux)
# The following is for the InterSense and Freespace libraries.
SYS_INCLUDE := -DUNIX -DLINUX -I../libfreespace/include -I./submodules/hidapi/hidapi -I/usr/include/libusb-1.0
endif
ifeq ($(HW_OS),pc_linux64)
# The following is for the InterSense and Freespace libraries.
SYS_INCLUDE := -DUNIX -DLINUX -I../libfreespace/include -I./submodules/hidapi/hidapi -I/usr/include/libusb-1.0
endif
ifeq ($(HW_OS),pc_linux_arm)
SYS_INCLUDE := -I/opt/Embedix/arm-linux/include
# -I/usr/local/contrib/include \
# -I/usr/local/contrib/mod/include -I/usr/include/bsd \
# -I/usr/include/g++
endif
ifeq ($(HW_OS),pc_cygwin_arm)
SYS_INCLUDE := -I/opt/Embedix/arm-linux/include
# -I/usr/local/contrib/include \
# -I/usr/local/contrib/mod/include -I/usr/include/bsd \
# -I/usr/include/g++
endif
ifeq ($(HW_OS),sgi_irix)
# SYS_INCLUDE := -I/usr/local/contrib/mod/include
SYS_INCLUDE :=
endif
ifeq ($(HW_OS),hp700_hpux10)
SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \
-I/usr/include/bsd
endif
ifeq ($(HW_OS),hp_flow)
SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \
-I/usr/include/bsd -DFLOW
endif
ifeq ($(HW_OS),hp_flow_aCC)
SYS_INCLUDE := -I/usr/local/contrib/include -I/usr/local/contrib/mod/include \
-I/usr/include/bsd -DFLOW
endif
# On the PC, place quatlib in the directory ./quat. No actual system
# includes should be needed.
ifeq ($(HW_OS),pc_cygwin)
INCLUDE_FLAGS := -I. -I./quat -I./atmellib -I./gpsnmealib
else
INCLUDE_FLAGS := -I. $(SYS_INCLUDE) -I./quat -I../quat -I./atmellib -I./gpsnmealib
endif
ifeq ($(HW_OS),universal_macosx)
LOAD_FLAGS := $(LOAD_FLAGS)
endif
ifeq ($(HW_OS),macosx_32_64)
LOAD_FLAGS := $(LOAD_FLAGS)
endif
ifeq ($(HW_OS),macosx_64)
LOAD_FLAGS := $(LOAD_FLAGS)
endif
##########################
# Load flags
#
#LOAD_FLAGS := -L./$(HW_OS)$(OBJECT_DIR_SUFFIX) -L/usr/local/lib \
# -L/usr/local/contrib/unmod/lib -L/usr/local/contrib/mod/lib -g
LOAD_FLAGS := -L./$(HW_OS)$(OBJECT_DIR_SUFFIX) -L/usr/local/lib \
-L/usr/local/contrib/unmod/lib -L/usr/local/contrib/mod/lib $(DEBUG_FLAGS) $(LDFLAGS)
ifeq ($(HW_OS),sgi_irix)
LOAD_FLAGS := $(LOAD_FLAGS) -old_ld -LANG:std
endif
ifeq ($(HW_OS),pc_linux)
LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib
endif
ifeq ($(HW_OS),pc_linux_ia64)
LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib
endif
ifeq ($(HW_OS),pc_linux64)
LOAD_FLAGS := $(LOAD_FLAGS) -L/usr/X11R6/lib
endif
ifeq ($(HW_OS),powerpc_macosx)
LOAD_FLAGS := $(LOAD_FLAGS)
endif
##########################
# Libraries
#
ifeq ($(HW_OS),pc_linux64)
ARCH_LIBS := -lbsd -ldl
else
ifeq ($(HW_OS),pc_linux)
ARCH_LIBS := -lbsd -ldl
else
ifeq ($(HW_OS),pc_linux_ia64)
ARCH_LIBS := -lbsd -ldl
else
ifeq ($(HW_OS),sparc_solaris)
ARCH_LIBS := -lsocket -lnsl
else
ifeq ($(HW_OS),sparc_solaris_64)
ARCH_LIBS := -lsocket -lnsl
else
ARCH_LIBS :=
endif
endif
endif
endif
endif
LIBS := -lquat -lsdi $(TCL_LIBS) -lXext -lX11 $(ARCH_LIBS) -lm
#
# Defines for the compilation, CFLAGS
#
#CFLAGS := $(INCLUDE_FLAGS) -g
override CFLAGS := $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CFLAGS)
override CXXFLAGS := $(INCLUDE_FLAGS) $(DEBUG_FLAGS) $(CXXFLAGS)
# If we're building for sgi_irix, we need both g++ and non-g++ versions,
# unless we're building for one of the weird ABIs, which are only supported
# by the native compiler.
ifeq ($(HW_OS),sgi_irix)
ifeq ($(SGI_ABI),32)
all: client server client_g++ server_g++ atmellib gpsnmealib
else
all: client server atmellib gpsnmealib
endif
else
ifeq ($(HW_OS),pc_cygwin)
all: client server atmellib gpsnmealib
else
all: client server atmellib gpsnmealib
endif
endif
.PHONY: client_g++
client_g++:
$(MAKE) FORCE_GPP=1 $(UNQUAL_OBJECT_DIR)/g++/libvrpn.a
$(MV) $(UNQUAL_OBJECT_DIR)/g++/libvrpn.a $(UNQUAL_OBJECT_DIR)/libvrpn_g++.a
.PHONY: server_g++
server_g++:
$(MAKE) FORCE_GPP=1 $(UNQUAL_OBJECT_DIR)/g++/libvrpnserver.a
$(MV) $(UNQUAL_OBJECT_DIR)/g++/libvrpnserver.a $(UNQUAL_OBJECT_DIR)/libvrpnserver_g++.a
.PHONY: client
client: $(OBJECT_DIR) $(OBJECT_DIR)/libvrpn.a
.PHONY: server
server: $(SOBJECT_DIR)
$(MAKE) $(OBJECT_DIR)/libvrpnserver.a
.PHONY: atmellib
atmellib: $(AOBJECT_DIR)
$(MAKE) $(OBJECT_DIR)/libvrpnatmel.a
.PHONY: gpsnmealib
gpsnmealib: $(GOBJECT_DIR)
$(MAKE) $(OBJECT_DIR)/libvrpngpsnmea.a
$(OBJECT_DIR):
-mkdir -p $(OBJECT_DIR)
$(SOBJECT_DIR):
-mkdir -p $(SOBJECT_DIR)
$(AOBJECT_DIR):
-mkdir -p $(AOBJECT_DIR)
$(GOBJECT_DIR):
-mkdir -p $(GOBJECT_DIR)
#############################################################################
#
# implicit rule for all .c files
#
.SUFFIXES: .c .C .o .a
.c.o:
$(CC) -c $(CFLAGS) $<
.C.o:
$(CC) -c $(CXXFLAGS) $<
# Build objects from .c files
$(OBJECT_DIR)/%.o: %.c $(LIB_INCLUDES) $(MAKEFILE)
@[ -d $(OBJECT_DIR) ] || mkdir -p $(OBJECT_DIR)
$(CC) $(CFLAGS) -DVRPN_CLIENT_ONLY -o $@ -c $<
# Build objects from .C files
$(OBJECT_DIR)/%.o: %.C $(LIB_INCLUDES) $(MAKEFILE)
@[ -d $(OBJECT_DIR) ] || mkdir -p $(OBJECT_DIR)
$(CC) $(CFLAGS) -DVRPN_CLIENT_ONLY -o $@ -c $<
# Build objects from .C files
$(SOBJECT_DIR)/%.o: %.C $(SLIB_INCLUDES) $(MAKEFILE)
@[ -d $(SOBJECT_DIR) ] || mkdir -p $(SOBJECT_DIR)
$(CC) $(CFLAGS) -o $@ -c $<
# Build objects from .C files
$(AOBJECT_DIR)/%.o: %.C $(ALIB_INCLUDES) $(MAKEFILE)
@[ -d $(AOBJECT_DIR) ] || mkdir -p $(AOBJECT_DIR)
$(CC) $(CFLAGS) -o $@ -c $<
# Special rule for vrpn_Local_HIDAPI.C, which must be build with
# the C compiler.
$(SOBJECT_DIR)/vrpn_Local_HIDAPI.o : vrpn_Local_HIDAPI.C $(SLIB_INCLUDES) $(MAKEFILE)
@[ -d $(SOBJECT_DIR) ] || mkdir -p $(SOBJECT_DIR)
$(CC) $(CFLAGS) -x c -o $@ -c $<
#
#
#############################################################################
#############################################################################
#
# library code
#
#############################################################################
# files to be compiled into the client library
LIB_FILES = \
vrpn_Analog.C \
vrpn_Analog_Output.C \
vrpn_Auxiliary_Logger.C \
vrpn_BaseClass.C \
vrpn_Button.C \
vrpn_Connection.C \
vrpn_Dial.C \
vrpn_FileConnection.C \
vrpn_FileController.C \
vrpn_ForceDevice.C \
vrpn_Forwarder.C \
vrpn_ForwarderController.C \
vrpn_Imager.C \
vrpn_LamportClock.C \
vrpn_Mutex.C \
vrpn_Poser.C \
vrpn_RedundantTransmission.C \
vrpn_Serial.C \
vrpn_Shared.C \
vrpn_SharedObject.C \
vrpn_Sound.C \
vrpn_Text.C \
vrpn_Tracker.C
LIB_OBJECTS = $(patsubst %,$(OBJECT_DIR)/%,$(LIB_FILES:.C=.o))
LIB_INCLUDES = \
vrpn_Connection.h \
vrpn_Tracker.h \
vrpn_Button.h \
vrpn_Sound.h \
vrpn_ForceDevice.h \
vrpn_Shared.h \
vrpn_Analog.h \
vrpn_FileConnection.h \
vrpn_FileController.h \
vrpn_Forwarder.h \
vrpn_Text.h \
vrpn_ForwarderController.h \
vrpn_Serial.h \
vrpn_Dial.h \
vrpn_SharedObject.h \
vrpn_LamportClock.h \
vrpn_Mutex.h \
vrpn_BaseClass.h \
vrpn_Imager.h \
vrpn_Analog_Output.h \
vrpn_Poser.h \
vrpn_Auxiliary_Logger.h \
vrpn_MainloopObject.h \
vrpn_MainloopContainer.h \
vrpn_BufferUtils.h \
vrpn_SendTextMessageStreamProxy.h
$(LIB_OBJECTS):
$(OBJECT_DIR)/libvrpn.a: $(MAKEFILE) $(LIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpn.a $(LIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpn.a
# We aren't going to use architecture-dependent sets of files.
# If vrpn_sgibox isn't supposed to be compiled on any other architecture,
# then put all of it inside "#ifdef sgi"!
SLIB_FILES = $(LIB_FILES) \
vrpn_3DConnexion.C \
vrpn_3DMicroscribe.C \
vrpn_3Space.C \
vrpn_5DT16.C \
vrpn_ADBox.C \
vrpn_Analog_5dt.C \
vrpn_Analog_5dtUSB.C \
vrpn_Analog_Radamec_SPI.C \
vrpn_Analog_USDigital_A2.C \
vrpn_Atmel.C \
vrpn_BiosciencesTools.C \
vrpn_Button_NI_DIO24.C \
vrpn_CerealBox.C \
vrpn_CHProducts_Controller_Raw.C \
vrpn_Contour.C \
vrpn_Dyna.C \
vrpn_DreamCheeky.C \
vrpn_Event_Analog.C \
vrpn_Event.C \
vrpn_Event_Mouse.C \
vrpn_Flock.C \
vrpn_Flock_Parallel.C \
vrpn_ForceDeviceServer.C \
vrpn_Freespace.C \
vrpn_FunctionGenerator.C \
vrpn_Futaba.C \
vrpn_GlobalHapticsOrb.C \
vrpn_Griffin.C \
vrpn_HumanInterface.C \
vrpn_IDEA.C \
vrpn_Imager_Stream_Buffer.C \
vrpn_ImmersionBox.C \
vrpn_inertiamouse.C \
vrpn_JoyFly.C \
vrpn_Joylin.C \
vrpn_Keyboard.C \
vrpn_Local_HIDAPI.C \
vrpn_Logitech_Controller_Raw.C \
vrpn_LUDL.C \
vrpn_Magellan.C \
vrpn_Microsoft_Controller_Raw.C \
vrpn_Mouse.C \
vrpn_NationalInstruments.C \
vrpn_nikon_controls.C \
vrpn_OmegaTemperature.C \
vrpn_Poser_Analog.C \
vrpn_Poser_Tek4662.C \
vrpn_raw_sgibox.C \
vrpn_Retrolink.C \
vrpn_Saitek_Controller_Raw.C \
vrpn_sgibox.C \
vrpn_Spaceball.C \
vrpn_Tng3.C \
vrpn_Tracker_3DMouse.C \
vrpn_Tracker_AnalogFly.C \
vrpn_Tracker_ButtonFly.C \
vrpn_Tracker_Crossbow.C \
vrpn_Tracker_DTrack.C \
vrpn_Tracker_Fastrak.C \
vrpn_Tracker_Filter.C \
vrpn_Tracker_GameTrak.C \
vrpn_Tracker_isense.C \
vrpn_Tracker_Isotrak.C \
vrpn_Tracker_Liberty.C \
vrpn_Tracker_PDI.C \
vrpn_Tracker_MotionNode.C \
vrpn_Tracker_NDI_Polaris.C \
vrpn_Tracker_PhaseSpace.C \
vrpn_Tracker_RazerHydra.C \
vrpn_Tracker_TrivisioColibri.C \
vrpn_Tracker_ViewPoint.C \
vrpn_Tracker_NovintFalcon.C \
vrpn_Tracker_SpacePoint.C \
vrpn_Tracker_Wintracker.C \
vrpn_Tracker_WiimoteHead.C \
vrpn_Tracker_GPS.C \
vrpn_UNC_Joystick.C \
vrpn_VPJoystick.C \
vrpn_Wanda.C \
vrpn_WiiMote.C \
vrpn_Xkeys.C \
vrpn_Tracker_LibertyHS.C \
vrpn_YEI_3Space.C \
vrpn_Zaber.C
SLIB_OBJECTS = $(patsubst %,$(SOBJECT_DIR)/%,$(SLIB_FILES:.C=.o))
SLIB_INCLUDES = $(LIB_INCLUDES) \
vrpn_3DConnexion.h \
vrpn_3DMicroscribe.h \
vrpn_3Space.h \
vrpn_5DT16.h \
vrpn_ADBox.h \
vrpn_Analog_5dt.h \
vrpn_Analog_5dtUSB.h \
vrpn_Analog_Radamec_SPI.h \
vrpn_Analog_USDigital_A2.h \
vrpn_Atmel.h \
vrpn_BiosciencesTools.h \
vrpn_Button_NI_DIO24.h \
vrpn_CerealBox.h \
vrpn_CHProducts_Controller_Raw.h \
vrpn_Contour.h \
vrpn_Dyna.h \
vrpn_DreamCheeky.h \
vrpn_Event_Analog.h \
vrpn_Event.h \
vrpn_Event_Mouse.h \
vrpn_Flock.h \
vrpn_Flock_Parallel.h \
vrpn_ForceDeviceServer.h \
vrpn_Freespace.h \
vrpn_Futaba.C \
vrpn_GlobalHapticsOrb.h \
vrpn_Griffin.h \
vrpn_HumanInterface.h \
vrpn_IDEA.h \
vrpn_Imager_Stream_Buffer.h \
vrpn_ImmersionBox.h \
vrpn_inertiamouse.h \
vrpn_JoyFly.h \
vrpn_Joylin.h \
vrpn_Keyboard.h \
vrpn_Logitech_Controller_Raw.h \
vrpn_LUDL.h \
vrpn_Magellan.h \
vrpn_Microsoft_Controller_Raw.h \
vrpn_Mouse.h \
vrpn_NationalInstruments.h \
vrpn_nikon_controls.h \
vrpn_OneEuroFilter.h \
vrpn_OmegaTemperature.h \
vrpn_Poser_Analog.h \
vrpn_Poser_Tek4662.h \
vrpn_raw_sgibox.h \
vrpn_Retrolink.h \
vrpn_Saitek_Controller_Raw.h \
vrpn_sgibox.h \
vrpn_Spaceball.h \
vrpn_Tng3.h \
vrpn_Tracker_3DMouse.h \
vrpn_Tracker_AnalogFly.h \
vrpn_Tracker_ButtonFly.h \
vrpn_Tracker_Crossbow.h \
vrpn_Tracker_DTrack.h \
vrpn_Tracker_Fastrak.h \
vrpn_Tracker_Filter.h \
vrpn_Tracker_GameTrak.h \
vrpn_Tracker_isense.h \
vrpn_Tracker_Isotrak.h \
vrpn_Tracker_Liberty.h \
vrpn_Tracker_PDI.h \
vrpn_Tracker_MotionNode.h \
vrpn_Tracker_NDI_Polaris.h \
vrpn_Tracker_PhaseSpace.h \
vrpn_Tracker_RazerHydra.h \
vrpn_Tracker_SpacePoint.h \
vrpn_Tracker_Wintracker.h \
vrpn_Tracker_TrivisioColibri.h \
vrpn_Tracker_ViewPoint.h \
vrpn_Tracker_NovintFalcon.h \
vrpn_Tracker_WiimoteHead.h \
vrpn_Tracker_GPS.h \
vrpn_UNC_Joystick.h \
vrpn_VPJoystick.h \
vrpn_Wanda.h \
vrpn_WiiMote.h \
vrpn_Xkeys.h \
vrpn_Tracker_LibertyHS.h \
vrpn_YEI_3Space.h \
vrpn_Zaber.h
ifeq ($(HW_OS), pc_linux64)
SLIB_FILES += vrpn_DevInput.C
SLIB_INCLUDES += vrpn_DevInput.h
endif
ifeq ($(HW_OS), pc_linux)
SLIB_FILES += vrpn_DevInput.C
SLIB_INCLUDES += vrpn_DevInput.h
endif
$(SLIB_OBJECTS):
$(OBJECT_DIR)/libvrpnserver.a: $(MAKEFILE) $(SLIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpnserver.a $(SLIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpnserver.a
# atmellib files.
ALIB_FILES = \
atmellib/vrpn_atmellib_helper.C \
atmellib/vrpn_atmellib_iobasic.C \
atmellib/vrpn_atmellib_openclose.C \
atmellib/vrpn_atmellib_register.C \
atmellib/vrpn_atmellib_tester.C
ALIB_OBJECTS = $(patsubst %,$(AOBJECT_DIR)/../%,$(ALIB_FILES:.C=.o))
ALIB_INCLUDES = \
vrpn_atmellib.h \
vrpn_atmellib_helper.h \
vrpn_atmellib_errno.h
$(ALIB_OBJECTS):
$(OBJECT_DIR)/libvrpnatmel.a: $(MAKEFILE) $(ALIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpnatmel.a $(ALIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpnatmel.a
# gpsnmealib files.
GLIB_FILES = \
gpsnmealib/latLonCoord.C \
gpsnmealib/nmeaParser.C \
gpsnmealib/typedCoord.C \
gpsnmealib/utmCoord.C
GLIB_OBJECTS = $(patsubst %,$(GOBJECT_DIR)/../%,$(GLIB_FILES:.C=.o))
GLIB_INCLUDES = \
latLonCoord.h \
nmeaParser.h \
typeCoord.h \
utmCoord.h
$(GLIB_OBJECTS):
$(OBJECT_DIR)/libvrpngpsnmea.a: $(MAKEFILE) $(GLIB_OBJECTS)
$(AR) $(OBJECT_DIR)/libvrpngpsnmea.a $(GLIB_OBJECTS)
-$(RANLIB) $(OBJECT_DIR)/libvrpngpsnmea.a
#############################################################################
#
# other stuff
#
#############################################################################
.PHONY: clean
clean:
ifeq ($(HW_OS),)
echo "Must specify HW_OS !"
else
$(RMF) $(LIB_OBJECTS) $(OBJECT_DIR)/libvrpn.a \
$(OBJECT_DIR)/libvrpn_g++.a \
$(SLIB_OBJECTS) \
$(ALIB_OBJECTS) \
$(GLIB_OBJECTS) \
$(OBJECT_DIR)/libvrpnserver.a \
$(OBJECT_DIR)/libvrpnatmel.a \
$(OBJECT_DIR)/libvrpngpsnmea.a \
$(OBJECT_DIR)/libvrpnserver_g++.a \
$(OBJECT_DIR)/.depend \
$(OBJECT_DIR)/.depend-old
ifneq (xxx$(FORCE_GPP),xxx1)
@echo -----------------------------------------------------------------
@echo -- Wart: type \"$(MAKE) clean_g++\" to clean up after g++
@echo -- I don\'t do it automatically in case you don\'t have g++
@echo -----------------------------------------------------------------
endif
#ifneq ($(CC), g++)
# $(MAKE) FORCE_GPP=1 clean
#endif
endif
.PHONY: clean
clean_g++:
$(MAKE) FORCE_GPP=1 clean
# clobberall removes the object directory for EVERY architecture.
# One problem - the object directory for pc_win32 also contains files
# that must be saved.
# clobberall also axes left-over CVS cache files.
.PHONY: clobberall
clobberall: clobberwin32
$(RMF) -r $(SAFE_KNOWN_ARCHITECTURES)
$(RMF) -r $(CLIENT_SKA)
$(RMF) -r $(SERVER_SKA)
$(RMF) .#* server_src/.#* client_src/.#*
.PHONY: clobberwin32
clobberwin32:
$(RMF) -r pc_win32/DEBUG/*
$(RMF) -r pc_win32/vrpn/Debug/*
$(RMF) -r client_src/pc_win32/printvals/Debug/*
$(RMF) -r server_src/pc_win32/vrpn_server/Debug/*
install: all
-mkdir -p $(LIB_DIR)
( cd $(LIB_DIR) ; rm -f libvrpn*.a )
( cd $(OBJECT_DIR) ; cp *.a $(LIB_DIR) )
-mkdir -p $(INCLUDE_DIR)
cp vrpn*.h $(INCLUDE_DIR)
uninstall:
( cd $(LIB_DIR) ; rm -f libvrpn*.a )
( cd $(INCLUDE_DIR) ; rm -f vrpn*.h )
#############################################################################
#
# Dependencies
#
# If it doesn't already exist, this makefile automatically creates
# a dependency file called .depend. Then it includes it so that
# the build will know the dependency information.
#
# to recreate a dependencies file, type "make depend"
# do this any time you add a file to the project,
# or add/remove #include lines from a source file
#
# if you are on an SGI and want g++ to make the dependency file,
# then type: gmake CC=g++ depend
#
# if you don't want a dependency file, then remove .depend if it exists,
# and type "touch .depend". if it exists (and is empty), make will not
# automatically create it or automatically update it (unless you type
# make depend)
#
###############
### this way works better
### you type "make depend" anytime you add a file or
### add/remove #includes from a file
########
include $(OBJECT_DIR)/.depend
.PHONY: depend
depend:
-$(MVF) $(OBJECT_DIR)/.depend $(OBJECT_DIR)/.depend-old
$(MAKE) $(OBJECT_DIR)/.depend
$(OBJECT_DIR)/.depend:
@echo ----------------------------------------------------------------
@echo -- Making dependency file. If you add files to the makefile,
@echo -- or add/remove includes from a .h or .C file, then you should
@echo -- remake the dependency file by typing \"$(MAKE) depend\"
@echo ----------------------------------------------------------------
-mkdir -p $(OBJECT_DIR)
ifeq ($(HW_OS),hp700_hpux10)
@echo -- $(HW_OS): Using g++ since HP CC does not understand -M
@echo -- if this causes an error, then delete .depend and type
@echo -- \"touch .depend\" to create an empty file
@echo ----------------------------------------------------------------
$(SHELL) -ec 'g++ -MM $(CXXFLAGS) $(LIB_FILES) \
| sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend'
else
ifeq ($(HW_OS),hp_flow_aCC)
@echo -- $(HW_OS): Using g++ since HP aCC does not understand -M
@echo -- if this causes an error, then delete .depend and type
@echo -- \"touch .depend\" to create an empty file
@echo ----------------------------------------------------------------
$(SHELL) -ec 'g++ -MM $(CXXFLAGS) $(LIB_FILES) \
| sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend'
else
ifeq ($(HW_OS),powerpc_aix)
@$(RMF) *.u
$(SHELL) -ec '$(CC) -E -M $(CFLAGS) $(LIB_FILES) > /dev/null 2>&1'
cat *.u > .depend
@$(RMF) *.u
else
$(SHELL) -ec '$(CC) -M $(CFLAGS) $(LIB_FILES) \
| sed '\''s/\(.*\.o[ ]*:[ ]*\)/$(OBJECT_DIR)\/\1/g'\'' > $(OBJECT_DIR)/.depend'
endif
endif
endif
@echo ----------------------------------------------------------------
# Example toolchain file for building with mingw32 on Ubuntu 10.04 x64
# Pass to CMake using cmake -DCMAKE_TOOLCHAIN_FILE=MinGWToolchain.cmake
# Not needed when actually building on Windows using mingw, only when
# cross-compiling
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
set(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
set(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
# here is the target environment located
set(CMAKE_FIND_ROOT_PATH
/usr/i586-mingw32msvc
$ENV{HOME}/mingw-install)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
###
# Get the version number by parsing vrpn_Connection.C
###
include(WarningDev.cmake)
set(_vrpn_version_file "${CMAKE_CURRENT_SOURCE_DIR}/vrpn_Connection.C")
if(EXISTS "${_vrpn_version_file}")
file(READ "${_vrpn_version_file}" _vrpn_version_contents)
endif()
set(_vrpn_version_regex "vrpn: ver. ([0-9]+).([0-9]+)")
string(REGEX
MATCH
"${_vrpn_version_regex}"
_dummy
"${_vrpn_version_contents}")
if(CMAKE_MATCH_1)
set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_MATCH_1}")
else()
set(CPACK_PACKAGE_VERSION_MAJOR "07")
warning_dev("Could not parse major version from vrpn_Connection.C")
endif()
if(CMAKE_MATCH_2)
set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_MATCH_2}")
else()
set(CPACK_PACKAGE_VERSION_MAJOR "26")
warning_dev("Could not parse minor version from vrpn_Connection.C")
endif()
set(CPACK_PACKAGE_VERSION
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
set(CONFIG_VERSION "${CPACK_PACKAGE_VERSION}")
set(BRIEF_VERSION "${CPACK_PACKAGE_VERSION}")
include(GetGitRevisionDescription)
git_get_exact_tag(GIT_EXACT_TAG --tags --match version_*)
if(GIT_EXACT_TAG)
# Extract simple version number from description to verify it
string(REPLACE "version_" "" GIT_LAST_TAGGED_VER "${GIT_EXACT_TAG}")
string(REGEX
REPLACE
"-.*"
""
GIT_LAST_TAGGED_VER
"${GIT_LAST_TAGGED_VER}")
if(GIT_LAST_TAGGED_VER VERSION_EQUAL CPACK_PACKAGE_VERSION)
# OK, they match. All done!
return()
endif()
message("WARNING: Git reports that the current source code is tagged '${GIT_EXACT_TAG}',
but the version extracted from the source code (${CPACK_PACKAGE_VERSION}) differs!
You may need to fix the source code's version and/or update the tag!
The version extracted from the source code will be trusted for now,
but please fix this issue!\n")
else()
# Not an exact tag, let's try a description
git_describe(GIT_REVISION_DESCRIPTION --tags --match version_*)
if(GIT_REVISION_DESCRIPTION)
# Extract simple version number from description
string(REPLACE
"version_"
""
GIT_LAST_TAGGED_VER
"${GIT_REVISION_DESCRIPTION}")
set(GIT_REDUCED_REVISION_DESCRIPTION "${GIT_LAST_TAGGED_VER}")
string(REGEX
REPLACE
"-.*"
""
GIT_LAST_TAGGED_VER
"${GIT_LAST_TAGGED_VER}")
if(GIT_LAST_TAGGED_VER VERSION_LESS CPACK_PACKAGE_VERSION)
# Prerelease
message(STATUS
"Git's description of the current revision indicates this is a prerelease of ${CPACK_PACKAGE_VERSION}: ${GIT_REVISION_DESCRIPTION}\n")
set(CPACK_PACKAGE_VERSION_PATCH
"0~prerelease-git-${GIT_REDUCED_REVISION_DESCRIPTION}")
set(CONFIG_VERSION "pre-${CONFIG_VERSION}")
else()
# OK, this is a followup version
# TODO verify assumption
message(STATUS
"Git's description of the current revision indicates this is a patched version of ${CPACK_PACKAGE_VERSION}: ${GIT_REVISION_DESCRIPTION}\n")
set(CONFIG_VERSION "post-${CONFIG_VERSION}")
set(CPACK_PACKAGE_VERSION_PATCH "0-git-${GIT_REDUCED_REVISION_DESCRIPTION}")
endif()
set(CPACK_PACKAGE_VERSION
"${CPACK_PACKAGE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
endif()
endif()
IMPORTANT LEGAL INFORMATION for offsite use is in README.Legal
IMPORTANT compiling at other sites information in README.Compile
NOTE: See http://www.vrpn.org for
information on VRPN.
VRPN has had a CMake-based build system since version 07.23. CMake is
similar in purpose but not in implementation to the Autoconf collection
of tools, and permits building on multiple platforms by creating native
project files for MSVC, XCode, Eclipse, Code::Blocks, makefiles, and
more.
Get CMake from your Linux distribution and/or from www.cmake.org
Use the current directory (vrpn_XX_XX) as the "source code" directory
in the CMake GUI; the quat directory (vrpn_XX_XX/quat) will be automatically
detected and built as well. Choose any directory you want (the source
directory followed by /build is suggested) as the "build binaries"
directory: generated build files will be placed there rather than cluttering
up your source tree.
Many options can be fully configured using CMake as of Dec 2009, and more
are sure to come. Until then, if you need specific compilation needs
that CMake doesn't appear to provide an interface for, look in the
vrpn_Configure.h.cmake_in file.
If you'd rather use the command line, here's the basics:
mkdir build
cd build
ccmake ../
- Press 'c' to run the initial configuration
- Change any options, pressing 'c' to re-configure after each change
- when satisfied, after configuring, press 'g' to create makefiles, etc
make
and any/all of these if desired:
make package
- Create binary install packages of your configured build using CPack
make package_source
- Create source code packages using CPack
make install
- Install all libraries, executables, and headers (as configured)
to your system, to the configured path. Add DESTDIR=whatever/
to place the installation tree somewhere other than root.
Instructions for the original Makefile-based or project-based build follow.
For those not at UNC, you compile by doing the following:
for Visual C++:
Open the vrpn.dsw file.
Compile the quat project.
Compile the VRPN project.
Then compile whichever of vrpn_server, printvals, etc you want.
for Unix/Cygwin:
Go to ../quat.
Edit 'makefile' to uncomment the architecture you are on.
gmake
Come back here (cd ../vrpn)
Edit Makefile to uncomment your architecture
gmake
Go to client_src
Edit Makefile to uncomment your architecture
gmake
Go to server_src
Edit Makefile to uncomment your architecture
gmake
edit the vrpn.cfg file to set it to start tracker you want
See the file vrpn.cfg.SAMPLE for examples.
Example: vrpn_Tracker_NULL Tracker0@MYHOSTNAME 2 2
(Run the server: sgi_irix/vrpn_server -millisleep 1 -f vrpn.cfg)
Go to client_src
Run printvals to check the server
Example: sgi_irix/printvals localhost
For those wanting to build client code for Android, see the README_Android.txt in
the java_vrpn directory.
The initial release of VRPN (The Virtual Reality Peripheral Network) was placed into the public domain on 5/4/1998 by the copyright holder Russell M. Taylor II at the University of North Carolina at Chapel Hill.
To protect all VRPN contributors from liability without restricting the use of VRPN, as of July 22, 2010, future versions of VRPN (versions 7.27 and higher) are being released under the Boost Software License 1.0, which is as follows:
Boost Software License 1.0 (BSL1.0)
Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:
The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Additional requests follow:
1. Please acknowledge this library in any publication, written, videotaped,
or otherwise produced, that results from making programs using it.
The acknowledgement will credit
CISMM Project
University of North Carolina at Chapel Hill,
Supported by the NIH/NCRR and the NIH/NIBIB.
2. Please furnish us a copy of any publication, including videotape,
that you produce and disseminate outside your group using our
program. These should be addressed to Professor R.M. Taylor
at taylorr@cs.unc.edu.
3. Please send us derived classes and drivers for new devices that you
create for the library. We will attempt to include them in
future releases of the library for you and others to use. This
is the fastest way to get a working system for everyone.
vrpn_devel is currently accessed over https:// at git.cs.unc.edu.
Use a password to push changes.
Getting to the Git repository using a public/private key pair from a UNC Linux host.
---------------------
1) Generate a public/private key pair and store them securely on your AFS space:
cd ~
mkdir .ssh-private
fs sa .ssh-private system:anyuser none
fs sa .ssh-private system:administrators none
cd ~/.ssh-private
ssh-keygen -t dsa -b 1024 -f ./git_dsa
(Decide if you want a passphrase on the key, enter it if so
or blank if not.)
---------------------
2) Tell SSH to share this key with the other side when you're connecting to the server by adding the following lines into the file ~/.ssh/config under Linux:
Host cvs.cs.unc.edu
IdentityFile ~/.ssh-private/git_dsa
Host git.cs.unc.edu
IdentityFile ~/.ssh-private/git_dsa
---------------------
3) Send the public key to Murray to be added to the list of users who can log on to CVS as the git user. You can paste the text of the key into an email to him.
---------------------
4) Use the following name for the repository: git@git.cs.unc.edu:vrpn.git, for example:
git clone git@git.cs.unc.edu:vrpn.git
git push git@git.cs.unc.edu:vrpn.git master
---------------------
Random: If you end up pushing in a way that requires a password, you may need to do the following in your shell ahead of time to avoid having it attempt to display via an X server:
unset DISPLAY
unset SSH_ASKPASS
JSONCPP is required to build a VRPN server for the Vrpn Android widgets (see android_widgets directory).
If you've done a recursive clone, JSONCPP is in the submodules directory,
will be built automatically, and you can completely ignore the rest of this file.
Get the latest JSONCPP (r156 has been used successfully) from
http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp
You will also need Scons and Python
To build jsoncpp, see README.txt in the JSONCPP directory, but :
1/ Get scons-local (2.0.1 is OK) from http://www.scons.org/download.php
instead of the link in the README, then
extract scons-local into the jsoncpp directory as mentionned in the README
2/ To avoid LNK2005 errors when building VRPN, you will need to edit jsoncpp/Sconstruct
locate the section relative to your build environment, for instance :
elif platform == 'msvc90':
in this instruction block, replace the line :
env['CXXFLAGS']='xxxxxxx /MT'
by :
env['CXXFLAGS']='xxxxxxx /MD'
3/ To build with Visual Studio, run the Visual Studio command that configures environment variables
(on VS-2008-32, look for a file named vsvars32.bat), otherwise scons may not find the compiler
Then build, for instance with the command
c:\Python27\python.exe scons.py platform=msvc90
The values allowed for platform are
suncc vacpp mingw msvc6 msvc7 msvc71 msvc80 msvc90 linux-gcc
WARNING:
the JSONCPP build system builds a Release version. Using this release library with a
Debug VRPN server crashes.
To clean, use the command
c:\Python271\python.exe scons.py platform=msvc90 -c
Then, run CMAKE for VRPN, define VRPN_USE_JSONNET and JSONCPP_ROOT_DIR.
python_vrpn:
VRPN wrapped in Python using Swig. Works with Python 2.7.
python:
Hand-written Python classes that work with Python 2.7 and 3.2.
Compile the main library (ie.: root of VRPN) and the quat library. Then, go to the "python" folder. Before making the binary, you have to define the "PYTHON_VERSION" environment variable to the version of python you want to compile it for (ie.: "3.2", "2.7" ...). And you have to put the resulting vrpn.so shared library (found in $HW_OS/$PYTHON_VERSION) in the python module folder or in a path defined in the PYTHONPATH environment variable.
The "essai_*.py" are simple python files that show you how to use this module (the single difference is a call to python3.2 or python2.7 interpreter).
# - Print a developer warning, using author_warning if we have cmake 2.8
#
# warning_dev("your desired message")
#
# Original Author:
# 2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
function(warning_dev _yourmsg)
if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
# CMake version <2.8.0
message(STATUS
"The following is a developer warning - end users may ignore it")
message(STATUS "Dev Warning: ${_yourmsg}")
else()
message(AUTHOR_WARNING "${_yourmsg}")
endif()
endfunction()
This project is totally distinct from java_vrpn and the Vrpn server running on Android.
The Vrpn widgets for Android provide a set of Android Widgets that are bound to a Vrpn server. On the Android device, an application can be written mainly with Android XML layout, almost without Java coding. The documentation of the widgets is in android_widgets/vrpn_library/doc/
The Android application will send updates as UDP packets with a JSON payload to the vrpn_Tracker_JsonNet device. You need a VRPN server build with VRPN_USE_JSONNET and a vrpn.cfg file that declares a vrpn_Tracker_JsonNet device.
To build such a server you need JSONCPP. See README.jsoncpp for instructions about obtaining and building JSONCPP first, then use CMAKE to generate the VRPN project with VRPN_USE_JSONNET. You will need to define the JSONCPP_ROOT_DIR CMake variable.
Note :
the JSONNET server was built and tested only on Windows 7 32 bits, MSVC 2008
Philippe Crassous / Ensam ParisTech - Institut Image / 2011
p.crassous@free.fr
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="src" path="vrpn_library_src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>example_app</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>vrpn_library_src</name>
<type>2</type>
<locationURI>_android_vrpn_library_5bacf36/src</locationURI>
</link>
</linkedResources>
</projectDescription>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.app1"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:name="eu.ensam.ii.vrpn.VrpnApplication">
<activity android:name=".MainActivity" android:label="@string/app_name">
<intent-filter><action android:name="eu.ensam.ii.vrpn.STARTUI"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<data android:scheme="vrpn"></data>
</intent-filter><intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="8"></uses-sdk>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
\ No newline at end of file
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
android.library.reference.1=../vrpn_library/
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
src/vrpn/android_widgets/example_app/res/drawable-hdpi/icon.png

4.05 KiB

src/vrpn/android_widgets/example_app/res/drawable-ldpi/icon.png

1.68 KiB

src/vrpn/android_widgets/example_app/res/drawable-mdpi/icon.png

2.51 KiB