编译OpenWrt时遇到的问题及解决方法(一)

在编译uboot时,报错:

1.编译uboot时报错:
In file included from fs.c:54:
fsdata.c:226: error: parse error before ',' token
/home/polaris/mtk7688/u-boot-mt7688-hiwooya-master/config.mk:799: recipe for target 'fs.o' failed
make[1]: *** [fs.o] Error 1
make[1]: Leaving directory '/home/polaris/mtk7688/u-boot-mt7688-hiwooya-master/httpd'
Makefile:369: recipe for target 'httpd/libhttpd.a' failed
make: *** [httpd/libhttpd.a] Error 2

分析问题:

通过错误信息发现,在fsdata.c 的226行多了一个,通过查找问题,发现在生成fsdata.c文件时,出现错误。(在httpd/vendors/makefsdatac中生成fsdata.c)

解决办法:

修改 ./httpd/vendors/makefsdatac
 # Content
        if [ "$_file_ext" == "css"  ]; then
                if [ -e "$yui_compressor" ]; then
                        _file_content=`java -jar "$yui_compressor" --charset utf-8 "$1" | od -A n -t x1 | tr -d '\r\n' | sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g'`
                else
                        _file_content=`cat "$1" | tr -d '\r\n\t' | od -A n -t x1 | tr -d '\r\n' | sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g'`
                fi
                `ascii_to_bytes "Content-type: text/css; charset=UTF-8\r\n\r\n" >> "$files_content_tmp"`
        elif [ "$_file_ext" == "png"  ]; then
                _file_content=`od -A n -t x1 < "$1" | tr -d '\r\n' | sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g'`
                `ascii_to_bytes "Content-Type: image/png\r\n\r\n" >> "$files_content_tmp"`
        elif [ "$_file_ext" == "jpg" -o "$_file_ext" == "jpeg"  ]; then
                _file_content=`od -A n -t x1 < "$1" | tr -d '\r\n' | sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g'`
                `ascii_to_bytes "Content-Type: image/jpeg\r\n\r\n" >> "$files_content_tmp"`
        elif [ "$_file_ext" == "gif"  ]; then
                _file_content=`od -A n -t x1 < "$1" | tr -d '\r\n' | sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g'`
                `ascii_to_bytes "Content-Type: image/gif\r\n\r\n" >> "$files_content_tmp"`
        else
                _file_content=`cat "$1" | tr -d '\t\r\n' | od -A n -t x1 | tr -d '\r\n' | sed 's/ /0x/;s/ /, 0x/g;s/.\{102\}/&\n/g'`
                `ascii_to_bytes "Content-type: text/html; charset=UTF-8\r\n\r\n" >> "$files_content_tmp"`
        fi
#####################################################################################       
        #add zgx 2018/7/31        
        if [ "$_file_ext" == "css" ]; then
                `echo " " >> "$files_content_tmp"`
        else
                `echo "," >> "$files_content_tmp"`
        fi
######################################################################################
        # File content
        `echo -ne "/* Page/File content */\n" >> "$files_content_tmp"`
        `echo -ne "$_file_content" >> "$files_content_tmp"`

        # And close declaration
        `echo -ne ", 0 };\n\n" >> "$files_content_tmp"`
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值