simple shell script for help compiling progs for openwrt.

#!/bin/bash
basedir=/bld/trunk/staging_dir
#/bld/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2
toolchaindir=$(echo $basedir/toolchain-mips*)
#/bld/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2
targetdir=$(echo $basedir/target-mips*)
 
export STAGING_DIR=$basedir
export PATH=$toolchaindir/bin:$PATH
gcc_cmd="mips-openwrt-linux-uclibc-gcc
-I$targetdir/usr/include
-I$targetdir/include
-I$toolchaindir/usr/include
-I$toolchaindir/include
 
-Os
-pipe
-mips32r2
-mtune=mips32r2
-fno-caller-saves
-fhonour-copts
-msoft-float
-ffunction-sections
-fdata-sections
 
-L$targetdir/usr/lib
-L$targetdir/lib
-L$toolchaindir/usr/lib
-L$toolchaindir/lib
-Wl,--gc-sections
"
alias mgcc=$(echo $gcc_cmd)

usage:
$ source ./rt_gcc.sh
$ mgcc -o hello hello.c

此条目发表在linux分类目录,贴了标签。将固定链接加入收藏夹。

simple shell script for help compiling progs for openwrt.》有1条回应

  1. Tia说:

    This is very interesting, You are a very skilled blogger.
    I have joined your feed and look forward to seeking more of your great post.

    Also, I have shared your site in mmy social networks!

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

*