xref: /OK3568_Linux_fs/external/mpp/build/linux/aarch64/make-Makefiles.bash (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/bash
2# Run this from within a bash shell
3
4set +e
5
6MPP_PWD=`pwd`
7MPP_TOP=${MPP_PWD}/../../..
8
9# toolchain detection
10check_cmd(){
11    "$@" >> /dev/null 2>&1
12}
13check_system_arm_linux_gcc(){
14    check_cmd aarch64-linux-gnu-gcc -v
15}
16
17check_system_arm_linux_gcc
18if [ $? -eq 127 ];then
19    MPP_TOOLCHAIN=/usr/bin
20    export PATH=$PATH:${MPP_TOOLCHAIN}
21fi
22
23# generate Makefile
24cmake -DCMAKE_BUILD_TYPE=Release \
25      -DCMAKE_TOOLCHAIN_FILE=./arm.linux.cross.cmake \
26      -DHAVE_DRM=ON \
27      -G "Unix Makefiles" \
28      ${MPP_TOP}
29