设为首页 加入收藏

TOP

RTEMS 在 Linux环境开发的小技巧
2014-11-24 11:17:50 来源: 作者: 【 】 浏览:0
Tags:RTEMS Linux 环境 开发 技巧

用find命令配合sed就可以解决,这个是Linux开发中常用的方法


系统默认的autoconf是2.65,但是RTEMS 4.10以后需要autoconf 2.68,怎么办呢?


大家可以知道AC_PREREQ([2.68]) 这个就是autoconf的版本


ricky@ricky-laptop:rtems$ cat configure.ac
## Process this file with autoconf to produce a configure script.
##
## $Id: configure.ac,v 1.35 2011/03/04 18:32:15 ralf Exp $

AC_PREREQ([2.68 ])
AC_INIT([rtems],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
AC_CONFIG_SRCDIR([c])
RTEMS_TOP([.])


系统有很多.ac的文件


ricky@ricky-laptop:rtems$ find . -name "*.ac"
./doc/tools/configure.ac
./doc/configure.ac
./testsuites/mptests/configure.ac
./testsuites/psxtmtests/configure.ac
./testsuites/sptests/configure.ac
./testsuites/samples/configure.ac
./testsuites/psxtests/configure.ac
......


我们批量来修改


ricky@ricky-laptop:rtems$ find . -name "*.ac" -exec sed -i 's/2.68/2.65/g' {} /; -print
./doc/tools/configure.ac
./doc/configure.ac
./testsuites/mptests/configure.ac
./testsuites/psxtmtests/configure.ac
./testsuites/sptests/configure.ac
./testsuites/samples/configure.ac
./testsuites/psxtests/configure.ac
./testsuites/tools/generic/configure.ac
./testsuites/tools/configure.ac
./testsuites/configure.ac
./testsuites/tmtests/configure.ac
./testsuites/libtests/configure.ac
./cpukit/configure.ac
再看看


ricky@ricky-laptop:rtems$ cat configure.ac
## Process this file with autoconf to produce a configure script.
##
## $Id: configure.ac,v 1.35 2011/03/04 18:32:15 ralf Exp $

AC_PREREQ([2.65 ])
AC_INIT([rtems],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
AC_CONFIG_SRCDIR([c])
RTEMS_TOP([.])

# Abort if trying to build inside of the source tree.
AS_IF([test -f aclocal/version.m4],[
rm -f config.cache config.log confdefs.h
AC_MSG_ERROR([***]
[Attempt to build inside of the source tree]
[Please use a separate build directory, instead] )
])



稍微解释一下


find . -name "*.ac" -exec sed -i 's/2.68/2.65/g' {} /; -print



find . -name "*.ac" 表示在当前目录寻找*.ac的文件。



{} /;表示找到的结果



-exec sed表示我要执行 sed命令



-i 's/2.68/2.65/g' 其实是sed的命令参数,就是把找到的文件中的2.68替换成2.65



-print表示把操作的情况打印出来,:-)当然可以不打印。



类似的应用有很多比如find 配合 grep命令


我们现在在找到的.ac文件中查找AC_PREREQ这个字符串,并且把行号打印出来。


ricky@ricky-laptop:rtems$ find . -name "*.ac" -exec grep -n "AC_PREREQ" {} /; -print



3:AC_PREREQ([2.65])
./doc/tools/configure.ac
3:AC_PREREQ([2.65])
./doc/configure.ac
5:AC_PREREQ([2.65])
./testsuites/mptests/configure.ac
5:AC_PREREQ([2.65])
./testsuites/psxtmtests/configure.ac
5:AC_PREREQ([2.65])
./testsuites/sptests/configure.ac
5:AC_PREREQ([2.65])
./testsuites/samples/configure.ac
5:AC_PREREQ([2.65])


很方便吧。


您考虑的问题,Linux桌面发布者肯定也考虑到了,至于为什么没有把insight放入ubuntu肯定有些特别的原因的。


姑且不理他,看看我们用系统内部的资源能不能解决图形调试的问题。


首先安装ddd


sudo apt-get install ddd


然后


ddd --debugger arm-rtems4.9-gdb hello.exe


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇QEMU 仿真 RTEMS pc386 下一篇Android虚拟平台的编译和整合

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Redis on AWS:Elast (2025-12-27 04:19:30)
·在 Spring Boot 项目 (2025-12-27 04:19:27)
·使用华为开发者空间 (2025-12-27 04:19:24)
·Getting Started wit (2025-12-27 03:49:24)
·Ubuntu 上最好用的中 (2025-12-27 03:49:20)