【求教】Mozilla编译顺序

阅读:5080回复:7
2009-05-05 14:35
写私信
楼主#
我自己基于Mozilla的代码添加了一下接口,可是编译的时候总是找不到相应的头文件。我看了一下这些头文件主要是有IDL编译出来的,比如nsIDocshell.h。
我在netwerk/protocol/http/src/nsHttpChannel.cpp里#include "nsIDocshell.h"。
当编译到这个文件的时候,找不到nsIDocshell.h,我查了一下编出来的结果文件夹,docshell/base/nsIDocshell.h还没有出来呢?
不知道是编译的顺序需要调整还是哪里有错误?
谢谢!
2009-05-05 14:35
写私信
1楼#
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?
2009-05-05 14:35
写私信
3楼#
我试过Mozilla3.0.8的源代码我是可以编译过的。
只是我加了上面提到的类似的#include就说找不到头文件了。
2009-05-05 14:35
写私信
4楼#
一般头文件只要指定路径
头文件有时会引用依赖包的头文件,需要手动指定。
2009-05-05 14:35
写私信
5楼#
Re: 一般头文件只要指定路径
life31:头文件有时会引用依赖包的头文件,需要手动指定。回到原帖


可是我的mozilla3.0.8源码是可以编译通过的,说明环境设置是没有问题的。
举个例子说,我只是在network相关文件里调用了docshell的interface,所以在network的原文件里增加了#include "某个docshell的头文件"。
应该与依赖包没有关系的。
2009-05-05 14:35
写私信
6楼#
Re: 一般头文件只要指定路径
IAMTOP

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


docshell目录是否指定,因为你依赖docshell。
2009-05-05 14:35
写私信
7楼#
Re: 一般头文件只要指定路径


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



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

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