mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] building OpenNI with ptxdist
@ 2012-01-19 14:37 Alexander Dahl
  2012-01-20  9:33 ` Alexander Dahl
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Dahl @ 2012-01-19 14:37 UTC (permalink / raw)
  To: PTXdist Developer Mailinglist

[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]

Hei hei, 

currently I'm working on building OpenNI [1] with ptxdist. I take the
source from GitHub [2] and try writing an appropriate rules/openni.make
– however this is not as easy as it seems. :(

OpenNI does not use standard tools like autotools or cmake for
uncomplicated cross compiling but some hand written Makefile. They have
a very short section in their README how to cross compile:
https://github.com/OpenNI/OpenNI/blob/master/README

For doing this without ptxdist I create a folder ~/build/sysroot and
tried cross compiling. Doing it like in the README this results in an
error stating 'unistd.h' is not found. If I copy the content of
/opt/OSELAS.Toolchain-2011.03.0/arm-v5te-linux-gnueabi/gcc-4.5.2-glibc-2.13-binutils-2.21-kernel-2.6.36-sanitized/sysroot-arm-v5te-linux-gnueabi
to ~/build/sysroot/ first, compiling succeeds (after manually cross
compiling libusb and installing it to ~/build/sysroot).

In ptxdist compiling fails with the same error, the unistd.h is not
found. There's none in my BSP in platform-at91.../sysroot-target – I
guess all the other packages are able to find these libc include files
somewhere else, maybe in the same subfolder of the toolchain. I assume I
should not copy these files to sysroot-target and I should also not let
the openni Makefile install stuff in my toolchain.

The Makefile of OpenNI can be found at [3] but I'll also attach how far
I got with my rule files.

I tried finding out how autotools or cmake generate their Makefiles or
what ptxdist calls in the compile stage so other packages find their
stuff, but this is horribly complex. :-/

Maybe someone has a hint how to pass some parameter or patch the
Makefile? I guess it lacks on some understanding of cross-compiling
here. O:-)
Alex

[1] http://www.openni.org/
[2] https://github.com/OpenNI/OpenNI
[3]
https://github.com/OpenNI/OpenNI/blob/master/Platform/Linux/Build/Makefile

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***

[-- Attachment #2: openni.in --]
[-- Type: text/plain, Size: 517 bytes --]

## SECTION=project_specific

config OPENNI
	tristate
	select LIBUSB
	prompt "openni"
	help
	  The OpenNI framework provides an application programming interface
	  (API) for writing applications utilizing natural interaction. This
	  API covers communication with both low level devices (e.g. vision
	  and audio sensors), as well as high-level middleware solutions
	  (e.g. for visual tracking using computer vision).

	  See http://www.openni.org/ and https://github.com/OpenNI/OpenNI

# vim: ft=kconfig noet tw=72

[-- Attachment #3: openni.make --]
[-- Type: text/plain, Size: 3037 bytes --]

# -*-makefile-*-
#
# Copyright (C) 2012 by Alexander Dahl <post@lespocky.de>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_OPENNI) += openni

#
# Paths and names
#
OPENNI_VERSION	:= 1.5.2.23
OPENNI_MD5		:= 12389c56bf3685a741f6bcfa068585ff
OPENNI			:= openni-$(OPENNI_VERSION)
OPENNI_SUFFIX	:= tar.gz
OPENNI_URL		:= https://github.com/OpenNI/OpenNI/tarball/Stable-$(OPENNI_VERSION)
OPENNI_SOURCE	:= $(SRCDIR)/$(OPENNI).$(OPENNI_SUFFIX)
OPENNI_DIR		:= $(BUILDDIR)/$(OPENNI)
OPENNI_LICENSE	:= unknown

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

#$(OPENNI_SOURCE):
#	@$(call targetinfo)
#	@$(call get, OPENNI)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

#OPENNI_CONF_ENV	:= $(CROSS_ENV)

#
# autoconf
#
OPENNI_CONF_TOOL	:= NO
#OPENNI_CONF_OPT	:= $(CROSS_AUTOCONF_USR)

#$(STATEDIR)/openni.prepare:
#	@$(call targetinfo)
#	@$(call clean, $(OPENNI_DIR)/config.cache)
#	cd $(OPENNI_DIR) && \
#		$(OPENNI_PATH) $(OPENNI_ENV) \
#		./configure $(OPENNI_CONF_OPT)
#	@$(call touch)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------
OPENNI_MAKE_ENV	:= $(CROSS_ENV)
OPENNI_MAKE_ENV += ARM_CXX=$(CROSS_CXX)
OPENNI_MAKE_ENV += ARM_STAGING=$(PTXDIST_SYSROOT_TARGET)

OPENNI_MAKE_OPT += PLATFORM=Arm

$(STATEDIR)/openni.compile:
	@$(call targetinfo)
	cd $(OPENNI_DIR)/Platform/Linux/Build && $(OPENNI_MAKE_ENV) $(MAKE) $(OPENNI_MAKE_OPT) core
	@$(call touch)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

#$(STATEDIR)/openni.install:
#	@$(call targetinfo)
#	@$(call world/install, OPENNI)
#	@$(call touch)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/openni.targetinstall:
	@$(call targetinfo)

	@$(call install_init, openni)
	@$(call install_fixup, openni,PRIORITY,optional)
	@$(call install_fixup, openni,SECTION,base)
	@$(call install_fixup, openni,AUTHOR,"Alexander Dahl <post@lespocky.de>")
	@$(call install_fixup, openni,DESCRIPTION,missing)

	@$(call install_copy, openni, 0, 0, 0755, $(OPENNI_DIR)/foobar, /dev/null)

	@$(call install_finish, openni)

	@$(call touch)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

#$(STATEDIR)/openni.clean:
#	@$(call targetinfo)
#	@$(call clean_pkg, OPENNI)

# vim: ft=make noet

[-- Attachment #4: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] building OpenNI with ptxdist
  2012-01-19 14:37 [ptxdist] building OpenNI with ptxdist Alexander Dahl
@ 2012-01-20  9:33 ` Alexander Dahl
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Dahl @ 2012-01-20  9:33 UTC (permalink / raw)
  To: ptxdist

Some progress on this topic:

Am 19.01.2012 15:37, schrieb Alexander Dahl:
> For doing this without ptxdist I create a folder ~/build/sysroot and
> tried cross compiling. Doing it like in the README this results in an
> error stating 'unistd.h' is not found. If I copy the content of
> /opt/OSELAS.Toolchain-2011.03.0/arm-v5te-linux-gnueabi/gcc-4.5.2-glibc-2.13-binutils-2.21-kernel-2.6.36-sanitized/sysroot-arm-v5te-linux-gnueabi
> to ~/build/sysroot/ first, compiling succeeds (after manually cross
> compiling libusb and installing it to ~/build/sysroot).

I asked on the OpenNI mailing list [1] and it seems this will get ugly
because of patching their Makefiles with fixed path to the toolchain
lets my hackles raise. I guess there's no way of »dynamic patching«
depending on environmental things, I would have to hack something in the
extract rule maybe to not have fixed pathes in my patches. 

To make a long story short, I'll see if the OpenNI community has
further ideas how to build this before starting a rant of using a cross
compile aware build system. ;)

Greets
Alex

[1]
https://groups.google.com/group/openni-dev/browse_thread/thread/7a9d1afc8c7cfbd1

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-20  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19 14:37 [ptxdist] building OpenNI with ptxdist Alexander Dahl
2012-01-20  9:33 ` Alexander Dahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox