嵌入式爱好者

查看: 3448|回复: 3

madplay 移植最后一步出错!求指教

[复制链接]
alove110 该用户已被删除
发表于 2012-3-30 11:12:03 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

chenweixin 该用户已被删除
发表于 2012-6-21 21:34:32 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
点评回复 支持 反对

使用道具 举报

13

主题

75

帖子

368

积分

发表于 2012-6-25 17:14:17 | 显示全部楼层
给你一个我写的,用来下载,交叉编译libmad,mplayer的脚本。关于我们,请参考:
http://mcuos.com/thread-7178-1-1.html

[guowenxue@centos6 systools]$ cat mplayer/build.sh
#!/bin/sh

#+--------------------------------------------------------------------------------------------
#|Description:  This shell script used to download file source code and cross compile it.
#|     Author:  GuoWenxue <武汉凌云嵌入式大学生学习辅导 guowenxue@gmail.com QQ:281143292>
#|  ChangeLog:
#|           1, Initialize 1.0.0 on 2012.03.28
#+--------------------------------------------------------------------------------------------

PRJ_PATH=`pwd`

if [ -z "$INST_PATH" ] ; then
    INST_PATH=${PRJ_PATH}/install
fi

if [ ! -d $INST_PATH ] ; then
    mkdir -p $INST_PATH
fi

ARCH=arm920t

if [ -z "$ARCH" -a $# -gt 0 ] ; then
   ARCH=$1
fi

sup_arch=("" "arm926t" "arm920t" )

function select_arch()
{
   echo "Current support ARCH: "
   i=1
   len=${#sup_arch
  • }

       while [ $i -lt $len ]; do
         echo "$i: ${sup_arch[$i]}"
         let i++;
       done

       echo "Please select: "
       index=
       read index
       ARCH=${sup_arch[$index]}
    }


    function decompress_packet()
    (
       echo "+---------------------------------------------+"
       echo "|  Decompress $1 now"  
       echo "+---------------------------------------------+"

        ftype=`file "$1"`
        case "$ftype" in
           "$1: Zip archive"*)
               unzip "$1" ;;
           "$1: gzip compressed"*)
               if [ 0 != `expr "$1" : ".*.tar.*" ` ] ; then
                   tar -xzf $1
               else
                   gzip -d "$1"
               fi ;;
           "$1: bzip2 compressed"*)
               if [ 0 != `expr "$1" : ".*.tar.*" ` ] ; then
                   tar -xjf $1
               else
                   bunzip2 "$1"
               fi ;;
           "$1: POSIX tar archive"*)
               tar -xf "$1" ;;
           *)
              echo "$1 is unknow compress format";;
        esac
    )


    if [ -z "$CROSS" ] ; then
       if [ -z $ARCH ] ; then
          select_arch
       fi
       CROSS="/opt/buildroot-2011.11/${ARCH}/usr/bin/arm-linux-"
    fi

    CROSS_PATH=`dirname $CROSS`
    export PATH=${CROSS_PATH}:$PATH
    export CC=${CROSS}gcc
    export CXX=${CROSS}g++
    export AR=${CROSS}ar
    export AS=${CROSS}as
    export LD=${CROSS}ld
    export NM=${CROSS}nm
    export RANLIB=${CROSS}ranlib
    export STRIP=${CROSS}strip

    LIBMAD_NAME=libmad-0.15.1b
    LIBMAD_DL_ADDR=ftp://ftp.mars.org/pub/mpeg/$LIBMAD_NAME.tar.gz
    if [ ! -d ${INST_PATH}/libmad/include ]; then

        echo "+------------------------------------------------------------------+"
        echo "|          Build libmad(MPEG Audio Decoder) for $ARCH "
        echo "| Crosstool:  $CROSS"
        echo "+------------------------------------------------------------------+"

        if [ ! -s $LIBMAD_NAME.tar.gz ] ; then
            wget $LIBMAD_DL_ADDR
        fi

        decompress_packet $LIBMAD_NAME.tar.gz
        cd $LIBMAD_NAME
        ./configure --enable-fpm=arm --host=arm-linux --disable-shared \
        --disable-debugging --prefix=$INST_PATH/libmad CC=${CC}

        #Modify the Makefile to fix the cross compiler bug
        sed -i -e 's/-fforce-mem//' Makefile

        make && make install

        cd -
    fi

    MADID3_NAME=libid3tag-0.15.1b
    MADID3_DL_ADDR=ftp://ftp.mars.org/pub/mpeg/$MADID3_NAME.tar.gz
    if [ ! -d ${INST_PATH}/madid3 ]; then

        echo "+------------------------------------------------------------------+"
        echo "|          Build madid3(MPEG Audio Decoder) for $ARCH "
        echo "| Crosstool:  $CROSS"
        echo "+------------------------------------------------------------------+"

        if [ ! -s $MADID3_NAME.tar.gz ] ; then
            wget $MADID3_DL_ADDR
        fi

        decompress_packet $MADID3_NAME.tar.gz
        cd $MADID3_NAME
        ./configure --host=arm-linux --prefix=$INST_PATH/madid3 --disable-shared --disable-debugging \
        CFLAGS=-I${INST_PATH}/libmad/include LDFLAGS=-L${INST_PATH}/libmad/lib CC=${CC}

        #Modify the Makefile to fix the cross compiler bug
        sed -i -e 's/-fforce-mem//' Makefile

        make && make install

        cd -
    fi

    MADPLAY_NAME=madplay-0.15.2b
    MADPLAY_DL_ADDR=ftp://ftp.mars.org/pub/mpeg/$MADPLAY_NAME.tar.gz
    if [ ! -d ${INST_PATH}/madplay ]; then

        echo "+------------------------------------------------------------------+"
        echo "|          Build madplay(MPEG Audio Decoder Player) for $ARCH "
        echo "| Crosstool:  $CROSS"
        echo "+------------------------------------------------------------------+"

        if [ ! -s $MADPLAY_NAME.tar.gz ] ; then
            wget $MADPLAY_DL_ADDR
        fi

        decompress_packet $MADPLAY_NAME.tar.gz
        cd $MADPLAY_NAME
        ./configure --host=arm-linux --prefix=$INST_PATH/madplay --disable-shared --disable-debugging \
        CFLAGS="-I${INST_PATH}/libmad/include -I${INST_PATH}/madid3/include " \
        LDFLAGS="-L${INST_PATH}/libmad/lib -L${INST_PATH}/madid3/lib" CC=${CC}

        #Modify the Makefile to fix the cross compiler bug
        sed -i -e 's/-fforce-mem//' Makefile

        make && make install

        cd -
    fi

    APP_NAME="MPlayer-1.0rc3"
    PACK_SUFIX="tar.bz2"
    DL_ADDR="http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc3.tar.bz2"

    echo "+------------------------------------------------------------------+"
    echo "|          Build $APP_NAME for $ARCH "
    echo "| Crosstool:  $CROSS"
    echo "+------------------------------------------------------------------+"

    # Download source code packet
    if [ ! -s $APP_NAME.$PACK_SUFIX ] ; then
       echo "+------------------------------------------------------------------+"
       echo "|  Download $APP_NAME.$PACK_SUFIX  now "  
       echo "+------------------------------------------------------------------+"

       wget $DL_ADDR
    fi

    # Decompress source code packet
    if [ -d $APP_NAME ] ; then
        rm -rf $APP_NAME
    fi
    decompress_packet $APP_NAME.$PACK_SUFIX


    cd $APP_NAME

    #Modify the source code to fix the build bug
    FILE=libmpeg2/motion_comp_arm_s.S
    line=`sed -n '/.text/=' $FILE`
    line=`expr $line - 1`
    sed -i -e `expr $line`a"#ifndef HAVE_PLD" $FILE
    sed -i -e `expr $line + 1`a"    .macro pld reg" $FILE
    sed -i -e `expr $line + 2`a"    .endm" $FILE
    sed -i -e `expr $line + 3`a"#endif" $FILE

    ./configure --prefix=$INST_PATH/mplayer --cc=arm-linux-gcc  --ar=arm-linux-ar  \
    --ranlib=arm-linux-ranlib --disable-gui   \
    --target=arm-armv4-linux --host-cc=gcc  --disable-freetype\
    --enable-fbdev --disable-mencoder --disable-sdl --disable-live  --disable-dvdread \
    --disable-libdvdcss-internal --disable-x11 --enable-cross-compile  --disable-mp3lib \
    --enable-ass  \
    --disable-dvdnav  --disable-dvdread-internal    --disable-jpeg --disable-tga \
    --disable-dvbhead --disable-pnm --disable-tv --disable-ivtv \
    --disable-fontconfig --disable-xanim --disable-win32dll --disable-armv5te --disable-armv6

        make && make install
    cd -

    [guowenxue@centos6 systools]$
  • 该会员没有填写今日想说内容.
    点评回复 支持 反对

    使用道具 举报

    0

    主题

    1836

    帖子

    1028

    积分

    发表于 2012-6-29 08:56:38 | 显示全部楼层
    感谢楼上朋友无私的奉献
    点评回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

    GMT+8, 2024-12-27 00:24

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表