mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] rpi-userland cmake problems
@ 2013-10-12 21:48 Tim Sander
  2013-10-14  8:31 ` Alexander Dahl
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Sander @ 2013-10-12 21:48 UTC (permalink / raw)
  To: ptxdist

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

Hi

I am currently trying to package the rpi userland. Unfortunatly it seems that
the cmake opts are not used?

Any idea why that is?

The files are appended but the main lines are:
RPI_USERLAND_CONF_TOOL  := cmake
RPI_USERLAND_CONF_OPT   := $(CROSS_CMAKE_USR) -DVMCS_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_PREFIX=/usr

When looking at the CMakeCache.txt file in the -build directory it seems as if
the /usr path is not taken. Are there any debug flags to see the command
execution?

Best regards
Tim

[-- Attachment #2: rpi-userland.in --]
[-- Type: text/x-matlab, Size: 145 bytes --]

## SECTION=project_specific

config RPI_USERLAND
	bool
	prompt "rpi-userland"
	select HOST_CMAKE
	help
		ARM side libraries used on Raspberry Pi

[-- Attachment #3: rpi-userland.make --]
[-- Type: text/plain, Size: 2947 bytes --]

# -*-makefile-*-
#
# Copyright (C) 2013 by Tim Sander <tim@krieglstein.org>
#
# 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_RPI_USERLAND) += rpi-userland

#
# Paths and names
#
#RPI_USERLAND_VERSION	:= 8b271ac
#RPI_USERLAND_MD5		:= 23d2ed4cb9098e7d7968f3f83db3175c
RPI_USERLAND_VERSION	:= f65a4ee
RPI_USERLAND_MD5		:= 567ac5e022ed8e60335d203acd891dcf
RPI_USERLAND			:= rpi-userland-$(RPI_USERLAND_VERSION)
RPI_USERLAND_URL		:= http://github.com/raspberrypi/userland/tarball/$(RPI_USERLAND_VERSION)
RPI_USERLAND_DIR		:= $(BUILDDIR)/$(RPI_USERLAND)
RPI_USERLAND_SUFFIX		:= .tar.gz
RPI_USERLAND_SOURCE		:= $(SRCDIR)/$(RPI_USERLAND).$(RPI_USERLAND_SUFFIX)
RPI_USERLAND_LICENSE	:= BSD-3c

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

#$(RPI_USERLAND_SOURCE):
#	@$(call targetinfo)
#	@$(call get, RPI_USERLAND)

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

#RPI_USERLAND_CONF_ENV	:= $(CROSS_ENV)

#
# cmake
#
RPI_USERLAND_CONF_TOOL	:= cmake
RPI_USERLAND_CONF_OPT   := $(CROSS_CMAKE_USR) -DVMCS_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_PREFIX=/usr
#RPI_USERLAND_CONF_OPT   := $(CROSS_CMAKE_USR)

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

$(STATEDIR)/rpi-userland.targetinstall:
	@$(call targetinfo)

	@$(call install_init, rpi-userland)
	@$(call install_fixup, rpi-userland, PRIORITY, optional)
	@$(call install_fixup, rpi-userland, SECTION, base)
	@$(call install_fixup, rpi-userland, AUTHOR, "Tim Sander <tim@krieglstein.org>")
	@$(call install_fixup, rpi-userland, DESCRIPTION, missing)

	@for i in $(shell cd $(RPI_USERLAND_PKGDIR) && find bin sbin usr/bin usr/sbin -type f); do \
		$(call install_copy, rpi-userland, 0, 0, 0755, -, /$$i); \
	done
	@for i in $(shell cd $(RPI_USERLAND_PKGDIR) && find lib usr/lib -name "*.so*"); do \
		$(call install_copy, rpi-userland, 0, 0, 0644, -, /$$i); \
	done
	@links="$(shell cd $(RPI_USERLAND_PKGDIR) && find lib usr/lib -type l)"; \
	if [ -n "$$links" ]; then \
		for i in $$links; do \
			from="`readlink $(RPI_USERLAND_PKGDIR)/$$i`"; \
			to="/$$i"; \
			$(call install_link, rpi-userland, $$from, $$to); \
		done; \
	fi

	@$(call install_finish, rpi-userland)

	@$(call touch)

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

#$(STATEDIR)/rpi-userland.clean:
#	@$(call targetinfo)
#	@$(call clean_pkg, RPI_USERLAND)

# vim: syntax=make

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] rpi-userland cmake problems
  2013-10-12 21:48 [ptxdist] rpi-userland cmake problems Tim Sander
@ 2013-10-14  8:31 ` Alexander Dahl
  2013-10-15 21:38   ` [ptxdist] rpi-userland cmake problems solved next stop qt5 Tim Sander
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Dahl @ 2013-10-14  8:31 UTC (permalink / raw)
  To: ptxdist

Hei hei, 

Am 2013-10-12 23:48, schrieb Tim Sander:
> The files are appended but the main lines are:
> RPI_USERLAND_CONF_TOOL  := cmake
> RPI_USERLAND_CONF_OPT   := $(CROSS_CMAKE_USR)
> -DVMCS_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_PREFIX=/usr

Maybe the problem is double defining CMAKE_INSTALL_PREFIX which is
already set in $(CROSS_CMAKE_USR), see:

% ptxdist print CROSS_CMAKE_USR
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_TOOLCHAIN_FILE='[removed]'

It's some time ago, but I guess we had the same problem.
$(CROSS_CMAKE_USR) is set in rules/pre/Rules.make from line 241:

241 CROSS_CMAKE_USR  := \                                               
   
242     -DCMAKE_INSTALL_PREFIX=/usr \                                   
   
243     -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \                      
   
244     -DCMAKE_TOOLCHAIN_FILE='${PTXDIST_CMAKE_TOOLCHAIN_TARGET}'      
   

So what we do for our CMake based projects, if we want to change
CMAKE_INSTALL_PREFIX or CMAKE_BUILD_TYPE (changing the toolchain file
path makes no sense IMHO) we go like this:

 54 FOO_CONF_TOOL  := cmake                                             
  
 55 # this is $(CROSS_CMAKE_USR) but with adapted install prefix        
   
 56 FOO_CONF_OPT       := \                                             
  
 57     -DCMAKE_INSTALL_PREFIX=$(PTXCONF_FOO_PREFIX) \                  
 58     -DCMAKE_BUILD_TYPE:STRING=$(PTXCONF_FOO_BUILD_TYPE) \           
             
 59     -DCMAKE_TOOLCHAIN_FILE='${PTXDIST_CMAKE_TOOLCHAIN_TARGET}'      
   

And then FOO_CONF_OPT += -DANYTHING=foo

PTXCONF_FOO_PREFIX and PTXCONF_FOO_BUILD_TYPE are more or less defined
in rules/foo.in and the comment is to remind we are overwriting ptxdist
defaults here. So what we actually do is not using CROSS_CMAKE_USR but
redefining the three variables it would set.

Greets
Alex

-- 
»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] 3+ messages in thread

* Re: [ptxdist] rpi-userland cmake problems solved next stop qt5
  2013-10-14  8:31 ` Alexander Dahl
@ 2013-10-15 21:38   ` Tim Sander
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Sander @ 2013-10-15 21:38 UTC (permalink / raw)
  To: ptxdist

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

Hi Alex

Thanks for your hints! 
It worked out but i also had to patch out a "force" keyword overwriting 
any settings. The files are attached to make search engine users happy.

No i would like to compile qt5 with that but somehow i got the paths wrong:
wrapper: Bad search path in:
arm-1136jfs-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=softfp -O2 -Wall -W -fPIE -I/bulk/baustelle/raspberry/DistroKit/platform-pengutronix-raspberrypi/build-target/qt-everywhere-opensource-src-5.1.1/qtbase/mkspecs/devices/linux-rasp-pi-g++ -I/bulk/baustelle/raspberry/DistroKit/platform-pengutronix-raspberrypi/build-target/qt-everywhere-opensource-src-5.1.1/qtbase/config.tests/unix/opengles2 -I/bulk/baustelle/raspberry/DistroKit/platform-pengutronix-raspberrypi/sysroot-target/usr/include -I/usr/include -I/usr/include/interface/vcos/pthreads -I/usr/include/interface/vmcs_host/linux -I. -o opengles2.o /bulk/baustelle/raspberry/DistroKit/platform-pengutronix-raspberrypi/build-target/qt-everywhere-opensource-src-5.1.1/qtbase/config.tests/unix/opengles2/opengles2.cpp

The wrapper thing is s.th. relativly new in ptxdist as far as i recall. 
So which search pathes are bad for the wrapper?

Best regards
Tim

[-- Attachment #2: rpi-userland.in --]
[-- Type: text/x-matlab, Size: 145 bytes --]

## SECTION=project_specific

config RPI_USERLAND
	bool
	prompt "rpi-userland"
	select HOST_CMAKE
	help
		ARM side libraries used on Raspberry Pi

[-- Attachment #3: rpi-userland.make --]
[-- Type: text/plain, Size: 3040 bytes --]

# -*-makefile-*-
#
# Copyright (C) 2013 by Tim Sander <tim@krieglstein.org>
#
# 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_RPI_USERLAND) += rpi-userland

#
# Paths and names
#
#RPI_USERLAND_VERSION	:= 8b271ac
#RPI_USERLAND_MD5		:= 23d2ed4cb9098e7d7968f3f83db3175c
RPI_USERLAND_VERSION	:= f65a4ee
RPI_USERLAND_MD5		:= 567ac5e022ed8e60335d203acd891dcf
RPI_USERLAND			:= rpi-userland-$(RPI_USERLAND_VERSION)
RPI_USERLAND_URL		:= http://github.com/raspberrypi/userland/tarball/$(RPI_USERLAND_VERSION)
RPI_USERLAND_DIR		:= $(BUILDDIR)/$(RPI_USERLAND)
RPI_USERLAND_SUFFIX		:= .tar.gz
RPI_USERLAND_SOURCE		:= $(SRCDIR)/$(RPI_USERLAND).$(RPI_USERLAND_SUFFIX)
RPI_USERLAND_LICENSE	:= BSD-3c

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

#$(RPI_USERLAND_SOURCE):
#	@$(call targetinfo)
#	@$(call get, RPI_USERLAND)

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

#RPI_USERLAND_CONF_ENV	:= $(CROSS_ENV)

#
# cmake
#
RPI_USERLAND_CONF_TOOL	:= cmake
RPI_USERLAND_CONF_OPT   := \
	-DVMCS_INSTALL_PREFIX=/usr\
	-DCMAKE_INSTALL_PREFIX=/usr\
	-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
	-DCMAKE_TOOLCHAIN_FILE='${PTXDIST_CMAKE_TOOLCHAIN_TARGET}' 

#RPI_USERLAND_CONF_OPT   := $(CROSS_CMAKE_USR)

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

$(STATEDIR)/rpi-userland.targetinstall:
	@$(call targetinfo)

	@$(call install_init, rpi-userland)
	@$(call install_fixup, rpi-userland, PRIORITY, optional)
	@$(call install_fixup, rpi-userland, SECTION, base)
	@$(call install_fixup, rpi-userland, AUTHOR, "Tim Sander <tim@krieglstein.org>")
	@$(call install_fixup, rpi-userland, DESCRIPTION, missing)

	@for i in $(shell cd $(RPI_USERLAND_PKGDIR) && find bin sbin usr/bin usr/sbin -type f); do \
		$(call install_copy, rpi-userland, 0, 0, 0755, -, /$$i); \
	done
	@for i in $(shell cd $(RPI_USERLAND_PKGDIR) && find lib usr/lib -name "*.so*"); do \
		$(call install_copy, rpi-userland, 0, 0, 0644, -, /$$i); \
	done
	@links="$(shell cd $(RPI_USERLAND_PKGDIR) && find lib usr/lib -type l)"; \
	if [ -n "$$links" ]; then \
		for i in $$links; do \
			from="`readlink $(RPI_USERLAND_PKGDIR)/$$i`"; \
			to="/$$i"; \
			$(call install_link, rpi-userland, $$from, $$to); \
		done; \
	fi

	@$(call install_finish, rpi-userland)

	@$(call touch)

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

#$(STATEDIR)/rpi-userland.clean:
#	@$(call targetinfo)
#	@$(call clean_pkg, RPI_USERLAND)

# vim: syntax=make

[-- Attachment #4: 0001-add-pkgconfig-files.patch --]
[-- Type: text/x-patch, Size: 1997 bytes --]

Add .pc files for the OpenGLESv2 and EGL libraries

Those pkg-config files make it easier for Qt5 to find those libraries
and the appropriate link flags.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Index: b/interface/khronos/egl/egl.pc.in
===================================================================
--- /dev/null
+++ b/interface/khronos/egl/egl.pc.in
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: egl
+Description: RasberryPi implementation of EGL
+Version: 1.0
+Libs: -L${libdir} -lEGL -lGLESv2 -lbcm_host
+Cflags: -I${includedir}/ -I${includedir}/interface/vcos/pthreads/ \
+        -I${includedir}/interface/vmcs_host/linux/
Index: b/interface/khronos/CMakeLists.txt
===================================================================
--- a/interface/khronos/CMakeLists.txt
+++ b/interface/khronos/CMakeLists.txt
@@ -73,3 +73,11 @@
 
 install(TARGETS EGL GLESv2 OpenVG WFC khrn_client DESTINATION lib)
 install(TARGETS EGL_static GLESv2_static khrn_static DESTINATION lib)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/egl/egl.pc.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/egl/egl.pc" @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/egl/egl.pc"
+  DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/glxx/glesv2.pc.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/glxx/glesv2.pc" @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glxx/glesv2.pc"
+  DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
Index: b/interface/khronos/glxx/glesv2.pc.in
===================================================================
--- /dev/null
+++ b/interface/khronos/glxx/glesv2.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: glesv2
+Description: RasberryPi implementation of OpenGL ESv2
+Version: 2.0
+Libs: -L${libdir} -lGLESv2
+Cflags: -I${includedir}/

[-- Attachment #5: series --]
[-- Type: text/plain, Size: 73 bytes --]

0001-add-pkgconfig-files.patch
0002-remove-force-from-path-setting.patch

[-- Attachment #6: 0002-remove-force-from-path-setting.patch --]
[-- Type: text/x-patch, Size: 604 bytes --]

--- rpi-userland-f65a4ee/makefiles/cmake/vmcs.cmake.orig	2013-10-14 23:22:24.043541066 +0200
+++ rpi-userland-f65a4ee/makefiles/cmake/vmcs.cmake	2013-10-14 23:23:31.263540835 +0200
@@ -10,7 +10,7 @@
 if (ANDROID)
   SET(VMCS_INSTALL_PREFIX "/vendor/brcm/islands" CACHE PATH "Prefix prepended to install directories" FORCE)
 else()
-  SET(VMCS_INSTALL_PREFIX "/opt/vc" CACHE PATH "Prefix prepended to install directories" FORCE)
+  SET(VMCS_INSTALL_PREFIX "/opt/vc" CACHE PATH "Prefix prepended to install directories")
 endif()
 
 SET(CMAKE_INSTALL_PREFIX "${VMCS_INSTALL_PREFIX}" CACHE INTERNAL "Prefix

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

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2013-10-15 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-12 21:48 [ptxdist] rpi-userland cmake problems Tim Sander
2013-10-14  8:31 ` Alexander Dahl
2013-10-15 21:38   ` [ptxdist] rpi-userland cmake problems solved next stop qt5 Tim Sander

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