如何在Ubuntu 11.10上交叉编译OMXPlayer

时间:2013-11-28 06:33:57

标签: cmake arm cross-compiling ubuntu-11.10

我正在尝试为我的raspi安装omxplayer,但因为它太慢了,我希望在我的Ubuntu 11.10桌面上进行。我按照here描述的设置交叉编译器的说明(注意,crosstools对我不起作用)。它提到了如何运行它:

  

现在你应该能够编译cmake程序就像使用这个额外的标志-D CMAKE_TOOLCHAIN_FILE=$HOME/raspberrypi/pi.cmake

执行cmake一样简单

但这对我没用,因为我从未使用cmake。如果我有这样的标准安装:

./configure
make
make install

-D CMAKE_TOOLCHAIN_FILE=$HOME/raspberrypi/pi.cmake适合所有这些?我是否只将make的出现更改为cmake = P我希望人们在回答这些问题时会考虑我们noob程序员。这张海报让我的血液沸腾了response。我已经包含了omxplayer Makefile.include文件,我认为这是我必须进行一些重大更改的地方,以及我的交叉汇编.cmake文件,有人可以向我描述我必须做出哪些更改和它们如何相互对应。

Makefile.include:

USE_BUILDROOT=0
FLOAT=hard

ifeq ($(USE_BUILDROOT), 1)
BUILDROOT   :=/opt/xbmc-bcm/buildroot
SDKSTAGE    :=$(BUILDROOT)/output/staging
TARGETFS    :=$(BUILDROOT)/output/target
TOOLCHAIN   :=$(BUILDROOT)/output/host/usr/
HOST            :=arm-unknown-linux-gnueabi
SYSROOT     :=$(BUILDROOT)/output/host/usr/arm-unknown-linux-gnueabi/sysroot
else
BUILDROOT   :=/opt/bcm-rootfs
SDKSTAGE    :=/opt/bcm-rootfs
TARGETFS    :=/opt/bcm-rootfs
TOOLCHAIN   :=/home/dc4/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/
HOST        :=arm-linux-gnueabihf
#SYSROOT        :=$(TOOLCHAIN)/arm-bcm2708hardfp-linux-gnueabi/sysroot
SYSROOT     :=/opt/bcm-rootfs
endif

JOBS=7

CFLAGS          := -isystem$(PREFIX)/include
CXXFLAGS        := $(CFLAGS)
CPPFLAGS        := $(CFLAGS)
LDFLAGS         := -L$(BUILDROOT)/lib
LD                  := $(TOOLCHAIN)/bin/$(HOST)-ld --sysroot=$(SYSROOT)
CC                  := $(TOOLCHAIN)/bin/$(HOST)-gcc --sysroot=$(SYSROOT)
CXX         := $(TOOLCHAIN)/bin/$(HOST)-g++ --sysroot=$(SYSROOT)
OBJDUMP         := $(TOOLCHAIN)/bin/$(HOST)-objdump
RANLIB          := $(TOOLCHAIN)/bin/$(HOST)-ranlib
STRIP               := $(TOOLCHAIN)/bin/$(HOST)-strip
AR                  := $(TOOLCHAIN)/bin/$(HOST)-ar
CXXCP           := $(CXX) -E
PATH                := $(PREFIX)/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH)

CFLAGS          += -pipe -mfloat-abi=$(FLOAT) -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapcs-linux -mtune=arm1176jzf-s -mfpu=vfp -Wno-psabi -mno-apcs-stack-check -g -mstructure-size-boundary=32 -mno-sched-prolog
LDFLAGS         += -L$(SDKSTAGE)/lib -L$(SDKSTAGE)/usr/lib -L$(SDKSTAGE)/opt/vc/lib/ -Lpcre/build
#INCLUDES       += -isystem$(SDKSTAGE)/usr/include -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -isystem$(SDKSTAGE)/usr/include/freetype2
INCLUDES        += -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SYSROOT)/usr/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads -Ipcre/build -Iboost-trunk -Ifreetype2/include

raspi.cmake:

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER /mnt/UEF/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /mnt/UEF/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++)
SET(CMAKE_FIND_ROOT_PATH /mnt/UEF/rootfs)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

2 个答案:

答案 0 :(得分:1)

使用Openembedded for Omxplayer进行编译,这是编译内容的最简单方法,而不必过多担心标记设置。

meta-raspberrypi可在https://github.com/martiert/meta-raspberrypi找到。

了解OE的一些基础知识然后开始工作。

为了在我现有的项目中变得简单,我尝试了它并且我已经成功了。

设置配置后运行make omxplayer。

否则如果你在OE中不够好只是试着理解bb文件omxplayer

http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/recipes-multimedia/omxplayer/omxplayer_git.bb?h=master

并尝试通过检查依赖项单独交叉编译

<强> ADDITION 如果您不熟悉开放式嵌入式转到BUildroot它更容易OE

git clone https://github.com/nezticle/RaspberryPi-BuildRoot.git

cd RaspberryPi-BuildRoot

make raspberrypi_defconfig

make menuconfig

这里位置:│
  │ - &gt;目标包的选择│
  │ - &gt; Raspberry Pi

此处将启用omxplayer

然后终于

make

生成的包将位于输出文件夹

答案 1 :(得分:0)

omxplayer是否有CMakeLists.txt?

然后运行:

cd omxplayer
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/raspberrypi/pi.cmake
make
make install

没有配置,没有Makefile hackery。