获取SVN版本号,作为参数传递给代码:
SVNREVSTR=`svn info | grep Revision | awk '{print $2}'`
TC_CFLAGS+=-DSVNREV=$(SVNREVSTR)C代码中使用:
#ifdef SVNREV
svn_rev = SVNREV;
tcdbg_printf("%d %d \n",svn_rev, SVNREV);
sprintf(revision, "%d", svn_rev);
mxmlElementSetAttr(node,"SvnRev",revision);
#endif结果编译就出错了:
mips-linux-uclibc-gcc: 406: No such file or directory
make[3]: *** [scripts/mod/empty.o] Error 1
make[2]: *** [scripts/mod] Error 2
make[1]: *** [scripts] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC      kernel/bounds.s
mips-linux-uclibc-gcc: 406: No such file or directory
make[2]: *** [kernel/bounds.s] Error 1
make[1]: *** [prepare0] Error 2求解!