mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <post@lespocky.de>
To: PTXdist Developer Mailinglist <ptxdist@pengutronix.de>
Subject: [ptxdist] building OpenNI with ptxdist
Date: Thu, 19 Jan 2012 15:37:06 +0100	[thread overview]
Message-ID: <9aa177152ed039e1e18f4d7b6c2ebd6f@idefix.lespocky.dyndns.org> (raw)

[-- 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

             reply	other threads:[~2012-01-19 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 14:37 Alexander Dahl [this message]
2012-01-20  9:33 ` Alexander Dahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9aa177152ed039e1e18f4d7b6c2ebd6f@idefix.lespocky.dyndns.org \
    --to=post@lespocky.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox