buildemotion.sh 2.99 KB
Newer Older
Thomas Guillem's avatar
Thomas Guillem committed
1 2 3 4
#!/bin/bash

SCRIPT=$(readlink -f "$0")
PROJECTPATH=$(dirname "$SCRIPT")
5 6 7 8

if [ "$BUILDCOMMONDONE" != 1 ]; then
    source ${PROJECTPATH}/buildcommon
fi
Thomas Guillem's avatar
Thomas Guillem committed
9 10 11 12 13 14 15

#########################
# FETCH EMOTION SOURCES #
#########################

if [ ! -d "${PROJECTPATH}/emotion" ]; then
    echo -e "\e[1m\e[32mEMOTION source not found, cloning\e[0m"
16
    git clone http://code.videolan.org/videolan/tizen_emotion.git "${PROJECTPATH}/emotion"
Thomas Guillem's avatar
Thomas Guillem committed
17 18 19 20 21 22 23 24 25 26 27 28 29
    checkfail "emotion source: git clone failed"
fi

###############################
# EMOTION CONFIGURE ARGUMENTS #
###############################
EMOTION_CONFIGURE_ARGS="\
    --enable-libvlc=static \
    --disable-emotion-test \
    --disable-doc \
    --disable-xine \
    --disable-generic \
    --disable-gstreamer \
30 31
    --enable-static \
    --disable-shared \
Thomas Guillem's avatar
Thomas Guillem committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
"

echo -e "\e[1m\e[36mCFLAGS:            ${CFLAGS}\e[0m"
echo -e "\e[1m\e[36mEXTRA_CFLAGS:      ${EXTRA_CFLAGS}\e[0m"

###########################
# Build buildsystem tools #
###########################

cd ${PROJECTPATH}/emotion

#############
# BOOTSTRAP #
#############

if [ ! -f configure ]; then
    echo -e "\e[1m\e[32mBootstraping\e[0m"
    NOCONFIGURE=1 ./autogen.sh
    checkfail "emotion: bootstrap failed"
fi

#############
# CONFIGURE #
#############

57 58 59 60 61 62
if [ "$RELEASE" = 1 ]; then
    EMOTION_BUILD_DIR=${PROJECTPATH}/emotion/build-tizen-${TARGET_TUPLE}-release
else
    EMOTION_BUILD_DIR=${PROJECTPATH}/emotion/build-tizen-${TARGET_TUPLE}
fi

63 64 65 66
EMOTION_PREFIX=${EMOTION_BUILD_DIR}/prefix
mkdir -p ${EMOTION_PREFIX}

cd ${EMOTION_BUILD_DIR}
Thomas Guillem's avatar
Thomas Guillem committed
67 68 69 70 71 72 73 74 75 76 77 78

if [ ! -e ./config.h -o "$RELEASE" = 1 ]; then
CPPFLAGS="$CPPFLAGS" \
CFLAGS="$CFLAGS ${EXTRA_CFLAGS}" \
CXXFLAGS="$CFLAGS ${EXTRA_CXXFLAGS}" \
LDFLAGS="$LDFLAGS" \
CC="${CROSS_COMPILE}gcc -fPIC --sysroot=${SYSROOT}" \
CXX="${CROSS_COMPILE}g++ -fPIC --sysroot=${SYSROOT} -D__cpp_static_assert=200410" \
NM="${CROSS_COMPILE}nm" \
STRIP="${CROSS_COMPILE}strip" \
RANLIB="${CROSS_COMPILE}ranlib" \
AR="${CROSS_COMPILE}ar" \
79 80 81 82 83 84
ECORE_X_CFLAGS="-I${TIZEN_INCLUDES}/ecore-1" \
ECORE_X_LIBS="-L${TIZEN_LIBS} -lecore_x" \
ECORE_FB_CFLAGS="-I${TIZEN_INCLUDES}/ecore-1" \
ECORE_FB_LIBS="-L${TIZEN_LIBS} -lecore_fb" \
EDJE_EXTERNAL_CFLAGS="-I${TIZEN_INCLUDES}/edje-1" \
EDJE_EXTERNAL_LIBS="-L${TIZEN_LIBS} -ledje" \
Thomas Guillem's avatar
Thomas Guillem committed
85 86
LIBVLC_CFLAGS="-I${PROJECTPATH}/vlc/include" \
LIBVLC_LIBS="-L${PROJECTPATH}/lib -lvlc" \
87 88
EMOTION_CFLAGS="-I${TIZEN_INCLUDES}/ecore-1 -I${TIZEN_INCLUDES}/evas-1 \
-I${TIZEN_INCLUDES}/eet-1 -I${TIZEN_INCLUDES}/eina-1 -I${TIZEN_INCLUDES}/eina-1/eina \
Thomas Guillem's avatar
Thomas Guillem committed
89
${LIBVLC_CFLAGS}" \
90
EMOTION_LIBS="-L${TIZEN_LIBS} -lecore -levas -leet -leina -lpthread -ltbm ${LIBVLC_LIBS}" \
Thomas Guillem's avatar
Thomas Guillem committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
sh ../configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux \
                ${EXTRA_PARAMS} ${EMOTION_CONFIGURE_ARGS} ${OPTS} \
                --prefix=${EMOTION_PREFIX}
checkfail "emotion: configure failed"
fi

############
# BUILDING #
############

echo -e "\e[1m\e[32mBuilding libemotion\e[0m"
make $MAKEFLAGS -C src install

checkfail "emotion: make failed"

106
cp -a ${EMOTION_PREFIX}/lib/libemotion.a ${PROJECTPATH}/lib
Thomas Guillem's avatar
Thomas Guillem committed
107 108

cd ../../