LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   compile omxplayer on rpi2 slackware (https://www.linuxquestions.org/questions/slackware-arm-108/compile-omxplayer-on-rpi2-slackware-4175560123/)

qjyao 11-29-2015 01:53 AM

compile omxplayer on rpi2 slackware
 
Since the slackbuid for omxplayer can not be accessed anymore, I decide to compile the omxplayer on my newly installed slackware-current on rpi2. There will come out various compiling error while tweaking the Makefile.include and Makefile.
On the slackware-current installation, you have to revise the /opt/vc/include/interface/vmcs_host/vcgencmd.h to solve #include "vchost_config.h" can not be found problem by adding the correct path like:"#include "interface/vmcs_host/linux/vchost_config.h". Also you need to copy the dbus-arch-deps.h from /usr/lib/dbus-1.0/include to /usr/include/dbus-1.0/dbus. The revised Makefile.include and Makefile is as following:

================ The revised Makefile.include ===============
USE_BUILDROOT=1
FLOAT=soft
#FLOAT=hard

ifeq ($(USE_BUILDROOT), 1)
BUILDROOT :=/
SDKSTAGE :=$(BUILDROOT)
TARGETFS :=$(BUILDROOT)/output/target
TOOLCHAIN :=$(BUILDROOT)/usr
HOST :=arm-slackware-linux-gnueabi
SYSROOT :=$(BUILDROOT)/usr/arm-slackware-linux-gnueabi
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 := -i$(PREFIX)/include
CXXFLAGS := $(CFLAGS)
CPPFLAGS := $(CFLAGS)
LDFLAGS := -L$(BUILDROOT)/lib
LD := $(TOOLCHAIN)/bin/$(HOST)-ld
CC := $(TOOLCHAIN)/bin/$(HOST)-gcc
CXX := $(TOOLCHAIN)/bin/$(HOST)-g++
#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)/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
CFLAGS += -pipe -mfloat-abi=$(FLOAT) -mcpu=cortex-a7 -fomit-frame-pointer -mabi=aapcs-linux -mtune=cortex-a7 -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 += -I$(SDKSTAGE)opt/vc/include -I$(SYSROOT)usr/include -I$(SDKSTAGE)opt/vc/include/interface/vcos/pthreads -Ipcre/build -Iboost-trunk -I /usr/include/freetype2
=====================End of reviesed Makefile.include =============

================ The revised Makefile ===============
include Makefile.include

CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST

LDFLAGS+=-L./ -L/usr/local/lib/ -lc -lWFC -lGLESv2 -lEGL -lbcm_host -lopenmaxil -lfreetype -lz -lbz2 -lOpenVG

INCLUDES+=-I./ -Ilinux -I/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include

DIST ?= omxplayer-dist

SRC=linux/XMemUtils.cpp \
utils/log.cpp \
DynamicDll.cpp \
utils/PCMRemap.cpp \
utils/RegExp.cpp \
OMXSubtitleTagSami.cpp \
OMXOverlayCodecText.cpp \
BitstreamConverter.cpp \
linux/RBP.cpp \
OMXThread.cpp \
OMXReader.cpp \
OMXStreamInfo.cpp \
OMXAudioCodecOMX.cpp \
OMXCore.cpp \
OMXVideo.cpp \
OMXAudio.cpp \
OMXClock.cpp \
File.cpp \
OMXPlayerVideo.cpp \
OMXPlayerAudio.cpp \
OMXPlayerSubtitles.cpp \
SubtitleRenderer.cpp \
Unicode.cpp \
Srt.cpp \
KeyConfig.cpp \
OMXControl.cpp \
Keyboard.cpp \
omxplayer.cpp \

OBJS+=$(filter %.o,$(SRC:.cpp=.o))

all: dist

%.o: %.cpp
@rm -f $@
$(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ -Wno-deprecated-declarations

omxplayer.o: help.h keys.h

version:
bash gen_version.sh > version.h

omxplayer.bin: version $(OBJS)
# $(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
$(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvcos -ldbus-1 -lrt -lpthread -lpcre `pkg-config --libs libavutil libavcodec libavformat libswscale libswresample` -lkhrn_static
# $(STRIP) omxplayer.bin

help.h: README.md Makefile
awk '/SYNOPSIS/{p=1;print;next} p&&/KEY BINDINGS/{p=0};p' $< \
| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
> $@
keys.h: README.md Makefile
awk '/KEY BINDINGS/{p=1;print;next} p&&/KEY CONFIG/{p=0};p' $< \
| sed -e '1,3 d' -e 's/^/"/' -e 's/$$/\\n"/' \
> $@

omxplayer.1: README.md
sed -e '/DOWNLOADING/,/omxplayer-dist/ d; /DBUS/,$$ d' $< >MAN
curl -F page=@MAN http://mantastic.herokuapp.com 2>/dev/null >$@

clean:
for i in $(OBJS); do (if test -e "$$i"; then ( rm $$i ); fi ); done
@rm -f omxplayer.old.log omxplayer.log
@rm -f omxplayer.bin
@rm -rf $(DIST)
@rm -f omxplayer-dist.tar.gz

ffmpeg:
@rm -rf ffmpeg
make -f Makefile.ffmpeg
make -f Makefile.ffmpeg install

dist: omxplayer.bin omxplayer.1
mkdir -p $(DIST)/usr/lib/omxplayer
mkdir -p $(DIST)/usr/bin
mkdir -p $(DIST)/usr/share/doc/omxplayer
mkdir -p $(DIST)/usr/share/man/man1
cp omxplayer omxplayer.bin $(DIST)/usr/bin
cp COPYING $(DIST)/usr/share/doc/omxplayer
cp README.md $(DIST)/usr/share/doc/omxplayer/README
cp omxplayer.1 $(DIST)/usr/share/man/man1
cp -a ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/omxplayer/
cd $(DIST); tar -czf ../$(DIST).tgz *

=====================End of reviesed Makefile =============

slacksam 12-25-2015 04:25 AM

Quote:

Originally Posted by qjyao
Since the slackbuid for omxplayer can not be accessed anymore[...]

Sorry for that.
The sources of the SlackBuild are now available on github:
https://github.com/Sammyboy/omxplayer-SlackBuild

qjyao 12-25-2015 10:45 PM

Thanks, This's really good news!

Geremia 04-18-2020 04:52 PM

Quote:

Originally Posted by slacksam (Post 5468742)
The sources of the SlackBuild are now available on github:
https://github.com/Sammyboy/omxplayer-SlackBuild

Thank you! I was able to get your script to build master on SARPi-current (without the in-house build of ffmpeg, though).
You should submit your SlackBuild script to SlackBuilds.org.


All times are GMT -5. The time now is 02:21 AM.