IAMTOP
小狐狸
小狐狸
  • UID28785
  • 注册日期2009-05-05
  • 最后登录2009-05-13
  • 发帖数5
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:4977回复:7

【求教】Mozilla编译顺序

楼主#
更多 发布于:2009-05-05 14:35
我自己基于Mozilla的代码添加了一下接口,可是编译的时候总是找不到相应的头文件。我看了一下这些头文件主要是有IDL编译出来的,比如nsIDocshell.h。
我在netwerk/protocol/http/src/nsHttpChannel.cpp里#include "nsIDocshell.h"。
当编译到这个文件的时候,找不到nsIDocshell.h,我查了一下编出来的结果文件夹,docshell/base/nsIDocshell.h还没有出来呢?
不知道是编译的顺序需要调整还是哪里有错误?
谢谢!
IAMTOP
小狐狸
小狐狸
  • UID28785
  • 注册日期2009-05-05
  • 最后登录2009-05-13
  • 发帖数5
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
1楼#
发布于:2009-05-05 14:35
From https://developer.mozilla.org/en/How_mo ... stem_works,
I found that
"At Mozilla, make is used to compile libraries and executables, create jar files for chrome, and copy files around. We use a 2-pass build system:

    * The export phase copies public header files to dist/include, and generates C++ header files from IDL files.
    * The libs phase compiles libraries, creates jar files, and creates typelib files from IDL files.

Each of these phases is just a make target. That is, each directory is traversed once with the export target, and then again later with the libs target. The two-stage build exists because of circular dependencies among modules - exporting all of the headers at the start allows module A to include public headers from module B, and module B to include public headers from module A.
"

It seems I have dropped into the circular dependencies.
Any ideas?
life31
小狐狸
小狐狸
  • UID26439
  • 注册日期2008-09-27
  • 最后登录2009-05-09
  • 发帖数44
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
2楼#
发布于:2009-05-05 14:35
IAMTOP
小狐狸
小狐狸
  • UID28785
  • 注册日期2009-05-05
  • 最后登录2009-05-13
  • 发帖数5
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
3楼#
发布于:2009-05-05 14:35
我试过Mozilla3.0.8的源代码我是可以编译过的。
只是我加了上面提到的类似的#include就说找不到头文件了。
life31
小狐狸
小狐狸
  • UID26439
  • 注册日期2008-09-27
  • 最后登录2009-05-09
  • 发帖数44
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
4楼#
发布于:2009-05-05 14:35
一般头文件只要指定路径
头文件有时会引用依赖包的头文件,需要手动指定。
IAMTOP
小狐狸
小狐狸
  • UID28785
  • 注册日期2009-05-05
  • 最后登录2009-05-13
  • 发帖数5
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
5楼#
发布于:2009-05-05 14:35
Re: 一般头文件只要指定路径
life31:头文件有时会引用依赖包的头文件,需要手动指定。回到原帖


可是我的mozilla3.0.8源码是可以编译通过的,说明环境设置是没有问题的。
举个例子说,我只是在network相关文件里调用了docshell的interface,所以在network的原文件里增加了#include "某个docshell的头文件"。
应该与依赖包没有关系的。
life31
小狐狸
小狐狸
  • UID26439
  • 注册日期2008-09-27
  • 最后登录2009-05-09
  • 发帖数44
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
6楼#
发布于:2009-05-05 14:35
Re: 一般头文件只要指定路径
IAMTOP

可是我的mozilla3.0.8源码是可以编译通过的,说明环境设置是没有问题的。
举个例子说,我只是在network相关文件里调用了docshell的interface,所以在network的原文件里增加了#include "某个docshell的头文件"。
应该与依赖包没有关系的。
回到原帖


docshell目录是否指定,因为你依赖docshell。
IAMTOP
小狐狸
小狐狸
  • UID28785
  • 注册日期2009-05-05
  • 最后登录2009-05-13
  • 发帖数5
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
7楼#
发布于:2009-05-05 14:35
Re: 一般头文件只要指定路径


docshell目录是否指定,因为你依赖docshell。



你是说network里的Make.in中吧:我增加了docshell在REQUIRES。
REQUIRES        = xpcom \
                  string \
                  pref \
                  nkcache \
                  mimetype \
                  intl \
                  unicharutil \
                  uconv \
                  docshell \
                  uriloader \
                  $(NULL)

不知道还需要添加什么指定么?
游客

返回顶部