Skip to content

Commit

Permalink
Introduce possibility for crossbuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
rellla committed Nov 25, 2014
1 parent 2de9c5a commit e7734d7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 8 deletions.
53 changes: 53 additions & 0 deletions Make.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# User defined Makefile options for the Video Disk Recorder
#
# Copy this file to 'Make.config' and change the parameters as necessary.
#
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Make.config.template 3.0 2013/02/18 10:55:39 kls Exp $

### The C compiler and options:

CC = gcc
CFLAGS = -g -O3 -Wall

CXX = g++
CXXFLAGS = -g -O3 -Wall -Werror=overloaded-virtual -Wno-parentheses

### Set Flags for Cortex-A8 platform
CPUOPT = armv7l
CFLAGS = -pipe -O2 -mfloat-abi=hard -mtune=cortex-a8 -D__ARM_NEON__ -mfpu=neon -march=armv7-a -fPIC -Werror=overloaded-virtual -Wno-parentheses -fsigned-char

### Set environment for crosscompiling
HOST=arm-linux-gnueabihf

ifeq ($(shell uname -m),armv7l)
BUILD=arm-linux-gnueabihf
CROSS_COMPILE=
TOOLCHAIN = /usr/lib
else
BUILD = amd64-linux
CROSS_COMPILE = ${HOST}-
TOOLCHAIN = /usr/lib/${HOST}
DESTDIR = $(BASEDIR)/export
endif

export CFLAGS+=${LDFLAGS}
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=${CFLAGS}
export LD=${CROSS_COMPILE}ld
export AR=${CROSS_COMPILE}ar
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export CXXCPP=${CXX} -E
export RANLIB=${CROSS_COMPILE}ranlib
export STRIP=${CROSS_COMPILE}strip
export OBJDUMP=${CROSS_COMPILE}objdump

### The directory environment:

# Default directories (adjust as necessary or desired):

PREFIX = /usr/local
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
include Make.config

TARGET = libvdpau_sunxi.so.1
SRC = device.c presentation_queue.c surface_output.c surface_video.c \
surface_bitmap.c video_mixer.c decoder.c handles.c ve.c \
h264.c mpeg12.c mpeg4.c rgba.c tiled_yuv.S
CFLAGS = -Wall -O3
LDFLAGS =
LIBS = -lrt -lm -lX11 -lpthread
CC = gcc
CFLAGS ?= -Wall -O3
LDFLAGS ?=
LIBS ?= -lrt -lm -lX11 -lpthread
CC ?= gcc

MAKEFLAGS += -rR --no-print-directory

DEP_CFLAGS = -MD -MP -MQ $@
LIB_CFLAGS = -fpic -fvisibility=hidden
LIB_LDFLAGS = -shared -Wl,-soname,$(TARGET)
DEP_CFLAGS ?= -MD -MP -MQ $@
LIB_CFLAGS ?= -fpic -fvisibility=hidden
LIB_LDFLAGS ?= -shared -Wl,-soname,$(TARGET)

OBJ = $(addsuffix .o,$(basename $(SRC)))
DEP = $(addsuffix .d,$(basename $(SRC)))

MODULEDIR = $(shell pkg-config --variable=moduledir vdpau)
MODULEDIR = $(shell export PKG_CONFIG_PATH=${TOOLCHAIN}/pkgconfig; pkg-config --variable=moduledir vdpau)

ifeq ($(MODULEDIR),)
MODULEDIR=/usr/lib/vdpau
Expand Down

0 comments on commit e7734d7

Please sign in to comment.