主题 : Ubuntu8.10下移植madplay 时怎么设置 LDFLAGS 环境变量?急!!! 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 4875
精华: 0
发帖: 32
金钱: 325 两
威望: 321 点
综合积分: 64 分
注册时间: 2009-04-01
最后登录: 2010-03-02
楼主  发表于: 2009-04-07 22:28

 Ubuntu8.10下移植madplay 时怎么设置 LDFLAGS 环境变量?急!!!

*** You must first install libmad before you can build this package.
*** If libmad is already installed, you may need to use the LDFLAGS
*** environment variable to specify its installed location, e.g. -L<dir>.
root@ubuntu:/opt/FriendlyARM/QQ2440/madplay/src-x86/madplay-0.15.2b#

几个压缩包都安装好了,就是到了这一步没有办法向下进行
按照手册(如下)
#cd ../src-x86/madplay-0.15.2b
#./configure --prefix=/opt/FriendlyARM/QQ2440/madplay/target-x86 --CPPFLAGS=-I/opt/
FriendlyARM/QQ2440/madplay/target-x86/include --LDFLAGS=-L/opt/FriendlyARM/QQ
2440/madplay/target-x86/lib

可根本就不正确
弹出以下错误
configure: error: unrecognized option: --CPPFLAGS=-I/opt/FriendlyARM/QQ2440/madplay/target-x86/include
Try `./configure --help' for more information.



*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-04-08 07:32
去掉CPPFLAGS以及LDFLAGS前面的'--',它们是环境变量而不是configure的参数.用./configure --help可以查看完整的参数用法
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 4875
精华: 0
发帖: 32
金钱: 325 两
威望: 321 点
综合积分: 64 分
注册时间: 2009-04-01
最后登录: 2010-03-02
2楼  发表于: 2009-04-08 12:25
上面的方法试过了,还是不可以,又回到了设置CPPFLAGS环境的地方
configure: error: mad.h was not found
*** You must first install libmad before you can build this package.
*** If libmad is already installed, you may need to use the CPPFLAGS
*** environment variable to specify its installed location, e.g. -I<dir>.
root@ubuntu:/opt/FriendlyARM/QQ2440/madplay/src-x86/madplay-0.15.2b#
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-04-08 13:06
所缺少的mad.h应该是libmad提供的.你需要先编译它.
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 4875
精华: 0
发帖: 32
金钱: 325 两
威望: 321 点
综合积分: 64 分
注册时间: 2009-04-01
最后登录: 2010-03-02
4楼  发表于: 2009-04-08 13:16
我在编译libmad的时候,使用手册上面的指令
#cd ../ libmad-0.15.1b
#./configure --prefix=/opt/FriendlyARM/QQ2440/madplay/target-x86
#make
则结果如下
#./configure --prefix=/opt/FriendlyARM/QQ2440/madplay/target-x86
#make
出现以下错误
(sed -e '1s|.*|/*|' -e '1b' -e '$s|.*| */|' -e '$b'  \
        -e 's/^.*/ *&/' ./COPYRIGHT; echo;  \
    echo "# ifdef __cplusplus";  \
    echo 'extern "C" {';  \
    echo "# endif"; echo;  \
    if [ ".-DFPM_DEFAULT" != "." ]; then  \
        echo ".-DFPM_DEFAULT" | sed -e 's|^\.-D|# define |'; echo;  \
    fi;  \
    sed -ne 's/^# *define  *\(HAVE_.*_ASM\).*/# define \1/p'  \
        config.h; echo;  \
    sed -ne 's/^# *define  *OPT_\(SPEED\|ACCURACY\).*/# define OPT_\1/p'  \
        config.h; echo;  \
    sed -ne 's/^# *define  *\(SIZEOF_.*\)/# define \1/p'  \
        config.h; echo;  \
    for header in version.h fixed.h bit.h timer.h stream.h frame.h synth.h decoder.h; do  \
        echo;  \
        sed -n -f ./mad.h.sed ./$header;  \
    done; echo;  \
    echo "# ifdef __cplusplus";  \
    echo '}';  \
    echo "# endif") >mad.h
make  all-recursive
make[1]: 正在进入目录 `/opt/FriendlyARM/QQ2440/madplay/src-x86/libmad-0.15.1b'
make[2]: 正在进入目录 `/opt/FriendlyARM/QQ2440/madplay/src-x86/libmad-0.15.1b'
if /bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT     -Wall -g -O -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT version.lo -MD -MP -MF ".deps/version.Tpo" -c -o version.lo version.c; \
    then mv -f ".deps/version.Tpo" ".deps/version.Plo"; else rm -f ".deps/version.Tpo"; exit 1; fi
gcc -DHAVE_CONFIG_H -I. -I. -I. -DFPM_DEFAULT -Wall -g -O -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 -MT version.lo -MD -MP -MF .deps/version.Tpo -c version.c  -fPIC -DPIC -o .libs/version.o
cc1: error: unrecognized command line option "-fforce-mem"
make[2]: *** [version.lo] 错误 1
make[2]:正在离开目录 `/opt/FriendlyARM/QQ2440/madplay/src-x86/libmad-0.15.1b'
make[1]: *** [all-recursive] 错误 1
make[1]:正在离开目录 `/opt/FriendlyARM/QQ2440/madplay/src-x86/libmad-0.15.1b'
make: *** [all] 错误 2

如果使用指令
./configure CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc --host=arm-linux --prefix=/opt/FriendlyARM/QQ2440/madplay/target-x86 --disable-shared

make
则不会报错,而且include 和lib 文件夹里面有相应的编译结果文件(结果和手册上面说的一样)


我不知道,我到底有没有编译成功~~~~~~~~~~~~
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2009-04-08 17:24
大哥,一个用的是Ubuntu的gcc-4.x,编译出的是x86的二进制档;一个是3.4.1的交叉编译器,生成的是开发板用的ARM二进制档.根本不是同一回事好吗
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."