现在的位置: 首页 > 综合 > 正文

Linux软件集成开发环境

2013年10月22日 ⁄ 综合 ⁄ 共 27094字 ⁄ 字号 评论关闭

package: download from:

软件集成开发环境(代码编辑、浏览、编译、调试)
Emacs http://www.gnu.org/software/emacs/
Source-Navigator 5.2b2 http://sourceforge.net/projects/sourcenav
Anjuta http://anjuta.sourceforge.net(可用yum安装)
代码索引工具
Cscope http://cscope.sourceforge.net/
KScope http://www.kde-apps.org
GLOBAL http://www.gnu.org/software/global/(可用yum安装)
调试器(GNU gdb的GUI前端)
DDD http://www.gnu.org/software/ddd/
Insight 6.4.0 http://sourceware.org/insight/
KDbg http://www.kdbg.org/
评测器(内存、性能、覆盖等的profiler,类似IBM Purify)
Valgrind http://www.valgrind.org/,FC5自带3.1.0-2
ggcov(GNU gcov的GUI) http://ggcov.sourceforge.net/
kprof(GNU gprof的GUI) http://kprof.sourceforge.net/
KCachegrind http://kcachegrind.sf.net
BoundsChecking http://www.doc.ic.ac.uk/~phjk/BoundsChecking.html
代码静态检查工具(类似Windows平台的PC-Lint)
Splint http://www.splint.org/(可用yum安装)
flawfinder http://www.dwheeler.com/flawfinder/
代码静态测量工具
--暂缺,Windows上非开源的LineCount(http://liangs.autodebug.com/)统计C/C++/Java代码还凑合。
PyMetrics(http://sourceforge.net/projects/pyme...??复杂度。
http://www.chris-lott.org/resources/cmetrics/罗列了好些C static metric tools。
软件构建系统(build system)
SCons http://www.scons.org/(用yum安装的版本太低)
CMake http://www.cmake.org/
GNU Make http://www.gnu.org/software/make/
交叉工具链
crosstool http://www.kegel.com/crosstool/
代码版本控制系统及相关工具
Subversion http://subversion.tigris.org (用yum安装)
WorkBench http://pysvn.tigris.org/(pysvn的附带物)
StatSvn http://svn.statsvn.org/
mpy-svn-stats http://mpy-svn-stats.berlios.de/
ViewVC http://viewvc.tigris.org/
测试框架
CppUnit http://sourceforge.net/projects/cppunit
CUnit http://cunit.sourceforge.net/
代码差异工具(比较/制作和应用补丁)
GNU diffutils http://www.gnu.org/software/diffutils/
kdiff3 http://kdiff3.sourceforge.net/或者...??yum安装)
代码在线文档
doxygen http://www.stack.nl/~dimitri/doxygen/
离线文档
DocBook http://www.docbook.org
XMLMind http://www.xmlmind.com/
代码格式化
astyle(Artistic Style) http://astyle.sourceforge.net/
indent http://www.gnu.org/software/indent/
UML建模
ArgoUML http://argouml.tigris.org

软件工程事务(BUG等)跟踪(类似IBM ClearQuest)
Trac http://trac.edgewall.org/(基于Pyth...ee一样小巧
BugFree http://www.1zsoft.com/(基于PHP+MySQL)--中小规模软件适用
BugZilla http://www.bugzilla.org/--配置复杂,使用麻烦
自动化持续构建与测试系统(类似IBM BuildForge)
BuildBot http://buildbot.sourceforge.net/(基于Python)
Cabie http://cabie.tigris.org/(基于Perl和MySQL)
系统级别测试框架
DejaGNU http://www.gnu.org/software/dejagnu/(基于Expect,因而基于Tcl)
QMTest http://www.codesourcery.com/qmtest/(基于Python)

Linux实用工具
yum http://linux.duke.edu/projects/yum/,FC4自带yum-2.3.2-7, FC5自带2.6.1-0
wget http://www.gnu.org/software/wget/
cURL http://curl.haxx.se/
Wireshark(原名Ethereal) http://www.wireshark.org,http://www....??版本较低)
NcFTP http://www.ncftp.com/ncftp/
tftp和tftp-server yum -y install tftp-server和tftp
rp-pppoe http://www.roaringpenguin.com/pengui...??版本较低)
minicom http://alioth.debian.org/projects/minicom/(FC自带)
TightVNC http://www.tightvnc.com/
Wine+IEs4Linux http://www.winehq.org/
http://www.tatanka.com.br/ies4linux/index-en.html
StarDict http://stardict.sourceforge.net
fcitx http://www.fcitx.org
KchmViewer http://kchmviewer.sourceforge.net
kmhtConvert http://www.kde-apps.org
永中Office http://www.evermoresw.com
webmin sourceforge.net,插件结构
Rsync http://rsync.samba.org/
wxDFast http://dfast.sourceforge.net/
FlashGot http://flashgot.net/
Amarok http://amarok.kde.org/(iTunes风格箮.??wma没搞定)
xmms http://www.xmms.org/(winamp风格的音乐播放器,可yum安装它以及mp3/wma插件)
MPlayer http://www.mplayerhq.hu/(Linux下最...G4文件、row data和.mp3)
VirtualBox http://www.virtualbox.org/
qRFCView http://qrfcview.berlios.de/

打字练习软件
Tuxtype, for Linux&Windows, http://tuxtype.sourceforge.net/
TypeFaster, for Windows, http://typefaster.sourceforge.net/

Python库/工具
pyserial http://pyserial.sourceforge.net/
pysvn http://pysvn.tigris.org/
twill http://twill.idyll.org/
pexpect http://pexpect.sourceforge.net/
wxPython http://www.wxpython.org/(可用yum宮..wxPython-devel)
Snack http://www.wanware.com/tsgdocs/snack.html
PIL http://www.pythonware.com/products/pil/index.htm
ReportLab http://www.reportlab.org/downloads.html
SIP http://riverbankcomputing.co.uk/sip/...?称Python-SIP)
dogtail http://people.redhat.com/zcerza/dogtail/index.html
PyChecker http://pychecker.sourceforge.net/
pylint http://www.logilab.org/857/(Logilab....??计算等包)
Winpdb http://www.digitalpeers.com/pythondebugger/
pydb http://bashdb.sourceforge.net/pydb/
SPE http://pythonide.stani.be/
Python数据库方面有个规格Python Database API 2.0,有遵循此规格的对各现有DBMS(sqlite,mysql等)的包装,如pysqlite,MySQLdb

python SIP/MGCP stacks
Shtoom http://divmod.org/trac/wiki/ShtoomProject
Divmod Sine http://divmod.org/trac/wiki/DivmodSine
PJSIP http://www.pjsip.org/(Pjsip now supports Python abstraction for PJSUA-API...)
Sipx利用Python实现了SIP Forum Basic UA Test Suite(http://www.sipfoundry.org/sftf-user-guide.html)

C/C++库/工具
wxWidgets http://www.wxwidgets.org/(可用yum宮.和wxGTK-devel)
STL-Boost中文站点 http://www.stlchina.org/
NullHttpd http://nullwebmail.sourceforge.net/httpd/
PCRE http://www.pcre.org/(Perl正则式兮..kages/pcre.htm)
GNU Regex http://directory.fsf.org/regex.html(...?是PCRE和GNU Regex,FC5上都装了)
Libxml2 http://xmlsoft.org/(The XML C parser and toolkit of Gnome)
Xerces-C++ http://xml.apache.org/xerces-c/(A validating XML parser written in a portable subset of C++ by the Apache project.)
expat http://expat.sourceforge.net/(XML parser written in C)
ACE http://www.cs.wustl.edu/%7Eschmidt/ACE.html(跨平台C++库/框架)
APR http://apr.apache.org/(跨平台C库)
NSPR http://www.mozilla.org/projects/nspr/(跨平台C库)

KXML Editor http://www.kde-apps.org
jedit sourceforge.net,插件结构。用处不大。
jdk1.5 java.sun.com

SIP协议栈相关
OpenSER http://www.openser.org/
SER http://www.iptel.org/ser
sipX http://www.sipfoundry.org/sipX
sipsak http://sipsak.org/
SIPp http://sourceforge.net/projects/sipp
xvidcore1.1.0 www.xvid.org (XViD MPEG4 codec)
live www.live555.com (RTSP_Server)

编译器/识别器生成工具
Bison http://www.gnu.org/software/bison/
ANTLR http://www.antlr.org/

ABNF工具
(1)Parser generators:
APG (ABNF Parser Generator) http://www.coasttocoastresearch.com/
Yacker http://www.w3.org/1999/02/26-modules/User/Yacker
(2)Test case generators:
abnfgen http://www.quut.com/abnfgen/
(3)Verifiers:
There's Bill Fenner's ABNF checker (for cut-and-pasted grammar), an ABNF parser in Perl from Harald Alvestrand, and
Chris Newman's abnf.c, a widely used validator (here's its cut-and-paste frontend).

跨平台的万能编辑器Emacs配合CEDET/ECB/Cscope/GDB-UI这4个插件之后就成了一个完整的IDE。接触Linux几年来总是对它崇敬畏惧,这两天下决心学习了一下,感觉(1)“学习曲线”并不是以前想象的那么“陡”;(2)编辑功能确实像传说中的那么强。对它稍作定制,就能在写代码过程中自动应用特定编码风格。http://www.chris-lott.org/resources/...??格规定。
我认为Emacs适合于编辑自己的代码(编辑功能很强,分析能力稍差),而Source-Navigator适合于阅读别人的代码(编辑能力稍差,分析能力很强)。
我试用了eclipse用来开发C/C++的cdt插件,对中等规模的工程(100-200个源文件)建立索引太慢,常常"Out of memory";调试器启动时有常遭遇"No symble 'New' in current context"和"Connot access memory at address 0x0"之类的错误;代码提示超级慢,10多秒无响应。我是在CPU2.6G,RAM1G的FC5上运行Eclipse3.2.1。大概eclipse的 cdt仅适用于"Hello,world"之类的C/C++工程,但eclipse依然是Linux/Windows平台上开发Java相关工程的首选。
附 cscope的使用方法:一般的首先生成cscope.files文件,这个文件里主要是要生成索引的文件列表,一般我都用的find命令生成(windows下可以考虑使用cygwin),比如我要在当前目录下生成*.c*文件和*.h*文件的索引,那么我可以键入:"find . -name "*.c*" -or -name "*.h*" > cscope.files",具体的find命令的用法不再阐述了。
生成cscope.files文件之后,在终端键入"cscope -k -q"就可以生成源代码的索引了。
Cscope(http://cscope.sourceforge.net/)解厮..cs准备的。
CEDET(Collection of Emacs Development Environment Tools)网址http://cedet.sourceforge.net/。
ECB(Emacs Code Browser)网址http://ecb.sourceforge.net/。
GDB-UI(Emacs Mode for GDB)网址http://www.inet.net.nz/~nickrob/。
注:在安装这些插件的过程中可能有些LISP文件和FC5自带的Emacs的重复,直接覆盖不会有啥问题。
我把cedet和ecb编译后拷贝到emacs资源所在目录(FC5自带Emacs是/usr/share/emacs),然后编辑$HOME/.emacs增加如下设置:
;; Load CEDET
(load-file "/usr/share/emacs/cedet-1.0pre3/common/cedet.el")
;; Enabling various SEMANTIC minor modes. See semantic/INSTALL for more ideas.
;; Select one of the following
(semantic-load-enable-code-helpers)
;; (semantic-load-enable-guady-code-helpers)
;; (semantic-load-enable-excessive-code-helpers)
;; Enable this if you develop in semantic, or develop grammars
;; (semantic-load-enable-semantic-debugging-helpers)

;; Load ECB
(add-to-list 'load-path "/usr/share/emacs/ecb-2.32")
(require 'ecb-autoloads)

;; Load Cscope
(require 'xcscope)

;; Some shortcuts
(global-set-key [f5] 'speedbar)
(global-set-key [f7] 'compile)

FC4 上面安装Anjuta2.0.2的过程真是太艰难了。(1)Anjuta2下载页面下方给出了Anjuta2依赖的一些包的名称和位置,但这个提示并不够显眼(2)把Anjuta网站提供的gdl下载安装后要配置pkg-config依赖的环境变量export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig(gdl-1.0.pc所在目录)。而某些版本的gdl安装之后并不产生相应的.pc文件!(3)FC4的glib版本太低,www.gtk.org给的链接用Firefox下载不了,用curl搞定了。(4)devhelp 0.11 --> Gtk+2.8 --> Pango with Cairo.
configure Devhelp:
checking for LIBDEVHELP... configure: error: Package requirements (
gthread-2.0 >= 2.6.0
gtk+-2.0 >= 2.6.0
libglade-2.0 >= 2.4.0
libwnck-1.0 >= 2.10.0
gconf-2.0 >= 2.6.0
) were not met.

在FC5上config Source-Navigator 5.2b2一直到5.1.0都失败:
checking if 64bit support is requested... no
checking if 64bit Sparc VIS support is requested... no
checking system version (for dynamic loading)... ../../../tcl/unix/configure: line 6020: syntax error near unexpected token `)'
../../../tcl/unix/configure: line 6020: ` OSF*)'
configure: error: ../../../tcl/unix/configure failed for unix
Configure in /home/kenny/WorkEvnInit/sourcenav-5.1.0/snbuild/tcl failed, exiting.
后来在sourceforge.net此项目的论坛上找到一个patch搞定了,但窗口最大化仍然有问题。

/usr/local/lib/pkgconfig/gdl-1.0.pc
sourcenav在FC4上编译遇到两个错误(在Redhat9上顺利编译),都是说不支持"-fwritable-strings"选项,把对应Makefile修改一下注释掉这个选项即可.
make[3]: Entering directory `/home/kenny/WorkEvnInit/sourcenav-5.2b2/tix/unix/tk8.3'
gcc -pipe -c -fwritable-strings
make[3]: Entering directory `/home/kenny/WorkEvnInit/sourcenav-5.2b2/libgui/src'
gcc -DHAVE_CONFIG_H -I. -I. -I.. -fwritable-strings

Source-Navigator自2004年3月发布5.2b2以来没有再更新。http://developer.berlios.de/projects/sourcenav/尝试继续维护它。

Linux 上除了SourceNavigator之外,另一个较好的C代码编辑、浏览工具是KScope在 http://kscope.sourceforge.net/。最...or逊一筹。
Windows上流行使用SourceInsight,不是免费的,且代码导航功能不如SourceNavigator。

GNU GLOBAL is a source code tag system that works the same way across diverse environments. You can locate a specified object in the source files and move there easily. It is useful for hacking a large project containing many subdirectories, many #ifdef and many main() functions. It is similar to ctags or etags but is different from them at the point of independence of any editor. It runs on a UNIX(POSIX) compatible operating system like GNU and BSD.
有人用GLOBAL分析Linux内核以自动生成HTML(例如http://joyfire.net/kernelsrc/),宮.ceNavigator。

当前Linux平台上的GDB前端有DDD,Insight,KDbg等。DDD是一个非常流行的调试器,Fedora Core 4附带了它。Insight是Redhat的GNUPro开发套件之一,是gdb的Tk包装(版本号与gdb版本号完全一致),可与 SourceNavigator集成。KDbg是gdb的KDE风格的GUI。DDD虽然GUI稍稍难看(Tk和KDE风格我也不太喜欢,基于KDE的应用在关闭时调用KNotify太慢了),但功能最强。三者中只有DDD支持的后台调试器不局限于gdb;也只有DDD提供了gdb的CLI,这使得其非常灵活(例如增加一个函数断点,命令break func就OK,而不像用菜单指定文件名和行号那样烦琐)。Insight调试多线程程序时暂停常常使得Insight失去响应。KDbg是gdb的前端,可以浏览过去打开的源文件,这是个优势。就像其简介中所说的,你不能期望它能做的比gdb更多,所以它在许多方面都比DDD差:(1)查看变量的值,如果变量形式较复杂,则鼠标放在其上不能显示其值或者显示其值为0,只得麻烦地写一个监视表达式。(2)不能像DDD的数据窗口那样可视化地显示一个结构体、数组,必须为特定成员写一个完整的监视表达式。(3)调试过程中不能修改变量值、挪动执行点(这些功能有时很有用)。(4)主窗口以及打开的各个窗口(本地变量、内存等)在FC5的任务面板上缩成一个标签,切换起来很是费事。

TotalView(http://www.etnus.com/)号称自己昮..db不够强。

Valgrind is an award-winning suite of tools for debugging and profiling Linux programs. ElectricFence(http://perens.com/FreeSoftware/ElectricFence/)声称自己不如 Checkergcc(http://www.gnu.org/software/checker/...?而Checkergcc 又由于Valgrind的出现而退役。一句话:当前大家公认Valgrind是最接近IBM商业产品Purify的开源的内存/性能评测工具。

C/C++ 代码覆盖、性能profiling工具一般基于GNU的gprof和gcov。(还有一类基于模拟器的profiling工具,如IBM Purify, Valgrind。KCahcegrind是Callgrind,OProfile等的GUI前端。)我知道的有ggcof,kprof,lcov。 lcov是Linux Testing Project工具之一,见http://ltp.sourceforge.net/tooltable...??测试、WEB Server测试等许多工具。在http://www.testingfaqs.org分类归纳了多种软件测试工具。

运行期间栈以及数据段的溢出比堆溢出更难以发现、定位。绝大多数安全工具聚焦于防止栈溢出覆盖函数返回地址从而阻止了可能的攻击。Avaya 实验室发布libsafe 2.0,增加了防止格式化字符串攻击功能,目前可以保护系统免受两种攻击'buffer overflow' and 'format string'. Libsafe在自己的strcpy/printf等函数即将导致栈帧处被覆盖时终止程序,从而防止被入侵。其技术思路是:采用 Interposition技术用自己的strcpy/printf等函数替换C标准库函数(ElectricFence也采用此技术替换堆内存相关函数);在自己的函数中找到FP位置(函数_libsafe_stackVariableP()),同时判断给定指针是栈上还是堆上;堆上指针直接调用C标准库函数;栈上指针则在边界检查通过后调用C标准库函数,检查未通过就exit。很多细节限制了其只能用于特定平台Linux并且被保护软件是用gcc编译。但我的目的是发现所有数组越界错误,要求更严格。可能只有GCC的补丁 BoundsChecking(http://www.doc.ic.ac.uk/~phjk/Bounds...SF上有下载 http://sourceforge.net/projects/boun...?前版本(for GCC4.0.2)仅支持C。我反汇编了它编译出来的executable,发现栈上的字符数组分配由10多条指令加call __bounds_add_stack_object 来做,在最后多分配了1字节用于保护。堆上内存分配的函数malloc也以__bounds_check_malloc代替。这类补丁最大的问题是产生的 executable运行速度奇慢,尤其是指针操作密集的测试成百上千倍地慢。
尝试了两个例子,效果很好。但webcam工程链接期大量错误,如:src/protocols/call/sip/src/misc/sipcopy.c:774:对‘__bounds_check_free’未定义的引用。是不是我的gcc编译不对劲?还是ld不对劲?

Splint is a tool for statically checking C programs for security vulnerabilities and coding mistakes. With minimal effort, Splint can be used as a better lint. If additional effort is invested adding annotations to programs, Splint can perform stronger checking than can be done by any standard lint.

Flawfinder, a program that examines source code and reports possible security weaknesses (``flaws'') sorted by risk level. It's very useful for quickly finding and removing at least some potential security problems before a program is widely released to the public. Flawfinder is written in Python.
检查当前目录下(递归地)所有C/C++代码,输出检查结果:
flawfind --quiet --html . >flaws.html
Error: File ended while in string.

除了Splint和Flawfinder之外,常用的开源的C/C++代码静态检查工具还有RATS(http: //www.fortifysoftware.com/security-resources/rats.jsp), ITS4(http://www.cigital.com/its4/)。此外,Open Source Quality Project(http://osq.cs.berkeley.edu/)组织了好几个这方面的项目。

SCons是一个与GNU make, qmake, CMake以及Ant类似的软件构建管理工具。SCons is a next-generation software construction tool, or make tool--that is, a software utility for building software (or other files) and keeping built software up-to-date whenever the underlying input files change.
Scons可以完全替代 GNU Automake/Autoconf。Automake/Autoconf脚本configure的作用有两个:一是平台环境(头文件、数据类型、库等)检测(交叉编译时这部分很重要),二是定制软件特性(例如Minigui的configure的--enable-clipboard选项表示支持剪切板)。scons手册的“Multi-Platform Configuration (Autoconf Functionality)”和“Controlling a Build From the Command Line”两章分别论述了scons是如何支持上诉功能的。
注意:安装几个版本的scons可能导致混乱:
[root@kenny lib]# scons -v
SCons by Steven Knight et al.:
script: v0.96.95.D002, 2007/02/14 11:01:59, by knight on roxbury
engine: v0.96.1.D001, 2004/08/23 09:55:29, by knight on casablanca
Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
我发现在/usr/lib下有scons和scons-0.96.92两个目录。我删除scons目录,就解决了这个问题:
[root@kenny lib]# rm -fr scons
[root@kenny lib]# scons -v
SCons by Steven Knight et al.:
script: v0.96.95.D002, 2007/02/14 11:01:59, by knight on roxbury
engine: v0.96.95.D002, 2007/02/14 11:01:59, by knight on roxbury
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 The SCons Foundation
修改/usr/local/bin/scons文件,使得其输出使用的engine位于何处:
sys.path = libs + sys.path
import SCons.Script
print SCons #自己加的
SCons.Script.main()
输出信息如下:
<module 'SCons' from '/usr/local/lib/python2.5/site-packages/SCons/__init__.pyc'>
scons 的README指出“Note that, by default, SCons does not install its build engine library in the standard Python library directories.” 以后别忘了加"--standard-lib"选项。
Java项目的构建现在主要用Ant或Maven来做,这两个工具目前也完全局限于Java项目。我现在不做Java项目,这些东西对我毫无用处,所以就没有深究它们。
技巧:中文环境下gcc给出的warning和error都是中文的,不便于在网上找资料,也不便于在Emacs查看。怎样让gcc输出英文的信息呢?一个麻烦的办法就是每次运行scons之前先执行"export LC_ALL=en_US.UTF-8"。其实可以这么做:在SConstruct文件设置好编译环境env之后,在导出env之前,添加如下一行以修改编译过程中的locale:
env['ENV']['LANG'] = "en_US.UTF-8"

SCons可以结合distcc (http://distcc.samba.org/)和ccache节省大型软件项目的编译时间。

CMake(http://www.cmake.org) 是一个Makefile生成器(作用相当于GNU atuotools链),它能为许多native build system(如GNU make, MS VC6, MAC OS Xcode等)生成配置文件。KDE4这个大型软件初期尝试了SCons以解决GNU atuotools链的各种弊端,不过最终选择了CMake。其中的缘由请看"Why the KDE project switched to CMake", http://lwn.net/Articles/188693/。

" 跨平台的编译工具,其中最有名的两个是 CMake 和 SCons。CMake 和 SCons大概代表了新一代跨平台编译工具的两种方向。第一种 (CMake) 是延续并改良传统 automake, autoconf 工具链,将之合为一体,但最终仍然生成 Makefile, Visual Studio 的 .sln,Xcode 的 .xcodebuild 文件,依赖现有编译工具 (make, nmake, vcbuild, xcodebuild) 来编译;第二种则是完全消除现有编译工具的调用,直接调用编译器,scons 就属于这一类。从人气上来说,反倒是走改良路线的 cmake 比 scons 好一些..."

按照《Building Embedded Linux Systems》极其详尽的指导,为嵌入式系统开发构建GNU交叉工具链也很困难:gcc/glibc/binutils/kernel版本之间的配合,特定版本的特征(如GCC3.2开始应该这么做而不是那么做),还要考虑补丁...手工来做非常耗时且不大可能成功(碰到问题看文档和使用Google也不一定能搞定)。用crosstool(http://www.kegel.com/crosstool/,另外在http: //www.freaknet.org/martin/crosstool/有一些解释、补丁等),只需要你有个Linux PC能上网,一个命令(如demo-arm.sh)下去就行。有时间可以深入研究一下这个工具。Building a gcc / glibc cross-toolchain for use in embedded systems development used to be a scary prospect, requiring iron will, days if not weeks of effort, lots of Unix and Gnu lore, and sometimes willingness to take dodgy shortcuts.
Linux内核的ARM补丁、ARM工具链都可在http://www.arm.linux.org.uk /developer/上找到,这是Linux ARM架构的最权威站点。 另外可能还需要特定芯片厂商提供的补丁,例如3615使用的TI DM320有内核补丁设置了各设备在Flash的地址。
注意:(1)对一个项目而言,升级交叉编译工具链后,制作的ramdisk内也要以新的C 动态库替换掉老的,否则可能导致兼容性问题如程序运行不起来。(2)要使得toolchain识别用户添加的库,把库放在arm-linux/arm- linux/usr/lib。为了运行时能找到这个库,制作的ramdisk也必须包含这个库。(3)如果硬件平台没有浮点支持,所以在 crosstool的arm.dat文件最后添加如下两行:GCC_EXTRA_CONFIG="--with-float=soft"和 GLIBC_EXTRA_CONFIG="--without-fp";或者不使用demo-arm.sh而是demo-arm- softfloat.sh(注意这两个脚本可能在GCC版本方面并不同步)。在交叉工具链完成后可以用"arm-linux-gcc -v"查看配置情况。(4)默认的目标是arm-unknown-linux-gnu,可以在arm.dat中将TARGET设置为"arm- linux"使得编译出来的GCC名字为arm-linux-gcc。

编译Linux内核,如果目录层次过深,可能出现如下错误:
scripts/mkdep -- `find /home/kenny/svn_LRSH/ipcam/trunk/LR3615_BII/kernel/linux-2.4.26_LRSH/include/asm /home/kenny/svn_LRSH/ipcam/trunk/LR3615_BII/kernel/linux-2.4.26_LRSH/include/linux /home/kenny/svn_LRSH/ipcam/trunk/LR3615_BII/kernel/linux-2.4.26_LRSH/include/scsi /home/kenny/svn_LRSH/ipcam/trunk/LR3615_BII/kernel/linux-2.4.26_LRSH/include/net /home/kenny/svn_LRSH/ipcam/trunk/LR3615_BII/kernel/linux-2.4.26_LRSH/include/math-emu /( -name SCCS -o -name .svn /) -prune -o -follow -name /*.h ! -name modversions.h -print` > .hdepend
/bin/sh: scripts/mkdep: 参数列表过长
make: *** [dep-files] 错误 126
可以把内核代码放到浅一些的目录,或者为内核代码根目录做个软链接。
为3615/3621编译Linux内核时,注意修改内核代码drivers/mtd/maps/dm320map.c。

[使用distcc 缩短编译时间]distcc is a program to distribute builds of C, C++, Objective C or Objective C++ code across several machines on a network. distcc should always generate the same results as a local build, is simple to install and use, and is usually much faster than a local compile.
The main feature required by distcc is that the compiler must be able to run the preprocessor separately, and then compile the preprocessor output from a file. This was a basic part of the original design of C, but some compilers seem to have lost the ability to do this. Secondarily, distcc is currently hardcoded to suit gcc's behaviour and command-line syntax, so only compilers that act like gcc will work. This could in principle be changed.

patch文件中指令都是面向单个文件内容比较的:增加的文件所在目录不存在则创建它;打补丁后空文件及其所有空的祖先目录都被删除。请看patch手册中选项"-E"和Caveats一节。
Tips for Patch Producers
To create a patch that changes an older version of a package into a
newer version, first make a copy of the older and newer versions in
adjacent subdirectories. It is common to do that by unpacking tar
archives of the two versions.
To generate the patch, use the command diff -Naur old new where old
and new identify the old and new directories. The names old and new
should not contain any slashes. The -N option lets the patch create
and remove files; -a lets the patch update non-text files; -u
generates useful time stamps and enough context; and -r lets the patch
update subdirectories. Here is an example command, using Bourne shell
syntax:
diff -Naur gcc-3.0.3 gcc-3.0.4 > patch_gcc_304_to_303
Tell your recipients how to apply the patches. This should include
which working directory to use, and which patch options to use; the
option -p1 is recommended. Test your procedure by pretending to be a
recipient and applying your patches to a copy of the original files.
For example, place patch_gcc_304_to_303 at the directory in which
gcc-3.0.3 lies, using Bourne shell syntax:
cd gcc-3.0.3
patch -p1 < ../patch_gcc_304_to_303

Kompare 是KDE自带的一个文件/目录比较工具,比较大目录太慢了,也没有合并功能。我上网了解到在这方面的好工具有Kdiff、Meld和xxdiff。 Meld的没有做汉化,许多菜单、按钮的文字显示不出来或者是乱码。xxdiff还没有尝试过。Kdiff3还有windows版本。

Kdiff3 is very good for large merges, automatic merge facility.
Meld is a visual diff and merge tool. Meld is written with the excellent pygtk toolkit.
kdiff3-0.9.90-1.fc.i686.rpm 要求libstdc++.so.6(GLIBCXX_3.4.6),对应的FC4平台RPM是libstdc++-4.0.2-8.i386.rpm,但 FC4光盘上只有4.0.0,网络速度太慢,下载不了!:( kdiff3-0.9.89把我的编译器列入了黑名单。最后用0.9.88终于顺利安装了。运行起来感觉不错!

Subversion(简称svn)是经典的开源的版本控制系统cvs的替代物。有个工具cvs2svn可以转换CVS库到SVN库。
SVN客户端GUI非常丰富。Windows上最流行TortoiseSVN(http://tortoisesvn.tigris.org/),奮..??试过的:
RapidSVN http://www.rapidsvn.org/(基于wxWid...??作不正常)
KdeSVN http://www.kde-apps.org(可yum安装,功能少,在中文环境下工作不正常)
QSvn http://ar.oszine.de/projects/qsvn/(议.??Blamme功能)
SmartSVN http://www.syntevo.com/smartsvn/(仅...??用SUN的JRE)
我推荐WorkBench(pysvn附属物,基于wxPython)。它功能和速度方面都不错,并且在中文环境下能很好地工作。注意:(1)如果已安装的wxPython版本在wb_main.py选择的wxPython版本列表内,则需要添加进去。(2)如果WorkBench工作不正常,很可能是 pysvn与系统SVN库有冲突。

StatSvn基于著名的StatCvs的SVN版本,开源,以Java编写。它能够对整个SVN库做统计,包括:每作者提交数、拥有代码行数等等。试用了一下,感觉很不错!(StatSvn手册指出:由于SVN日志文件的特性,第一次统计较慢。我针对 LR3615_WEBCAM工程[10万多行]第一次统计,耗时70多分钟。)另外要注意:FC5默认JRE(即gij)没有提供Graphics2D等库,这将导致JVM抛出异常。安装SUN提供的JDK1.5.0即可解决此问题。
[kenny@kenny statsvn-0.2.0]$ java -jar statsvn.jar /home/kenny/sw_3615/svn.log /home/kenny/sw_3615

mpy-svn-stats: Very simple and easy to use Subversion statistics generator written in Python. (http://mpy-svn-stats.berlios.de/)是...信息(http: //www.voiceworks.pl/sipxpbx-stats/)就是由此工具生成的。

ViewVC是一个基于web的CVS、 SVN代码仓库浏览工具。它最早是从cvsweb发展而来的,cvsweb是用Perl编写的, viewvc原作者Greg Stein发现很难在此基础上扩展新的功能,于是用Python重新实现,并命名为viewcvs。后来又加入了对SVN代码仓库的支持,为反映这一变化 viewcvs重命名为viewvc。viewvc可以以独立的程序运行(standalone.py),也可以以cgi方式运行于支持CGI的web服务器,还可以以ASP模式运行于IIS,以mod_python模式运行于Apache。viewvc通过本地文件系统访问代码仓库,所以它必须安装在运行CVS或SVN代码仓库的同一服务器上。运行viewvc需要很多第三方软件,具体需要的依赖软件取决于启用功能和运行平台两大因素。viewvc除了支持CVS代码仓库浏览功能,还支持
1)SVN代码仓库浏览功能
2)代码语法加亮、颜色标注
3)CVS代码修订历史图形显示
4)CVS代码代码提交动作的记录、查询

此外还有FishEye(http://cenqua.com/fisheye/)等商业的代码库分析工具。

程序代码美化工具astyle可美化C/C++/Java。astyle有几个成套的的风格定义:ansi java linux kr...不必记住复杂的缩进具体选项。indent(gcc附带的一个标准工具)只能美化C代码。专门针对Java代码的有CheckStyle(免费,http://checkstyle.sourceforge.net/N../www.tiobe.com /jacobe.htm)等。
astyle 1.19有个BUG:如果#ifdef 下一行以{开头,则{被调整到#ifdef行最后,这必然导致编译失败。
indent 也不完美:(1)处理dspcode.h类似文件时间极长,把数组每一项单独作为一行导致头文件行数极多。Frank说处理dspcode.h类似文件之后导致编译失败。(2)在#else之后自动加了/*,随后多了一行*/。(3)有时候格式化比较乱甚至导致编译失败。
Windows平台上有试用版的SourceFormatX。
结论:不要企图把整个工程的源代码一次性格式化,哪个C文件格式实在太乱了再说。
#/bin/sh
# -kr Kernighan & Ritchie style
# -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0
# -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs
# -nprs -npsl -saf -sai -saw -nsc -nsob -nss
# -nbad The '-bad' option causes `indent' to force a blank line after every
# block of declarations. The `-nbad' option causes `indent' not to force
# such blank lines.
# -cliN Case label indent of N spaces.
# -bliN Indent braces N spaces.
# -cbiN Indent braces after a case label N spaces.
# -nut Use spaces instead of tabs.
indent -kr -bli0 -cbi4 -nut $1

Bison 是替代yacc的语法解析器. 有时间研究一下!还有Boost Spirit框架!

pyserial是一个Python串口库,包装了Python标准库termios。虽然用C操作串口并不难,但要考虑一些细节,远不如用pyserial简单和方便。在编写测试代码、原型代码涉及串口通信时可以考虑它。
wxPython 是wxWidgets的Python绑定,类似的Python GUI库还有Tkinter(Python事实上标准的GUI toolkit,基于Tk)、PyGtk(基于GTK+)、PyQt。经过一番权衡(网上有个《知名GUI库简评》),我决定采用wxPython。我认为它的跨平台性非常好,且使用非常简单(安装包就带有大量的范例,这是最好的参考资料)。
The pysvn project's goal is to enable Tools to be written in Python that use Subversion.

Snack 是一个Python库,用于创建简单的基于文本的用户界面。红帽子的Linux在安装、配置期间出现的那些非常像GUI但又不具有普通窗口控制功能的界面,就是基于文本的用户界面,它们使用了Snack。例如:配置系统时区的命令/usr/sbin/timeconfig包装了Python脚本/usr/share/system-config-date /timeconfig.py,时区列表/usr/share/zoneinfo/zone.tab。
Snack is a python library based on newt that can be used to create a simple text based User interface. This is the package that was used by Red Hat to create their installation along with a number of configuration tools. It is an ideal platform upon which to create installation and configuration scripts, particularly if you don't want to rely on X, or you want to avoid complexity.
还有Python包也叫做Snack,在http://www.speech.kth.se/snack/。 The Snack Sound Toolkit is designed to be used with a scripting language such as Tcl/Tk or Python. Using Snack you can create powerful multi-platform audio applications with just a few lines of code.
用于创建基于文本的用户界面的Python包并不只有Snack。“某一类 Python 应用程序最好使用交互式用户界面,这样可以消除图形环境的系统开销或复杂性。交互式文本模式程序(在 Linux/UNIX 中),例如封装在 Python 的标准 curses 模块中的ncurses 库,正是您所需要的。 Tinter 是构建在 curses 上的高级窗口小部件的一个模块。Tinter 支持按钮、文本框、对话框和进展栏。一种没有充分引起公众注意的(并且难以捕捉到的) ncurses 和其它各种封装器的备用产品结合了slang 和newt 以及 python 封装器模块snack。slang 的功能与 curses 一样,而且newt 的功能与Tinter 一样。 ”

pexpect(http://pexpect.sourceforge.net/) is a pure Python Expect-like module. Pexpect makes Python a better tool for controlling other applications.Python-dev邮件列表http://mail.python.org/pipermail/python-dev /2002-November/thread.html对此有讨论。

twill is a simple scripting language intended for programmatic or automated browsing of Web sites. twill strives to be a complete implementation of a Web browser, omitting only JavaScript support. It includes support for cookies, basic authentication, and most (all?) HTTP trickery, including HTTP-EQUIV redirects. Please let me know if you find a situation where it doesn't work! It's written in Python. It's Python API is for Python programmers interested in using twill from Python.
twill还支持断言响应中含特定错误码、特定URL、特定文本等。twill还可以用于压力测试,twill-fork基于Python的os.fork()。其文档还列举了许多其他WEB测试相关的工具(要是twill实在不合适,可以看看它们)。
twill 支持cookie、基本认证等许多东西,唯一不爽的是不支持JavaScript(基于Java的HttpUnit支持一些JavaScript)。 IPCam项目的网页一般在HTML最后用一段简单的JavaScript脚本设置表单各域的值。好在它们的Javascript脚本和Cookie都非常简单,可以用Python的正则表达式来提取它们,然后修改twill解析出来的表单相应域的值。IPCam项目的网页用这样一段JavaScript 脚本来设置Cookie和跳转:
<script language=javascript>document.cookie="admin_999999;path=/";parent.location.href="../web/system_1.asp";</script>
twill忽略这一段,所以后继网页都访问不了了!可以先用正则表达式解析出Cookie值并存入一个文件,然后用load_cookies命令加载这个Cookie...
服务器返回的相应在HTTP头中这样设置Cookie:
Set-Cookie: S=gmail=ZlqdB1eh50LLOD2oHQy-AA:gmail_yj=wYXY0sDUzqa7YGNlHwld8w:gmproxy=r8SkXMoAtqc:gmproxy_yj=0nwuEpFAlkk; Domain=.google.com; Path=//r/n
twill这样表示Cookie:
<Cookie SID=DQAAAGkAAADjG8D7QJIQvqfILHXEzSkXTkoj8CjBwoANMpmfSGsZi2hdp1WmaECgfVyfgGihzZD_aOj30vO_UFH4U6aUrQ3OOF18ePC9owraK0-SVfGxjBwrARvxeWKUDP5QXFG40ehFrk8ynkZ1W7NHI4xz7CUt for .google.com/>
twill存储所有cookies为一个文件,以这样的格式:
#LWP-Cookies-2.0
Set-Cookie3: SID="DQAAAGkAAADjG8D7QJIQvqfILHXEzSkXTkoj8CjBwoANMpmfSGsZi2hdp1WmaECgfVyfgGihzZD_aOj30vO_UFH4U6aUrQ3OOF18ePC9owraK0-SVfGxjBwrARvxeWKUDP5QXFG40ehFrk8ynkZ1W7NHI4xz7CUt"; path="/"; domain=".google.com"; path_spec; domain_dot; discard; version=0

The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities. SVN统计工具mpy-svn-stats的图片操作基于它创建RGB模式的PNG图片。Python图像处理方面的极好文章:Python and Image processing位于http://python.cn/pipermail/python-chinese/2005-October /016910.html。

ReportLab Toolkit是用于创建PDF文档的Python工具包,依赖于PIL。

Trac: Simple, web based, intuitive bug and change tracking. Has a good interface with Subversion. Click around and view a current project using TRAC<http://trac.wordpress.org/>.
说到版本控制,也顺便提一下目前越来越热的 Trac,她是一个非常好的融合了wiki、故障跟踪、版本管理的软件项目管理平台。使用Python编写,版本管理采用subversion, 不过采用的是subversion自带的Swig-python接口。其他的数据存储在sqlite中,系统采用clearsliver页面模板引擎编写。

wget的"-r"选项递归方式下载整个web站点,“-nc”表示不要重复下载同一文件,“-X”的选项值是要排除的目录列表。
下载/离线浏览整个网站的工具非常多...Linux下有个商业版本的HTTrack V3.40 For Linux(http://www.httrack.com/,一直连接不上). 一个容易使用的站点镜像软件,能将网站传送到本地目录,并且会将所有相关链接重新组织,以便顺利的离线浏览。 KHttrack(http://www.nongnu.org/khttrack/index...??KDE包装。

cURL is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, TFTP, HTTP, HTTPS, TELNET, DICT, FILE and LDAP. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks.

Fedora Core操作系统提供了ftp客户端工具/usr/bin/ftp,但是这个工具使用起来不是非常方便。本文介绍一种在世界上广泛使用的ftp命令行客户端软件ncftp,它提供更方便、快捷、强大的功能,使我们在使用ftp服务的时候更得心应手。ncftp广泛应用于各个版本的Linux上。ncftp 与传统的ftp相比,主要有以下改进或变化:
1、子目录下载,采用递归的方法,下载整个目录及其子目录。
2、支持断点续传。一次传输没有完成,下次可以接着传输未完成的文件。
3、匿名ftp自动登录。目前大部分ftp站点都可以匿名登录,ncftp可以自动登录(默认方式)。
...

wxDFast也是一个图形化的下载工具,支持多线程、断点续传等功能,基于wxWidgets,最大特点是下载速度快。
FlashGot - Best Firefox Download Manager Integration.一个下载管理器,将浏览器(Mozilla/Firefox/Flock/Thunderbird)与一些下载工具(GUI的 wxDFast/D4X/KGet等,CLI的wget/cURL/WellGet[适合于边下载边播放电影]等)集成起来,使得下载操作就像 Windows下用netants/FlashGet那样简单。

我在Linux下经常下载一些新鲜软件尝试,但是浏览器 Firefox常常打不开链接或者下载失败,尤其是隔了防火墙访问SourceForge之类的较慢站点;而这些链接在Windows下是可以下载的,虽然速度慢一点。用yum升级系统,常出现“http://fedora.cs.wisc.edu/pub/mirrors/linux /download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/vim-minimal-7.0.042-0.fc5.i386.rpm: [Errno -1] Header is not complete.”类似的错误。而gFTP这样的FTP客户端GUI常常这儿或那儿工作得不对劲。用NcFTP或者cURL一般可以解决这些问题。(注:FTP的URL举例:ftp://book:book@125.64.92.50/book_h/20060828 /c69318f9-1bcb-4a11-8808-1daca711db4d.chm)

CHM是Windows平台帮助文件标准格式, 有许多电子书籍(甚至许多关于Unix/Linux的)以此格式发布.Linux平台上有一些阅读/编辑此格式的工具.KchmViewer基于Qt,独立于KDE/Gnome.我在make时参照README加上了选项"--with-kde"才编译成功,否则因为ld找不到Xext库而失败.可以把.chm格式关联到KchmViewer,在FedoraCore4下面这么做:右键单击一个文件,然后选属性,再点打开方式,选择添加,然后在自定义命令里面自己写上kchmviewer即可.

mht是IE另存的一种Web Archive格式,它将html/图片等存储在单一文件内. Linux平台的kmhtConvert可以将其转化为Konqueror(KDE的一个浏览器)支持的war格式(再把此格式关联到 Konqueror). Konqueror中这

抱歉!评论已关闭.